target
stringlengths
5
300
feat_repo_name
stringlengths
6
76
text
stringlengths
26
1.05M
docs/server.js
zanjs/react-bootstrap
/* eslint no-console: 0 */ import 'colors'; import React from 'react'; import express from 'express'; import path from 'path'; import Router from 'react-router'; import routes from './src/Routes'; import httpProxy from 'http-proxy'; import metadata from './generate-metadata'; import ip from 'ip'; const development = process.env.NODE_ENV !== 'production'; const port = process.env.PORT || 4000; let app = express(); if (development) { let proxy = httpProxy.createProxyServer(); let webpackPort = process.env.WEBPACK_DEV_PORT; let target = `http://${ip.address()}:${webpackPort}`; app.get('/assets/*', function(req, res) { proxy.web(req, res, { target }); }); proxy.on('error', function(e) { console.log('Could not connect to webpack proxy'.red); console.log(e.toString().red); }); console.log('Prop data generation started:'.green); metadata().then( props => { console.log('Prop data generation finished:'.green); app.use(function renderApp(req, res) { res.header('Access-Control-Allow-Origin', target); res.header('Access-Control-Allow-Headers', 'X-Requested-With'); Router.run(routes, req.url, Handler => { let html = React.renderToString(<Handler assetBaseUrl={target} propData={props}/>); res.send('<!doctype html>' + html); }); }); }); } else { app.use(express.static(path.join(__dirname, '../docs-built'))); } app.listen(port, function() { console.log(`Server started at:`); console.log(`- http://localhost:${port}`); console.log(`- http://${ip.address()}:${port}`); });
packages/material-ui-icons/src/BorderHorizontal.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path d="M3 21h2v-2H3v2zM5 7H3v2h2V7zM3 17h2v-2H3v2zm4 4h2v-2H7v2zM5 3H3v2h2V3zm4 0H7v2h2V3zm8 0h-2v2h2V3zm-4 4h-2v2h2V7zm0-4h-2v2h2V3zm6 14h2v-2h-2v2zm-8 4h2v-2h-2v2zm-8-8h18v-2H3v2zM19 3v2h2V3h-2zm0 6h2V7h-2v2zm-8 8h2v-2h-2v2zm4 4h2v-2h-2v2zm4 0h2v-2h-2v2z" /><path fill="none" d="M0 0h24v24H0z" /></React.Fragment> , 'BorderHorizontal');
ajax/libs/handsontable/0.10.5/jquery.handsontable.full.js
idleberg/cdnjs
/** * Handsontable 0.10.5 * Handsontable is a simple jQuery plugin for editable tables with basic copy-paste compatibility with Excel and Google Docs * * Copyright 2012, Marcin Warpechowski * Licensed under the MIT license. * http://handsontable.com/ * * Date: Mon Mar 31 2014 14:19:47 GMT+0200 (CEST) */ /*jslint white: true, browser: true, plusplus: true, indent: 4, maxerr: 50 */ var Handsontable = { //class namespace extension: {}, //extenstion namespace plugins: {}, //plugin namespace helper: {} //helper namespace }; (function ($, window, Handsontable) { "use strict"; //http://stackoverflow.com/questions/3629183/why-doesnt-indexof-work-on-an-array-ie8 if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (elt /*, from*/) { var len = this.length >>> 0; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); if (from < 0) from += len; for (; from < len; from++) { if (from in this && this[from] === elt) return from; } return -1; }; } /** * Array.filter() shim by Trevor Menagh (https://github.com/trevmex) with some modifications */ if (!Array.prototype.filter) { Array.prototype.filter = function (fun, thisp) { "use strict"; if (typeof this === "undefined" || this === null) { throw new TypeError(); } if (typeof fun !== "function") { throw new TypeError(); } thisp = thisp || this; if (isNodeList(thisp)) { thisp = convertNodeListToArray(thisp); } var len = thisp.length, res = [], i, val; for (i = 0; i < len; i += 1) { if (thisp.hasOwnProperty(i)) { val = thisp[i]; // in case fun mutates this if (fun.call(thisp, val, i, thisp)) { res.push(val); } } } return res; function isNodeList(object) { return /NodeList/i.test(object.item); } function convertNodeListToArray(nodeList) { var array = []; for (var i = 0, len = nodeList.length; i < len; i++){ array[i] = nodeList[i] } return array; } }; } /* * Copyright 2012 The Polymer Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ if (typeof WeakMap === 'undefined') { (function() { var defineProperty = Object.defineProperty; try { var properDefineProperty = true; defineProperty(function(){}, 'foo', {}); } catch (e) { properDefineProperty = false; } /* IE8 does not support Date.now() but IE8 compatibility mode in IE9 and IE10 does. M$ deserves a high five for this one :) */ var counter = +(new Date) % 1e9; var WeakMap = function() { this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__'); if(!properDefineProperty){ this._wmCache = []; } }; if(properDefineProperty){ WeakMap.prototype = { set: function(key, value) { var entry = key[this.name]; if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {value: [key, value], writable: true}); }, get: function(key) { var entry; return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; }, 'delete': function(key) { this.set(key, undefined); } }; } else { WeakMap.prototype = { set: function(key, value) { if(typeof key == 'undefined' || typeof value == 'undefined') return; for(var i = 0, len = this._wmCache.length; i < len; i++){ if(this._wmCache[i].key == key){ this._wmCache[i].value = value; return; } } this._wmCache.push({key: key, value: value}); }, get: function(key) { if(typeof key == 'undefined') return; for(var i = 0, len = this._wmCache.length; i < len; i++){ if(this._wmCache[i].key == key){ return this._wmCache[i].value; } } return; }, 'delete': function(key) { if(typeof key == 'undefined') return; for(var i = 0, len = this._wmCache.length; i < len; i++){ if(this._wmCache[i].key == key){ Array.prototype.slice.call(this._wmCache, i, 1); } } } }; } window.WeakMap = WeakMap; })(); } Handsontable.activeGuid = null; /** * Handsontable constructor * @param rootElement The jQuery element in which Handsontable DOM will be inserted * @param userSettings * @constructor */ Handsontable.Core = function (rootElement, userSettings) { var priv , datamap , grid , selection , editorManager , autofill , instance = this , GridSettings = function () {}; Handsontable.helper.extend(GridSettings.prototype, DefaultSettings.prototype); //create grid settings as a copy of default settings Handsontable.helper.extend(GridSettings.prototype, userSettings); //overwrite defaults with user settings Handsontable.helper.extend(GridSettings.prototype, expandType(userSettings)); this.rootElement = rootElement; var $document = $(document.documentElement); var $body = $(document.body); this.guid = 'ht_' + Handsontable.helper.randomString(); //this is the namespace for global events if (!this.rootElement[0].id) { this.rootElement[0].id = this.guid; //if root element does not have an id, assign a random id } priv = { cellSettings: [], columnSettings: [], columnsSettingConflicts: ['data', 'width'], settings: new GridSettings(), // current settings instance settingsFromDOM: {}, selStart: new Handsontable.SelectionPoint(), selEnd: new Handsontable.SelectionPoint(), isPopulated: null, scrollable: null, extensions: {}, firstRun: true }; grid = { /** * Inserts or removes rows and columns * @param {String} action Possible values: "insert_row", "insert_col", "remove_row", "remove_col" * @param {Number} index * @param {Number} amount * @param {String} [source] Optional. Source of hook runner. * @param {Boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows. */ alter: function (action, index, amount, source, keepEmptyRows) { var delta; amount = amount || 1; switch (action) { case "insert_row": delta = datamap.createRow(index, amount); if (delta) { if (priv.selStart.exists() && priv.selStart.row() >= index) { priv.selStart.row(priv.selStart.row() + delta); selection.transformEnd(delta, 0); //will call render() internally } else { selection.refreshBorders(); //it will call render and prepare methods } } break; case "insert_col": delta = datamap.createCol(index, amount); if (delta) { if(Handsontable.helper.isArray(instance.getSettings().colHeaders)){ var spliceArray = [index, 0]; spliceArray.length += delta; //inserts empty (undefined) elements at the end of an array Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray); //inserts empty (undefined) elements into the colHeader array } if (priv.selStart.exists() && priv.selStart.col() >= index) { priv.selStart.col(priv.selStart.col() + delta); selection.transformEnd(0, delta); //will call render() internally } else { selection.refreshBorders(); //it will call render and prepare methods } } break; case "remove_row": datamap.removeRow(index, amount); priv.cellSettings.splice(index, amount); grid.adjustRowsAndCols(); selection.refreshBorders(); //it will call render and prepare methods break; case "remove_col": datamap.removeCol(index, amount); for(var row = 0, len = datamap.getAll().length; row < len; row++){ if(row in priv.cellSettings){ //if row hasn't been rendered it wouldn't have cellSettings priv.cellSettings[row].splice(index, amount); } } if(Handsontable.helper.isArray(instance.getSettings().colHeaders)){ if(typeof index == 'undefined'){ index = -1; } instance.getSettings().colHeaders.splice(index, amount); } priv.columnSettings.splice(index, amount); grid.adjustRowsAndCols(); selection.refreshBorders(); //it will call render and prepare methods break; default: throw new Error('There is no such action "' + action + '"'); break; } if (!keepEmptyRows) { grid.adjustRowsAndCols(); //makes sure that we did not add rows that will be removed in next refresh } }, /** * Makes sure there are empty rows at the bottom of the table */ adjustRowsAndCols: function () { var r, rlen, emptyRows = instance.countEmptyRows(true), emptyCols; //should I add empty rows to data source to meet minRows? rlen = instance.countRows(); if (rlen < priv.settings.minRows) { for (r = 0; r < priv.settings.minRows - rlen; r++) { datamap.createRow(instance.countRows(), 1, true); } } //should I add empty rows to meet minSpareRows? if (emptyRows < priv.settings.minSpareRows) { for (; emptyRows < priv.settings.minSpareRows && instance.countRows() < priv.settings.maxRows; emptyRows++) { datamap.createRow(instance.countRows(), 1, true); } } //count currently empty cols emptyCols = instance.countEmptyCols(true); //should I add empty cols to meet minCols? if (!priv.settings.columns && instance.countCols() < priv.settings.minCols) { for (; instance.countCols() < priv.settings.minCols; emptyCols++) { datamap.createCol(instance.countCols(), 1, true); } } //should I add empty cols to meet minSpareCols? if (!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); } } if (priv.settings.enterBeginsEditing) { for (; (((priv.settings.minRows || priv.settings.minSpareRows) && instance.countRows() > priv.settings.minRows) && (priv.settings.minSpareRows && emptyRows > priv.settings.minSpareRows)); emptyRows--) { datamap.removeRow(); } } if (priv.settings.enterBeginsEditing && !priv.settings.columns) { for (; (((priv.settings.minCols || priv.settings.minSpareCols) && instance.countCols() > priv.settings.minCols) && (priv.settings.minSpareCols && emptyCols > priv.settings.minSpareCols)); emptyCols--) { datamap.removeCol(); } } var rowCount = instance.countRows(); var colCount = instance.countCols(); if (rowCount === 0 || colCount === 0) { selection.deselect(); } if (priv.selStart.exists()) { var selectionChanged; var fromRow = priv.selStart.row(); var fromCol = priv.selStart.col(); var toRow = priv.selEnd.row(); var toCol = priv.selEnd.col(); //if selection is outside, move selection to last row 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 selection is outside, move selection to last row 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); } } }, /** * Populate cells at position with 2d array * @param {Object} start Start selection position * @param {Array} input 2d array * @param {Object} [end] End selection position (only for drag-down mode) * @param {String} [source="populateFromArray"] * @param {String} [method="overwrite"] * @return {Object|undefined} ending td in pasted area (only if any cell was changed) */ populateFromArray: function (start, input, end, source, method) { var r, rlen, c, clen, setData = [], current = {}; rlen = input.length; if (rlen === 0) { return false; } var repeatCol , repeatRow , cmax , rmax; // insert data with specified pasteMode method switch (method) { case 'shift_down' : repeatCol = end ? end.col - start.col + 1 : 0; repeatRow = end ? end.row - start.row + 1 : 0; input = Handsontable.helper.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: // overwrite and other not specified options current.row = start.row; current.col = start.col; for (r = 0; r < rlen; r++) { if ((end && current.row > end.row) || (!priv.settings.minSpareRows && current.row > instance.countRows() - 1) || (current.row >= priv.settings.maxRows)) { break; } current.col = start.col; clen = input[r] ? input[r].length : 0; for (c = 0; c < clen; c++) { if ((end && current.col > end.col) || (!priv.settings.minSpareCols && current.col > instance.countCols() - 1) || (current.col >= priv.settings.maxCols)) { break; } if (!instance.getCellMeta(current.row, current.col).readOnly) { setData.push([current.row, current.col, input[r][c]]); } current.col++; if (end && c === clen - 1) { c = -1; } } current.row++; if (end && r === rlen - 1) { r = -1; } } instance.setDataAtCell(setData, null, null, source || 'populateFromArray'); break; } }, /** * Returns the top left (TL) and bottom right (BR) selection coordinates * @param {Object[]} coordsArr * @returns {Object} */ getCornerCoords: function (coordsArr) { function mapProp(func, array, prop) { function getProp(el) { return el[prop]; } if (Array.prototype.map) { return func.apply(Math, array.map(getProp)); } return func.apply(Math, $.map(array, getProp)); } return { TL: { row: mapProp(Math.min, coordsArr, "row"), col: mapProp(Math.min, coordsArr, "col") }, BR: { row: mapProp(Math.max, coordsArr, "row"), col: mapProp(Math.max, coordsArr, "col") } }; }, /** * Returns array of td objects given start and end coordinates */ getCellsAtCoords: function (start, end) { var corners = grid.getCornerCoords([start, end]); var r, c, output = []; for (r = corners.TL.row; r <= corners.BR.row; r++) { for (c = corners.TL.col; c <= corners.BR.col; c++) { output.push(instance.view.getCellAtCoords({ row: r, col: c })); } } return output; } }; this.selection = selection = { //this public assignment is only temporary inProgress: false, /** * Sets inProgress to true. This enables onSelectionEnd and onSelectionEndByProp to function as desired */ begin: function () { instance.selection.inProgress = true; }, /** * Sets inProgress to false. Triggers onSelectionEnd and onSelectionEndByProp */ finish: function () { var sel = instance.getSelected(); instance.PluginHooks.run("afterSelectionEnd", sel[0], sel[1], sel[2], sel[3]); instance.PluginHooks.run("afterSelectionEndByProp", sel[0], instance.colToProp(sel[1]), sel[2], instance.colToProp(sel[3])); instance.selection.inProgress = false; }, isInProgress: function () { return instance.selection.inProgress; }, /** * Starts selection range on given td object * @param {Object} coords */ setRangeStart: function (coords) { priv.selStart.coords(coords); selection.setRangeEnd(coords); }, /** * Ends selection range on given td object * @param {Object} coords * @param {Boolean} [scrollToCell=true] If true, viewport will be scrolled to range end */ setRangeEnd: function (coords, scrollToCell) { instance.selection.begin(); priv.selEnd.coords(coords); if (!priv.settings.multiSelect) { priv.selStart.coords(coords); } //set up current selection instance.view.wt.selections.current.clear(); instance.view.wt.selections.current.add(priv.selStart.arr()); //set up area selection instance.view.wt.selections.area.clear(); if (selection.isMultiple()) { instance.view.wt.selections.area.add(priv.selStart.arr()); instance.view.wt.selections.area.add(priv.selEnd.arr()); } //set up highlight if (priv.settings.currentRowClassName || priv.settings.currentColClassName) { instance.view.wt.selections.highlight.clear(); instance.view.wt.selections.highlight.add(priv.selStart.arr()); instance.view.wt.selections.highlight.add(priv.selEnd.arr()); } //trigger handlers instance.PluginHooks.run("afterSelection", priv.selStart.row(), priv.selStart.col(), priv.selEnd.row(), priv.selEnd.col()); instance.PluginHooks.run("afterSelectionByProp", priv.selStart.row(), datamap.colToProp(priv.selStart.col()), priv.selEnd.row(), datamap.colToProp(priv.selEnd.col())); if (scrollToCell !== false) { instance.view.scrollViewport(coords); } selection.refreshBorders(); }, /** * Destroys editor, redraws borders around cells, prepares editor * @param {Boolean} revertOriginal * @param {Boolean} keepEditor */ refreshBorders: function (revertOriginal, keepEditor) { if (!keepEditor) { editorManager.destroyEditor(revertOriginal); } instance.view.render(); if (selection.isSelected() && !keepEditor) { editorManager.prepareEditor(); } }, /** * Returns information if we have a multiselection * @return {Boolean} */ isMultiple: function () { return !(priv.selEnd.col() === priv.selStart.col() && priv.selEnd.row() === priv.selStart.row()); }, /** * Selects cell relative to current cell (if possible) */ transformStart: function (rowDelta, colDelta, force) { if (priv.selStart.row() + rowDelta > instance.countRows() - 1) { if (force && priv.settings.minSpareRows > 0) { instance.alter("insert_row", instance.countRows()); } else if (priv.settings.autoWrapCol) { rowDelta = 1 - instance.countRows(); colDelta = priv.selStart.col() + colDelta == instance.countCols() - 1 ? 1 - instance.countCols() : 1; } } else if (priv.settings.autoWrapCol && priv.selStart.row() + rowDelta < 0 && priv.selStart.col() + colDelta >= 0) { rowDelta = instance.countRows() - 1; colDelta = priv.selStart.col() + colDelta == 0 ? instance.countCols() - 1 : -1; } if (priv.selStart.col() + colDelta > instance.countCols() - 1) { if (force && priv.settings.minSpareCols > 0) { instance.alter("insert_col", instance.countCols()); } else if (priv.settings.autoWrapRow) { rowDelta = priv.selStart.row() + rowDelta == instance.countRows() - 1 ? 1 - instance.countRows() : 1; colDelta = 1 - instance.countCols(); } } else if (priv.settings.autoWrapRow && priv.selStart.col() + colDelta < 0 && priv.selStart.row() + rowDelta >= 0) { rowDelta = priv.selStart.row() + rowDelta == 0 ? instance.countRows() - 1 : -1; colDelta = instance.countCols() - 1; } var totalRows = instance.countRows(); var totalCols = instance.countCols(); var coords = { row: priv.selStart.row() + rowDelta, col: priv.selStart.col() + colDelta }; if (coords.row < 0) { coords.row = 0; } else if (coords.row > 0 && coords.row >= totalRows) { coords.row = totalRows - 1; } if (coords.col < 0) { coords.col = 0; } else if (coords.col > 0 && coords.col >= totalCols) { coords.col = totalCols - 1; } selection.setRangeStart(coords); }, /** * Sets selection end cell relative to current selection end cell (if possible) */ transformEnd: function (rowDelta, colDelta) { if (priv.selEnd.exists()) { var totalRows = instance.countRows(); var totalCols = instance.countCols(); var coords = { row: priv.selEnd.row() + rowDelta, col: priv.selEnd.col() + colDelta }; if (coords.row < 0) { coords.row = 0; } else if (coords.row > 0 && coords.row >= totalRows) { coords.row = totalRows - 1; } if (coords.col < 0) { coords.col = 0; } else if (coords.col > 0 && coords.col >= totalCols) { coords.col = totalCols - 1; } selection.setRangeEnd(coords); } }, /** * Returns true if currently there is a selection on screen, false otherwise * @return {Boolean} */ isSelected: function () { return priv.selEnd.exists(); }, /** * Returns true if coords is within current selection coords * @return {Boolean} */ inInSelection: function (coords) { if (!selection.isSelected()) { return false; } var sel = grid.getCornerCoords([priv.selStart.coords(), priv.selEnd.coords()]); return (sel.TL.row <= coords.row && sel.BR.row >= coords.row && sel.TL.col <= coords.col && sel.BR.col >= coords.col); }, /** * Deselects all selected cells */ deselect: function () { if (!selection.isSelected()) { return; } instance.selection.inProgress = false; //needed by HT inception priv.selEnd = new Handsontable.SelectionPoint(); //create new empty point to remove the existing one instance.view.wt.selections.current.clear(); instance.view.wt.selections.area.clear(); editorManager.destroyEditor(); selection.refreshBorders(); instance.PluginHooks.run('afterDeselect'); }, /** * Select all cells */ selectAll: function () { if (!priv.settings.multiSelect) { return; } selection.setRangeStart({ row: 0, col: 0 }); selection.setRangeEnd({ row: instance.countRows() - 1, col: instance.countCols() - 1 }, false); }, /** * Deletes data from selected cells */ empty: function () { if (!selection.isSelected()) { return; } var corners = grid.getCornerCoords([priv.selStart.coords(), priv.selEnd.coords()]); var r, c, changes = []; for (r = corners.TL.row; r <= corners.BR.row; r++) { for (c = corners.TL.col; c <= corners.BR.col; c++) { if (!instance.getCellMeta(r, c).readOnly) { changes.push([r, c, '']); } } } instance.setDataAtCell(changes); } }; this.autofill = autofill = { //this public assignment is only temporary handle: null, /** * Create fill handle and fill border objects */ init: function () { if (!autofill.handle) { autofill.handle = {}; } else { autofill.handle.disabled = false; } }, /** * Hide fill handle and fill border permanently */ disable: function () { autofill.handle.disabled = true; }, /** * Selects cells down to the last row in the left column, then fills down to that cell */ selectAdjacent: function () { var select, data, r, maxR, c; if (selection.isMultiple()) { select = instance.view.wt.selections.area.getCorners(); } else { select = instance.view.wt.selections.current.getCorners(); } data = datamap.getAll(); rows : for (r = select[2] + 1; r < 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) { instance.view.wt.selections.fill.clear(); instance.view.wt.selections.fill.add([select[0], select[1]]); instance.view.wt.selections.fill.add([maxR, select[3]]); autofill.apply(); } }, /** * Apply fill values to the area in fill border, omitting the selection border */ apply: function () { var drag, select, start, end, _data; autofill.handle.isDragged = 0; drag = instance.view.wt.selections.fill.getCorners(); if (!drag) { return; } instance.view.wt.selections.fill.clear(); if (selection.isMultiple()) { select = instance.view.wt.selections.area.getCorners(); } else { select = instance.view.wt.selections.current.getCorners(); } if (drag[0] === select[0] && drag[1] < select[1]) { start = { row: drag[0], col: drag[1] }; end = { row: drag[2], col: select[1] - 1 }; } else if (drag[0] === select[0] && drag[3] > select[3]) { start = { row: drag[0], col: select[3] + 1 }; end = { row: drag[2], col: drag[3] }; } else if (drag[0] < select[0] && drag[1] === select[1]) { start = { row: drag[0], col: drag[1] }; end = { row: select[0] - 1, col: drag[3] }; } else if (drag[2] > select[2] && drag[1] === select[1]) { start = { row: select[2] + 1, col: drag[1] }; end = { row: drag[2], col: drag[3] }; } if (start) { _data = SheetClip.parse(datamap.getText(priv.selStart.coords(), priv.selEnd.coords())); instance.PluginHooks.run('beforeAutofill', start, end, _data); grid.populateFromArray(start, _data, end, 'autofill'); selection.setRangeStart({row: drag[0], col: drag[1]}); selection.setRangeEnd({row: drag[2], col: drag[3]}); } /*else { //reset to avoid some range bug selection.refreshBorders(); }*/ }, /** * Show fill border */ showBorder: function (coords) { coords.row = coords[0]; coords.col = coords[1]; var corners = grid.getCornerCoords([priv.selStart.coords(), priv.selEnd.coords()]); if (priv.settings.fillHandle !== 'horizontal' && (corners.BR.row < coords.row || corners.TL.row > coords.row)) { coords = [coords.row, corners.BR.col]; } else if (priv.settings.fillHandle !== 'vertical') { coords = [corners.BR.row, coords.col]; } else { return; //wrong direction } instance.view.wt.selections.fill.clear(); instance.view.wt.selections.fill.add([priv.selStart.coords().row, priv.selStart.coords().col]); instance.view.wt.selections.fill.add([priv.selEnd.coords().row, priv.selEnd.coords().col]); instance.view.wt.selections.fill.add(coords); instance.view.render(); } }; this.init = function () { instance.PluginHooks.run('beforeInit'); this.view = new Handsontable.TableView(this); editorManager = new Handsontable.EditorManager(instance, priv, selection, datamap); this.updateSettings(priv.settings, true); this.parseSettingsFromDOM(); this.forceFullRender = true; //used when data was changed this.view.render(); if (typeof priv.firstRun === 'object') { instance.PluginHooks.run('afterChange', priv.firstRun[0], priv.firstRun[1]); priv.firstRun = false; } instance.PluginHooks.run('afterInit'); }; function ValidatorsQueue() { //moved this one level up so it can be used in any function here. Probably this should be moved to a separate file var resolved = false; return { validatorsInQueue: 0, addValidatorToQueue: function () { this.validatorsInQueue++; resolved = false; }, removeValidatorFormQueue: function () { this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1; this.checkIfQueueIsEmpty(); }, onQueueEmpty: function () { }, checkIfQueueIsEmpty: function () { if (this.validatorsInQueue == 0 && resolved == false) { resolved = true; this.onQueueEmpty(); } } }; } 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.runHooksAndReturn('modifyCol', col); //column order may have changes, so we need to translate physical col index (stored in datasource) to logical (displayed to user) 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])) { changes[i][3] = numeral().unformat(changes[i][3] || '0'); //numeral cannot unformat empty string } } 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); // cancel the change cellProperties.valid = true; // we cancelled the change, so cell value is still valid --i; } waitingForValidator.removeValidatorFormQueue(); } })(i, cellProperties) , source); } } } waitingForValidator.checkIfQueueIsEmpty(); function resolve() { var beforeChangeResult; if (changes.length) { beforeChangeResult = instance.PluginHooks.execute("beforeChange", changes, source); if (typeof beforeChangeResult === 'function') { $.when(result).then(function () { callback(); //called when async validators and async beforeChange are resolved }); } else if (beforeChangeResult === false) { changes.splice(0, changes.length); //invalidate all changes (remove everything from array) } } if (typeof beforeChangeResult !== 'function') { callback(); //called when async validators are resolved and beforeChange was not async } } } /** * Internal function to apply changes. Called after validateChanges * @param {Array} changes Array in form of [row, prop, oldValue, newValue] * @param {String} source String that identifies how this change will be described in changes array (useful in onChange 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 (priv.settings.minSpareRows) { while (changes[i][0] > instance.countRows() - 1) { datamap.createRow(); } } if (instance.dataType === 'array' && priv.settings.minSpareCols) { 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; //used when data was changed grid.adjustRowsAndCols(); selection.refreshBorders(null, true); instance.PluginHooks.run('afterChange', changes, source || 'edit'); } this.validateCell = function (value, cellProperties, callback, source) { var validator = instance.getCellValidator(cellProperties); 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 = instance.PluginHooks.execute("beforeValidate", value, cellProperties.row, cellProperties.prop, source); // To provide consistent behaviour, validation should be always asynchronous setTimeout(function () { validator.call(cellProperties, value, function (valid) { cellProperties.valid = valid; valid = instance.PluginHooks.execute("afterValidate", valid, value, cellProperties.row, cellProperties.prop, source); callback(valid); }); }); } else { //resolve callback even if validator function was not found cellProperties.valid = true; callback(true); } }; function setDataInputToArray(row, prop_or_col, value) { if (typeof row === "object") { //is it an array of changes return row; } else if ($.isPlainObject(value)) { //backwards compatibility return value; } else { return [ [row, prop_or_col, value] ]; } } /** * Set data at given cell * @public * @param {Number|Array} row or array of changes in format [[row, col, value], ...] * @param {Number|String} col or source String * @param {String} value * @param {String} source String that identifies how this change will be described in changes array (useful in onChange callback) */ 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); }); }; /** * Set data at given row property * @public * @param {Number|Array} row or array of changes in format [[row, prop, value], ...] * @param {String} prop or source String * @param {String} value * @param {String} source String that identifies how this change will be described in changes array (useful in onChange callback) */ 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); }); }; /** * Listen to document body keyboard input */ this.listen = function () { Handsontable.activeGuid = instance.guid; if (document.activeElement && document.activeElement !== document.body) { document.activeElement.blur(); } else if (!document.activeElement) { //IE document.body.focus(); } }; /** * Stop listening to document body keyboard input */ this.unlisten = function () { Handsontable.activeGuid = null; }; /** * Returns true if current Handsontable instance is listening on document body keyboard input */ this.isListening = function () { return Handsontable.activeGuid === instance.guid; }; /** * Destroys current editor, renders and selects current cell. If revertOriginal != true, edited data is saved * @param {Boolean} revertOriginal */ this.destroyEditor = function (revertOriginal) { selection.refreshBorders(revertOriginal); }; /** * Populate cells at position with 2d array * @param {Number} row Start row * @param {Number} col Start column * @param {Array} input 2d array * @param {Number=} endRow End row (use when you want to cut input when certain row is reached) * @param {Number=} endCol End column (use when you want to cut input when certain column is reached) * @param {String=} [source="populateFromArray"] * @param {String=} [method="overwrite"] * @return {Object|undefined} ending td in pasted area (only if any cell was changed) */ this.populateFromArray = function (row, col, input, endRow, endCol, source, method) { if (!(typeof input === 'object' && typeof input[0] === 'object')) { throw new Error("populateFromArray parameter `input` must be an array of arrays"); //API changed in 0.9-beta2, let's check if you use it correctly } return grid.populateFromArray({row: row, col: col}, input, typeof endRow === 'number' ? {row: endRow, col: endCol} : null, source, method); }; /** * Adds/removes data from the column * @param {Number} col Index of column in which do you want to do splice. * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed * param {...*} elements Optional. The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array */ this.spliceCol = function (col, index, amount/*, elements... */) { return datamap.spliceCol.apply(datamap, arguments); }; /** * Adds/removes data from the row * @param {Number} row Index of column in which do you want to do splice. * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed * param {...*} elements Optional. The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array */ this.spliceRow = function (row, index, amount/*, elements... */) { return datamap.spliceRow.apply(datamap, arguments); }; /** * Returns the top left (TL) and bottom right (BR) selection coordinates * @param {Object[]} coordsArr * @returns {Object} */ this.getCornerCoords = function (coordsArr) { return grid.getCornerCoords(coordsArr); }; /** * Returns current selection. Returns undefined if there is no selection. * @public * @return {Array} [`startRow`, `startCol`, `endRow`, `endCol`] */ this.getSelected = function () { //https://github.com/warpech/jquery-handsontable/issues/44 //cjl if (selection.isSelected()) { return [priv.selStart.row(), priv.selStart.col(), priv.selEnd.row(), priv.selEnd.col()]; } }; /** * Parse settings from DOM and CSS * @public */ this.parseSettingsFromDOM = function () { var overflow = this.rootElement.css('overflow'); if (overflow === 'scroll' || overflow === 'auto') { this.rootElement[0].style.overflow = 'visible'; priv.settingsFromDOM.overflow = overflow; } else if (priv.settings.width === void 0 || priv.settings.height === void 0) { priv.settingsFromDOM.overflow = 'auto'; } if (priv.settings.width === void 0) { priv.settingsFromDOM.width = this.rootElement.width(); } else { priv.settingsFromDOM.width = void 0; } priv.settingsFromDOM.height = void 0; if (priv.settings.height === void 0) { if (priv.settingsFromDOM.overflow === 'scroll' || priv.settingsFromDOM.overflow === 'auto') { //this needs to read only CSS/inline style and not actual height //so we need to call getComputedStyle on cloned container var clone = this.rootElement[0].cloneNode(false); var parent = this.rootElement[0].parentNode; if (parent) { clone.removeAttribute('id'); parent.appendChild(clone); var computedClientHeight = parseInt(clone.clientHeight, 10); var computedPaddingTop = parseInt(window.getComputedStyle(clone, null).getPropertyValue('paddingTop'), 10) || 0; var computedPaddingBottom = parseInt(window.getComputedStyle(clone, null).getPropertyValue('paddingBottom'), 10) || 0; var computedHeight = computedClientHeight - computedPaddingTop - computedPaddingBottom; if(isNaN(computedHeight) && clone.currentStyle){ computedHeight = parseInt(clone.currentStyle.height, 10) } if (computedHeight > 0) { priv.settingsFromDOM.height = computedHeight; } parent.removeChild(clone); } } } }; /** * Render visible data * @public */ this.render = function () { if (instance.view) { instance.forceFullRender = true; //used when data was changed instance.parseSettingsFromDOM(); selection.refreshBorders(null, true); } }; /** * Load data from array * @public * @param {Array} data */ this.loadData = function (data) { if (typeof data === 'object' && data !== null) { if (!(data.push && data.splice)) { //check if data is array. Must use duck-type check so Backbone Collections also pass it //when data is not an array, attempt to make a single-row array of it 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 (priv.settings.dataSchema instanceof Array || data[0] instanceof Array) { instance.dataType = 'array'; } else if (typeof priv.settings.dataSchema === 'function') { instance.dataType = 'function'; } else { instance.dataType = 'object'; } datamap = new Handsontable.DataMap(instance, priv, GridSettings); clearCellSettingCache(); grid.adjustRowsAndCols(); instance.PluginHooks.run('afterLoadData'); if (priv.firstRun) { priv.firstRun = [null, 'loadData']; } else { instance.PluginHooks.run('afterChange', null, 'loadData'); instance.render(); } priv.isPopulated = true; function clearCellSettingCache() { priv.cellSettings.length = 0; } }; /** * Return the current data object (the same that was passed by `data` configuration option or `loadData` method). Optionally you can provide cell range `r`, `c`, `r2`, `c2` to get only a fragment of grid data * @public * @param {Number} r (Optional) From row * @param {Number} c (Optional) From col * @param {Number} r2 (Optional) To row * @param {Number} c2 (Optional) To col * @return {Array|Object} */ this.getData = function (r, c, r2, c2) { if (typeof r === 'undefined') { return datamap.getAll(); } else { return datamap.getRange({row: r, col: c}, {row: r2, col: c2}, datamap.DESTINATION_RENDERER); } }; this.getCopyableData = function (startRow, startCol, endRow, endCol) { return datamap.getCopyableText({row: startRow, col: startCol}, {row: endRow, col: endCol}); } /** * Update settings * @public */ 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; //loadData will be triggered later } else { if (instance.PluginHooks.hooks[i] !== void 0 || instance.PluginHooks.legacy[i] !== void 0) { if (typeof settings[i] === 'function' || Handsontable.helper.isArray(settings[i])) { instance.PluginHooks.add(i, settings[i]); } } else { // Update settings if (!init && settings.hasOwnProperty(i)) { GridSettings.prototype[i] = settings[i]; } //launch extensions if (Handsontable.extension[i]) { priv.extensions[i] = new Handsontable.extension[i](instance, settings[i]); } } } } // Load data or create data map if (settings.data === void 0 && priv.settings.data === void 0) { instance.loadData(null); //data source created just now } else if (settings.data !== void 0) { instance.loadData(settings.data); //data source given as option } else if (settings.columns !== void 0) { datamap.createMap(); } // Init columns constructors configuration clen = instance.countCols(); //Clear cellSettings cache priv.cellSettings.length = 0; if (clen > 0) { var proto, column; for (i = 0; i < clen; i++) { priv.columnSettings[i] = Handsontable.helper.columnFactory(GridSettings, priv.columnsSettingConflicts); // shortcut for prototype proto = priv.columnSettings[i].prototype; // Use settings provided by user if (GridSettings.prototype.columns) { column = GridSettings.prototype.columns[i]; Handsontable.helper.extend(proto, column); Handsontable.helper.extend(proto, expandType(column)); } } } if (typeof settings.fillHandle !== "undefined") { if (autofill.handle && settings.fillHandle === false) { autofill.disable(); } else if (!autofill.handle && settings.fillHandle !== false) { autofill.init(); } } if (typeof settings.className !== "undefined") { if (GridSettings.prototype.className) { instance.rootElement.removeClass(GridSettings.prototype.className); } if (settings.className) { instance.rootElement.addClass(settings.className); } } if (!init) { instance.PluginHooks.run('afterUpdateSettings'); } grid.adjustRowsAndCols(); if (instance.view && !priv.firstRun) { instance.forceFullRender = true; //used when data was changed 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; //ignore obj.prototype.type 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; } /** * Returns current settings object * @return {Object} */ this.getSettings = function () { return priv.settings; }; /** * Returns current settingsFromDOM object * @return {Object} */ this.getSettingsFromDOM = function () { return priv.settingsFromDOM; }; /** * Clears grid * @public */ this.clear = function () { selection.selectAll(); selection.empty(); }; /** * Inserts or removes rows and columns * @param {String} action See grid.alter for possible values * @param {Number} index * @param {Number} amount * @param {String} [source] Optional. Source of hook runner. * @param {Boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows. * @public */ this.alter = function (action, index, amount, source, keepEmptyRows) { grid.alter(action, index, amount, source, keepEmptyRows); }; /** * Returns <td> element corresponding to params row, col * @param {Number} row * @param {Number} col * @public * @return {Element} */ this.getCell = function (row, col) { return instance.view.getCellAtCoords({row: row, col: col}); }; /** * Returns property name associated with column number * @param {Number} col * @public * @return {String} */ this.colToProp = function (col) { return datamap.colToProp(col); }; /** * Returns column number associated with property name * @param {String} prop * @public * @return {Number} */ this.propToCol = function (prop) { return datamap.propToCol(prop); }; /** * Return value at `row`, `col` * @param {Number} row * @param {Number} col * @public * @return value (mixed data type) */ this.getDataAtCell = function (row, col) { return datamap.get(row, datamap.colToProp(col)); }; /** * Return value at `row`, `prop` * @param {Number} row * @param {String} prop * @public * @return value (mixed data type) */ this.getDataAtRowProp = function (row, prop) { return datamap.get(row, prop); }; /** * Return value at `col` * @param {Number} col * @public * @return value (mixed data type) */ this.getDataAtCol = function (col) { return [].concat.apply([], datamap.getRange({row: 0, col: col}, {row: priv.settings.data.length - 1, col: col}, datamap.DESTINATION_RENDERER)); }; /** * Return value at `prop` * @param {String} prop * @public * @return value (mixed data type) */ this.getDataAtProp = function (prop) { return [].concat.apply([], datamap.getRange({row: 0, col: datamap.propToCol(prop)}, {row: priv.settings.data.length - 1, col: datamap.propToCol(prop)}, datamap.DESTINATION_RENDERER)); }; /** * Return value at `row` * @param {Number} row * @public * @return value (mixed data type) */ this.getDataAtRow = function (row) { return priv.settings.data[row]; }; /** * Returns cell meta data object corresponding to params row, col * @param {Number} row * @param {Number} col * @public * @return {Object} */ this.getCellMeta = function (row, col) { var prop = datamap.colToProp(col) , cellProperties; row = translateRowIndex(row); col = translateColIndex(col); if ("undefined" === typeof priv.columnSettings[col]) { priv.columnSettings[col] = Handsontable.helper.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]; //retrieve cellProperties from cache cellProperties.row = row; cellProperties.col = col; cellProperties.prop = prop; cellProperties.instance = instance; instance.PluginHooks.run('beforeGetCellMeta', row, col, cellProperties); Handsontable.helper.extend(cellProperties, expandType(cellProperties)); //for `type` added in beforeGetCellMeta if (cellProperties.cells) { var settings = cellProperties.cells.call(cellProperties, row, col, prop); if (settings) { Handsontable.helper.extend(cellProperties, settings); Handsontable.helper.extend(cellProperties, expandType(settings)); //for `type` added in cells } } instance.PluginHooks.run('afterGetCellMeta', row, col, cellProperties); return cellProperties; /** * If displayed rows order is different than the order of rows stored in memory (i.e. sorting is applied) * we need to translate logical (stored) row index to physical (displayed) index. * @param row - original row index * @returns {int} translated row index */ function translateRowIndex(row){ var getVars = {row: row}; instance.PluginHooks.execute('beforeGet', getVars); return getVars.row; } /** * If displayed columns order is different than the order of columns stored in memory (i.e. column were moved using manualColumnMove plugin) * we need to translate logical (stored) column index to physical (displayed) index. * @param col - original column index * @returns {int} - translated column index */ function translateColIndex(col){ return Handsontable.PluginHooks.execute(instance, 'modifyCol', col); // warning: this must be done after datamap.colToProp } }; var rendererLookup = Handsontable.helper.cellMethodLookupFactory('renderer'); this.getCellRenderer = function (row, col) { var renderer = rendererLookup.call(this, row, col); return Handsontable.renderers.getRenderer(renderer); }; this.getCellEditor = Handsontable.helper.cellMethodLookupFactory('editor'); this.getCellValidator = Handsontable.helper.cellMethodLookupFactory('validator'); /** * Validates all cells using their validator functions and calls callback when finished. Does not render the view * @param callback */ 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 () { waitingForValidator.removeValidatorFormQueue(); }, 'validateCells'); j--; } i--; } waitingForValidator.checkIfQueueIsEmpty(); }; /** * Return array of row headers (if they are enabled). If param `row` given, return header at given row as string * @param {Number} row (Optional) * @return {Array|String} */ this.getRowHeader = function (row) { if (row === void 0) { var out = []; for (var i = 0, ilen = instance.countRows(); i < ilen; i++) { out.push(instance.getRowHeader(i)); } return out; } else if (Object.prototype.toString.call(priv.settings.rowHeaders) === '[object Array]' && priv.settings.rowHeaders[row] !== void 0) { return priv.settings.rowHeaders[row]; } else if (typeof priv.settings.rowHeaders === 'function') { return priv.settings.rowHeaders(row); } else if (priv.settings.rowHeaders && typeof priv.settings.rowHeaders !== 'string' && typeof priv.settings.rowHeaders !== 'number') { return row + 1; } else { return priv.settings.rowHeaders; } }; /** * Returns information of this table is configured to display row headers * @returns {boolean} */ this.hasRowHeaders = function () { return !!priv.settings.rowHeaders; }; /** * Returns information of this table is configured to display column headers * @returns {boolean} */ this.hasColHeaders = function () { if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) { //Polymer has empty value = null return !!priv.settings.colHeaders; } for (var i = 0, ilen = instance.countCols(); i < ilen; i++) { if (instance.getColHeader(i)) { return true; } } return false; }; /** * Return array of column headers (if they are enabled). If param `col` given, return header at given column as string * @param {Number} col (Optional) * @return {Array|String} */ this.getColHeader = function (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 { col = Handsontable.PluginHooks.execute(instance, 'modifyCol', col); if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) { return priv.settings.columns[col].title; } else if (Object.prototype.toString.call(priv.settings.colHeaders) === '[object Array]' && 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 Handsontable.helper.spreadsheetColumnLabel(col); } else { return priv.settings.colHeaders; } } }; /** * Return column width from settings (no guessing). Private use intended * @param {Number} col * @return {Number} */ 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': //array width = width[col]; break; case 'function': width = width(col); break; } if (typeof width === 'string') { width = parseInt(width, 10); } } return width; }; /** * Return column width * @param {Number} col * @return {Number} */ this.getColWidth = function (col) { col = Handsontable.PluginHooks.execute(instance, 'modifyCol', col); var response = { width: instance._getColWidthFromSettings(col) }; if (!response.width) { response.width = 50; } instance.PluginHooks.run('afterGetColWidth', col, response); return response.width; }; /** * Return total number of rows in grid * @return {Number} */ this.countRows = function () { return priv.settings.data.length; }; /** * Return total number of columns in grid * @return {Number} */ 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; } } }; /** * Return index of first visible row * @return {Number} */ this.rowOffset = function () { return instance.view.wt.getSetting('offsetRow'); }; /** * Return index of first visible column * @return {Number} */ this.colOffset = function () { return instance.view.wt.getSetting('offsetColumn'); }; /** * Return number of visible rows. Returns -1 if table is not visible * @return {Number} */ this.countVisibleRows = function () { return instance.view.wt.drawn ? instance.view.wt.wtTable.rowStrategy.countVisible() : -1; }; /** * Return number of visible columns. Returns -1 if table is not visible * @return {Number} */ this.countVisibleCols = function () { return instance.view.wt.drawn ? instance.view.wt.wtTable.columnStrategy.countVisible() : -1; }; /** * Return number of empty rows * @return {Boolean} ending If true, will only count empty rows at the end of the data source */ this.countEmptyRows = function (ending) { var i = instance.countRows() - 1 , empty = 0; while (i >= 0) { datamap.get(i, 0); if (instance.isEmptyRow(datamap.getVars.row)) { empty++; } else if (ending) { break; } i--; } return empty; }; /** * Return number of empty columns * @return {Boolean} ending If true, will only count empty columns at the end of the data source row */ 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; }; /** * Return true if the row at the given index is empty, false otherwise * @param {Number} r Row index * @return {Boolean} */ this.isEmptyRow = function (r) { return priv.settings.isEmptyRow.call(instance, r); }; /** * Return true if the column at the given index is empty, false otherwise * @param {Number} c Column index * @return {Boolean} */ this.isEmptyCol = function (c) { return priv.settings.isEmptyCol.call(instance, c); }; /** * Selects cell on grid. Optionally selects range to another cell * @param {Number} row * @param {Number} col * @param {Number} [endRow] * @param {Number} [endCol] * @param {Boolean} [scrollToCell=true] If true, viewport will be scrolled to the selection * @public * @return {Boolean} */ this.selectCell = function (row, col, endRow, endCol, scrollToCell) { 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; } } priv.selStart.coords({row: row, col: col}); if (document.activeElement && document.activeElement !== document.documentElement && document.activeElement !== document.body) { document.activeElement.blur(); //needed or otherwise prepare won't focus the cell. selectionSpec tests this (should move focus to selected cell) } instance.listen(); if (typeof endRow === "undefined") { selection.setRangeEnd({row: row, col: col}, scrollToCell); } else { selection.setRangeEnd({row: endRow, col: 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); }; /** * Deselects current sell selection on grid * @public */ this.deselectCell = function () { selection.deselect(); }; /** * Remove grid from DOM * @public */ this.destroy = function () { instance.clearTimeouts(); if (instance.view) { //in case HT is destroyed before initialization has finished instance.view.wt.destroy(); } instance.rootElement.empty(); instance.rootElement.removeData('handsontable'); instance.rootElement.off('.handsontable'); $(window).off('.' + instance.guid); $document.off('.' + instance.guid); $body.off('.' + instance.guid); instance.PluginHooks.run('afterDestroy'); }; /** * Returns active editor object * @returns {Object} */ this.getActiveEditor = function(){ return editorManager.getActiveEditor(); }; /** * Return Handsontable instance * @public * @return {Object} */ this.getInstance = function () { return instance.rootElement.data("handsontable"); }; (function () { // Create new instance of plugin hooks instance.PluginHooks = new Handsontable.PluginHookClass(); // Upgrade methods to call of global PluginHooks instance var _run = instance.PluginHooks.run , _exe = instance.PluginHooks.execute; instance.PluginHooks.run = function (key, p1, p2, p3, p4, p5) { _run.call(this, instance, key, p1, p2, p3, p4, p5); Handsontable.PluginHooks.run(instance, key, p1, p2, p3, p4, p5); }; instance.PluginHooks.execute = function (key, p1, p2, p3, p4, p5) { var globalHandlerResult = Handsontable.PluginHooks.execute(instance, key, p1, p2, p3, p4, p5); var localHandlerResult = _exe.call(this, instance, key, globalHandlerResult, p2, p3, p4, p5); return typeof localHandlerResult == 'undefined' ? globalHandlerResult : localHandlerResult; }; // Map old API with new methods instance.addHook = function () { instance.PluginHooks.add.apply(instance.PluginHooks, arguments); }; instance.addHookOnce = function () { instance.PluginHooks.once.apply(instance.PluginHooks, arguments); }; instance.removeHook = function () { instance.PluginHooks.remove.apply(instance.PluginHooks, arguments); }; instance.runHooks = function () { instance.PluginHooks.run.apply(instance.PluginHooks, arguments); }; instance.runHooksAndReturn = function () { return instance.PluginHooks.execute.apply(instance.PluginHooks, arguments); }; })(); this.timeouts = {}; /** * Sets timeout. Purpose of this method is to clear all known timeouts when `destroy` method is called * @public */ this.registerTimeout = function (key, handle, ms) { clearTimeout(this.timeouts[key]); this.timeouts[key] = setTimeout(handle, ms || 0); }; /** * Clears all known timeouts * @public */ this.clearTimeouts = function () { for (var key in this.timeouts) { if (this.timeouts.hasOwnProperty(key)) { clearTimeout(this.timeouts[key]); } } }; /** * Handsontable version */ this.version = '0.10.5'; //inserted by grunt from package.json }; var DefaultSettings = function () {}; DefaultSettings.prototype = { data: void 0, width: void 0, height: void 0, startRows: 5, startCols: 5, rowHeaders: null, colHeaders: null, minRows: 0, minCols: 0, maxRows: Infinity, maxCols: Infinity, minSpareRows: 0, minSpareCols: 0, multiSelect: true, fillHandle: true, fixedRowsTop: 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', currentRowClassName: void 0, currentColClassName: void 0, stretchH: 'hybrid', isEmptyRow: function (r) { var val; for (var c = 0, clen = this.countCols(); c < clen; c++) { val = this.getDataAtCell(r, c); if (val !== '' && val !== null && typeof val !== 'undefined') { return false; } } return true; }, isEmptyCol: function (c) { var val; for (var r = 0, rlen = this.countRows(); r < rlen; r++) { val = this.getDataAtCell(r, c); if (val !== '' && val !== null && typeof val !== 'undefined') { return false; } } return true; }, observeDOMVisibility: true, allowInvalid: true, invalidCellClassName: 'htInvalid', placeholderCellClassName: 'htPlaceholder', readOnlyCellClassName: 'htDimmed', fragmentSelection: false, readOnly: false, nativeScrollbars: false, type: 'text', copyable: true, debug: false //shows debug overlays in Walkontable }; Handsontable.DefaultSettings = DefaultSettings; $.fn.handsontable = function (action) { var i , ilen , args , output , userSettings , $this = this.first() // Use only first element from list , instance = $this.data('handsontable'); // Init case if (typeof action !== 'string') { userSettings = action || {}; if (instance) { instance.updateSettings(userSettings); } else { instance = new Handsontable.Core($this, userSettings); $this.data('handsontable', instance); instance.init(); } return $this; } // Action case else { args = []; if (arguments.length > 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); } else { throw new Error('Handsontable do not provide action: ' + action); } } return output; } }; (function (window) { 'use strict'; 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); //Delete must be called using square bracket notation, because IE8 does not handle using `delete` with dot notation } } }; 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; // NaN === NaN is always false } } if (!window.MultiMap){ window.MultiMap = MultiMap; } })(window); /** * Handsontable TableView constructor * @param {Object} instance */ Handsontable.TableView = function (instance) { var that = this , $window = $(window) , $documentElement = $(document.documentElement); this.instance = instance; this.settings = instance.getSettings(); this.settingsFromDOM = instance.getSettingsFromDOM(); instance.rootElement.data('originalStyle', instance.rootElement[0].getAttribute('style')); //needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions // in IE7 getAttribute('style') returns an object instead of a string, but we only support IE8+ instance.rootElement.addClass('handsontable'); var table = document.createElement('TABLE'); table.className = 'htCore'; this.THEAD = document.createElement('THEAD'); table.appendChild(this.THEAD); this.TBODY = document.createElement('TBODY'); table.appendChild(this.TBODY); instance.$table = $(table); instance.rootElement.prepend(instance.$table); instance.rootElement.on('mousedown.handsontable', function (event) { if (!that.isTextSelectionAllowed(event.target)) { clearTextSelection(); event.preventDefault(); window.focus(); //make sure that window that contains HOT is active. Important when HOT is in iframe. } }); $documentElement.on('keyup.' + instance.guid, function (event) { if (instance.selection.isInProgress() && !event.shiftKey) { instance.selection.finish(); } }); var isMouseDown; $documentElement.on('mouseup.' + instance.guid, function (event) { if (instance.selection.isInProgress() && event.which === 1) { //is left mouse button instance.selection.finish(); } isMouseDown = false; if (instance.autofill.handle && instance.autofill.handle.isDragged) { if (instance.autofill.handle.isDragged > 1) { instance.autofill.apply(); } instance.autofill.handle.isDragged = 0; } if (Handsontable.helper.isOutsideInput(document.activeElement)) { instance.unlisten(); } }); $documentElement.on('mousedown.' + instance.guid, function (event) { var next = event.target; if (next !== that.wt.wtTable.spreader) { //immediate click on "spreader" means click on the right side of vertical scrollbar while (next !== document.documentElement) { if (next === null) { return; //click on something that was a row but now is detached (possibly because your click triggered a rerender) } if (next === instance.rootElement[0] || next.nodeName === 'HANDSONTABLE-TABLE') { return; //click inside container or Web Component (HANDSONTABLE-TABLE is the name of the custom element) } next = next.parentNode; } } if (that.settings.outsideClickDeselects) { instance.deselectCell(); } else { instance.destroyEditor(); } }); instance.rootElement.on('mousedown.handsontable', '.dragdealer', function () { instance.destroyEditor(); }); instance.$table.on('selectstart', function (event) { if (that.settings.fragmentSelection) { return; } //https://github.com/warpech/jquery-handsontable/issues/160 //selectstart is IE only event. Prevent text from being selected when performing drag down in IE8 event.preventDefault(); }); var clearTextSelection = function () { //http://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript if (window.getSelection) { if (window.getSelection().empty) { // Chrome window.getSelection().empty(); } else if (window.getSelection().removeAllRanges) { // Firefox window.getSelection().removeAllRanges(); } } else if (document.selection) { // IE? document.selection.empty(); } }; var walkontableConfig = { debug: function () { return that.settings.debug; }, table: table, stretchH: this.settings.stretchH, data: instance.getDataAtCell, totalRows: instance.countRows, totalColumns: instance.countCols, nativeScrollbars: this.settings.nativeScrollbars, offsetRow: 0, offsetColumn: 0, width: this.getWidth(), height: this.getHeight(), fixedColumnsLeft: function () { return that.settings.fixedColumnsLeft; }, fixedRowsTop: function () { return that.settings.fixedRowsTop; }, rowHeaders: function () { return instance.hasRowHeaders() ? [function (index, TH) { that.appendRowHeader(index, TH); }] : [] }, columnHeaders: function () { return instance.hasColHeaders() ? [function (index, TH) { that.appendColHeader(index, TH); }] : [] }, columnWidth: instance.getColWidth, 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); that.instance.PluginHooks.run('afterRenderer', TD, row, col, prop, value, cellProperties); }, selections: { current: { className: 'current', border: { width: 2, color: '#5292F7', style: 'solid', cornerVisible: function () { return that.settings.fillHandle && !that.isCellEdited() && !instance.selection.isMultiple() } } }, area: { className: 'area', border: { width: 1, color: '#89AFF9', style: 'solid', cornerVisible: function () { return that.settings.fillHandle && !that.isCellEdited() && instance.selection.isMultiple() } } }, highlight: { highlightRowClassName: that.settings.currentRowClassName, highlightColumnClassName: that.settings.currentColClassName }, fill: { className: 'fill', border: { width: 1, color: 'red', style: 'solid' } } }, hideBorderOnMouseDownOver: function () { return that.settings.fragmentSelection; }, onCellMouseDown: function (event, coords, TD) { instance.listen(); isMouseDown = true; var coordsObj = {row: coords[0], col: coords[1]}; if (event.button === 2 && instance.selection.inInSelection(coordsObj)) { //right mouse button //do nothing } else if (event.shiftKey) { instance.selection.setRangeEnd(coordsObj); } else { instance.selection.setRangeStart(coordsObj); } instance.PluginHooks.run('afterOnCellMouseDown', event, coords, TD); }, /*onCellMouseOut: function (/*event, coords, TD* /) { if (isMouseDown && that.settings.fragmentSelection === 'single') { clearTextSelection(); //otherwise text selection blinks during multiple cells selection } },*/ onCellMouseOver: function (event, coords, TD) { var coordsObj = {row: coords[0], col: coords[1]}; if (isMouseDown) { /*if (that.settings.fragmentSelection === 'single') { clearTextSelection(); //otherwise text selection blinks during multiple cells selection }*/ instance.selection.setRangeEnd(coordsObj); } else if (instance.autofill.handle && instance.autofill.handle.isDragged) { instance.autofill.handle.isDragged++; instance.autofill.showBorder(coords); } instance.PluginHooks.run('afterOnCellMouseOver', event, coords, TD); }, onCellCornerMouseDown: function (event) { instance.autofill.handle.isDragged = 1; event.preventDefault(); instance.PluginHooks.run('afterOnCellCornerMouseDown', event); }, onCellCornerDblClick: function () { instance.autofill.selectAdjacent(); }, beforeDraw: function (force) { that.beforeRender(force); }, onDraw: function(force){ that.onDraw(force); }, onScrollVertically: function () { instance.runHooks('afterScrollVertically'); }, onScrollHorizontally: function () { instance.runHooks('afterScrollHorizontally'); } }; instance.PluginHooks.run('beforeInitWalkontable', walkontableConfig); this.wt = new Walkontable(walkontableConfig); $window.on('resize.' + instance.guid, function () { instance.registerTimeout('resizeTimeout', function () { instance.parseSettingsFromDOM(); var newWidth = that.getWidth(); var newHeight = that.getHeight(); if (walkontableConfig.width !== newWidth || walkontableConfig.height !== newHeight) { instance.forceFullRender = true; that.render(); walkontableConfig.width = newWidth; walkontableConfig.height = newHeight; } }, 60); }); $(that.wt.wtTable.spreader).on('mousedown.handsontable, contextmenu.handsontable', function (event) { if (event.target === that.wt.wtTable.spreader && event.which === 3) { //right mouse button exactly on spreader means right clickon the right hand side of vertical scrollbar event.stopPropagation(); } }); $documentElement.on('click.' + instance.guid, function () { if (that.settings.observeDOMVisibility) { if (that.wt.drawInterrupted) { that.instance.forceFullRender = true; that.render(); } } }); }; Handsontable.TableView.prototype.isTextSelectionAllowed = function (el) { if ( Handsontable.helper.isInput(el) ) { return (true); } if (this.settings.fragmentSelection && this.wt.wtDom.isChildOf(el, this.TBODY)) { return (true); } return false; }; Handsontable.TableView.prototype.isCellEdited = function () { var activeEditor = this.instance.getActiveEditor(); return activeEditor && activeEditor.isOpened(); }; Handsontable.TableView.prototype.getWidth = function () { var val = this.settings.width !== void 0 ? this.settings.width : this.settingsFromDOM.width; return typeof val === 'function' ? val() : val; }; Handsontable.TableView.prototype.getHeight = function () { var val = this.settings.height !== void 0 ? this.settings.height : this.settingsFromDOM.height; return typeof val === 'function' ? val() : val; }; Handsontable.TableView.prototype.beforeRender = function (force) { if (force) { //force = did Walkontable decide to do full render this.instance.PluginHooks.run('beforeRender', this.instance.forceFullRender); //this.instance.forceFullRender = did Handsontable request full render? this.wt.update('width', this.getWidth()); this.wt.update('height', this.getHeight()); } }; Handsontable.TableView.prototype.onDraw = function(force){ if (force) { //force = did Walkontable decide to do full render this.instance.PluginHooks.run('afterRender', this.instance.forceFullRender); //this.instance.forceFullRender = did Handsontable request full render? } }; Handsontable.TableView.prototype.render = function () { this.wt.draw(!this.instance.forceFullRender); this.instance.forceFullRender = false; this.instance.rootElement.triggerHandler('render.handsontable'); }; /** * Returns td object given coordinates */ Handsontable.TableView.prototype.getCellAtCoords = function (coords) { var td = this.wt.wtTable.getCell([coords.row, coords.col]); if (td < 0) { //there was an exit code (cell is out of bounds) return null; } else { return td; } }; /** * Scroll viewport to selection * @param coords */ Handsontable.TableView.prototype.scrollViewport = function (coords) { this.wt.scrollViewport([coords.row, coords.col]); }; /** * Append row header to a TH element * @param row * @param TH */ Handsontable.TableView.prototype.appendRowHeader = function (row, TH) { if (row > -1) { this.wt.wtDom.fastInnerHTML(TH, this.instance.getRowHeader(row)); } else { var DIV = document.createElement('DIV'); DIV.className = 'relative'; this.wt.wtDom.fastInnerText(DIV, '\u00A0'); this.wt.wtDom.empty(TH); TH.appendChild(DIV); } }; /** * Append column header to a TH element * @param col * @param TH */ Handsontable.TableView.prototype.appendColHeader = function (col, TH) { var DIV = document.createElement('DIV') , SPAN = document.createElement('SPAN'); DIV.className = 'relative'; SPAN.className = 'colHeader'; this.wt.wtDom.fastInnerHTML(SPAN, this.instance.getColHeader(col)); DIV.appendChild(SPAN); this.wt.wtDom.empty(TH); TH.appendChild(DIV); this.instance.PluginHooks.run('afterGetColHeader', col, TH); }; /** * Given a element's left position relative to the viewport, returns maximum element width until the right edge of the viewport (before scrollbar) * @param {Number} left * @return {Number} */ Handsontable.TableView.prototype.maximumVisibleElementWidth = function (left) { var rootWidth = this.wt.wtViewport.getWorkspaceWidth(); if(this.settings.nativeScrollbars) { return rootWidth; } return rootWidth - left; }; /** * Given a element's top position relative to the viewport, returns maximum element height until the bottom edge of the viewport (before scrollbar) * @param {Number} top * @return {Number} */ Handsontable.TableView.prototype.maximumVisibleElementHeight = function (top) { var rootHeight = this.wt.wtViewport.getWorkspaceHeight(); if(this.settings.nativeScrollbars) { return rootHeight; } return rootHeight - top; }; /** * Utility to register editors and common namespace for keeping reference to all editor classes */ (function (Handsontable) { 'use strict'; function RegisteredEditor(editorClass) { var clazz, instances; instances = {}; clazz = editorClass; this.getInstance = function (hotInstance) { if (!(hotInstance.guid in instances)) { instances[hotInstance.guid] = new clazz(hotInstance); } return instances[hotInstance.guid]; } } var registeredEditorNames = {}; var registeredEditorClasses = new WeakMap(); Handsontable.editors = { /** * Registers editor under given name * @param {String} editorName * @param {Function} editorClass */ registerEditor: function (editorName, editorClass) { var editor = new RegisteredEditor(editorClass); if (typeof editorName === "string") { registeredEditorNames[editorName] = editor; } registeredEditorClasses.set(editorClass, editor); }, /** * Returns instance (singleton) of editor class * @param {String|Function} editorName/editorClass * @returns {Function} editorClass */ getEditor: function (editorName, hotInstance) { var editor; if (typeof editorName == 'function') { if (!(registeredEditorClasses.get(editorName))) { this.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); } }; })(Handsontable); (function(Handsontable){ 'use strict'; Handsontable.EditorManager = function(instance, priv, selection){ var that = this; var $document = $(document); var keyCodes = Handsontable.helper.keyCode; var activeEditor; var init = function () { function onKeyDown(event) { if (!instance.isListening()) { return; } if (priv.settings.beforeOnKeyDown) { // HOT in HOT Plugin priv.settings.beforeOnKeyDown.call(instance, event); } instance.PluginHooks.run('beforeKeyDown', event); if (!event.isImmediatePropagationStopped()) { priv.lastKeyCode = event.keyCode; if (selection.isSelected()) { var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; //catch CTRL but not right ALT (which in some systems triggers ALT+CTRL) if (!activeEditor.isWaiting()) { if (!Handsontable.helper.isMetaKey(event.keyCode) && !ctrlDown && !that.isEditorOpened()) { that.openEditor(''); event.stopPropagation(); //required by HandsontableEditor return; } } var rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart; switch (event.keyCode) { case keyCodes.A: if (ctrlDown) { selection.selectAll(); //select all cells event.preventDefault(); event.stopPropagation(); break; } case keyCodes.ARROW_UP: if (that.isEditorOpened() && !activeEditor.isWaiting()){ that.closeEditorAndSaveChanges(ctrlDown); } moveSelectionUp(event.shiftKey); event.preventDefault(); event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.ARROW_DOWN: if (that.isEditorOpened() && !activeEditor.isWaiting()){ that.closeEditorAndSaveChanges(ctrlDown); } moveSelectionDown(event.shiftKey); event.preventDefault(); event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.ARROW_RIGHT: if(that.isEditorOpened() && !activeEditor.isWaiting()){ that.closeEditorAndSaveChanges(ctrlDown); } moveSelectionRight(event.shiftKey); event.preventDefault(); event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.ARROW_LEFT: if(that.isEditorOpened() && !activeEditor.isWaiting()){ that.closeEditorAndSaveChanges(ctrlDown); } moveSelectionLeft(event.shiftKey); event.preventDefault(); event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.TAB: var tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves; if (event.shiftKey) { selection.transformStart(-tabMoves.row, -tabMoves.col); //move selection left } else { selection.transformStart(tabMoves.row, tabMoves.col, true); //move selection right (add a new column if needed) } event.preventDefault(); event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.BACKSPACE: case keyCodes.DELETE: selection.empty(event); that.prepareEditor(); event.preventDefault(); break; case keyCodes.F2: /* F2 */ that.openEditor(); event.preventDefault(); //prevent Opera from opening Go to Page dialog break; case keyCodes.ENTER: /* return/enter */ if(that.isEditorOpened()){ if (activeEditor.state !== Handsontable.EditorState.WAITING){ that.closeEditorAndSaveChanges(ctrlDown); } moveSelectionAfterEnter(event.shiftKey); } else { if (instance.getSettings().enterBeginsEditing){ that.openEditor(); } else { moveSelectionAfterEnter(event.shiftKey); } } event.preventDefault(); //don't add newline to field event.stopImmediatePropagation(); //required by HandsontableEditor break; case keyCodes.ESCAPE: if(that.isEditorOpened()){ that.closeEditorAndRestoreOriginalValue(ctrlDown); } event.preventDefault(); break; case keyCodes.HOME: if (event.ctrlKey || event.metaKey) { rangeModifier({row: 0, col: priv.selStart.col()}); } else { rangeModifier({row: priv.selStart.row(), col: 0}); } event.preventDefault(); //don't scroll the window event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.END: if (event.ctrlKey || event.metaKey) { rangeModifier({row: instance.countRows() - 1, col: priv.selStart.col()}); } else { rangeModifier({row: priv.selStart.row(), col: instance.countCols() - 1}); } event.preventDefault(); //don't scroll the window event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.PAGE_UP: selection.transformStart(-instance.countVisibleRows(), 0); instance.view.wt.scrollVertical(-instance.countVisibleRows()); instance.view.render(); event.preventDefault(); //don't page up the window event.stopPropagation(); //required by HandsontableEditor break; case keyCodes.PAGE_DOWN: selection.transformStart(instance.countVisibleRows(), 0); instance.view.wt.scrollVertical(instance.countVisibleRows()); instance.view.render(); event.preventDefault(); //don't page down the window event.stopPropagation(); //required by HandsontableEditor break; default: break; } } } } $document.on('keydown.handsontable.' + instance.guid, onKeyDown); function onDblClick() { // that.instance.destroyEditor(); that.openEditor(); } instance.view.wt.update('onCellDblClick', onDblClick); instance.addHook('afterDestroy', function(){ $document.off('keydown.handsontable.' + instance.guid); }); 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); //move selection up } else { selection.transformStart(enterMoves.row, enterMoves.col, true); //move selection down (add a new row if needed) } } function moveSelectionUp(shiftKey){ if (shiftKey) { selection.transformEnd(-1, 0); } else { selection.transformStart(-1, 0); } } function moveSelectionDown(shiftKey){ if (shiftKey) { selection.transformEnd(1, 0); //expanding selection down with shift } else { selection.transformStart(1, 0); //move selection down } } 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); } } }; /** * Destroy current editor, if exists * @param {Boolean} revertOriginal */ this.destroyEditor = function (revertOriginal) { this.closeEditor(revertOriginal); }; this.getActiveEditor = function () { return activeEditor; }; /** * Prepare text input to be displayed at given grid cell */ this.prepareEditor = function () { if (activeEditor && activeEditor.isWaiting()){ this.closeEditor(false, false, function(dataSaved){ if(dataSaved){ that.prepareEditor(); } }); return; } var row = priv.selStart.row(); var col = priv.selStart.col(); var prop = instance.colToProp(col); var td = instance.getCell(row, col); var originalValue = instance.getDataAtCell(row, col); var cellProperties = instance.getCellMeta(row, col); var editorClass = instance.getCellEditor(cellProperties); activeEditor = Handsontable.editors.getEditor(editorClass, instance); activeEditor.prepare(row, col, prop, td, originalValue, cellProperties); }; this.isEditorOpened = function () { return activeEditor.isOpened(); }; this.openEditor = function (initialValue) { if (!activeEditor.cellProperties.readOnly){ activeEditor.beginEditing(initialValue); } }; this.closeEditor = function (restoreOriginalValue, ctrlDown, callback) { if (!activeEditor){ if(callback) { callback(false); } } else { activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback); } }; this.closeEditorAndSaveChanges = function(ctrlDown){ return this.closeEditor(false, ctrlDown); }; this.closeEditorAndRestoreOriginalValue = function(ctrlDown){ return this.closeEditor(true, ctrlDown); }; init(); }; })(Handsontable); /** * Utility to register renderers and common namespace for keeping reference to all renderers classes */ (function (Handsontable) { 'use strict'; var registeredRenderers = {}; Handsontable.renderers = { /** * Registers renderer under given name * @param {String} rendererName * @param {Function} rendererFunction */ registerRenderer: function (rendererName, rendererFunction) { registeredRenderers[rendererName] = rendererFunction }, /** * @param {String|Function} rendererName/rendererFunction * @returns {Function} rendererFunction */ getRenderer: function (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]; } }; })(Handsontable); /** * DOM helper optimized for maximum performance * It is recommended for Handsontable plugins and renderers, because it is much faster than jQuery * @type {WalkonableDom} */ Handsontable.Dom = new WalkontableDom(); /** * Returns true if keyCode represents a printable character * @param {Number} keyCode * @return {Boolean} */ Handsontable.helper.isPrintableChar = function (keyCode) { return ((keyCode == 32) || //space (keyCode >= 48 && keyCode <= 57) || //0-9 (keyCode >= 96 && keyCode <= 111) || //numpad (keyCode >= 186 && keyCode <= 192) || //;=,-./` (keyCode >= 219 && keyCode <= 222) || //[]{}\|"' keyCode >= 226 || //special chars (229 for Asian chars) (keyCode >= 65 && keyCode <= 90)); //a-z }; Handsontable.helper.isMetaKey = function (keyCode) { var keyCodes = Handsontable.helper.keyCode; var metaKeys = [ keyCodes.ARROW_DOWN, keyCodes.ARROW_UP, keyCodes.ARROW_LEFT, keyCodes.ARROW_RIGHT, keyCodes.HOME, keyCodes.END, keyCodes.DELETE, keyCodes.BACKSPACE, keyCodes.F1, keyCodes.F2, keyCodes.F3, keyCodes.F4, keyCodes.F5, keyCodes.F6, keyCodes.F7, keyCodes.F8, keyCodes.F9, keyCodes.F10, keyCodes.F11, keyCodes.F12, keyCodes.TAB, keyCodes.PAGE_DOWN, keyCodes.PAGE_UP, keyCodes.ENTER, keyCodes.ESCAPE, keyCodes.SHIFT, keyCodes.CAPS_LOCK, keyCodes.ALT ]; return metaKeys.indexOf(keyCode) != -1; }; Handsontable.helper.isCtrlKey = function (keyCode) { var keys = Handsontable.helper.keyCode; return [keys.CONTROL_LEFT, 224, keys.COMMAND_LEFT, keys.COMMAND_RIGHT].indexOf(keyCode) != -1; }; /** * Converts a value to string * @param value * @return {String} */ Handsontable.helper.stringify = function (value) { switch (typeof value) { case 'string': case 'number': return value + ''; break; case 'object': if (value === null) { return ''; } else { return value.toString(); } break; case 'undefined': return ''; break; default: return value.toString(); } }; /** * Generates spreadsheet-like column names: A, B, C, ..., Z, AA, AB, etc * @param index * @returns {String} */ Handsontable.helper.spreadsheetColumnLabel = function (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; }; /** * Checks if value of n is a numeric one * http://jsperf.com/isnan-vs-isnumeric/4 * @param n * @returns {boolean} */ Handsontable.helper.isNumeric = function (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; }; Handsontable.helper.isArray = function (obj) { return Object.prototype.toString.call(obj).match(/array/i) !== null; }; /** * Checks if child is a descendant of given parent node * http://stackoverflow.com/questions/2234979/how-to-check-in-javascript-if-one-element-is-a-child-of-another * @param parent * @param child * @returns {boolean} */ Handsontable.helper.isDescendant = function (parent, child) { var node = child.parentNode; while (node != null) { if (node == parent) { return true; } node = node.parentNode; } return false; }; /** * Generates a random hex string. Used as namespace for Handsontable instance events. * @return {String} - 16 character random string: "92b1bfc74ec4" */ Handsontable.helper.randomString = function () { return walkontableRandomString(); }; /** * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`. * Creates temporary dummy function to call it as constructor. * Described in ticket: https://github.com/warpech/jquery-handsontable/pull/516 * @param {Object} Child child class * @param {Object} Parent parent class * @return {Object} extended Child */ Handsontable.helper.inherit = function (Child, Parent) { Parent.prototype.constructor = Parent; Child.prototype = new Parent(); Child.prototype.constructor = Child; return Child; }; /** * Perform shallow extend of a target object with extension's own properties * @param {Object} target An object that will receive the new properties * @param {Object} extension An object containing additional properties to merge into the target */ Handsontable.helper.extend = function (target, extension) { for (var i in extension) { if (extension.hasOwnProperty(i)) { target[i] = extension[i]; } } }; Handsontable.helper.getPrototypeOf = function (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; // get real constructor obj.constructor = oldConstructor; // restore constructor } } prototype = constructor ? constructor.prototype : null; // needed for IE } return prototype; }; /** * Factory for columns constructors. * @param {Object} GridSettings * @param {Array} conflictList * @return {Object} ColumnSettings */ Handsontable.helper.columnFactory = function (GridSettings, conflictList) { function ColumnSettings () {} Handsontable.helper.inherit(ColumnSettings, GridSettings); // Clear conflict settings for (var i = 0, len = conflictList.length; i < len; i++) { ColumnSettings.prototype[conflictList[i]] = void 0; } return ColumnSettings; }; Handsontable.helper.translateRowsToColumns = function (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; }; Handsontable.helper.to2dArray = function (arr) { var i = 0 , ilen = arr.length; while (i < ilen) { arr[i] = [arr[i]]; i++; } }; Handsontable.helper.extendArray = function (arr, extension) { var i = 0 , ilen = extension.length; while (i < ilen) { arr.push(extension[i]); i++; } }; /** * Determines if the given DOM element is an input field. * Notice: By 'input' we mean input, textarea and select nodes * @param element - DOM element * @returns {boolean} */ Handsontable.helper.isInput = function (element) { var inputs = ['INPUT', 'SELECT', 'TEXTAREA']; return inputs.indexOf(element.nodeName) > -1; } /** * Determines if the given DOM element is an input field placed OUTSIDE of HOT. * Notice: By 'input' we mean input, textarea and select nodes * @param element - DOM element * @returns {boolean} */ Handsontable.helper.isOutsideInput = function (element) { return Handsontable.helper.isInput(element) && element.className.indexOf('handsontableInput') == -1; }; Handsontable.helper.keyCode = { MOUSE_LEFT: 1, MOUSE_RIGHT: 3, MOUSE_MIDDLE: 2, BACKSPACE: 8, COMMA: 188, 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 }; /** * Determines whether given object is a plain Object. * Note: String and Array are not plain Objects * @param {*} obj * @returns {boolean} */ Handsontable.helper.isObject = function (obj) { return Object.prototype.toString.call(obj) == '[object Object]'; }; /** * Determines whether given object is an Array. * Note: String is not an Array * @param {*} obj * @returns {boolean} */ Handsontable.helper.isArray = function(obj){ return Array.isArray ? Array.isArray(obj) : Object.prototype.toString.call(obj) == '[object Array]'; }; Handsontable.helper.pivot = function (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; }; Handsontable.helper.proxy = function (fun, context) { return function () { return fun.apply(context, arguments); }; }; /** * Factory that produces a function for searching methods (or any properties) which could be defined directly in * table configuration or implicitly, within cell type definition. * * For example: renderer can be defined explicitly using "renderer" property in column configuration or it can be * defined implicitly using "type" property. * * Methods/properties defined explicitly always takes precedence over those defined through "type". * * If the method/property is not found in an object, searching is continued recursively through prototype chain, until * it reaches the Object.prototype. * * * @param methodName {String} name of the method/property to search (i.e. 'renderer', 'validator', 'copyable') * @param allowUndefined {Boolean} [optional] if false, the search is continued if methodName has not been found in cell "type" * @returns {Function} */ Handsontable.helper.cellMethodLookupFactory = function (methodName, allowUndefined) { allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined; return function cellMethodLookup (row, col) { return (function getMethodFromProperties(properties) { if (!properties){ return; //method not found } else if (properties.hasOwnProperty(methodName) && properties[methodName]) { //check if it is own and is not empty return properties[methodName]; //method defined directly } else if (properties.hasOwnProperty('type') && properties.type) { //check if it is own and is not empty 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]; //method defined in type. } else if (allowUndefined) { return; //method does not defined in type (eg. validator), returns undefined } } return getMethodFromProperties(Handsontable.helper.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; } }; Handsontable.helper.toString = function (obj) { return '' + obj; }; Handsontable.SelectionPoint = function () { this._row = null; //private use intended this._col = null; }; Handsontable.SelectionPoint.prototype.exists = function () { return (this._row !== null); }; Handsontable.SelectionPoint.prototype.row = function (val) { if (val !== void 0) { this._row = val; } return this._row; }; Handsontable.SelectionPoint.prototype.col = function (val) { if (val !== void 0) { this._col = val; } return this._col; }; Handsontable.SelectionPoint.prototype.coords = function (coords) { if (coords !== void 0) { this._row = coords.row; this._col = coords.col; } return { row: this._row, col: this._col } }; Handsontable.SelectionPoint.prototype.arr = function (arr) { if (arr !== void 0) { this._row = arr[0]; this._col = arr[1]; } return [this._row, this._col] }; (function (Handsontable) { 'use strict'; /** * Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names * TODO refactor arguments of methods getRange, getText to be numbers (not objects) * TODO remove priv, GridSettings from object constructor * * @param instance * @param priv * @param GridSettings * @constructor */ Handsontable.DataMap = function (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(); this.getVars = {}; //used by modifier this.setVars = {}; //used by modifier }; Handsontable.DataMap.prototype.DESTINATION_RENDERER = 1; Handsontable.DataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2; Handsontable.DataMap.prototype.recursiveDuckSchema = function (obj) { var schema; if ($.isPlainObject(obj)) { schema = {}; for (var i in obj) { if (obj.hasOwnProperty(i)) { if ($.isPlainObject(obj[i])) { schema[i] = this.recursiveDuckSchema(obj[i]); } else { schema[i] = null; } } } } else { schema = []; } return schema; }; Handsontable.DataMap.prototype.recursiveDuckColumns = function (schema, lastCol, parent) { var prop, i; if (typeof lastCol === 'undefined') { lastCol = 0; parent = ''; } if ($.isPlainObject(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; }; Handsontable.DataMap.prototype.createMap = function () { if (typeof this.getSchema() === "undefined") { throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`"); } var i, ilen, schema = this.getSchema(); 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); } }; Handsontable.DataMap.prototype.colToProp = function (col) { col = Handsontable.PluginHooks.execute(this.instance, 'modifyCol', col); if (this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') { return this.colToPropCache[col]; } else { return col; } }; Handsontable.DataMap.prototype.propToCol = function (prop) { var col; if (typeof this.propToColCache.get(prop) !== 'undefined') { col = this.propToColCache.get(prop); } else { col = prop; } col = Handsontable.PluginHooks.execute(this.instance, 'modifyCol', col); return col; }; Handsontable.DataMap.prototype.getSchema = function () { var schema = this.instance.getSettings().dataSchema; if (schema) { if (typeof schema === 'function') { return schema(); } return schema; } return this.duckSchema; }; /** * Creates row at the bottom of the data array * @param {Number} [index] Optional. Index of the row before which the new row will be inserted */ Handsontable.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.countRows()) { index = this.instance.countRows(); } currentIndex = index; var maxRows = this.instance.getSettings().maxRows; while (numberOfCreatedRows < amount && this.instance.countRows() < 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 = $.extend(true, {}, this.getSchema()); } if (index === this.instance.countRows()) { this.dataSource.push(row); } else { this.dataSource.splice(index, 0, row); } numberOfCreatedRows++; currentIndex++; } this.instance.PluginHooks.run('afterCreateRow', index, numberOfCreatedRows, createdAutomatically); this.instance.forceFullRender = true; //used when data was changed return numberOfCreatedRows; }; /** * Creates col at the right of the data array * @param {Number} [index] Optional. Index of the column before which the new column will be inserted * * @param {Number} [amount] Optional. */ Handsontable.DataMap.prototype.createCol = function (index, amount, createdAutomatically) { if (this.instance.dataType === 'object' || this.instance.getSettings().columns) { 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.countRows() , 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 = Handsontable.helper.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); } // Add new column constructor this.priv.columnSettings.push(constructor); } else { for (var r = 0; r < rlen; r++) { data[r].splice(currentIndex, 0, null); } // Add new column constructor at given index this.priv.columnSettings.splice(currentIndex, 0, constructor); } numberOfCreatedCols++; currentIndex++; } this.instance.PluginHooks.run('afterCreateCol', index, numberOfCreatedCols, createdAutomatically); this.instance.forceFullRender = true; //used when data was changed return numberOfCreatedCols; }; /** * Removes row from the data array * @param {Number} [index] Optional. Index of the row to be removed. If not provided, the last row will be removed * @param {Number} [amount] Optional. Amount of the rows to be removed. If not provided, one row will be removed */ Handsontable.DataMap.prototype.removeRow = function (index, amount) { if (!amount) { amount = 1; } if (typeof index !== 'number') { index = -amount; } index = (this.instance.countRows() + index) % this.instance.countRows(); // We have to map the physical row ids to logical and than perform removing with (possibly) new row id var logicRows = this.physicalRowsToLogical(index, amount); var actionWasNotCancelled = this.instance.PluginHooks.execute('beforeRemoveRow', index, amount); 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); this.instance.PluginHooks.run('afterRemoveRow', index, amount); this.instance.forceFullRender = true; //used when data was changed }; /** * Removes column from the data array * @param {Number} [index] Optional. Index of the column to be removed. If not provided, the last column will be removed * @param {Number} [amount] Optional. Amount of the columns to be removed. If not provided, one column will be removed */ Handsontable.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 = this.instance.PluginHooks.execute('beforeRemoveCol', index, amount); if (actionWasNotCancelled === false) { return; } var data = this.dataSource; for (var r = 0, rlen = this.instance.countRows(); r < rlen; r++) { data[r].splice(index, amount); } this.priv.columnSettings.splice(index, amount); this.instance.PluginHooks.run('afterRemoveCol', index, amount); this.instance.forceFullRender = true; //used when data was changed }; /** * Add / removes data from the column * @param {Number} col Index of column in which do you want to do splice. * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed * param {...*} elements Optional. The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array */ Handsontable.DataMap.prototype.spliceCol = function (col, index, amount/*, elements...*/) { 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); Handsontable.helper.extendArray(elements, after); var i = 0; while (i < amount) { elements.push(null); //add null in place of removed elements i++; } Handsontable.helper.to2dArray(elements); this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol'); return removed; }; /** * Add / removes data from the row * @param {Number} row Index of row in which do you want to do splice. * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed * param {...*} elements Optional. The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array */ Handsontable.DataMap.prototype.spliceRow = function (row, index, amount/*, elements...*/) { var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : []; var rowData = this.instance.getDataAtRow(row); var removed = rowData.slice(index, index + amount); var after = rowData.slice(index + amount); Handsontable.helper.extendArray(elements, after); var i = 0; while (i < amount) { elements.push(null); //add null in place of removed elements i++; } this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow'); return removed; }; /** * Returns single value from the data array * @param {Number} row * @param {Number} prop */ Handsontable.DataMap.prototype.get = function (row, prop) { this.getVars.row = row; this.getVars.prop = prop; this.instance.PluginHooks.run('beforeGet', this.getVars); if (typeof this.getVars.prop === 'string' && this.getVars.prop.indexOf('.') > -1) { var sliced = this.getVars.prop.split("."); var out = this.dataSource[this.getVars.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 this.getVars.prop === 'function') { /** * allows for interacting with complex structures, for example * d3/jQuery getter/setter properties: * * {columns: [{ * data: function(row, value){ * if(arguments.length === 1){ * return row.property(); * } * row.property(value); * } * }]} */ return this.getVars.prop(this.dataSource.slice( this.getVars.row, this.getVars.row + 1 )[0]); } else { return this.dataSource[this.getVars.row] ? this.dataSource[this.getVars.row][this.getVars.prop] : null; } }; var copyableLookup = Handsontable.helper.cellMethodLookupFactory('copyable', false); /** * Returns single value from the data array (intended for clipboard copy to an external application) * @param {Number} row * @param {Number} prop * @return {String} */ Handsontable.DataMap.prototype.getCopyable = function (row, prop) { if (copyableLookup.call(this.instance, row, this.propToCol(prop))) { return this.get(row, prop); } return ''; }; /** * Saves single value to the data array * @param {Number} row * @param {Number} prop * @param {String} value * @param {String} [source] Optional. Source of hook runner. */ Handsontable.DataMap.prototype.set = function (row, prop, value, source) { this.setVars.row = row; this.setVars.prop = prop; this.setVars.value = value; this.instance.PluginHooks.run('beforeSet', this.setVars, source || "datamapGet"); if (typeof this.setVars.prop === 'string' && this.setVars.prop.indexOf('.') > -1) { var sliced = this.setVars.prop.split("."); var out = this.dataSource[this.setVars.row]; for (var i = 0, ilen = sliced.length - 1; i < ilen; i++) { out = out[sliced[i]]; } out[sliced[i]] = this.setVars.value; } else if (typeof this.setVars.prop === 'function') { /* see the `function` handler in `get` */ this.setVars.prop(this.dataSource.slice( this.setVars.row, this.setVars.row + 1 )[0], this.setVars.value); } else { this.dataSource[this.setVars.row][this.setVars.prop] = this.setVars.value; } }; /** * This ridiculous piece of code maps rows Id that are present in table data to those displayed for user. * The trick is, the physical row id (stored in settings.data) is not necessary the same * as the logical (displayed) row id (e.g. when sorting is applied). */ Handsontable.DataMap.prototype.physicalRowsToLogical = function (index, amount) { var totalRows = this.instance.countRows(); var physicRow = (totalRows + index) % totalRows; var logicRows = []; var rowsToRemove = amount; while (physicRow < totalRows && rowsToRemove) { this.get(physicRow, 0); //this performs an actual mapping and saves the result to getVars logicRows.push(this.getVars.row); rowsToRemove--; physicRow++; } return logicRows; }; /** * Clears the data array */ Handsontable.DataMap.prototype.clear = function () { for (var r = 0; r < this.instance.countRows(); r++) { for (var c = 0; c < this.instance.countCols(); c++) { this.set(r, this.colToProp(c), ''); } } }; /** * Returns the data array * @return {Array} */ Handsontable.DataMap.prototype.getAll = function () { return this.dataSource; }; /** * Returns data range as array * @param {Object} start Start selection position * @param {Object} end End selection position * @param {Number} destination Destination of datamap.get * @return {Array} */ Handsontable.DataMap.prototype.getRange = function (start, end, destination) { var r, rlen, c, clen, output = [], row; 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 = []; for (c = Math.min(start.col, end.col); c <= clen; c++) { row.push(getFn.call(this, r, this.colToProp(c))); } output.push(row); } return output; }; /** * Return data as text (tab separated columns) * @param {Object} start (Optional) Start selection position * @param {Object} end (Optional) End selection position * @return {String} */ Handsontable.DataMap.prototype.getText = function (start, end) { return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_RENDERER)); }; /** * Return data as copyable text (tab separated columns intended for clipboard copy to an external application) * @param {Object} start (Optional) Start selection position * @param {Object} end (Optional) End selection position * @return {String} */ Handsontable.DataMap.prototype.getCopyableText = function (start, end) { return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR)); }; })(Handsontable); (function (Handsontable) { 'use strict'; /* Adds appropriate CSS class to table cell, based on cellProperties */ Handsontable.renderers.cellDecorator = function (instance, TD, row, col, prop, value, cellProperties) { if (cellProperties.readOnly) { instance.view.wt.wtDom.addClass(TD, cellProperties.readOnlyCellClassName); } if (cellProperties.valid === false && cellProperties.invalidCellClassName) { instance.view.wt.wtDom.addClass(TD, cellProperties.invalidCellClassName); } if (!value && cellProperties.placeholder) { instance.view.wt.wtDom.addClass(TD, cellProperties.placeholderCellClassName); } } })(Handsontable); /** * Default text renderer * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row * @param {Number} col * @param {String|Number} prop Row object property name * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!) * @param {Object} cellProperties Cell properites (shared by cell renderer and editor) */ (function (Handsontable) { 'use strict'; var TextRenderer = function (instance, TD, row, col, prop, value, cellProperties) { Handsontable.renderers.cellDecorator.apply(this, arguments); if (!value && cellProperties.placeholder) { value = cellProperties.placeholder; } var escaped = Handsontable.helper.stringify(value); if (cellProperties.rendererTemplate) { instance.view.wt.wtDom.empty(TD); var TEMPLATE = document.createElement('TEMPLATE'); TEMPLATE.setAttribute('bind', '{{}}'); TEMPLATE.innerHTML = cellProperties.rendererTemplate; HTMLTemplateElement.decorate(TEMPLATE); TEMPLATE.model = instance.getDataAtRow(row); TD.appendChild(TEMPLATE); } else { instance.view.wt.wtDom.fastInnerText(TD, escaped); //this is faster than innerHTML. See: https://github.com/warpech/jquery-handsontable/wiki/JavaScript-&-DOM-performance-tips } }; //Handsontable.TextRenderer = TextRenderer; //Left for backward compatibility Handsontable.renderers.TextRenderer = TextRenderer; Handsontable.renderers.registerRenderer('text', TextRenderer); })(Handsontable); (function (Handsontable) { var clonableWRAPPER = document.createElement('DIV'); clonableWRAPPER.className = 'htAutocompleteWrapper'; var clonableARROW = document.createElement('DIV'); clonableARROW.className = 'htAutocompleteArrow'; clonableARROW.appendChild(document.createTextNode('\u25BC')); //this is faster than innerHTML. See: https://github.com/warpech/jquery-handsontable/wiki/JavaScript-&-DOM-performance-tips var wrapTdContentWithWrapper = function(TD, WRAPPER){ WRAPPER.innerHTML = TD.innerHTML; Handsontable.Dom.empty(TD); TD.appendChild(WRAPPER); }; /** * Autocomplete renderer * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row * @param {Number} col * @param {String|Number} prop Row object property name * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!) * @param {Object} cellProperties Cell properites (shared by cell renderer and editor) */ var AutocompleteRenderer = function (instance, TD, row, col, prop, value, cellProperties) { var WRAPPER = clonableWRAPPER.cloneNode(true); //this is faster than createElement var ARROW = clonableARROW.cloneNode(true); //this is faster than createElement Handsontable.renderers.TextRenderer(instance, TD, row, col, prop, value, cellProperties); TD.appendChild(ARROW); Handsontable.Dom.addClass(TD, 'htAutocomplete'); if (!TD.firstChild) { //http://jsperf.com/empty-node-if-needed //otherwise empty fields appear borderless in demo/renderers.html (IE) TD.appendChild(document.createTextNode('\u00A0')); //\u00A0 equals &nbsp; for a text node //this is faster than innerHTML. See: https://github.com/warpech/jquery-handsontable/wiki/JavaScript-&-DOM-performance-tips } if (!instance.acArrowListener) { //not very elegant but easy and fast instance.acArrowListener = function () { instance.view.wt.getSetting('onCellDblClick'); }; instance.rootElement.on('mousedown.htAutocompleteArrow', '.htAutocompleteArrow', instance.acArrowListener); //this way we don't bind event listener to each arrow. We rely on propagation instead //We need to unbind the listener after the table has been destroyed instance.addHookOnce('afterDestroy', function () { this.rootElement.off('mousedown.htAutocompleteArrow'); }); } }; Handsontable.AutocompleteRenderer = AutocompleteRenderer; Handsontable.renderers.AutocompleteRenderer = AutocompleteRenderer; Handsontable.renderers.registerRenderer('autocomplete', AutocompleteRenderer); })(Handsontable); /** * Checkbox renderer * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row * @param {Number} col * @param {String|Number} prop Row object property name * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!) * @param {Object} cellProperties Cell properites (shared by cell renderer and editor) */ (function (Handsontable) { 'use strict'; var clonableINPUT = document.createElement('INPUT'); clonableINPUT.className = 'htCheckboxRendererInput'; clonableINPUT.type = 'checkbox'; clonableINPUT.setAttribute('autocomplete', 'off'); var CheckboxRenderer = function (instance, TD, row, col, prop, value, cellProperties) { if (typeof cellProperties.checkedTemplate === "undefined") { cellProperties.checkedTemplate = true; } if (typeof cellProperties.uncheckedTemplate === "undefined") { cellProperties.uncheckedTemplate = false; } instance.view.wt.wtDom.empty(TD); //TODO identify under what circumstances this line can be removed var INPUT = clonableINPUT.cloneNode(false); //this is faster than createElement if (value === cellProperties.checkedTemplate || value === Handsontable.helper.stringify(cellProperties.checkedTemplate)) { INPUT.checked = true; TD.appendChild(INPUT); } else if (value === cellProperties.uncheckedTemplate || value === Handsontable.helper.stringify(cellProperties.uncheckedTemplate)) { TD.appendChild(INPUT); } else if (value === null) { //default value INPUT.className += ' noValue'; TD.appendChild(INPUT); } else { instance.view.wt.wtDom.fastInnerText(TD, '#bad value#'); //this is faster than innerHTML. See: https://github.com/warpech/jquery-handsontable/wiki/JavaScript-&-DOM-performance-tips } var $input = $(INPUT); if (cellProperties.readOnly) { $input.on('click', function (event) { event.preventDefault(); }); } else { $input.on('mousedown', function (event) { event.stopPropagation(); //otherwise can confuse cell mousedown handler }); $input.on('mouseup', function (event) { event.stopPropagation(); //otherwise can confuse cell dblclick handler }); $input.on('change', function(){ if (this.checked) { instance.setDataAtRowProp(row, prop, cellProperties.checkedTemplate); } else { instance.setDataAtRowProp(row, prop, cellProperties.uncheckedTemplate); } }); } if(!instance.CheckboxRenderer || !instance.CheckboxRenderer.beforeKeyDownHookBound){ instance.CheckboxRenderer = { beforeKeyDownHookBound : true }; instance.addHook('beforeKeyDown', function(event){ if(event.keyCode == Handsontable.helper.keyCode.SPACE){ var selection = instance.getSelected(); var cell, checkbox, cellProperties; var selStart = { row: Math.min(selection[0], selection[2]), col: Math.min(selection[1], selection[3]) }; var selEnd = { row: Math.max(selection[0], selection[2]), col: Math.max(selection[1], selection[3]) }; for(var row = selStart.row; row <= selEnd.row; row++ ){ for(var col = selEnd.col; col <= selEnd.col; col++){ cell = instance.getCell(row, col); cellProperties = instance.getCellMeta(row, col); checkbox = cell.querySelectorAll('input[type=checkbox]'); if(checkbox.length > 0 && !cellProperties.readOnly){ if(!event.isImmediatePropagationStopped()){ event.stopImmediatePropagation(); event.preventDefault(); } for(var i = 0, len = checkbox.length; i < len; i++){ checkbox[i].checked = !checkbox[i].checked; $(checkbox[i]).trigger('change'); } } } } } }); } }; Handsontable.CheckboxRenderer = CheckboxRenderer; Handsontable.renderers.CheckboxRenderer = CheckboxRenderer; Handsontable.renderers.registerRenderer('checkbox', CheckboxRenderer); })(Handsontable); /** * Numeric cell renderer * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row * @param {Number} col * @param {String|Number} prop Row object property name * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!) * @param {Object} cellProperties Cell properites (shared by cell renderer and editor) */ (function (Handsontable) { 'use strict'; var NumericRenderer = function (instance, TD, row, col, prop, value, cellProperties) { if (Handsontable.helper.isNumeric(value)) { if (typeof cellProperties.language !== 'undefined') { numeral.language(cellProperties.language) } value = numeral(value).format(cellProperties.format || '0'); //docs: http://numeraljs.com/ instance.view.wt.wtDom.addClass(TD, 'htNumeric'); } Handsontable.renderers.TextRenderer(instance, TD, row, col, prop, value, cellProperties); }; Handsontable.NumericRenderer = NumericRenderer; //Left for backward compatibility with versions prior 0.10.0 Handsontable.renderers.NumericRenderer = NumericRenderer; Handsontable.renderers.registerRenderer('numeric', NumericRenderer); })(Handsontable); (function(Handosntable){ 'use strict'; var PasswordRenderer = function (instance, TD, row, col, prop, value, cellProperties) { Handsontable.renderers.TextRenderer.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); instance.view.wt.wtDom.fastInnerHTML(TD, hash); }; Handosntable.PasswordRenderer = PasswordRenderer; Handosntable.renderers.PasswordRenderer = PasswordRenderer; Handosntable.renderers.registerRenderer('password', PasswordRenderer); })(Handsontable); (function (Handsontable) { function HtmlRenderer(instance, TD, row, col, prop, value, cellProperties){ Handsontable.renderers.cellDecorator.apply(this, arguments); Handsontable.Dom.fastInnerHTML(TD, value); } Handsontable.renderers.registerRenderer('html', HtmlRenderer); Handsontable.renderers.HtmlRenderer = HtmlRenderer; })(Handsontable); (function (Handsontable) { 'use strict'; Handsontable.EditorState = { VIRGIN: 'STATE_VIRGIN', //before editing EDITING: 'STATE_EDITING', WAITING: 'STATE_WAITING', //waiting for async validation FINISHED: 'STATE_FINISHED' }; function BaseEditor(instance) { this.instance = instance; this.state = Handsontable.EditorState.VIRGIN; this._opened = 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; 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) { if (ctrlDown) { //if ctrl+enter and multiple cells selected, behave like Excel (finish editing and apply to all cells) var sel = this.instance.getSelected(); 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){ if (this.state != Handsontable.EditorState.VIRGIN) { return; } this.instance.view.scrollViewport({row: this.row, col: this.col}); this.instance.view.render(); this.state = Handsontable.EditorState.EDITING; initialValue = typeof initialValue == 'string' ? initialValue : this.originalValue; this.setValue(Handsontable.helper.stringify(initialValue)); this.open(); this._opened = true; this.focus(); this.instance.view.render(); //only rerender the selections (FillHandle should disappear when beginediting is triggered) }; BaseEditor.prototype.finishEditing = function (restoreOriginalValue, ctrlDown, callback) { 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) { var that = this; setTimeout(function () { that._fireCallbacks(true); }); return; } if (this.state == Handsontable.EditorState.EDITING) { if (restoreOriginalValue) { this.cancelChanges(); return; } var val = [ [String.prototype.trim.call(this.getValue())] //String.prototype.trim is defined in Walkontable polyfill.js ]; this.state = Handsontable.EditorState.WAITING; this.saveValue(val, ctrlDown); if(this.instance.getCellValidator(this.cellProperties)){ var that = this; this.instance.addHookOnce('afterValidate', function (result) { that.state = Handsontable.EditorState.FINISHED; that.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) { //validator was defined and failed this.instance.selectCell(this.row, this.col); this.focus(); this.state = Handsontable.EditorState.EDITING; this._fireCallbacks(false); } else { this.close(); this._opened = false; this.state = Handsontable.EditorState.VIRGIN; this._fireCallbacks(true); } }; BaseEditor.prototype.isOpened = function(){ return this._opened; }; BaseEditor.prototype.isWaiting = function () { return this.state === Handsontable.EditorState.WAITING; }; Handsontable.editors.BaseEditor = BaseEditor; })(Handsontable); (function(Handsontable){ var TextEditor = Handsontable.editors.BaseEditor.prototype.extend(); TextEditor.prototype.init = function(){ this.createElements(); this.bindEvents(); }; 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; var that = instance.getActiveEditor(); var keyCodes = Handsontable.helper.keyCode; var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; //catch CTRL but not right ALT (which in some systems triggers ALT+CTRL) //Process only events that have been fired in the editor if (event.target !== that.TEXTAREA || event.isImmediatePropagationStopped()){ return; } if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) { //when CTRL or its equivalent is pressed and cell is edited, don't prepare selectable text in textarea event.stopImmediatePropagation(); return; } switch (event.keyCode) { case keyCodes.ARROW_RIGHT: if (that.wtDom.getCaretPosition(that.TEXTAREA) !== that.TEXTAREA.value.length) { event.stopImmediatePropagation(); } break; case keyCodes.ARROW_LEFT: /* arrow left */ if (that.wtDom.getCaretPosition(that.TEXTAREA) !== 0) { event.stopImmediatePropagation(); } break; case keyCodes.ENTER: var selected = that.instance.getSelected(); var isMultipleSelection = !(selected[0] === selected[2] && selected[1] === selected[3]); if ((ctrlDown && !isMultipleSelection) || event.altKey) { //if ctrl+enter or alt+enter, add new line if(that.isOpened()){ that.setValue(that.getValue() + '\n'); that.focus(); } else { that.beginEditing(that.originalValue + '\n') } event.stopImmediatePropagation(); } event.preventDefault(); //don't add newline to field break; case keyCodes.A: case keyCodes.X: case keyCodes.C: case keyCodes.V: if(ctrlDown){ event.stopImmediatePropagation(); //CTRL+A, CTRL+C, CTRL+V, CTRL+X should only work locally when cell is edited (not in table context) break; } case keyCodes.BACKSPACE: case keyCodes.DELETE: case keyCodes.HOME: case keyCodes.END: event.stopImmediatePropagation(); //backspace, delete, home, end should only work locally when cell is edited (not in table context) break; } }; TextEditor.prototype.open = function(){ this.refreshDimensions(); //need it instantly, to prevent https://github.com/warpech/jquery-handsontable/issues/348 this.instance.addHook('beforeKeyDown', onBeforeKeyDown); }; TextEditor.prototype.close = function(){ this.textareaParentStyle.display = 'none'; if (document.activeElement === this.TEXTAREA) { this.instance.listen(); //don't refocus the table if user focused some cell outside of HT on purpose } this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); }; TextEditor.prototype.focus = function(){ this.TEXTAREA.focus(); this.wtDom.setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length); }; TextEditor.prototype.createElements = function () { this.$body = $(document.body); this.wtDom = new WalkontableDom(); this.TEXTAREA = document.createElement('TEXTAREA'); this.$textarea = $(this.TEXTAREA); this.wtDom.addClass(this.TEXTAREA, 'handsontableInput'); this.textareaStyle = this.TEXTAREA.style; this.textareaStyle.width = 0; this.textareaStyle.height = 0; this.TEXTAREA_PARENT = document.createElement('DIV'); this.wtDom.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[0].appendChild(this.TEXTAREA_PARENT); var that = this; Handsontable.PluginHooks.add('afterRender', function () { that.instance.registerTimeout('refresh_editor_dimensions', function () { that.refreshDimensions(); }, 0); }); }; TextEditor.prototype.refreshDimensions = function () { if (this.state !== Handsontable.EditorState.EDITING) { return; } ///start prepare textarea position this.TD = this.instance.getCell(this.row, this.col); if (!this.TD) { //TD is outside of the viewport. Otherwise throws exception when scrolling the table while a cell is edited return; } var $td = $(this.TD); //because old td may have been scrolled out with scrollViewport var currentOffset = this.wtDom.offset(this.TD); var containerOffset = this.wtDom.offset(this.instance.rootElement[0]); var scrollTop = this.instance.rootElement.scrollTop(); var scrollLeft = this.instance.rootElement.scrollLeft(); var editTop = currentOffset.top - containerOffset.top + scrollTop - 1; var editLeft = currentOffset.left - containerOffset.left + scrollLeft - 1; var settings = this.instance.getSettings(); var rowHeadersCount = settings.rowHeaders === false ? 0 : 1; var colHeadersCount = settings.colHeaders === false ? 0 : 1; if (editTop < 0) { editTop = 0; } if (editLeft < 0) { editLeft = 0; } if (rowHeadersCount > 0 && parseInt($td.css('border-top-width'), 10) > 0) { editTop += 1; } if (colHeadersCount > 0 && parseInt($td.css('border-left-width'), 10) > 0) { editLeft += 1; } this.textareaParentStyle.top = editTop + 'px'; this.textareaParentStyle.left = editLeft + 'px'; ///end prepare textarea position var width = $td.width() , maxWidth = this.instance.view.maximumVisibleElementWidth(editLeft) - 10 //10 is TEXTAREAs border and padding , height = $td.outerHeight() - 4 , maxHeight = this.instance.view.maximumVisibleElementHeight(editTop) - 5; //10 is TEXTAREAs border and padding if (parseInt($td.css('border-top-width'), 10) > 0) { height -= 1; } if (parseInt($td.css('border-left-width'), 10) > 0) { if (rowHeadersCount > 0) { width -= 1; } } //in future may change to pure JS http://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize this.$textarea.autoResize({ minHeight: Math.min(height, maxHeight), maxHeight: maxHeight, //TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar) minWidth: Math.min(width, maxWidth), maxWidth: maxWidth, //TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar) animate: false, extraSpace: 0 }); this.textareaParentStyle.display = 'block'; }; TextEditor.prototype.bindEvents = function () { this.$textarea.on('cut.editor', function (event) { event.stopPropagation(); }); this.$textarea.on('paste.editor', function (event) { event.stopPropagation(); }); }; Handsontable.editors.TextEditor = TextEditor; Handsontable.editors.registerEditor('text', Handsontable.editors.TextEditor); })(Handsontable); (function(Handsontable){ //Blank editor, because all the work is done by renderer var CheckboxEditor = Handsontable.editors.BaseEditor.prototype.extend(); CheckboxEditor.prototype.beginEditing = function () { var checkbox = this.TD.querySelector('input[type="checkbox"]'); if (checkbox) { $(checkbox).trigger('click'); } }; CheckboxEditor.prototype.finishEditing = function () {}; CheckboxEditor.prototype.init = function () {}; CheckboxEditor.prototype.open = function () {}; CheckboxEditor.prototype.close = function () {}; CheckboxEditor.prototype.getValue = function () {}; CheckboxEditor.prototype.setValue = function () {}; CheckboxEditor.prototype.focus = function () {}; Handsontable.editors.CheckboxEditor = CheckboxEditor; Handsontable.editors.registerEditor('checkbox', CheckboxEditor); })(Handsontable); (function (Handsontable) { var DateEditor = Handsontable.editors.TextEditor.prototype.extend(); DateEditor.prototype.init = function () { if (!$.datepicker) { throw new Error("jQuery UI Datepicker dependency not found. Did you forget to include jquery-ui.custom.js or its substitute?"); } Handsontable.editors.TextEditor.prototype.init.apply(this, arguments); this.isCellEdited = false; var that = this; this.instance.addHook('afterDestroy', function () { that.destroyElements(); }) }; DateEditor.prototype.createElements = function () { Handsontable.editors.TextEditor.prototype.createElements.apply(this, arguments); this.datePicker = document.createElement('DIV'); this.instance.view.wt.wtDom.addClass(this.datePicker, 'htDatepickerHolder'); this.datePickerStyle = this.datePicker.style; this.datePickerStyle.position = 'absolute'; this.datePickerStyle.top = 0; this.datePickerStyle.left = 0; this.datePickerStyle.zIndex = 99; document.body.appendChild(this.datePicker); this.$datePicker = $(this.datePicker); var that = this; var defaultOptions = { dateFormat: "yy-mm-dd", showButtonPanel: true, changeMonth: true, changeYear: true, onSelect: function (dateStr) { that.setValue(dateStr); that.finishEditing(false); } }; this.$datePicker.datepicker(defaultOptions); /** * Prevent recognizing clicking on jQuery Datepicker as clicking outside of table */ this.$datePicker.on('mousedown', function (event) { event.stopPropagation(); }); this.hideDatepicker(); }; DateEditor.prototype.destroyElements = function () { this.$datePicker.datepicker('destroy'); this.$datePicker.remove(); }; DateEditor.prototype.open = function () { Handsontable.editors.TextEditor.prototype.open.call(this); this.showDatepicker(); }; DateEditor.prototype.finishEditing = function (isCancelled, ctrlDown) { this.hideDatepicker(); Handsontable.editors.TextEditor.prototype.finishEditing.apply(this, arguments); }; DateEditor.prototype.showDatepicker = function () { var $td = $(this.TD); var offset = $td.offset(); this.datePickerStyle.top = (offset.top + $td.height()) + 'px'; this.datePickerStyle.left = offset.left + 'px'; var dateOptions = { defaultDate: this.originalValue || void 0 }; $.extend(dateOptions, this.cellProperties); this.$datePicker.datepicker("option", dateOptions); if (this.originalValue) { this.$datePicker.datepicker("setDate", this.originalValue); } this.datePickerStyle.display = 'block'; }; DateEditor.prototype.hideDatepicker = function () { this.datePickerStyle.display = 'none'; }; Handsontable.editors.DateEditor = DateEditor; Handsontable.editors.registerEditor('date', DateEditor); })(Handsontable); /** * This is inception. Using Handsontable as Handsontable editor */ (function (Handsontable) { "use strict"; var HandsontableEditor = Handsontable.editors.TextEditor.prototype.extend(); HandsontableEditor.prototype.createElements = function () { Handsontable.editors.TextEditor.prototype.createElements.apply(this, arguments); var DIV = document.createElement('DIV'); DIV.className = 'handsontableEditor'; this.TEXTAREA_PARENT.appendChild(DIV); this.$htContainer = $(DIV); this.$htContainer.handsontable(); }; HandsontableEditor.prototype.prepare = function (td, row, col, prop, value, cellProperties) { Handsontable.editors.TextEditor.prototype.prepare.apply(this, arguments); var parent = this; var options = { startRows: 0, startCols: 0, minRows: 0, minCols: 0, className: 'listbox', copyPaste: false, cells: function () { return { readOnly: true } }, fillHandle: false, afterOnCellMouseDown: function () { var value = this.getValue(); if (value !== void 0) { //if the value is undefined then it means we don't want to set the value parent.setValue(value); } parent.instance.destroyEditor(); }, beforeOnKeyDown: function (event) { var instance = this; switch (event.keyCode) { case Handsontable.helper.keyCode.ESCAPE: parent.instance.destroyEditor(true); event.stopImmediatePropagation(); event.preventDefault(); break; case Handsontable.helper.keyCode.ENTER: //enter var sel = instance.getSelected(); var value = this.getDataAtCell(sel[0], sel[1]); if (value !== void 0) { //if the value is undefined then it means we don't want to set the value parent.setValue(value); } parent.instance.destroyEditor(); break; case Handsontable.helper.keyCode.ARROW_UP: if (instance.getSelected() && instance.getSelected()[0] == 0 && !parent.cellProperties.strict){ instance.deselectCell(); parent.instance.listen(); parent.focus(); event.preventDefault(); event.stopImmediatePropagation(); } break; } } }; if (this.cellProperties.handsontable) { options = $.extend(options, cellProperties.handsontable); } this.$htContainer.handsontable('destroy'); this.$htContainer.handsontable(options); }; var onBeforeKeyDown = function (event) { if (event.isImmediatePropagationStopped()) { return; } var editor = this.getActiveEditor(); var innerHOT = editor.$htContainer.handsontable('getInstance'); if (event.keyCode == Handsontable.helper.keyCode.ARROW_DOWN) { if (!innerHOT.getSelected()){ innerHOT.selectCell(0, 0); } else { var selectedRow = innerHOT.getSelected()[0]; var rowToSelect = selectedRow < innerHOT.countRows() - 1 ? selectedRow + 1 : selectedRow; innerHOT.selectCell(rowToSelect, 0); } event.preventDefault(); event.stopImmediatePropagation(); } }; HandsontableEditor.prototype.open = function () { this.instance.addHook('beforeKeyDown', onBeforeKeyDown); Handsontable.editors.TextEditor.prototype.open.apply(this, arguments); this.$htContainer.handsontable('render'); if (this.cellProperties.strict) { this.$htContainer.handsontable('selectCell', 0, 0); this.$textarea[0].style.visibility = 'hidden'; } else { this.$htContainer.handsontable('deselectCell'); this.$textarea[0].style.visibility = 'visible'; } this.wtDom.setCaretPosition(this.$textarea[0], 0, this.$textarea[0].value.length); }; HandsontableEditor.prototype.close = function () { this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); this.instance.listen(); Handsontable.editors.TextEditor.prototype.close.apply(this, arguments); }; HandsontableEditor.prototype.focus = function () { this.instance.listen(); Handsontable.editors.TextEditor.prototype.focus.apply(this, arguments); }; HandsontableEditor.prototype.beginEditing = function (initialValue) { var onBeginEditing = this.instance.getSettings().onBeginEditing; if (onBeginEditing && onBeginEditing() === false) { return; } Handsontable.editors.TextEditor.prototype.beginEditing.apply(this, arguments); }; HandsontableEditor.prototype.finishEditing = function (isCancelled, ctrlDown) { if (this.$htContainer.handsontable('isListening')) { //if focus is still in the HOT editor this.instance.listen(); //return the focus to the parent HOT instance } if (this.$htContainer.handsontable('getSelected')) { var value = this.$htContainer.handsontable('getInstance').getValue(); if (value !== void 0) { //if the value is undefined then it means we don't want to set the value this.setValue(value); } } return Handsontable.editors.TextEditor.prototype.finishEditing.apply(this, arguments); }; Handsontable.editors.HandsontableEditor = HandsontableEditor; Handsontable.editors.registerEditor('handsontable', HandsontableEditor); })(Handsontable); (function (Handsontable) { var AutocompleteEditor = Handsontable.editors.HandsontableEditor.prototype.extend(); AutocompleteEditor.prototype.init = function () { Handsontable.editors.HandsontableEditor.prototype.init.apply(this, arguments); this.query = null; this.choices = []; }; AutocompleteEditor.prototype.createElements = function(){ Handsontable.editors.HandsontableEditor.prototype.createElements.apply(this, arguments); this.$htContainer.addClass('autocompleteEditor'); }; AutocompleteEditor.prototype.bindEvents = function(){ var that = this; this.$textarea.on('keydown.autocompleteEditor', function(event){ if(!Handsontable.helper.isMetaKey(event.keyCode) || [Handsontable.helper.keyCode.BACKSPACE, Handsontable.helper.keyCode.DELETE].indexOf(event.keyCode) != -1){ setTimeout(function () { that.queryChoices(that.$textarea.val()); }); } else if (event.keyCode == Handsontable.helper.keyCode.ENTER && that.cellProperties.strict !== true){ that.$htContainer.handsontable('deselectCell'); } }); this.$htContainer.on('mouseleave', function () { if(that.cellProperties.strict === true){ that.highlightBestMatchingChoice(); } }); this.$htContainer.on('mouseenter', function () { that.$htContainer.handsontable('deselectCell'); }); Handsontable.editors.HandsontableEditor.prototype.bindEvents.apply(this, arguments); }; var onBeforeKeyDownInner; AutocompleteEditor.prototype.open = function () { Handsontable.editors.HandsontableEditor.prototype.open.apply(this, arguments); this.$textarea[0].style.visibility = 'visible'; this.focus(); var choicesListHot = this.$htContainer.handsontable('getInstance'); var that = this; choicesListHot.updateSettings({ 'colWidths': [this.wtDom.outerWidth(this.TEXTAREA) - 2], afterRenderer: function (TD, row, col, prop, value) { var caseSensitive = this.getCellMeta(row, col).filteringCaseSensitive === true; var indexOfMatch = caseSensitive ? value.indexOf(this.query) : value.toLowerCase().indexOf(that.query.toLowerCase()); if(indexOfMatch != -1){ var match = value.substr(indexOfMatch, that.query.length); TD.innerHTML = value.replace(match, '<strong>' + match + '</strong>'); } } }); onBeforeKeyDownInner = function (event) { var instance = this; if (event.keyCode == Handsontable.helper.keyCode.ARROW_UP){ if (instance.getSelected() && instance.getSelected()[0] == 0){ if(!parent.cellProperties.strict){ instance.deselectCell(); } parent.instance.listen(); parent.focus(); event.preventDefault(); event.stopImmediatePropagation(); } } }; choicesListHot.addHook('beforeKeyDown', onBeforeKeyDownInner); this.queryChoices(this.TEXTAREA.value); }; AutocompleteEditor.prototype.close = function () { this.$htContainer.handsontable('getInstance').removeHook('beforeKeyDown', onBeforeKeyDownInner); Handsontable.editors.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 (Handsontable.helper.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) { this.choices = choices; this.$htContainer.handsontable('loadData', Handsontable.helper.pivot([choices])); if(this.cellProperties.strict === true){ this.highlightBestMatchingChoice(); } this.focus(); }; AutocompleteEditor.prototype.highlightBestMatchingChoice = function () { var bestMatchingChoice = this.findBestMatchingChoice(); if ( typeof bestMatchingChoice == 'undefined' && this.cellProperties.allowInvalid === false){ bestMatchingChoice = 0; } if(typeof bestMatchingChoice == 'undefined'){ this.$htContainer.handsontable('deselectCell'); } else { this.$htContainer.handsontable('selectCell', bestMatchingChoice, 0); } }; AutocompleteEditor.prototype.findBestMatchingChoice = function(){ var bestMatch = {}; var valueLength = this.getValue().length; var currentItem; var indexOfValue; var charsLeft; for(var i = 0, len = this.choices.length; i < len; i++){ currentItem = this.choices[i]; if(valueLength > 0){ indexOfValue = currentItem.indexOf(this.getValue()) } else { indexOfValue = currentItem === this.getValue() ? 0 : -1; } if(indexOfValue == -1) continue; charsLeft = currentItem.length - indexOfValue - valueLength; if( typeof bestMatch.indexOfValue == 'undefined' || bestMatch.indexOfValue > indexOfValue || ( bestMatch.indexOfValue == indexOfValue && bestMatch.charsLeft > charsLeft ) ){ bestMatch.indexOfValue = indexOfValue; bestMatch.charsLeft = charsLeft; bestMatch.index = i; } } return bestMatch.index; }; Handsontable.editors.AutocompleteEditor = AutocompleteEditor; Handsontable.editors.registerEditor('autocomplete', AutocompleteEditor); })(Handsontable); (function(Handsontable){ var PasswordEditor = Handsontable.editors.TextEditor.prototype.extend(); var wtDom = new WalkontableDom(); PasswordEditor.prototype.createElements = function () { Handsontable.editors.TextEditor.prototype.createElements.apply(this, arguments); 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; this.$textarea = $(this.TEXTAREA); wtDom.empty(this.TEXTAREA_PARENT); this.TEXTAREA_PARENT.appendChild(this.TEXTAREA); }; Handsontable.editors.PasswordEditor = PasswordEditor; Handsontable.editors.registerEditor('password', PasswordEditor); })(Handsontable); (function (Handsontable) { var SelectEditor = Handsontable.editors.BaseEditor.prototype.extend(); SelectEditor.prototype.init = function(){ this.select = document.createElement('SELECT'); Handsontable.Dom.addClass(this.select, 'htSelectEditor'); this.select.style.display = 'none'; this.instance.rootElement[0].appendChild(this.select); }; SelectEditor.prototype.prepare = function(){ Handsontable.editors.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); } Handsontable.Dom.empty(this.select); for (var option in options){ if (options.hasOwnProperty(option)){ var optionElement = document.createElement('OPTION'); optionElement.value = option; Handsontable.Dom.fastInnerHTML(optionElement, options[option]); this.select.appendChild(optionElement); } } }; SelectEditor.prototype.prepareOptions = function(optionsToPrepare){ var preparedOptions = {}; if (Handsontable.helper.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 Handsontable.helper.keyCode.ARROW_UP: var previousOption = editor.select.find('option:selected').prev(); if (previousOption.length == 1){ previousOption.prop('selected', true); } event.stopImmediatePropagation(); event.preventDefault(); break; case Handsontable.helper.keyCode.ARROW_DOWN: var nextOption = editor.select.find('option:selected').next(); if (nextOption.length == 1){ nextOption.prop('selected', true); } event.stopImmediatePropagation(); event.preventDefault(); break; } }; SelectEditor.prototype.open = function () { var width = Handsontable.Dom.outerWidth(this.TD); //important - group layout reads together for better performance var height = Handsontable.Dom.outerHeight(this.TD); var rootOffset = Handsontable.Dom.offset(this.instance.rootElement[0]); var tdOffset = Handsontable.Dom.offset(this.TD); this.select.style.height = height + 'px'; this.select.style.minWidth = width + 'px'; this.select.style.top = tdOffset.top - rootOffset.top + 'px'; this.select.style.left = tdOffset.left - rootOffset.left - 2 + 'px'; //2 is cell border this.select.style.display = ''; this.instance.addHook('beforeKeyDown', onBeforeKeyDown); }; SelectEditor.prototype.close = function () { this.select.style.display = 'none'; this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); }; SelectEditor.prototype.focus = function () { this.select.focus(); }; Handsontable.editors.SelectEditor = SelectEditor; Handsontable.editors.registerEditor('select', SelectEditor); })(Handsontable); (function (Handsontable) { var DropdownEditor = Handsontable.editors.AutocompleteEditor.prototype.extend(); DropdownEditor.prototype.prepare = function () { Handsontable.editors.AutocompleteEditor.prototype.prepare.apply(this, arguments); this.cellProperties.filter = false; this.cellProperties.strict = true; }; Handsontable.editors.DropdownEditor = DropdownEditor; Handsontable.editors.registerEditor('dropdown', DropdownEditor); })(Handsontable); /** * Numeric cell validator * @param {*} value - Value of edited cell * @param {*} callback - Callback called with validation result */ Handsontable.NumericValidator = function (value, callback) { if (value === null) { value = ''; } callback(/^-?\d*\.?\d*$/.test(value)); }; /** * Function responsible for validation of autocomplete value * @param {*} value - Value of edited cell * @param {*} calback - Callback called with validation result */ var process = function (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; //perfect match break; } else if (lowercaseVal === source[s].toLowerCase()) { // changes[i][3] = source[s]; //good match, fix the case << TODO? found = true; break; } } callback(found); } }; /** * Autocomplete cell validator * @param {*} value - Value of edited cell * @param {*} calback - Callback called with validation result */ Handsontable.AutocompleteValidator = function (value, callback) { if (this.strict && this.source) { typeof this.source === 'function' ? this.source(value, process(value, callback)) : process(value, callback)(this.source); } else { callback(true); } }; /** * Cell type is just a shortcut for setting bunch of cellProperties (used in getCellMeta) */ Handsontable.AutocompleteCell = { editor: Handsontable.editors.AutocompleteEditor, renderer: Handsontable.renderers.AutocompleteRenderer, validator: Handsontable.AutocompleteValidator }; Handsontable.CheckboxCell = { editor: Handsontable.editors.CheckboxEditor, renderer: Handsontable.renderers.CheckboxRenderer }; Handsontable.TextCell = { editor: Handsontable.editors.TextEditor, renderer: Handsontable.renderers.TextRenderer }; Handsontable.NumericCell = { editor: Handsontable.editors.TextEditor, renderer: Handsontable.renderers.NumericRenderer, validator: Handsontable.NumericValidator, dataType: 'number' }; Handsontable.DateCell = { editor: Handsontable.editors.DateEditor, renderer: Handsontable.renderers.AutocompleteRenderer //displays small gray arrow on right side of the cell }; Handsontable.HandsontableCell = { editor: Handsontable.editors.HandsontableEditor, renderer: Handsontable.renderers.AutocompleteRenderer //displays small gray arrow on right side of the cell }; Handsontable.PasswordCell = { editor: Handsontable.editors.PasswordEditor, renderer: Handsontable.renderers.PasswordRenderer, copyable: false }; Handsontable.DropdownCell = { editor: Handsontable.editors.DropdownEditor, renderer: Handsontable.renderers.AutocompleteRenderer, //displays small gray arrow on right side of the cell validator: Handsontable.AutocompleteValidator }; //here setup the friendly aliases that are used by cellProperties.type 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 }; //here setup the friendly aliases that are used by cellProperties.renderer and cellProperties.editor Handsontable.cellLookup = { validator: { numeric: Handsontable.NumericValidator, autocomplete: Handsontable.AutocompleteValidator } }; /* * jQuery.fn.autoResize 1.1+ * -- * https://github.com/warpech/jQuery.fn.autoResize * * This fork differs from others in a way that it autoresizes textarea in 2-dimensions (horizontally and vertically). * It was originally forked from alexbardas's repo but maybe should be merged with dpashkevich's repo in future. * * originally forked from: * https://github.com/jamespadolsey/jQuery.fn.autoResize * which is now located here: * https://github.com/alexbardas/jQuery.fn.autoResize * though the mostly maintained for is here: * https://github.com/dpashkevich/jQuery.fn.autoResize/network * * -- * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ (function($){ autoResize.defaults = { onResize: function(){}, animate: { duration: 200, complete: function(){} }, extraSpace: 50, minHeight: 'original', maxHeight: 500, minWidth: 'original', maxWidth: 500 }; autoResize.cloneCSSProperties = [ 'lineHeight', 'textDecoration', 'letterSpacing', 'fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'textTransform', 'textAlign', 'direction', 'wordSpacing', 'fontSizeAdjust', 'padding' ]; autoResize.cloneCSSValues = { position: 'absolute', top: -9999, left: -9999, opacity: 0, overflow: 'hidden', overflowX: 'hidden', overflowY: 'hidden', border: '1px solid black', padding: '0.49em' //this must be about the width of caps W character }; autoResize.resizableFilterSelector = 'textarea,input:not(input[type]),input[type=text],input[type=password]'; autoResize.AutoResizer = AutoResizer; $.fn.autoResize = autoResize; function autoResize(config) { this.filter(autoResize.resizableFilterSelector).each(function(){ new AutoResizer( $(this), config ); }); return this; } function AutoResizer(el, config) { if(this.clones) return; this.config = $.extend({}, autoResize.defaults, config); this.el = el; this.nodeName = el[0].nodeName.toLowerCase(); this.previousScrollTop = null; if (config.maxWidth === 'original') config.maxWidth = el.width(); if (config.minWidth === 'original') config.minWidth = el.width(); if (config.maxHeight === 'original') config.maxHeight = el.height(); if (config.minHeight === 'original') config.minHeight = el.height(); if (this.nodeName === 'textarea') { el.css({ resize: 'none', overflowY: 'none' }); } el.data('AutoResizer', this); this.createClone(); this.injectClone(); this.bind(); } AutoResizer.prototype = { bind: function() { var check = $.proxy(function(){ this.check(); return true; }, this); this.unbind(); this.el .bind('keyup.autoResize', check) //.bind('keydown.autoResize', check) .bind('change.autoResize', check); this.check(null, true); }, unbind: function() { this.el.unbind('.autoResize'); }, createClone: function() { var el = this.el, self = this, config = this.config; this.clones = $(); if (config.minHeight !== 'original' || config.maxHeight !== 'original') { this.hClone = el.clone().height('auto'); this.clones = this.clones.add(this.hClone); } if (config.minWidth !== 'original' || config.maxWidth !== 'original') { this.wClone = $('<div/>').width('auto').css({ whiteSpace: 'nowrap', 'float': 'left' }); this.clones = this.clones.add(this.wClone); } $.each(autoResize.cloneCSSProperties, function(i, p){ self.clones.css(p, el.css(p)); }); this.clones .removeAttr('name') .removeAttr('id') .attr('tabIndex', -1) .css(autoResize.cloneCSSValues) .css('overflowY', 'scroll'); }, check: function(e, immediate) { var config = this.config, wClone = this.wClone, hClone = this.hClone, el = this.el, value = el.val(); if (wClone) { wClone.text(value); // Calculate new width + whether to change var cloneWidth = wClone.outerWidth(), newWidth = (cloneWidth + config.extraSpace) >= config.minWidth ? cloneWidth + config.extraSpace : config.minWidth, currentWidth = el.width(); newWidth = Math.min(newWidth, config.maxWidth); if ( (newWidth < currentWidth && newWidth >= config.minWidth) || (newWidth >= config.minWidth && newWidth <= config.maxWidth) ) { config.onResize.call(el); el.scrollLeft(0); config.animate && !immediate ? el.stop(1,1).animate({ width: newWidth }, config.animate) : el.width(newWidth); } } if (hClone) { if (newWidth) { hClone.width(newWidth); } hClone.height(0).val(value).scrollTop(10000); var scrollTop = hClone[0].scrollTop + config.extraSpace; // Don't do anything if scrollTop hasen't changed: if (this.previousScrollTop === scrollTop) { return; } this.previousScrollTop = scrollTop; if (scrollTop >= config.maxHeight) { scrollTop = config.maxHeight; } if (scrollTop < config.minHeight) { scrollTop = config.minHeight; } if(scrollTop == config.maxHeight && newWidth == config.maxWidth) { el.css('overflowY', 'scroll'); } else { el.css('overflowY', 'hidden'); } config.onResize.call(el); // Either animate or directly apply height: config.animate && !immediate ? el.stop(1,1).animate({ height: scrollTop }, config.animate) : el.height(scrollTop); } }, destroy: function() { this.unbind(); this.el.removeData('AutoResizer'); this.clones.remove(); delete this.el; delete this.hClone; delete this.wClone; delete this.clones; }, injectClone: function() { ( autoResize.cloneContainer || (autoResize.cloneContainer = $('<arclones/>').appendTo('body')) ).empty().append(this.clones); //this should be refactored so that a node is never cloned more than once } }; })(jQuery); /** * SheetClip - Spreadsheet Clipboard Parser * version 0.2 * * This tiny library transforms JavaScript arrays to strings that are pasteable by LibreOffice, OpenOffice, * Google Docs and Microsoft Excel. * * Copyright 2012, Marcin Warpechowski * Licensed under the MIT license. * http://github.com/warpech/sheetclip/ */ /*jslint white: true*/ (function (global) { "use strict"; function countQuotes(str) { return str.split('"').length - 1; } global.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)) { //& 1 is a bitwise way of performing mod 2 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) { 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) { for (c = 0, clen = arr[r].length; 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) { //void 0 resolves to undefined str += ''; } else { str += val; } } str += '\n'; } return str; } }; }(window)); /** * CopyPaste.js * Creates a textarea that stays hidden on the page and gets focused when user presses CTRL while not having a form input focused * In future we may implement a better driver when better APIs are available * @constructor */ var CopyPaste = (function () { var instance; return { getInstance: function () { if (!instance) { instance = new CopyPasteClass(); } else if (instance.hasBeenDestroyed()){ instance.init(); } instance.refCounter++; return instance; } }; })(); function CopyPasteClass() { this.refCounter = 0; this.init(); } CopyPasteClass.prototype.init = function () { var that = this , style , parent; this.copyCallbacks = []; this.cutCallbacks = []; this.pasteCallbacks = []; this.listenerElement = document.documentElement; 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'; 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; } else { /*@cc_on @if (@_jscript) if(typeof style.filter === 'string') { style.filter = 'alpha(opacity=0)'; } @end @*/ } } this.keydownListener = function (event) { var isCtrlDown = false; if (event.metaKey) { //mac isCtrlDown = true; } else if (event.ctrlKey && navigator.userAgent.indexOf('Mac') === -1) { //pc isCtrlDown = true; } if (isCtrlDown) { if (document.activeElement !== that.elTextarea && (that.getSelectionText() != '' || ['INPUT', 'SELECT', 'TEXTAREA'].indexOf(document.activeElement.nodeName) != -1)) { return; //this is needed by fragmentSelection in Handsontable. Ignore copypaste.js behavior if fragment of cell text is selected } that.selectNodeText(that.elTextarea); setTimeout(function () { that.selectNodeText(that.elTextarea); }, 0); } /* 67 = c * 86 = v * 88 = x */ if (isCtrlDown && (event.keyCode === 67 || event.keyCode === 86 || event.keyCode === 88)) { // that.selectNodeText(that.elTextarea); if (event.keyCode === 88) { //works in all browsers, incl. Opera < 12.12 setTimeout(function () { that.triggerCut(event); }, 0); } else if (event.keyCode === 86) { setTimeout(function () { that.triggerPaste(event); }, 0); } } } this._bindEvent(this.listenerElement, 'keydown', this.keydownListener); }; //http://jsperf.com/textara-selection //http://stackoverflow.com/questions/1502385/how-can-i-make-this-code-work-in-ie CopyPasteClass.prototype.selectNodeText = function (el) { el.select(); }; //http://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text 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 (str) { if (typeof str !== 'string' && str.toString === void 0) { throw new Error('copyable requires string parameter'); } this.elTextarea.value = str; }; /*CopyPasteClass.prototype.onCopy = function (fn) { this.copyCallbacks.push(fn); };*/ CopyPasteClass.prototype.onCut = function (fn) { this.cutCallbacks.push(fn); }; CopyPasteClass.prototype.onPaste = function (fn) { this.pasteCallbacks.push(fn); }; CopyPasteClass.prototype.removeCallback = function (fn) { var i, ilen; for (i = 0, ilen = this.copyCallbacks.length; i < ilen; i++) { if (this.copyCallbacks[i] === fn) { this.copyCallbacks.splice(i, 1); return true; } } for (i = 0, ilen = this.cutCallbacks.length; i < ilen; i++) { if (this.cutCallbacks[i] === fn) { this.cutCallbacks.splice(i, 1); return true; } } for (i = 0, ilen = this.pasteCallbacks.length; i < ilen; i++) { if (this.pasteCallbacks[i] === fn) { this.pasteCallbacks.splice(i, 1); return true; } } return false; }; CopyPasteClass.prototype.triggerCut = function (event) { var that = this; if (that.cutCallbacks) { setTimeout(function () { for (var i = 0, ilen = that.cutCallbacks.length; i < ilen; i++) { that.cutCallbacks[i](event); } }, 50); } }; CopyPasteClass.prototype.triggerPaste = function (event, str) { var that = this; if (that.pasteCallbacks) { setTimeout(function () { var val = (str || that.elTextarea.value).replace(/\n$/, ''); //remove trailing newline for (var i = 0, ilen = that.pasteCallbacks.length; i < ilen; i++) { that.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._unbindEvent(this.listenerElement, 'keydown', this.keydownListener); } }; CopyPasteClass.prototype.hasBeenDestroyed = function () { return !this.refCounter; }; //old version used this: // - http://net.tutsplus.com/tutorials/javascript-ajax/javascript-from-null-cross-browser-event-binding/ // - http://stackoverflow.com/questions/4643249/cross-browser-event-object-normalization //but that cannot work with jQuery.trigger CopyPasteClass.prototype._bindEvent = (function () { if (window.jQuery) { //if jQuery exists, use jQuery event (for compatibility with $.trigger and $.triggerHandler, which can only trigger jQuery events - and we use that in tests) return function (elem, type, cb) { $(elem).on(type + '.copypaste', cb); }; } else { return function (elem, type, cb) { elem.addEventListener(type, cb, false); //sorry, IE8 will only work with jQuery }; } })(); CopyPasteClass.prototype._unbindEvent = (function () { if (window.jQuery) { //if jQuery exists, use jQuery event (for compatibility with $.trigger and $.triggerHandler, which can only trigger jQuery events - and we use that in tests) return function (elem, type, cb) { $(elem).off(type + '.copypaste', cb); }; } else { return function (elem, type, cb) { elem.removeEventListener(type, cb, false); //sorry, IE8 will only work with jQuery }; } })(); // json-patch-duplex.js 0.3.6 // (c) 2013 Joachim Wester // MIT license 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 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); 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) { //This "refresh" is needed to begin observing new object properties _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) { //callbacks.push(callback); this has no purpose 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; /// Listen to changes on an object tree, accumulate patches 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; } } _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; }; } // Dirty check if obj is different from mirror, generate patches and update mirror 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'; }; } /// Apply a json-patch operation on an object tree function apply(tree, patches) { var result = false, p = 0, plen = patches.length, patch; while (p < plen) { patch = patches[p]; // Find the object 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; } Handsontable.PluginHookClass = (function () { var Hooks = function () { return { // Hooks beforeInitWalkontable: [], beforeInit: [], beforeRender: [], beforeChange: [], beforeRemoveCol: [], beforeRemoveRow: [], beforeValidate: [], beforeGet: [], beforeSet: [], beforeGetCellMeta: [], beforeAutofill: [], beforeKeyDown: [], beforeColumnSort: [], afterInit : [], afterLoadData : [], afterUpdateSettings: [], afterRender : [], afterRenderer : [], afterChange : [], afterValidate: [], afterGetCellMeta: [], afterGetColHeader: [], afterGetColWidth: [], afterDestroy: [], afterRemoveRow: [], afterCreateRow: [], afterRemoveCol: [], afterCreateCol: [], afterColumnResize: [], afterColumnMove: [], afterColumnSort: [], afterDeselect: [], afterSelection: [], afterSelectionByProp: [], afterSelectionEnd: [], afterSelectionEndByProp: [], afterCopyLimit: [], afterOnCellMouseDown: [], afterOnCellMouseOver: [], afterOnCellCornerMouseDown: [], afterScrollVertically: [], afterScrollHorizontally: [], // Modifiers modifyCol: [] } }; var legacy = { onBeforeChange: "beforeChange", onChange: "afterChange", onCreateRow: "afterCreateRow", onCreateCol: "afterCreateCol", onSelection: "afterSelection", onCopyLimit: "afterCopyLimit", onSelectionEnd: "afterSelectionEnd", onSelectionByProp: "afterSelectionByProp", onSelectionEndByProp: "afterSelectionEndByProp" }; function PluginHookClass() { this.hooks = Hooks(); this.legacy = legacy; } PluginHookClass.prototype.add = function (key, fn) { //if fn is array, run this for all the array items if (Handsontable.helper.isArray(fn)) { for (var i = 0, len = fn.length; i < len; i++) { this.add(key, fn[i]); } } else { // provide support for old versions of HOT if (key in legacy) { key = legacy[key]; } if (typeof this.hooks[key] === "undefined") { this.hooks[key] = []; } if (this.hooks[key].indexOf(fn) == -1) { this.hooks[key].push(fn); //only add a hook if it has not already be added (adding the same hook twice is now silently ignored) } } return this; }; PluginHookClass.prototype.once = function(key, fn){ if(Handsontable.helper.isArray(fn)){ for(var i = 0, len = fn.length; i < len; i++){ fn[i].runOnce = true; this.add(key, fn[i]); } } else { fn.runOnce = true; this.add(key, fn); } }; PluginHookClass.prototype.remove = function (key, fn) { var status = false; // provide support for old versions of HOT if (key in legacy) { key = legacy[key]; } if (typeof this.hooks[key] !== 'undefined') { for (var i = 0, leni = this.hooks[key].length; i < leni; i++) { if (this.hooks[key][i] == fn) { delete this.hooks[key][i].runOnce; this.hooks[key].splice(i, 1); status = true; break; } } } return status; }; PluginHookClass.prototype.run = function (instance, key, p1, p2, p3, p4, p5) { // provide support for old versions of HOT if (key in legacy) { key = legacy[key]; } //performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture if (typeof this.hooks[key] !== 'undefined') { //Make a copy of handler array var handlers = Array.prototype.slice.call(this.hooks[key]); for (var i = 0, leni = handlers.length; i < leni; i++) { handlers[i].call(instance, p1, p2, p3, p4, p5); if(handlers[i].runOnce){ this.remove(key, handlers[i]); } } } }; PluginHookClass.prototype.execute = function (instance, key, p1, p2, p3, p4, p5) { var res, handlers; // provide support for old versions of HOT if (key in legacy) { key = legacy[key]; } //performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture if (typeof this.hooks[key] !== 'undefined') { handlers = Array.prototype.slice.call(this.hooks[key]); for (var i = 0, leni = handlers.length; i < leni; i++) { res = handlers[i].call(instance, p1, p2, p3, p4, p5); if (res !== void 0) { p1 = res; } if(handlers[i].runOnce){ this.remove(key, handlers[i]); } if(res === false){ //if any handler returned false return false; //event has been cancelled and further execution of handler queue is being aborted } } } return p1; }; return PluginHookClass; })(); Handsontable.PluginHooks = new Handsontable.PluginHookClass(); (function (Handsontable) { function HandsontableAutoColumnSize() { var plugin = this , sampleCount = 5; //number of samples to take of each value length this.beforeInit = function () { var instance = this; instance.autoColumnWidths = []; if (instance.getSettings().autoColumnSize !== false) { if (!instance.autoColumnSizeTmp) { instance.autoColumnSizeTmp = { table: null, tableStyle: null, theadTh: null, tbody: null, container: null, containerStyle: null, determineBeforeNextRender: true }; instance.addHook('beforeRender', htAutoColumnSize.determineIfChanged); instance.addHook('afterGetColWidth', htAutoColumnSize.getColWidth); instance.addHook('afterDestroy', htAutoColumnSize.afterDestroy); instance.determineColumnWidth = plugin.determineColumnWidth; } } else { if (instance.autoColumnSizeTmp) { instance.removeHook('beforeRender', htAutoColumnSize.determineIfChanged); instance.removeHook('afterGetColWidth', htAutoColumnSize.getColWidth); instance.removeHook('afterDestroy', htAutoColumnSize.afterDestroy); delete instance.determineColumnWidth; plugin.afterDestroy.call(instance); } } }; this.determineIfChanged = function (force) { if (force) { htAutoColumnSize.determineColumnsWidth.apply(this, arguments); } }; this.determineColumnWidth = function (col) { var instance = this , tmp = instance.autoColumnSizeTmp; if (!tmp.container) { createTmpContainer.call(tmp, instance); } tmp.container.className = instance.rootElement[0].className + ' htAutoColumnSize'; tmp.table.className = instance.$table[0].className; var rows = instance.countRows(); var samples = {}; var maxLen = 0; for (var r = 0; r < rows; r++) { var value = Handsontable.helper.stringify(instance.getDataAtCell(r, col)); var len = value.length; if (len > maxLen) { maxLen = len; } if (!samples[len]) { samples[len] = { needed: sampleCount, strings: [] }; } if (samples[len].needed) { samples[len].strings.push({value: value, row: r}); samples[len].needed--; } } var settings = instance.getSettings(); if (settings.colHeaders) { instance.view.appendColHeader(col, tmp.theadTh); //TH innerHTML } instance.view.wt.wtDom.empty(tmp.tbody); for (var i in samples) { if (samples.hasOwnProperty(i)) { for (var j = 0, jlen = samples[i].strings.length; j < jlen; j++) { var row = samples[i].strings[j].row; var cellProperties = instance.getCellMeta(row, col); cellProperties.col = col; cellProperties.row = row; var renderer = instance.getCellRenderer(cellProperties); var tr = document.createElement('tr'); var td = document.createElement('td'); renderer(instance, td, row, col, instance.colToProp(col), samples[i].strings[j].value, cellProperties); r++; tr.appendChild(td); tmp.tbody.appendChild(tr); } } } var parent = instance.rootElement[0].parentNode; parent.appendChild(tmp.container); var width = instance.view.wt.wtDom.outerWidth(tmp.table); parent.removeChild(tmp.container); if (!settings.nativeScrollbars) { //with native scrollbars a cell size can safely exceed the width of the viewport var maxWidth = instance.view.wt.wtViewport.getViewportWidth() - 2; //2 is some overhead for cell border if (width > maxWidth) { width = maxWidth; } } return width; }; this.determineColumnsWidth = function () { var instance = this; var settings = this.getSettings(); if (settings.autoColumnSize || !settings.colWidths) { var cols = this.countCols(); for (var c = 0; c < cols; c++) { if (!instance._getColWidthFromSettings(c)) { this.autoColumnWidths[c] = plugin.determineColumnWidth.call(instance, c); } } } }; this.getColWidth = function (col, response) { if (this.autoColumnWidths[col] && this.autoColumnWidths[col] > response.width) { response.width = this.autoColumnWidths[col]; } }; this.afterDestroy = function () { var instance = this; if (instance.autoColumnSizeTmp && instance.autoColumnSizeTmp.container && instance.autoColumnSizeTmp.container.parentNode) { instance.autoColumnSizeTmp.container.parentNode.removeChild(instance.autoColumnSizeTmp.container); } instance.autoColumnSizeTmp = null; }; function createTmpContainer(instance) { var d = document , tmp = this; tmp.table = d.createElement('table'); tmp.theadTh = d.createElement('th'); tmp.table.appendChild(d.createElement('thead')).appendChild(d.createElement('tr')).appendChild(tmp.theadTh); tmp.tableStyle = tmp.table.style; tmp.tableStyle.tableLayout = 'auto'; tmp.tableStyle.width = 'auto'; tmp.tbody = d.createElement('tbody'); tmp.table.appendChild(tmp.tbody); tmp.container = d.createElement('div'); tmp.container.className = instance.rootElement[0].className + ' hidden'; tmp.containerStyle = tmp.container.style; tmp.container.appendChild(tmp.table); } } var htAutoColumnSize = new HandsontableAutoColumnSize(); Handsontable.PluginHooks.add('beforeInit', htAutoColumnSize.beforeInit); Handsontable.PluginHooks.add('afterUpdateSettings', htAutoColumnSize.beforeInit); })(Handsontable); /** * This plugin sorts the view by a column (but does not sort the data source!) * @constructor */ function HandsontableColumnSorting() { var plugin = this; this.init = function (source) { var instance = this; var sortingSettings = instance.getSettings().columnSorting; var sortingColumn, sortingOrder; instance.sortingEnabled = !!(sortingSettings); if (instance.sortingEnabled) { instance.sortIndex = []; var loadedSortingState = loadSortingState.call(instance); if (typeof loadedSortingState != 'undefined') { sortingColumn = loadedSortingState.sortColumn; sortingOrder = loadedSortingState.sortOrder; } else { sortingColumn = sortingSettings.column; sortingOrder = sortingSettings.sortOrder; } plugin.sortByColumn.call(instance, sortingColumn, sortingOrder); instance.sort = function(){ var args = Array.prototype.slice.call(arguments); return plugin.sortByColumn.apply(instance, args) }; if (typeof instance.getSettings().observeChanges == 'undefined'){ enableObserveChangesPlugin.call(instance); } if (source == 'afterInit') { bindColumnSortingAfterClick.call(instance); instance.addHook('afterCreateRow', plugin.afterCreateRow); instance.addHook('afterRemoveRow', plugin.afterRemoveRow); instance.addHook('afterLoadData', plugin.init); } } else { delete instance.sort; instance.removeHook('afterCreateRow', plugin.afterCreateRow); instance.removeHook('afterRemoveRow', plugin.afterRemoveRow); instance.removeHook('afterLoadData', plugin.init); } }; this.setSortingColumn = function (col, order) { var instance = this; if (typeof col == 'undefined') { delete instance.sortColumn; delete instance.sortOrder; return; } else if (instance.sortColumn === col && typeof order == 'undefined') { instance.sortOrder = !instance.sortOrder; } else { instance.sortOrder = typeof order != 'undefined' ? order : true; } instance.sortColumn = col; }; this.sortByColumn = function (col, order) { var instance = this; plugin.setSortingColumn.call(instance, col, order); if(typeof instance.sortColumn == 'undefined'){ return; } instance.PluginHooks.run('beforeColumnSort', instance.sortColumn, instance.sortOrder); plugin.sort.call(instance); instance.render(); saveSortingState.call(instance); instance.PluginHooks.run('afterColumnSort', instance.sortColumn, instance.sortOrder); }; var saveSortingState = function () { var instance = this; var sortingState = {}; if (typeof instance.sortColumn != 'undefined') { sortingState.sortColumn = instance.sortColumn; } if (typeof instance.sortOrder != 'undefined') { sortingState.sortOrder = instance.sortOrder; } if (sortingState.hasOwnProperty('sortColumn') || sortingState.hasOwnProperty('sortOrder')) { instance.PluginHooks.run('persistentStateSave', 'columnSorting', sortingState); } }; var loadSortingState = function () { var instance = this; var storedState = {}; instance.PluginHooks.run('persistentStateLoad', 'columnSorting', storedState); return storedState.value; }; var bindColumnSortingAfterClick = function () { var instance = this; instance.rootElement.on('click.handsontable', '.columnSorting', function (e) { if (instance.view.wt.wtDom.hasClass(e.target, 'columnSorting')) { var col = getColumn(e.target); plugin.sortByColumn.call(instance, col); } }); function countRowHeaders() { var THs = instance.view.TBODY.querySelector('tr').querySelectorAll('th'); return THs.length; } function getColumn(target) { var TH = instance.view.wt.wtDom.closest(target, 'TH'); return instance.view.wt.wtDom.index(TH) - countRowHeaders(); } }; function enableObserveChangesPlugin () { var instance = this; instance.registerTimeout('enableObserveChanges', function(){ instance.updateSettings({ observeChanges: true }); }, 0); } function defaultSort(sortOrder) { return function (a, b) { if (a[1] === b[1]) { return 0; } if (a[1] === null) { return 1; } if (b[1] === null) { return -1; } if (a[1] < b[1]) return sortOrder ? -1 : 1; if (a[1] > b[1]) return sortOrder ? 1 : -1; return 0; } } function dateSort(sortOrder) { return function (a, b) { if (a[1] === b[1]) { return 0; } if (a[1] === null) { return 1; } if (b[1] === null) { 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; } } this.sort = function () { var instance = this; if (typeof instance.sortOrder == 'undefined') { return; } instance.sortingEnabled = false; //this is required by translateRow plugin hook instance.sortIndex.length = 0; var colOffset = this.colOffset(); for (var i = 0, ilen = this.countRows() - instance.getSettings()['minSpareRows']; i < ilen; i++) { this.sortIndex.push([i, instance.getDataAtCell(i, this.sortColumn + colOffset)]); } var colMeta = instance.getCellMeta(0, instance.sortColumn); var sortFunction; switch (colMeta.type) { case 'date': sortFunction = dateSort; break; default: sortFunction = defaultSort; } this.sortIndex.sort(sortFunction(instance.sortOrder)); //Append spareRows for(var i = this.sortIndex.length; i < instance.countRows(); i++){ this.sortIndex.push([i, instance.getDataAtCell(i, this.sortColumn + colOffset)]); } instance.sortingEnabled = true; //this is required by translateRow plugin hook }; this.translateRow = function (row) { var instance = this; if (instance.sortingEnabled && instance.sortIndex && instance.sortIndex.length && instance.sortIndex[row]) { return instance.sortIndex[row][0]; } return row; }; this.onBeforeGetSet = function (getVars) { var instance = this; getVars.row = plugin.translateRow.call(instance, getVars.row); }; this.untranslateRow = function (row) { var instance = this; if (instance.sortingEnabled && instance.sortIndex && instance.sortIndex.length) { for (var i = 0; i < instance.sortIndex.length; i++) { if (instance.sortIndex[i][0] == row) { return i; } } } }; this.getColHeader = function (col, TH) { if (this.getSettings().columnSorting) { this.view.wt.wtDom.addClass(TH.querySelector('.colHeader'), 'columnSorting'); } }; function isSorted(instance){ return typeof instance.sortColumn != 'undefined'; } this.afterCreateRow = function(index, amount){ var instance = this; if(!isSorted(instance)){ return; } for(var i = 0; i < instance.sortIndex.length; i++){ if (instance.sortIndex[i][0] >= index){ instance.sortIndex[i][0] += amount; } } for(var i=0; i < amount; i++){ instance.sortIndex.splice(index+i, 0, [index+i, instance.getData()[index+i][instance.sortColumn + instance.colOffset()]]); } saveSortingState.call(instance); }; this.afterRemoveRow = function(index, amount){ var instance = this; if(!isSorted(instance)){ return; } var physicalRemovedIndex = plugin.translateRow.call(instance, index); instance.sortIndex.splice(index, amount); for(var i = 0; i < instance.sortIndex.length; i++){ if (instance.sortIndex[i][0] > physicalRemovedIndex){ instance.sortIndex[i][0] -= amount; } } saveSortingState.call(instance); }; this.afterChangeSort = function (changes/*, source*/) { var instance = this; var sortColumnChanged = false; var selection = {}; if (!changes) { return; } for (var i = 0; i < changes.length; i++) { if (changes[i][1] == instance.sortColumn) { sortColumnChanged = true; selection.row = plugin.translateRow.call(instance, changes[i][0]); selection.col = changes[i][1]; break; } } if (sortColumnChanged) { setTimeout(function () { plugin.sort.call(instance); instance.render(); instance.selectCell(plugin.untranslateRow.call(instance, selection.row), selection.col); }, 0); } }; } var htSortColumn = new HandsontableColumnSorting(); Handsontable.PluginHooks.add('afterInit', function () { htSortColumn.init.call(this, 'afterInit') }); Handsontable.PluginHooks.add('afterUpdateSettings', function () { htSortColumn.init.call(this, 'afterUpdateSettings') }); Handsontable.PluginHooks.add('beforeGet', htSortColumn.onBeforeGetSet); Handsontable.PluginHooks.add('beforeSet', htSortColumn.onBeforeGetSet); Handsontable.PluginHooks.add('afterGetColHeader', htSortColumn.getColHeader); (function (Handsontable) { 'use strict'; function ContextMenu(instance, customOptions){ this.instance = instance; var contextMenu = this; this.menu = createMenu(); this.enabled = true; this.bindMouseEvents(); this.bindTableEvents(); this.instance.addHook('afterDestroy', function () { contextMenu.destroy(); }); this.defaultOptions = { items: { 'row_above': { name: 'Insert row above', callback: function(key, selection){ this.alter("insert_row", selection.start.row()); }, disabled: function () { return this.countRows() >= this.getSettings().maxRows; } }, 'row_below': { name: 'Insert row below', callback: function(key, selection){ this.alter("insert_row", selection.end.row() + 1); }, disabled: function () { return this.countRows() >= this.getSettings().maxRows; } }, "hsep1": ContextMenu.SEPARATOR, 'col_left': { name: 'Insert column on the left', callback: function(key, selection){ this.alter("insert_col", selection.start.col()); }, disabled: function () { return this.countCols() >= this.getSettings().maxCols; } }, 'col_right': { name: 'Insert column on the right', callback: function(key, selection){ this.alter("insert_col", selection.end.col() + 1); }, disabled: function () { return this.countCols() >= this.getSettings().maxCols; } }, "hsep2": ContextMenu.SEPARATOR, '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); } }, 'remove_col': { name: 'Remove column', callback: function(key, selection){ var amount = selection.end.col() - selection.start.col() + 1; this.alter("remove_col", selection.start.col(), amount); } }, "hsep3": ContextMenu.SEPARATOR, 'undo': { name: 'Undo', callback: function(){ this.undo(); }, disabled: function () { return this.undoRedo && !this.undoRedo.isUndoAvailable(); } }, 'redo': { name: 'Redo', callback: function(){ this.redo(); }, disabled: function () { return this.undoRedo && !this.undoRedo.isRedoAvailable(); } } } }; this.options = {}; Handsontable.helper.extend(this.options, this.defaultOptions); this.updateOptions(customOptions); function createMenu(){ var menu = $('body > .htContextMenu')[0]; if(!menu){ menu = document.createElement('DIV'); Handsontable.Dom.addClass(menu, 'htContextMenu'); document.getElementsByTagName('body')[0].appendChild(menu); } return menu; } } ContextMenu.prototype.bindMouseEvents = function (){ function contextMenuOpenListener(event){ event.preventDefault(); if(event.target.nodeName != 'TD' && !(Handsontable.Dom.hasClass(event.target, 'current') && Handsontable.Dom.hasClass(event.target, 'wtBorder'))){ return; } this.show(event.pageY, event.pageX); $(document).on('mousedown.htContextMenu', Handsontable.helper.proxy(ContextMenu.prototype.close, this)); } this.instance.rootElement.on('contextmenu.htContextMenu', Handsontable.helper.proxy(contextMenuOpenListener, this)); }; ContextMenu.prototype.bindTableEvents = function () { var that = this; this._afterScrollCallback = function () { that.close(); }; this.instance.addHook('afterScrollVertically', this._afterScrollCallback); this.instance.addHook('afterScrollHorizontally', this._afterScrollCallback); }; ContextMenu.prototype.unbindTableEvents = function () { var that = this; if(this._afterScrollCallback){ this.instance.removeHook('afterScrollVertically', this._afterScrollCallback); this.instance.removeHook('afterScrollHorizontally', this._afterScrollCallback); this._afterScrollCallback = null; } }; ContextMenu.prototype.performAction = function (){ var hot = $(this.menu).handsontable('getInstance'); var selectedItemIndex = hot.getSelected()[0]; var selectedItem = hot.getData()[selectedItemIndex]; if (selectedItem.disabled === true || (typeof selectedItem.disabled == 'function' && selectedItem.disabled.call(this.instance) === true)){ return; } if(typeof selectedItem.callback != 'function'){ return; } var corners = this.instance.getSelected(); var normalizedSelection = ContextMenu.utils.normalizeSelection(corners); selectedItem.callback.call(this.instance, selectedItem.key, normalizedSelection); }; ContextMenu.prototype.unbindMouseEvents = function () { this.instance.rootElement.off('contextmenu.htContextMenu'); $(document).off('mousedown.htContextMenu'); }; ContextMenu.prototype.show = function(top, left){ this.menu.style.display = 'block'; $(this.menu) .off('mousedown.htContextMenu') .on('mousedown.htContextMenu', Handsontable.helper.proxy(this.performAction, this)); $(this.menu).handsontable({ data: ContextMenu.utils.convertItemsToArray(this.getItems()), colHeaders: false, colWidths: [160], readOnly: true, copyPaste: false, columns: [ { data: 'name', renderer: Handsontable.helper.proxy(this.renderer, this) } ], beforeKeyDown: Handsontable.helper.proxy(this.onBeforeKeyDown, this) }); this.bindTableEvents(); this.setMenuPosition(top, left); $(this.menu).handsontable('listen'); }; ContextMenu.prototype.close = function () { this.hide(); $(document).off('mousedown.htContextMenu'); this.unbindTableEvents(); this.instance.listen(); }; ContextMenu.prototype.hide = function(){ this.menu.style.display = 'none'; $(this.menu).handsontable('destroy'); }; ContextMenu.prototype.renderer = function(instance, TD, row, col, prop, value, cellProperties){ var contextMenu = this; var item = instance.getData()[row]; var wrapper = document.createElement('DIV'); Handsontable.Dom.empty(TD); TD.appendChild(wrapper); if(itemIsSeparator(item)){ Handsontable.Dom.addClass(TD, 'htSeparator'); } else { Handsontable.Dom.fastInnerText(wrapper, value); } if (itemIsDisabled(item, contextMenu.instance)){ Handsontable.Dom.addClass(TD, 'htDisabled'); $(wrapper).on('mouseenter', function () { instance.deselectCell(); }); } else { Handsontable.Dom.removeClass(TD, 'htDisabled'); $(wrapper).on('mouseenter', function () { instance.selectCell(row, col); }); } function itemIsSeparator(item){ return new RegExp(ContextMenu.SEPARATOR, 'i').test(item.name); } function itemIsDisabled(item, instance){ return item.disabled === true || (typeof item.disabled == 'function' && item.disabled.call(contextMenu.instance) === true); } }; ContextMenu.prototype.onBeforeKeyDown = function (event) { var contextMenu = this; var instance = $(contextMenu.menu).handsontable('getInstance'); var selection = instance.getSelected(); switch(event.keyCode){ case Handsontable.helper.keyCode.ESCAPE: contextMenu.close(); event.preventDefault(); event.stopImmediatePropagation(); break; case Handsontable.helper.keyCode.ENTER: if(instance.getSelected()){ contextMenu.performAction(); contextMenu.close(); } break; case Handsontable.helper.keyCode.ARROW_DOWN: if(!selection){ selectFirstCell(instance); } else { selectNextCell(selection[0], selection[1], instance); } event.preventDefault(); event.stopImmediatePropagation(); break; case Handsontable.helper.keyCode.ARROW_UP: if(!selection){ selectLastCell(instance); } else { selectPrevCell(selection[0], selection[1], instance); } event.preventDefault(); event.stopImmediatePropagation(); break; } function selectFirstCell(instance) { var firstCell = instance.getCell(0, 0); if(ContextMenu.utils.isSeparator(firstCell) || ContextMenu.utils.isDisabled(firstCell)){ selectNextCell(0, 0, instance); } else { instance.selectCell(0, 0); } } function selectLastCell(instance) { var lastRow = instance.countRows() - 1; var lastCell = instance.getCell(lastRow, 0); if(ContextMenu.utils.isSeparator(lastCell) || ContextMenu.utils.isDisabled(lastCell)){ selectPrevCell(lastRow, 0, instance); } else { instance.selectCell(lastRow, 0); } } function selectNextCell(row, col, instance){ var nextRow = row + 1; var nextCell = nextRow < instance.countRows() ? instance.getCell(nextRow, col) : null; if(!nextCell){ return; } if(ContextMenu.utils.isSeparator(nextCell) || ContextMenu.utils.isDisabled(nextCell)){ selectNextCell(nextRow, col, instance); } else { instance.selectCell(nextRow, col); } } function selectPrevCell(row, col, instance) { var prevRow = row - 1; var prevCell = prevRow >= 0 ? instance.getCell(prevRow, col) : null; if (!prevCell) { return; } if(ContextMenu.utils.isSeparator(prevCell) || ContextMenu.utils.isDisabled(prevCell)){ selectPrevCell(prevRow, col, instance); } else { instance.selectCell(prevRow, col); } } }; ContextMenu.prototype.getItems = function () { var items = {}; function Item(rawItem){ if(typeof rawItem == 'string'){ this.name = rawItem; } else { Handsontable.helper.extend(this, rawItem); } } Item.prototype = this.options; for(var itemName in this.options.items){ if(this.options.items.hasOwnProperty(itemName) && (!this.itemsFilter || this.itemsFilter.indexOf(itemName) != -1)){ items[itemName] = new Item(this.options.items[itemName]); } } return items; }; ContextMenu.prototype.updateOptions = function(newOptions){ newOptions = newOptions || {}; if(newOptions.items){ for(var itemName in newOptions.items){ var item = {}; if(newOptions.items.hasOwnProperty(itemName)) { if(this.defaultOptions.items.hasOwnProperty(itemName) && Handsontable.helper.isObject(newOptions.items[itemName])){ Handsontable.helper.extend(item, this.defaultOptions.items[itemName]); Handsontable.helper.extend(item, newOptions.items[itemName]); newOptions.items[itemName] = item; } } } } Handsontable.helper.extend(this.options, newOptions); }; ContextMenu.prototype.setMenuPosition = function (cursorY, cursorX) { var cursor = { top: cursorY, topRelative: cursorY - document.documentElement.scrollTop, left: cursorX, leftRelative:cursorX - document.documentElement.scrollLeft }; if(this.menuFitsBelowCursor(cursor)){ this.positionMenuBelowCursor(cursor); } else { this.positionMenuAboveCursor(cursor); } if(this.menuFitsOnRightOfCursor(cursor)){ this.positionMenuOnRightOfCursor(cursor); } else { this.positionMenuOnLeftOfCursor(cursor); } }; ContextMenu.prototype.menuFitsBelowCursor = function (cursor) { return cursor.topRelative + this.menu.offsetHeight <= document.documentElement.scrollTop + document.documentElement.clientHeight; }; ContextMenu.prototype.menuFitsOnRightOfCursor = function (cursor) { return cursor.leftRelative + this.menu.offsetWidth <= document.documentElement.scrollLeft + document.documentElement.clientWidth; }; ContextMenu.prototype.positionMenuBelowCursor = function (cursor) { this.menu.style.top = cursor.top + 'px'; }; ContextMenu.prototype.positionMenuAboveCursor = function (cursor) { this.menu.style.top = (cursor.top - this.menu.offsetHeight) + 'px'; }; ContextMenu.prototype.positionMenuOnRightOfCursor = function (cursor) { this.menu.style.left = cursor.left + 'px'; }; ContextMenu.prototype.positionMenuOnLeftOfCursor = function (cursor) { this.menu.style.left = (cursor.left - this.menu.offsetWidth) + 'px'; }; ContextMenu.utils = {}; ContextMenu.utils.convertItemsToArray = function (items) { var itemArray = []; var item; for(var itemName in items){ if(items.hasOwnProperty(itemName)){ if(typeof items[itemName] == 'string'){ item = {name: items[itemName]}; } else if (items[itemName].visible !== false) { item = items[itemName]; } else { continue; } item.key = itemName; itemArray.push(item); } } return itemArray; }; ContextMenu.utils.normalizeSelection = function(corners){ var selection = { start: new Handsontable.SelectionPoint(), end: new Handsontable.SelectionPoint() }; selection.start.row(Math.min(corners[0], corners[2])); selection.start.col(Math.min(corners[1], corners[3])); selection.end.row(Math.max(corners[0], corners[2])); selection.end.col(Math.max(corners[1], corners[3])); return selection; }; ContextMenu.utils.isSeparator = function (cell) { return Handsontable.Dom.hasClass(cell, 'htSeparator'); }; ContextMenu.utils.isDisabled = function (cell) { return Handsontable.Dom.hasClass(cell, 'htDisabled'); }; ContextMenu.prototype.enable = function () { if(!this.enabled){ this.enabled = true; this.bindMouseEvents(); } }; ContextMenu.prototype.disable = function () { if(this.enabled){ this.enabled = false; this.close(); this.unbindMouseEvents(); this.unbindTableEvents(); } }; ContextMenu.prototype.destroy = function () { this.close(); this.unbindMouseEvents(); this.unbindTableEvents(); if(!this.isMenuEnabledByOtherHotInstance()){ this.removeMenu(); } }; ContextMenu.prototype.isMenuEnabledByOtherHotInstance = function () { var hotContainers = $('.handsontable'); var menuEnabled = false; for(var i = 0, len = hotContainers.length; i < len; i++){ var instance = $(hotContainers[i]).handsontable('getInstance'); if(instance && instance.getSettings().contextMenu){ menuEnabled = true; break; } } return menuEnabled; }; ContextMenu.prototype.removeMenu = function () { if(this.menu.parentNode){ this.menu.parentNode.removeChild(this.menu); } } ContextMenu.prototype.filterItems = function(itemsToLeave){ this.itemsFilter = itemsToLeave; }; ContextMenu.SEPARATOR = "---------"; function init(){ var instance = this; var contextMenuSetting = instance.getSettings().contextMenu; var customOptions = Handsontable.helper.isObject(contextMenuSetting) ? contextMenuSetting : {}; if(contextMenuSetting){ if(!instance.contextMenu){ instance.contextMenu = new ContextMenu(instance, customOptions); } instance.contextMenu.enable(); if(Handsontable.helper.isArray(contextMenuSetting)){ instance.contextMenu.filterItems(contextMenuSetting); } } else if(instance.contextMenu){ instance.contextMenu.destroy(); delete instance.contextMenu; } } Handsontable.PluginHooks.add('afterInit', init); Handsontable.PluginHooks.add('afterUpdateSettings', init); Handsontable.ContextMenu = ContextMenu; })(Handsontable); /** * This plugin adds support for legacy features, deprecated APIs, etc. */ /** * Support for old autocomplete syntax * For old syntax, see: https://github.com/warpech/jquery-handsontable/blob/8c9e701d090ea4620fe08b6a1a048672fadf6c7e/README.md#defining-autocomplete */ Handsontable.PluginHooks.add('beforeGetCellMeta', function (row, col, cellProperties) { //isWritable - deprecated since 0.8.0 cellProperties.isWritable = !cellProperties.readOnly; //autocomplete - deprecated since 0.7.1 (see CHANGELOG.md) if (cellProperties.autoComplete) { throw new Error("Support for legacy autocomplete syntax was removed in Handsontable 0.10.0. Please remove the property named 'autoComplete' from your config. For replacement instructions, see wiki page https://github.com/warpech/jquery-handsontable/wiki/Migration-guide-to-0.10.x"); } }); function HandsontableManualColumnMove() { var pressed , startCol , endCol , startX , startOffset; var ghost = document.createElement('DIV') , ghostStyle = ghost.style; ghost.className = 'ghost'; ghostStyle.position = 'absolute'; ghostStyle.top = '25px'; ghostStyle.left = 0; ghostStyle.width = '10px'; ghostStyle.height = '10px'; ghostStyle.backgroundColor = '#CCC'; ghostStyle.opacity = 0.7; var saveManualColumnPositions = function () { var instance = this; instance.PluginHooks.run('persistentStateSave', 'manualColumnPositions', instance.manualColumnPositions); }; var loadManualColumnPositions = function () { var instance = this; var storedState = {}; instance.PluginHooks.run('persistentStateLoad', 'manualColumnPositions', storedState); return storedState.value; }; var bindMoveColEvents = function () { var instance = this; instance.rootElement.on('mousemove.manualColumnMove', function (e) { if (pressed) { ghostStyle.left = startOffset + e.pageX - startX + 6 + 'px'; if (ghostStyle.display === 'none') { ghostStyle.display = 'block'; } } }); instance.rootElement.on('mouseup.manualColumnMove', function () { if (pressed) { if (startCol < endCol) { endCol--; } if (instance.getSettings().rowHeaders) { startCol--; endCol--; } instance.manualColumnPositions.splice(endCol, 0, instance.manualColumnPositions.splice(startCol, 1)[0]); $('.manualColumnMover.active').removeClass('active'); pressed = false; instance.forceFullRender = true; instance.view.render(); //updates all ghostStyle.display = 'none'; saveManualColumnPositions.call(instance); instance.PluginHooks.run('afterColumnMove', startCol, endCol); } }); instance.rootElement.on('mousedown.manualColumnMove', '.manualColumnMover', function (e) { var mover = e.currentTarget; var TH = instance.view.wt.wtDom.closest(mover, 'TH'); startCol = instance.view.wt.wtDom.index(TH) + instance.colOffset(); endCol = startCol; pressed = true; startX = e.pageX; var TABLE = instance.$table[0]; TABLE.parentNode.appendChild(ghost); ghostStyle.width = instance.view.wt.wtDom.outerWidth(TH) + 'px'; ghostStyle.height = instance.view.wt.wtDom.outerHeight(TABLE) + 'px'; startOffset = parseInt(instance.view.wt.wtDom.offset(TH).left - instance.view.wt.wtDom.offset(TABLE).left, 10); ghostStyle.left = startOffset + 6 + 'px'; }); instance.rootElement.on('mouseenter.manualColumnMove', 'td, th', function () { if (pressed) { var active = instance.view.THEAD.querySelector('.manualColumnMover.active'); if (active) { instance.view.wt.wtDom.removeClass(active, 'active'); } endCol = instance.view.wt.wtDom.index(this) + instance.colOffset(); var THs = instance.view.THEAD.querySelectorAll('th'); var mover = THs[endCol].querySelector('.manualColumnMover'); instance.view.wt.wtDom.addClass(mover, 'active'); } }); instance.addHook('afterDestroy', unbindMoveColEvents); }; var unbindMoveColEvents = function(){ var instance = this; instance.rootElement.off('mouseup.manualColumnMove'); instance.rootElement.off('mousemove.manualColumnMove'); instance.rootElement.off('mousedown.manualColumnMove'); instance.rootElement.off('mouseenter.manualColumnMove'); }; 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 (initialManualColumnPositions instanceof Array) { this.manualColumnPositions = initialManualColumnPositions; } else { this.manualColumnPositions = []; } instance.forceFullRender = true; if (source == 'afterInit') { bindMoveColEvents.call(this); if (this.manualColumnPositions.length > 0) { this.forceFullRender = true; this.render(); } } } else { unbindMoveColEvents.call(this); this.manualColumnPositions = []; } }; this.modifyCol = function (col) { //TODO test performance: http://jsperf.com/object-wrapper-vs-primitive/2 if (this.getSettings().manualColumnMove) { if (typeof this.manualColumnPositions[col] === 'undefined') { this.manualColumnPositions[col] = col; } return this.manualColumnPositions[col]; } return col; }; this.getColHeader = function (col, TH) { if (this.getSettings().manualColumnMove) { var DIV = document.createElement('DIV'); DIV.className = 'manualColumnMover'; TH.firstChild.appendChild(DIV); } }; } var htManualColumnMove = new HandsontableManualColumnMove(); Handsontable.PluginHooks.add('beforeInit', htManualColumnMove.beforeInit); Handsontable.PluginHooks.add('afterInit', function () { htManualColumnMove.init.call(this, 'afterInit') }); Handsontable.PluginHooks.add('afterUpdateSettings', function () { htManualColumnMove.init.call(this, 'afterUpdateSettings') }); Handsontable.PluginHooks.add('afterGetColHeader', htManualColumnMove.getColHeader); Handsontable.PluginHooks.add('modifyCol', htManualColumnMove.modifyCol); function HandsontableManualColumnResize() { var pressed , currentTH , currentCol , currentWidth , instance , newSize , startX , startWidth , startOffset , resizer = document.createElement('DIV') , handle = document.createElement('DIV') , line = document.createElement('DIV') , lineStyle = line.style; resizer.className = 'manualColumnResizer'; handle.className = 'manualColumnResizerHandle'; resizer.appendChild(handle); line.className = 'manualColumnResizerLine'; resizer.appendChild(line); var $document = $(document); $document.mousemove(function (e) { if (pressed) { currentWidth = startWidth + (e.pageX - startX); newSize = setManualSize(currentCol, currentWidth); //save col width resizer.style.left = startOffset + currentWidth + 'px'; } }); $document.mouseup(function () { if (pressed) { instance.view.wt.wtDom.removeClass(resizer, 'active'); pressed = false; if(newSize != startWidth){ instance.forceFullRender = true; instance.view.render(); //updates all saveManualColumnWidths.call(instance); instance.PluginHooks.run('afterColumnResize', currentCol, newSize); } refreshResizerPosition.call(instance, currentTH); } }); var saveManualColumnWidths = function () { var instance = this; instance.PluginHooks.run('persistentStateSave', 'manualColumnWidths', instance.manualColumnWidths); }; var loadManualColumnWidths = function () { var instance = this; var storedState = {}; instance.PluginHooks.run('persistentStateLoad', 'manualColumnWidths', storedState); return storedState.value; }; function refreshResizerPosition(TH) { instance = this; currentTH = TH; var col = this.view.wt.wtTable.getCoords(TH)[1]; //getCoords returns array [row, col] if (col >= 0) { //if not row header currentCol = col; var rootOffset = this.view.wt.wtDom.offset(this.rootElement[0]).left; var thOffset = this.view.wt.wtDom.offset(TH).left; startOffset = (thOffset - rootOffset) - 6; resizer.style.left = startOffset + parseInt(this.view.wt.wtDom.outerWidth(TH), 10) + 'px'; this.rootElement[0].appendChild(resizer); } } function refreshLinePosition() { var instance = this; startWidth = parseInt(this.view.wt.wtDom.outerWidth(currentTH), 10); instance.view.wt.wtDom.addClass(resizer, 'active'); lineStyle.height = instance.view.wt.wtDom.outerHeight(instance.$table[0]) + 'px'; pressed = instance; } var bindManualColumnWidthEvents = function () { var instance = this; var dblclick = 0; var autoresizeTimeout = null; this.rootElement.on('mouseenter.handsontable', 'th', function (e) { if (!pressed) { refreshResizerPosition.call(instance, e.currentTarget); } }); this.rootElement.on('mousedown.handsontable', '.manualColumnResizer', function () { if (autoresizeTimeout == null) { autoresizeTimeout = setTimeout(function () { if (dblclick >= 2) { newSize = instance.determineColumnWidth.call(instance, currentCol); setManualSize(currentCol, newSize); instance.forceFullRender = true; instance.view.render(); //updates all instance.PluginHooks.run('afterColumnResize', currentCol, newSize); } dblclick = 0; autoresizeTimeout = null; }, 500); } dblclick++; }); this.rootElement.on('mousedown.handsontable', '.manualColumnResizer', function (e) { startX = e.pageX; refreshLinePosition.call(instance); newSize = startWidth; }); }; this.beforeInit = function () { this.manualColumnWidths = []; }; this.init = function (source) { var instance = this; var manualColumnWidthEnabled = !!(this.getSettings().manualColumnResize); if (manualColumnWidthEnabled) { var initialColumnWidths = this.getSettings().manualColumnResize; var loadedManualColumnWidths = loadManualColumnWidths.call(instance); if (typeof loadedManualColumnWidths != 'undefined') { this.manualColumnWidths = loadedManualColumnWidths; } else if (initialColumnWidths instanceof Array) { this.manualColumnWidths = initialColumnWidths; } else { this.manualColumnWidths = []; } if (source == 'afterInit') { bindManualColumnWidthEvents.call(this); instance.forceFullRender = true; instance.render(); } } }; var setManualSize = function (col, width) { width = Math.max(width, 20); /** * We need to run col through modifyCol hook, in case the order of displayed columns is different than the order * in data source. For instance, this order can be modified by manualColumnMove plugin. */ col = instance.PluginHooks.execute('modifyCol', col); instance.manualColumnWidths[col] = width; return width; }; this.getColWidth = function (col, response) { if (this.getSettings().manualColumnResize && this.manualColumnWidths[col]) { response.width = this.manualColumnWidths[col]; } }; } var htManualColumnResize = new HandsontableManualColumnResize(); Handsontable.PluginHooks.add('beforeInit', htManualColumnResize.beforeInit); Handsontable.PluginHooks.add('afterInit', function () { htManualColumnResize.init.call(this, 'afterInit') }); Handsontable.PluginHooks.add('afterUpdateSettings', function () { htManualColumnResize.init.call(this, 'afterUpdateSettings') }); Handsontable.PluginHooks.add('afterGetColWidth', htManualColumnResize.getColWidth); (function HandsontableObserveChanges() { Handsontable.PluginHooks.add('afterLoadData', init); Handsontable.PluginHooks.add('afterUpdateSettings', init); function init() { var instance = this; var pluginEnabled = instance.getSettings().observeChanges; if (pluginEnabled) { if(instance.observer) { destroy.call(instance); //destroy observer for old data object } 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.getData(); 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; } /** * Removing or adding column will produce one patch for each table row. * This function leaves only one patch for each column add/remove operation */ 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; }); } /** * If observeChanges uses native Object.observe method, then it produces patches for length property. * This function removes them. */ 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.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(); }); } })(); /* * * Plugin enables saving table state * * */ 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' ? key : defaultValue; 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 (StorageClass) { 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 StorageClass(instance.rootElement[0].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.reset(key); } else { instance.storage.resetAll(); } }; var hooks = { 'persistentStateSave': plugin.saveValue, 'persistentStateLoad': plugin.loadValue, 'persistentStateReset': plugin.resetValue }; function addHooks() { var instance = this; for (var hookName in hooks) { if (hooks.hasOwnProperty(hookName) && !hookExists.call(instance, hookName)) { instance.PluginHooks.add(hookName, hooks[hookName]); } } } function removeHooks() { var instance = this; for (var hookName in hooks) { if (hooks.hasOwnProperty(hookName) && hookExists.call(instance, hookName)) { instance.PluginHooks.remove(hookName, hooks[hookName]); } } } function hookExists(hookName) { var instance = this; return instance.PluginHooks.hooks.hasOwnProperty(hookName); } } var htPersistentState = new HandsontablePersistentState(); Handsontable.PluginHooks.add('beforeInit', htPersistentState.init); Handsontable.PluginHooks.add('afterUpdateSettings', htPersistentState.init); })(Storage); /** * Handsontable UndoRedo class */ (function(Handsontable){ 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.getData(); 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.getData(); 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(Handsontable.helper.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); }); }; Handsontable.UndoRedo.prototype.done = function (action) { if (!this.ignoreNewActions) { this.doneActions.push(action); this.undoneActions.length = 0; } }; /** * Undo operation from current revision */ 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); }); } }; /** * Redo operation from current revision */ 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); }); } }; /** * Returns true if undo point is available * @return {Boolean} */ Handsontable.UndoRedo.prototype.isUndoAvailable = function () { return this.doneActions.length > 0; }; /** * Returns true if redo point is available * @return {Boolean} */ Handsontable.UndoRedo.prototype.isRedoAvailable = function () { return this.undoneActions.length > 0; }; /** * Clears undo history */ 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; }; Handsontable.helper.inherit(Handsontable.UndoRedo.ChangeAction, Handsontable.UndoRedo.Action); Handsontable.UndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) { var data = $.extend(true, [], this.changes); 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'); }; Handsontable.UndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) { var data = $.extend(true, [], 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; }; Handsontable.helper.inherit(Handsontable.UndoRedo.CreateRowAction, Handsontable.UndoRedo.Action); Handsontable.UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) { 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; }; Handsontable.helper.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.getData(), 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; }; Handsontable.helper.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.RemoveColumnAction = function (index, data, headers) { this.index = index; this.data = data; this.amount = this.data[0].length; this.headers = headers; }; Handsontable.helper.inherit(Handsontable.UndoRedo.RemoveColumnAction, Handsontable.UndoRedo.Action); Handsontable.UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) { var row, spliceArgs; for (var i = 0, len = instance.getData().length; i < len; i++) { row = instance.getDataAtRow(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); }; })(Handsontable); (function(Handsontable){ 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)) { //CTRL + Y or CTRL + SHIFT + Z instance.undoRedo.redo(); event.stopImmediatePropagation(); } else if (event.keyCode === 90) { //CTRL + Z instance.undoRedo.undo(); event.stopImmediatePropagation(); } } } 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.PluginHooks.add('afterInit', init); Handsontable.PluginHooks.add('afterUpdateSettings', init); })(Handsontable); /** * Plugin used to scroll Handsontable by selecting a cell and dragging outside of visible viewport * @constructor */ function DragToScroll() { this.boundaries = null; this.callback = null; } /** * @param boundaries {Object} compatible with getBoundingClientRect */ DragToScroll.prototype.setBoundaries = function (boundaries) { this.boundaries = boundaries; }; /** * @param callback {Function} */ DragToScroll.prototype.setCallback = function (callback) { this.callback = callback; }; /** * Check if mouse position (x, y) is outside of the viewport * @param x * @param y */ DragToScroll.prototype.check = function (x, y) { var diffX = 0; var diffY = 0; if (y < this.boundaries.top) { //y is less than top diffY = y - this.boundaries.top; } else if (y > this.boundaries.bottom) { //y is more than bottom diffY = y - this.boundaries.bottom; } if (x < this.boundaries.left) { //x is less than left diffX = x - this.boundaries.left; } else if (x > this.boundaries.right) { //x is more than right diffX = x - this.boundaries.right; } this.callback(diffX, diffY); }; var listening = false; var dragToScroll; var instance; if (typeof Handsontable !== 'undefined') { var setupListening = function (instance) { var scrollHandler = instance.view.wt.wtScrollbars.vertical.scrollHandler; //native scroll dragToScroll = new DragToScroll(); if (scrollHandler === window) { //not much we can do currently return; } else if (scrollHandler) { dragToScroll.setBoundaries(scrollHandler.getBoundingClientRect()); } else { dragToScroll.setBoundaries(instance.$table[0].getBoundingClientRect()); } dragToScroll.setCallback(function (scrollX, scrollY) { if (scrollX < 0) { if (scrollHandler) { scrollHandler.scrollLeft -= 50; } else { instance.view.wt.scrollHorizontal(-1).draw(); } } else if (scrollX > 0) { if (scrollHandler) { scrollHandler.scrollLeft += 50; } else { instance.view.wt.scrollHorizontal(1).draw(); } } if (scrollY < 0) { if (scrollHandler) { scrollHandler.scrollTop -= 20; } else { instance.view.wt.scrollVertical(-1).draw(); } } else if (scrollY > 0) { if (scrollHandler) { scrollHandler.scrollTop += 20; } else { instance.view.wt.scrollVertical(1).draw(); } } }); listening = true; }; Handsontable.PluginHooks.add('afterInit', function () { $(document).on('mouseup.' + this.guid, function () { listening = false; }); $(document).on('mousemove.' + this.guid, function (event) { if (listening) { dragToScroll.check(event.clientX, event.clientY); } }); }); Handsontable.PluginHooks.add('destroy', function () { $(document).off('.' + this.guid); }); Handsontable.PluginHooks.add('afterOnCellMouseDown', function () { setupListening(this); }); Handsontable.PluginHooks.add('afterOnCellCornerMouseDown', function () { setupListening(this); }); Handsontable.plugins.DragToScroll = DragToScroll; } (function (Handsontable, CopyPaste, SheetClip) { function CopyPastePlugin(instance) { this.copyPasteInstance = CopyPaste.getInstance(); this.copyPasteInstance.onCut(onCut); this.copyPasteInstance.onPaste(onPaste); var plugin = this; instance.addHook('beforeKeyDown', onBeforeKeyDown); function onCut() { if (!instance.isListening()) { return; } instance.selection.empty(); } function onPaste(str) { if (!instance.isListening() || !instance.selection.isSelected()) { return; } var input = str.replace(/^[\r\n]*/g, '').replace(/[\r\n]*$/g, '') //remove newline from the start and the end of the input , inputArray = SheetClip.parse(input) , selected = instance.getSelected() , coords = instance.getCornerCoords([{row: selected[0], col: selected[1]}, {row: selected[2], col: selected[3]}]) , areaStart = coords.TL , areaEnd = { row: Math.max(coords.BR.row, inputArray.length - 1 + coords.TL.row), col: Math.max(coords.BR.col, inputArray[0].length - 1 + coords.TL.col) }; instance.PluginHooks.once('afterChange', function (changes, source) { if (changes && changes.length) { this.selectCell(areaStart.row, areaStart.col, areaEnd.row, areaEnd.col); } }); instance.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'paste', instance.getSettings().pasteMode); }; function onBeforeKeyDown (event) { if (Handsontable.helper.isCtrlKey(event.keyCode) && instance.getSelected()) { //when CTRL is pressed, prepare selectable text in textarea //http://stackoverflow.com/questions/3902635/how-does-one-capture-a-macs-command-key-via-javascript plugin.setCopyableText(); event.stopImmediatePropagation(); return; } var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; //catch CTRL but not right ALT (which in some systems triggers ALT+CTRL) if (event.keyCode == Handsontable.helper.keyCode.A && ctrlDown) { setTimeout(Handsontable.helper.proxy(plugin.setCopyableText, plugin)); } } this.destroy = function () { this.copyPasteInstance.removeCallback(onCut); this.copyPasteInstance.removeCallback(onPaste); this.copyPasteInstance.destroy(); instance.removeHook('beforeKeyDown', onBeforeKeyDown); }; instance.addHook('afterDestroy', Handsontable.helper.proxy(this.destroy, this)); this.triggerPaste = Handsontable.helper.proxy(this.copyPasteInstance.triggerPaste, this.copyPasteInstance); this.triggerCut = Handsontable.helper.proxy(this.copyPasteInstance.triggerCut, this.copyPasteInstance); /** * Prepares copyable text in the invisible textarea */ this.setCopyableText = function () { var selection = instance.getSelected(); var settings = instance.getSettings(); var copyRowsLimit = settings.copyRowsLimit; var copyColsLimit = settings.copyColsLimit; var startRow = Math.min(selection[0], selection[2]); var startCol = Math.min(selection[1], selection[3]); var endRow = Math.max(selection[0], selection[2]); var endCol = Math.max(selection[1], selection[3]); var finalEndRow = Math.min(endRow, startRow + copyRowsLimit - 1); var finalEndCol = Math.min(endCol, startCol + copyColsLimit - 1); instance.copyPaste.copyPasteInstance.copyable(instance.getCopyableData(startRow, startCol, finalEndRow, finalEndCol)); if (endRow !== finalEndRow || endCol !== finalEndCol) { instance.PluginHooks.run("afterCopyLimit", endRow - startRow + 1, endCol - startCol + 1, copyRowsLimit, copyColsLimit); } }; } function init() { var instance = this; var pluginEnabled = instance.getSettings().copyPaste !== false; if(pluginEnabled && !instance.copyPaste){ instance.copyPaste = new CopyPastePlugin(instance); } else if (!pluginEnabled && instance.copyPaste) { instance.copyPaste.destroy(); delete instance.copyPaste; } } Handsontable.PluginHooks.add('afterInit', init); Handsontable.PluginHooks.add('afterUpdateSettings', init); })(Handsontable, CopyPaste, SheetClip); (function (Handsontable) { 'use strict'; 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; } 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 = (typeof cellProperties.search == 'object' && cellProperties.search.searchResultClass) || Handsontable.Search.global.getDefaultSearchResultClass(); if(cellProperties.isSearchResult){ Handsontable.Dom.addClass(TD, searchResultClass); } else { Handsontable.Dom.removeClass(TD, searchResultClass); } }; var originalDecorator = Handsontable.renderers.cellDecorator; Handsontable.renderers.cellDecorator = function (instance, TD, row, col, prop, value, cellProperties) { originalDecorator.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.PluginHooks.add('afterInit', init); Handsontable.PluginHooks.add('afterUpdateSettings', init); })(Handsontable); /** * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable * and (optionally) implements behavior needed for native horizontal and vertical scrolling */ function WalkontableOverlay() { this.maxOuts = 10; //max outs in one direction (before and after table) } /* Possible optimizations: [x] don't rerender if scroll delta is smaller than the fragment outside of the viewport [ ] move .style.top change before .draw() [ ] put .draw() in requestAnimationFrame [ ] don't rerender rows that remain visible after the scroll */ WalkontableOverlay.prototype.init = function () { this.TABLE = this.instance.wtTable.TABLE; this.fixed = this.instance.wtTable.hider; this.fixedContainer = this.instance.wtTable.holder; this.fixed.style.position = 'absolute'; this.fixed.style.left = '0'; this.scrollHandler = this.getScrollableElement(this.TABLE); this.$scrollHandler = $(this.scrollHandler); //in future remove jQuery from here }; WalkontableOverlay.prototype.makeClone = function (direction) { var clone = document.createElement('DIV'); clone.className = 'ht_clone_' + direction + ' handsontable'; clone.style.position = 'fixed'; clone.style.overflow = 'hidden'; var table2 = document.createElement('TABLE'); table2.className = this.instance.wtTable.TABLE.className; clone.appendChild(table2); this.instance.wtTable.holder.parentNode.appendChild(clone); return new Walkontable({ cloneSource: this.instance, cloneOverlay: this, table: table2 }); }; WalkontableOverlay.prototype.getScrollableElement = function (TABLE) { var el = TABLE.parentNode; while (el && el.style) { if (el.style.overflow !== 'visible' && el.style.overflow !== '') { return el; } if (this instanceof WalkontableHorizontalScrollbarNative && el.style.overflowX !== 'visible' && el.style.overflowX !== '') { return el; } el = el.parentNode; } return window; }; WalkontableOverlay.prototype.prepare = function () { }; WalkontableOverlay.prototype.onScroll = function (forcePosition) { this.windowScrollPosition = this.getScrollPosition(); this.readSettings(); //read window scroll position if (forcePosition) { this.windowScrollPosition = forcePosition; } this.resetFixedPosition(); //may be redundant }; WalkontableOverlay.prototype.availableSize = function () { var availableSize; if (this.windowScrollPosition > this.tableParentOffset /*&& last > -1*/) { //last -1 means that viewport is scrolled behind the table if (this.instance.wtTable.getLastVisibleRow() === this.total - 1) { availableSize = this.instance.wtDom.outerHeight(this.TABLE); } else { availableSize = this.windowSize; } } else { availableSize = this.windowSize - (this.tableParentOffset); } return availableSize; }; WalkontableOverlay.prototype.refresh = function (selectionsOnly) { var last = this.getLastCell(); this.measureBefore = this.sumCellSizes(0, this.offset); if (last === -1) { //last -1 means that viewport is scrolled behind the table this.measureAfter = 0; } else { this.measureAfter = this.sumCellSizes(last, this.total - last); } this.applyToDOM(); this.clone && this.clone.draw(selectionsOnly); }; WalkontableOverlay.prototype.destroy = function () { this.$scrollHandler.off('.' + this.instance.guid); $(window).off('.' + this.instance.guid); $(document).off('.' + this.instance.guid); }; function WalkontableBorder(instance, settings) { var style; //reference to instance this.instance = instance; this.settings = settings; this.wtDom = this.instance.wtDom; this.main = document.createElement("div"); style = this.main.style; style.position = 'absolute'; style.top = 0; style.left = 0; // style.visibility = 'hidden'; for (var i = 0; i < 5; i++) { var DIV = document.createElement('DIV'); DIV.className = 'wtBorder ' + (settings.className || ''); style = DIV.style; style.backgroundColor = settings.border.color; style.height = settings.border.width + 'px'; style.width = 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.top).on(sss, function(event) { event.preventDefault(); event.stopImmediatePropagation(); $(this).hide(); }); $(this.left).on(sss, function(event) { event.preventDefault(); event.stopImmediatePropagation(); $(this).hide(); }); $(this.bottom).on(sss, function(event) { event.preventDefault(); event.stopImmediatePropagation(); $(this).hide(); }); $(this.right).on(sss, function(event) { event.preventDefault(); event.stopImmediatePropagation(); $(this).hide(); });*/ 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 = '5px'; this.cornerStyle.height = '5px'; this.cornerStyle.border = '2px solid #FFF'; this.disappear(); if (!instance.wtTable.bordersHolder) { instance.wtTable.bordersHolder = document.createElement('div'); instance.wtTable.bordersHolder.className = 'htBorders'; instance.wtTable.hider.appendChild(instance.wtTable.bordersHolder); } instance.wtTable.bordersHolder.appendChild(this.main); var down = false; var $body = $(document.body); $body.on('mousedown.walkontable.' + instance.guid, function () { down = true; }); $body.on('mouseup.walkontable.' + instance.guid, function () { down = false }); $(this.main.childNodes).on('mouseenter', function (event) { if (!down || !instance.getSetting('hideBorderOnMouseDownOver')) { return; } event.preventDefault(); event.stopImmediatePropagation(); var bounds = this.getBoundingClientRect(); var $this = $(this); $this.hide(); var isOutside = function (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; } }; $body.on('mousemove.border.' + instance.guid, function (event) { if (isOutside(event)) { $body.off('mousemove.border.' + instance.guid); $this.show(); } }); }); } /** * Show border around one or many cells * @param {Array} corners */ WalkontableBorder.prototype.appear = function (corners) { var isMultiple, fromTD, toTD, fromOffset, toOffset, containerOffset, top, minTop, left, minLeft, height, width; if (this.disabled) { return; } var instance = this.instance , fromRow , fromColumn , toRow , toColumn , hideTop = false , hideLeft = false , hideBottom = false , hideRight = false , i , ilen , s; if (!instance.wtTable.isRowInViewport(corners[0])) { hideTop = true; } if (!instance.wtTable.isRowInViewport(corners[2])) { hideBottom = true; } ilen = instance.wtTable.rowStrategy.countVisible(); for (i = 0; i < ilen; i++) { s = instance.wtTable.rowFilter.visibleToSource(i); if (s >= corners[0] && s <= corners[2]) { fromRow = s; break; } } for (i = ilen - 1; i >= 0; i--) { s = instance.wtTable.rowFilter.visibleToSource(i); if (s >= corners[0] && s <= corners[2]) { toRow = s; break; } } if (hideTop && hideBottom) { hideLeft = true; hideRight = true; } else { if (!instance.wtTable.isColumnInViewport(corners[1])) { hideLeft = true; } if (!instance.wtTable.isColumnInViewport(corners[3])) { hideRight = true; } ilen = instance.wtTable.columnStrategy.countVisible(); for (i = 0; i < ilen; i++) { s = instance.wtTable.columnFilter.visibleToSource(i); if (s >= corners[1] && s <= corners[3]) { fromColumn = s; break; } } for (i = ilen - 1; i >= 0; i--) { s = instance.wtTable.columnFilter.visibleToSource(i); if (s >= corners[1] && s <= corners[3]) { toColumn = s; break; } } } if (fromRow !== void 0 && fromColumn !== void 0) { isMultiple = (fromRow !== toRow || fromColumn !== toColumn); fromTD = instance.wtTable.getCell([fromRow, fromColumn]); toTD = isMultiple ? instance.wtTable.getCell([toRow, toColumn]) : fromTD; fromOffset = this.wtDom.offset(fromTD); toOffset = isMultiple ? this.wtDom.offset(toTD) : fromOffset; containerOffset = this.wtDom.offset(instance.wtTable.TABLE); minTop = fromOffset.top; height = toOffset.top + this.wtDom.outerHeight(toTD) - minTop; minLeft = fromOffset.left; width = toOffset.left + this.wtDom.outerWidth(toTD) - minLeft; top = minTop - containerOffset.top - 1; left = minLeft - containerOffset.left - 1; var style = this.wtDom.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; } } else { this.disappear(); return; } if (hideTop) { this.topStyle.display = 'none'; } else { this.topStyle.top = top + 'px'; this.topStyle.left = left + 'px'; this.topStyle.width = width + 'px'; this.topStyle.display = 'block'; } if (hideLeft) { this.leftStyle.display = 'none'; } else { 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); if (hideBottom) { this.bottomStyle.display = 'none'; } else { this.bottomStyle.top = top + height - delta + 'px'; this.bottomStyle.left = left + 'px'; this.bottomStyle.width = width + 'px'; this.bottomStyle.display = 'block'; } if (hideRight) { this.rightStyle.display = 'none'; } else { this.rightStyle.top = top + 'px'; this.rightStyle.left = left + width - delta + 'px'; this.rightStyle.height = height + 1 + 'px'; this.rightStyle.display = 'block'; } if (hideBottom || hideRight || !this.hasSetting(this.settings.border.cornerVisible)) { this.cornerStyle.display = 'none'; } else { this.cornerStyle.top = top + height - 4 + 'px'; this.cornerStyle.left = left + width - 4 + 'px'; this.cornerStyle.display = 'block'; } }; /** * Hide border */ WalkontableBorder.prototype.disappear = function () { this.topStyle.display = 'none'; this.leftStyle.display = 'none'; this.bottomStyle.display = 'none'; this.rightStyle.display = 'none'; this.cornerStyle.display = 'none'; }; WalkontableBorder.prototype.hasSetting = function (setting) { if (typeof setting === 'function') { return setting(); } return !!setting; }; /** * WalkontableCellFilter * @constructor */ function WalkontableCellFilter() { this.offset = 0; this.total = 0; this.fixedCount = 0; } WalkontableCellFilter.prototype.source = function (n) { return n; }; WalkontableCellFilter.prototype.offsetted = function (n) { return n + this.offset; }; WalkontableCellFilter.prototype.unOffsetted = function (n) { return n - this.offset; }; WalkontableCellFilter.prototype.fixed = function (n) { if (n < this.fixedCount) { return n - this.offset; } else { return n; } }; WalkontableCellFilter.prototype.unFixed = function (n) { if (n < this.fixedCount) { return n + this.offset; } else { return n; } }; WalkontableCellFilter.prototype.visibleToSource = function (n) { return this.source(this.offsetted(this.fixed(n))); }; WalkontableCellFilter.prototype.sourceToVisible = function (n) { return this.source(this.unOffsetted(this.unFixed(n))); }; /** * WalkontableCellStrategy * @constructor */ function WalkontableCellStrategy(instance) { this.instance = instance; } WalkontableCellStrategy.prototype.getSize = function (index) { return this.cellSizes[index]; }; WalkontableCellStrategy.prototype.getContainerSize = function (proposedSize) { return typeof this.containerSizeFn === 'function' ? this.containerSizeFn(proposedSize) : this.containerSizeFn; }; WalkontableCellStrategy.prototype.countVisible = function () { return this.cellCount; }; WalkontableCellStrategy.prototype.isLastIncomplete = function () { if(this.instance.getSetting('nativeScrollbars')){ var nativeScrollbar = this.instance.cloneFrom ? this.instance.cloneFrom.wtScrollbars.vertical : this.instance.wtScrollbars.vertical; return this.remainingSize > nativeScrollbar.sumCellSizes(nativeScrollbar.offset, nativeScrollbar.offset + nativeScrollbar.curOuts + 1); } else { return this.remainingSize > 0; } }; /** * WalkontableClassNameList * @constructor */ function WalkontableClassNameCache() { this.cache = []; } WalkontableClassNameCache.prototype.add = function (r, c, cls) { if (!this.cache[r]) { this.cache[r] = []; } if (!this.cache[r][c]) { this.cache[r][c] = []; } this.cache[r][c][cls] = true; }; WalkontableClassNameCache.prototype.test = function (r, c, cls) { return (this.cache[r] && this.cache[r][c] && this.cache[r][c][cls]); }; /** * WalkontableColumnFilter * @constructor */ function WalkontableColumnFilter() { this.countTH = 0; } WalkontableColumnFilter.prototype = new WalkontableCellFilter(); WalkontableColumnFilter.prototype.readSettings = function (instance) { this.offset = instance.wtSettings.settings.offsetColumn; this.total = instance.getSetting('totalColumns'); this.fixedCount = instance.getSetting('fixedColumnsLeft'); this.countTH = instance.getSetting('rowHeaders').length; }; WalkontableColumnFilter.prototype.offsettedTH = function (n) { return n - this.countTH; }; WalkontableColumnFilter.prototype.unOffsettedTH = function (n) { return n + this.countTH; }; WalkontableColumnFilter.prototype.visibleRowHeadedColumnToSourceColumn = function (n) { return this.visibleToSource(this.offsettedTH(n)); }; WalkontableColumnFilter.prototype.sourceColumnToVisibleRowHeadedColumn = function (n) { return this.unOffsettedTH(this.sourceToVisible(n)); }; /** * WalkontableColumnStrategy * @param containerSizeFn * @param sizeAtIndex * @param strategy - all, last, none * @constructor */ function WalkontableColumnStrategy(instance, containerSizeFn, sizeAtIndex, strategy) { var size , i = 0; WalkontableCellStrategy.apply(this, arguments); this.containerSizeFn = containerSizeFn; this.cellSizesSum = 0; this.cellSizes = []; this.cellStretch = []; this.cellCount = 0; this.remainingSize = 0; this.strategy = strategy; //step 1 - determine cells that fit containerSize and cache their widths while (true) { size = sizeAtIndex(i); if (size === void 0) { break; //total columns exceeded } if (this.cellSizesSum >= this.getContainerSize(this.cellSizesSum + size)) { break; //total width exceeded } this.cellSizes.push(size); this.cellSizesSum += size; this.cellCount++; i++; } var containerSize = this.getContainerSize(this.cellSizesSum); this.remainingSize = this.cellSizesSum - containerSize; //negative value means the last cell is fully visible and there is some space left for stretching //positive value means the last cell is not fully visible } WalkontableColumnStrategy.prototype = new WalkontableCellStrategy(); WalkontableColumnStrategy.prototype.getSize = function (index) { return this.cellSizes[index] + (this.cellStretch[index] || 0); }; WalkontableColumnStrategy.prototype.stretch = function () { //step 2 - apply stretching strategy var containerSize = this.getContainerSize(this.cellSizesSum) , i = 0; this.remainingSize = this.cellSizesSum - containerSize; this.cellStretch.length = 0; //clear previous stretch if (this.strategy === 'all') { if (this.remainingSize < 0) { var ratio = containerSize / this.cellSizesSum; var newSize; while (i < this.cellCount - 1) { //"i < this.cellCount - 1" is needed because last cellSize is adjusted after the loop newSize = Math.floor(ratio * this.cellSizes[i]); this.remainingSize += newSize - this.cellSizes[i]; this.cellStretch[i] = newSize - this.cellSizes[i]; i++; } this.cellStretch[this.cellCount - 1] = -this.remainingSize; this.remainingSize = 0; } } else if (this.strategy === 'last') { if (this.remainingSize < 0 && containerSize !== Infinity) { //Infinity is with native scroll when the table is wider than the viewport (TODO: test) this.cellStretch[this.cellCount - 1] = -this.remainingSize; this.remainingSize = 0; } } }; function Walkontable(settings) { var that = this, originalHeaders = []; this.guid = 'wt_' + walkontableRandomString(); //this is the namespace for global events //bootstrap from settings this.wtDom = new WalkontableDom(); if (settings.cloneSource) { this.cloneSource = settings.cloneSource; this.cloneOverlay = settings.cloneOverlay; this.wtSettings = settings.cloneSource.wtSettings; this.wtTable = new WalkontableTable(this, settings.table); this.wtScroll = new WalkontableScroll(this); this.wtViewport = settings.cloneSource.wtViewport; } 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.wtScrollbars = new WalkontableScrollbars(this); this.wtWheel = new WalkontableWheel(this); this.wtEvent = new WalkontableEvent(this); } //find original headers 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) { that.wtDom.fastInnerText(TH, originalHeaders[column]); }]); } } //initialize selections this.selections = {}; var selectionsSettings = this.getSetting('selections'); if (selectionsSettings) { for (var i in selectionsSettings) { if (selectionsSettings.hasOwnProperty(i)) { this.selections[i] = new WalkontableSelection(this, selectionsSettings[i]); } } } this.drawn = false; this.drawInterrupted = false; //at this point the cached row heights may be invalid, but it is better not to reset the cache, which could cause scrollbar jumping when there are multiline cells outside of the rendered part of the table /*if (window.Handsontable) { Handsontable.PluginHooks.add('beforeChange', function () { if (that.rowHeightCache) { that.rowHeightCache.length = 0; } }); }*/ } Walkontable.prototype.draw = function (selectionsOnly) { this.drawInterrupted = false; if (!selectionsOnly && !this.wtDom.isVisible(this.wtTable.TABLE)) { this.drawInterrupted = true; //draw interrupted because TABLE is not visible return; } this.getSetting('beforeDraw', !selectionsOnly); selectionsOnly = selectionsOnly && this.getSetting('offsetRow') === this.lastOffsetRow && this.getSetting('offsetColumn') === this.lastOffsetColumn; if (this.drawn) { //fix offsets that might have changed this.scrollVertical(0); this.scrollHorizontal(0); } this.lastOffsetRow = this.getSetting('offsetRow'); this.lastOffsetColumn = this.getSetting('offsetColumn'); this.wtTable.draw(selectionsOnly); if (!this.cloneSource) { this.getSetting('onDraw', !selectionsOnly); } return this; }; Walkontable.prototype.update = function (settings, value) { return this.wtSettings.update(settings, value); }; Walkontable.prototype.scrollVertical = function (delta) { var result = this.wtScroll.scrollVertical(delta); this.getSetting('onScrollVertically'); return result; }; Walkontable.prototype.scrollHorizontal = function (delta) { var result = this.wtScroll.scrollHorizontal(delta); this.getSetting('onScrollHorizontally'); return result; }; Walkontable.prototype.scrollViewport = function (coords) { this.wtScroll.scrollViewport(coords); return this; }; Walkontable.prototype.getViewport = function () { return [ this.wtTable.rowFilter.visibleToSource(0), this.wtTable.columnFilter.visibleToSource(0), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn() ]; }; Walkontable.prototype.getSetting = function (key, param1, param2, param3) { return this.wtSettings.getSetting(key, param1, param2, param3); }; Walkontable.prototype.hasSetting = function (key) { return this.wtSettings.has(key); }; Walkontable.prototype.destroy = function () { $(document.body).off('.' + this.guid); this.wtScrollbars.destroy(); clearTimeout(this.wheelTimeout); this.wtEvent && this.wtEvent.destroy(); }; /** * A overlay that renders ALL available rows & columns positioned on top of the original Walkontable instance and all other overlays. * Used for debugging purposes to see if the other overlays (that render only part of the rows & columns) are positioned correctly * @param instance * @constructor */ function WalkontableDebugOverlay(instance) { this.instance = instance; this.init(); this.clone = this.makeClone('debug'); this.clone.wtTable.holder.style.opacity = 0.4; this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000'; var that = this; var lastTimeout; var lastX = 0; var lastY = 0; var overlayContainer = that.clone.wtTable.holder.parentNode; $(document.body).on('mousemove.' + this.instance.guid, function (event) { if (!that.instance.wtTable.holder.parentNode) { return; //removed from DOM } if ((event.clientX - lastX > -5 && event.clientX - lastX < 5) && (event.clientY - lastY > -5 && event.clientY - lastY < 5)) { return; //ignore minor mouse movement } lastX = event.clientX; lastY = event.clientY; WalkontableDom.prototype.addClass(overlayContainer, 'wtDebugHidden'); WalkontableDom.prototype.removeClass(overlayContainer, 'wtDebugVisible'); clearTimeout(lastTimeout); lastTimeout = setTimeout(function () { WalkontableDom.prototype.removeClass(overlayContainer, 'wtDebugHidden'); WalkontableDom.prototype.addClass(overlayContainer, 'wtDebugVisible'); }, 1000); }); } WalkontableDebugOverlay.prototype = new WalkontableOverlay(); WalkontableDebugOverlay.prototype.resetFixedPosition = function () { if (!this.instance.wtTable.holder.parentNode) { return; //removed from DOM } var elem = this.clone.wtTable.holder.parentNode; var box = this.instance.wtTable.holder.getBoundingClientRect(); elem.style.top = Math.ceil(box.top, 10) + 'px'; elem.style.left = Math.ceil(box.left, 10) + 'px'; }; WalkontableDebugOverlay.prototype.prepare = function () { }; WalkontableDebugOverlay.prototype.refresh = function (selectionsOnly) { this.clone && this.clone.draw(selectionsOnly); }; WalkontableDebugOverlay.prototype.getScrollPosition = function () { }; WalkontableDebugOverlay.prototype.getLastCell = function () { }; WalkontableDebugOverlay.prototype.applyToDOM = function () { }; WalkontableDebugOverlay.prototype.scrollTo = function () { }; WalkontableDebugOverlay.prototype.readWindowSize = function () { }; WalkontableDebugOverlay.prototype.readSettings = function () { }; function WalkontableDom() { } //goes up the DOM tree (including given element) until it finds an element that matches the nodeName WalkontableDom.prototype.closest = function (elem, nodeNames, until) { while (elem != null && elem !== until) { if (elem.nodeType === 1 && nodeNames.indexOf(elem.nodeName) > -1) { return elem; } elem = elem.parentNode; } return null; }; //goes up the DOM tree and checks if element is child of another element WalkontableDom.prototype.isChildOf = function (child, parent) { var node = child.parentNode; while (node != null) { if (node == parent) { return true; } node = node.parentNode; } return false; }; /** * Counts index of element within its parent * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true for Walkotnable * Otherwise would need to check for nodeType or use previousElementSibling * @see http://jsperf.com/sibling-index/10 * @param {Element} elem * @return {Number} */ WalkontableDom.prototype.index = function (elem) { var i = 0; while (elem = elem.previousSibling) { ++i } return i; }; if (document.documentElement.classList) { // HTML5 classList API WalkontableDom.prototype.hasClass = function (ele, cls) { return ele.classList.contains(cls); }; WalkontableDom.prototype.addClass = function (ele, cls) { ele.classList.add(cls); }; WalkontableDom.prototype.removeClass = function (ele, cls) { ele.classList.remove(cls); }; } else { //http://snipplr.com/view/3561/addclass-removeclass-hasclass/ WalkontableDom.prototype.hasClass = function (ele, cls) { return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); }; WalkontableDom.prototype.addClass = function (ele, cls) { if (!this.hasClass(ele, cls)) ele.className += " " + cls; }; WalkontableDom.prototype.removeClass = function (ele, cls) { if (this.hasClass(ele, cls)) { //is this really needed? var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); ele.className = ele.className.replace(reg, ' ').trim(); //String.prototype.trim is defined in polyfill.js } }; } /*//http://net.tutsplus.com/tutorials/javascript-ajax/javascript-from-null-cross-browser-event-binding/ WalkontableDom.prototype.addEvent = (function () { var that = this; if (document.addEventListener) { return function (elem, type, cb) { if ((elem && !elem.length) || elem === window) { elem.addEventListener(type, cb, false); } else if (elem && elem.length) { var len = elem.length; for (var i = 0; i < len; i++) { that.addEvent(elem[i], type, cb); } } }; } else { return function (elem, type, cb) { if ((elem && !elem.length) || elem === window) { elem.attachEvent('on' + type, function () { //normalize //http://stackoverflow.com/questions/4643249/cross-browser-event-object-normalization var e = window['event']; e.target = e.srcElement; //e.offsetX = e.layerX; //e.offsetY = e.layerY; e.relatedTarget = e.relatedTarget || e.type == 'mouseover' ? e.fromElement : e.toElement; if (e.target.nodeType === 3) e.target = e.target.parentNode; //Safari bug return cb.call(elem, e) }); } else if (elem.length) { var len = elem.length; for (var i = 0; i < len; i++) { that.addEvent(elem[i], type, cb); } } }; } })(); WalkontableDom.prototype.triggerEvent = function (element, eventName, target) { var event; if (document.createEvent) { event = document.createEvent("MouseEvents"); event.initEvent(eventName, true, true); } else { event = document.createEventObject(); event.eventType = eventName; } event.eventName = eventName; event.target = target; if (document.createEvent) { target.dispatchEvent(event); } else { target.fireEvent("on" + event.eventType, event); } };*/ WalkontableDom.prototype.removeTextNodes = function (elem, parent) { if (elem.nodeType === 3) { parent.removeChild(elem); //bye text nodes! } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(elem.nodeName) > -1) { var childs = elem.childNodes; for (var i = childs.length - 1; i >= 0; i--) { this.removeTextNodes(childs[i], elem); } } }; /** * Remove childs function * WARNING - this doesn't unload events and data attached by jQuery * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9 * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method * @param element * @returns {void} */ // WalkontableDom.prototype.empty = function (element) { var child; while (child = element.lastChild) { element.removeChild(child); } }; WalkontableDom.prototype.HTML_CHARACTERS = /(<(.*)>|&(.*);)/; /** * Insert content into element trying avoid innerHTML method. * @return {void} */ WalkontableDom.prototype.fastInnerHTML = function (element, content) { if (this.HTML_CHARACTERS.test(content)) { element.innerHTML = content; } else { this.fastInnerText(element, content); } }; /** * Insert text content into element * @return {void} */ if (document.createTextNode('test').textContent) { //STANDARDS WalkontableDom.prototype.fastInnerText = function (element, content) { var child = element.firstChild; if (child && child.nodeType === 3 && child.nextSibling === null) { //fast lane - replace existing text node //http://jsperf.com/replace-text-vs-reuse child.textContent = content; } else { //slow lane - empty element and insert a text node this.empty(element); element.appendChild(document.createTextNode(content)); } }; } else { //IE8 WalkontableDom.prototype.fastInnerText = function (element, content) { var child = element.firstChild; if (child && child.nodeType === 3 && child.nextSibling === null) { //fast lane - replace existing text node //http://jsperf.com/replace-text-vs-reuse child.data = content; } else { //slow lane - empty element and insert a text node this.empty(element); element.appendChild(document.createTextNode(content)); } }; } /** * Returns true/false depending if element has offset parent * @param elem * @returns {boolean} */ /*if (document.createTextNode('test').textContent) { //STANDARDS WalkontableDom.prototype.hasOffsetParent = function (elem) { return !!elem.offsetParent; } } else { WalkontableDom.prototype.hasOffsetParent = function (elem) { try { if (!elem.offsetParent) { return false; } } catch (e) { return false; //IE8 throws "Unspecified error" when offsetParent is not found - we catch it here } return true; } }*/ /** * Returns true if element is attached to the DOM and visible, false otherwise * @param elem * @returns {boolean} */ WalkontableDom.prototype.isVisible = function (elem) { //fast method according to benchmarks, but requires layout so slow in our case /* if (!WalkontableDom.prototype.hasOffsetParent(elem)) { return false; //fixes problem with UI Bootstrap <tabs> directive } // if (elem.offsetWidth > 0 || (elem.parentNode && elem.parentNode.offsetWidth > 0)) { //IE10 was mistaken here if (elem.offsetWidth > 0) { return true; } */ //slow method var next = elem; while (next !== document.documentElement) { //until <html> reached if (next === null) { //parent detached from DOM return false; } else if (next.nodeType === 11) { //nodeType == 1 -> DOCUMENT_FRAGMENT_NODE if (next.host) { //this is Web Components Shadow DOM //see: http://w3c.github.io/webcomponents/spec/shadow/#encapsulation //according to spec, should be if (next.ownerDocument !== window.document), but that doesn't work yet if (next.host.impl) { //Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features disabled return WalkontableDom.prototype.isVisible(next.host.impl); } else if (next.host) { //Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled return WalkontableDom.prototype.isVisible(next.host); } else { throw new Error("Lost in Web Components world"); } } else { return false; //this is a node detached from document in IE8 } } else if (next.style.display === 'none') { return false; } next = next.parentNode; } return true; }; /** * Returns elements top and left offset relative to the document. In our usage case compatible with jQuery but 2x faster * @param {HTMLElement} elem * @return {Object} */ WalkontableDom.prototype.offset = function (elem) { if (this.hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') { //fixes problem with Firefox ignoring <caption> in TABLE offset (see also WalkontableDom.prototype.outerHeight) //http://jsperf.com/offset-vs-getboundingclientrect/8 var box = elem.getBoundingClientRect(); return { top: box.top + (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0), left: box.left + (window.pageXOffset || document.documentElement.scrollLeft) - (document.documentElement.clientLeft || 0) }; } var offsetLeft = elem.offsetLeft , offsetTop = elem.offsetTop , lastElem = elem; while (elem = elem.offsetParent) { if (elem === document.body) { //from my observation, document.body always has scrollLeft/scrollTop == 0 break; } offsetLeft += elem.offsetLeft; offsetTop += elem.offsetTop; lastElem = elem; } if (lastElem && lastElem.style.position === 'fixed') { //slow - http://jsperf.com/offset-vs-getboundingclientrect/6 //if(lastElem !== document.body) { //faster but does gives false positive in Firefox offsetLeft += window.pageXOffset || document.documentElement.scrollLeft; offsetTop += window.pageYOffset || document.documentElement.scrollTop; } return { left: offsetLeft, top: offsetTop }; }; WalkontableDom.prototype.getComputedStyle = function (elem) { return elem.currentStyle || document.defaultView.getComputedStyle(elem); }; WalkontableDom.prototype.outerWidth = function (elem) { return elem.offsetWidth; }; WalkontableDom.prototype.outerHeight = function (elem) { if (this.hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') { //fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight //jQuery (1.10.1) still has this unsolved //may be better to just switch to getBoundingClientRect //http://bililite.com/blog/2009/03/27/finding-the-size-of-a-table/ //http://lists.w3.org/Archives/Public/www-style/2009Oct/0089.html //http://bugs.jquery.com/ticket/2196 //http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140 return elem.offsetHeight + elem.firstChild.offsetHeight; } else { return elem.offsetHeight; } }; (function () { 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 = '<tr><td>t<br>t</td></tr>'; var CAPTION = document.createElement('CAPTION'); CAPTION.innerHTML = 'c<br>c<br>c<br>c'; CAPTION.style.padding = 0; CAPTION.style.margin = 0; TABLE.insertBefore(CAPTION, TBODY); document.body.appendChild(TABLE); hasCaptionProblem = (TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight); //boolean document.body.removeChild(TABLE); } WalkontableDom.prototype.hasCaptionProblem = function () { if (hasCaptionProblem === void 0) { detectCaptionProblem(); } return hasCaptionProblem; }; /** * Returns caret position in text input * @author http://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea * @return {Number} */ WalkontableDom.prototype.getCaretPosition = function (el) { if (el.selectionStart) { return el.selectionStart; } else if (document.selection) { //IE8 el.focus(); var r = document.selection.createRange(); if (r == null) { return 0; } var re = el.createTextRange(), rc = re.duplicate(); re.moveToBookmark(r.getBookmark()); rc.setEndPoint('EndToStart', re); return rc.text.length; } return 0; }; /** * Sets caret position in text input * @author http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/ * @param {Element} el * @param {Number} pos * @param {Number} endPos */ WalkontableDom.prototype.setCaretPosition = function (el, pos, endPos) { if (endPos === void 0) { endPos = pos; } if (el.setSelectionRange) { el.focus(); el.setSelectionRange(pos, endPos); } else if (el.createTextRange) { //IE8 var range = el.createTextRange(); range.collapse(true); range.moveEnd('character', endPos); range.moveStart('character', pos); range.select(); } }; var cachedScrollbarWidth; //http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes 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); } /** * Returns the computed width of the native browser scroll bar * @return {Number} width */ WalkontableDom.prototype.getScrollbarWidth = function () { if (cachedScrollbarWidth === void 0) { cachedScrollbarWidth = walkontableCalculateScrollbarWidth(); } return cachedScrollbarWidth; } })(); function WalkontableEvent(instance) { var that = this; //reference to instance this.instance = instance; this.wtDom = this.instance.wtDom; var dblClickOrigin = [null, null]; var dblClickTimeout = [null, null]; var onMouseDown = function (event) { var cell = that.parentCell(event.target); if (that.wtDom.hasClass(event.target, 'corner')) { that.instance.getSetting('onCellCornerMouseDown', event, event.target); } else if (cell.TD && cell.TD.nodeName === 'TD') { if (that.instance.hasSetting('onCellMouseDown')) { that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD); } } if (event.button !== 2) { //if not right mouse button if (cell.TD && cell.TD.nodeName === 'TD') { dblClickOrigin[0] = cell.TD; clearTimeout(dblClickTimeout[0]); dblClickTimeout[0] = setTimeout(function () { dblClickOrigin[0] = null; }, 1000); } } }; var lastMouseOver; var onMouseOver = function (event) { if (that.instance.hasSetting('onCellMouseOver')) { var TABLE = that.instance.wtTable.TABLE; var TD = that.wtDom.closest(event.target, ['TD', 'TH'], TABLE); if (TD && TD !== lastMouseOver && that.wtDom.isChildOf(TD, TABLE)) { lastMouseOver = TD; if (TD.nodeName === 'TD') { that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(TD), TD); } } } }; /* var lastMouseOut; var onMouseOut = function (event) { if (that.instance.hasSetting('onCellMouseOut')) { var TABLE = that.instance.wtTable.TABLE; var TD = that.wtDom.closest(event.target, ['TD', 'TH'], TABLE); if (TD && TD !== lastMouseOut && that.wtDom.isChildOf(TD, TABLE)) { lastMouseOut = TD; if (TD.nodeName === 'TD') { that.instance.getSetting('onCellMouseOut', event, that.instance.wtTable.getCoords(TD), TD); } } } };*/ var onMouseUp = function (event) { if (event.button !== 2) { //if not right mouse button var cell = that.parentCell(event.target); if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) { if (that.wtDom.hasClass(event.target, 'corner')) { that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD); } else if (cell.TD) { that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD); } dblClickOrigin[0] = null; dblClickOrigin[1] = null; } else if (cell.TD === dblClickOrigin[0]) { dblClickOrigin[1] = cell.TD; clearTimeout(dblClickTimeout[1]); dblClickTimeout[1] = setTimeout(function () { dblClickOrigin[1] = null; }, 500); } } }; $(this.instance.wtTable.holder).on('mousedown', onMouseDown); $(this.instance.wtTable.TABLE).on('mouseover', onMouseOver); // $(this.instance.wtTable.TABLE).on('mouseout', onMouseOut); $(this.instance.wtTable.holder).on('mouseup', onMouseUp); } WalkontableEvent.prototype.parentCell = function (elem) { var cell = {}; var TABLE = this.instance.wtTable.TABLE; var TD = this.wtDom.closest(elem, ['TD', 'TH'], TABLE); if (TD && this.wtDom.isChildOf(TD, TABLE)) { cell.coords = this.instance.wtTable.getCoords(TD); cell.TD = TD; } else if (this.wtDom.hasClass(elem, 'wtBorder') && this.wtDom.hasClass(elem, 'current')) { cell.coords = this.instance.selections.current.selected[0]; cell.TD = this.instance.wtTable.getCell(cell.coords); } return cell; }; WalkontableEvent.prototype.destroy = function () { clearTimeout(this.dblClickTimeout0); clearTimeout(this.dblClickTimeout1); }; function walkontableRangesIntersect() { var from = arguments[0]; var to = arguments[1]; for (var i = 1, ilen = arguments.length / 2; i < ilen; i++) { if (from <= arguments[2 * i + 1] && to >= arguments[2 * i]) { return true; } } return false; } /** * Generates a random hex string. Used as namespace for Walkontable instance events. * @return {String} - 16 character random string: "92b1bfc74ec4" */ function walkontableRandomString() { function s4() { return Math.floor((1 + Math.random()) * 0x10000) .toString(16) .substring(1); } return s4() + s4() + s4() + s4(); } /** * http://notes.jetienne.com/2011/05/18/cancelRequestAnimFrame-for-paul-irish-requestAnimFrame.html */ window.requestAnimFrame = (function () { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (/* function */ callback, /* DOMElement */ element) { return window.setTimeout(callback, 1000 / 60); }; })(); window.cancelRequestAnimFrame = (function () { return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout })(); //http://snipplr.com/view/13523/ //modified for speed //http://jsperf.com/getcomputedstyle-vs-style-vs-css/8 if (!window.getComputedStyle) { (function () { var elem; var styleObj = { getPropertyValue: function getPropertyValue(prop) { if (prop == 'float') prop = 'styleFloat'; return elem.currentStyle[prop.toUpperCase()] || null; } }; window.getComputedStyle = function (el) { elem = el; return styleObj; } })(); } /** * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim */ if (!String.prototype.trim) { var trimRegex = /^\s+|\s+$/g; String.prototype.trim = function () { return this.replace(trimRegex, ''); }; } /** * WalkontableRowFilter * @constructor */ function WalkontableRowFilter() { } WalkontableRowFilter.prototype = new WalkontableCellFilter(); WalkontableRowFilter.prototype.readSettings = function (instance) { if (instance.cloneOverlay instanceof WalkontableDebugOverlay) { this.offset = 0; } else { this.offset = instance.wtSettings.settings.offsetRow; } this.total = instance.getSetting('totalRows'); this.fixedCount = instance.getSetting('fixedRowsTop'); }; /** * WalkontableRowStrategy * @param containerSizeFn * @param sizeAtIndex * @constructor */ function WalkontableRowStrategy(instance, containerSizeFn, sizeAtIndex) { WalkontableCellStrategy.apply(this, arguments); this.containerSizeFn = containerSizeFn; this.sizeAtIndex = sizeAtIndex; this.cellSizesSum = 0; this.cellSizes = []; this.cellCount = 0; this.remainingSize = -Infinity; } WalkontableRowStrategy.prototype = new WalkontableCellStrategy(); WalkontableRowStrategy.prototype.add = function (i, TD, reverse) { if (!this.isLastIncomplete() && this.remainingSize != 0) { var size = this.sizeAtIndex(i, TD); if (size === void 0) { return false; //total rows exceeded } var containerSize = this.getContainerSize(this.cellSizesSum + size); if (reverse) { this.cellSizes.unshift(size); } else { this.cellSizes.push(size); } this.cellSizesSum += size; this.cellCount++; this.remainingSize = this.cellSizesSum - containerSize; if (reverse && this.isLastIncomplete()) { //something is outside of the screen, maybe even some full rows? return false; } return true; } return false; }; WalkontableRowStrategy.prototype.remove = function () { var size = this.cellSizes.pop(); this.cellSizesSum -= size; this.cellCount--; this.remainingSize -= size; }; WalkontableRowStrategy.prototype.removeOutstanding = function () { while (this.cellCount > 0 && this.cellSizes[this.cellCount - 1] < this.remainingSize) { //this row is completely off screen! this.remove(); } }; function WalkontableScroll(instance) { this.instance = instance; } WalkontableScroll.prototype.scrollVertical = function (delta) { if (!this.instance.drawn) { throw new Error('scrollVertical can only be called after table was drawn to DOM'); } var instance = this.instance , newOffset , offset = instance.getSetting('offsetRow') , fixedCount = instance.getSetting('fixedRowsTop') , total = instance.getSetting('totalRows') , maxSize = instance.wtViewport.getViewportHeight(); if (total > 0) { newOffset = this.scrollLogicVertical(delta, offset, total, fixedCount, maxSize, function (row) { if (row - offset < fixedCount && row - offset >= 0) { return instance.getSetting('rowHeight', row - offset); } else { return instance.getSetting('rowHeight', row); } }, function (isReverse) { instance.wtTable.verticalRenderReverse = isReverse; }); } else { newOffset = 0; } if (newOffset !== offset) { this.instance.wtScrollbars.vertical.scrollTo(newOffset); } return instance; }; WalkontableScroll.prototype.scrollHorizontal = function (delta) { if (!this.instance.drawn) { throw new Error('scrollHorizontal can only be called after table was drawn to DOM'); } var instance = this.instance , newOffset , offset = instance.getSetting('offsetColumn') , fixedCount = instance.getSetting('fixedColumnsLeft') , total = instance.getSetting('totalColumns') , maxSize = instance.wtViewport.getViewportWidth(); if (total > 0) { newOffset = this.scrollLogicHorizontal(delta, offset, total, fixedCount, maxSize, function (col) { if (col - offset < fixedCount && col - offset >= 0) { return instance.getSetting('columnWidth', col - offset); } else { return instance.getSetting('columnWidth', col); } }); } else { newOffset = 0; } if (newOffset !== offset) { this.instance.wtScrollbars.horizontal.scrollTo(newOffset); } return instance; }; WalkontableScroll.prototype.scrollLogicVertical = function (delta, offset, total, fixedCount, maxSize, cellSizeFn, setReverseRenderFn) { var newOffset = offset + delta; if (newOffset >= total - fixedCount) { newOffset = total - fixedCount - 1; setReverseRenderFn(true); } if (newOffset < 0) { newOffset = 0; } return newOffset; }; WalkontableScroll.prototype.scrollLogicHorizontal = function (delta, offset, total, fixedCount, maxSize, cellSizeFn) { var newOffset = offset + delta , sum = 0 , col; if (newOffset > fixedCount) { if (newOffset >= total - fixedCount) { newOffset = total - fixedCount - 1; } col = newOffset; while (sum < maxSize && col < total) { sum += cellSizeFn(col); col++; } if (sum < maxSize) { while (newOffset > 0) { //if sum still less than available width, we cannot scroll that far (must move offset to the left) sum += cellSizeFn(newOffset - 1); if (sum < maxSize) { newOffset--; } else { break; } } } } else if (newOffset < 0) { newOffset = 0; } return newOffset; }; /** * Scrolls viewport to a cell by minimum number of cells */ WalkontableScroll.prototype.scrollViewport = function (coords) { if (!this.instance.drawn) { return; } var offsetRow = this.instance.getSetting('offsetRow') , offsetColumn = this.instance.getSetting('offsetColumn') , lastVisibleRow = this.instance.wtTable.getLastVisibleRow() , totalRows = this.instance.getSetting('totalRows') , totalColumns = this.instance.getSetting('totalColumns') , fixedRowsTop = this.instance.getSetting('fixedRowsTop') , fixedColumnsLeft = this.instance.getSetting('fixedColumnsLeft'); if (this.instance.getSetting('nativeScrollbars')) { var TD = this.instance.wtTable.getCell(coords); if (typeof TD === 'object') { var offset = WalkontableDom.prototype.offset(TD); var outerWidth = WalkontableDom.prototype.outerWidth(TD); var outerHeight = WalkontableDom.prototype.outerHeight(TD); var scrollX = this.instance.wtScrollbars.horizontal.getScrollPosition(); var scrollY = this.instance.wtScrollbars.vertical.getScrollPosition(); var clientWidth = WalkontableDom.prototype.outerWidth(this.instance.wtScrollbars.horizontal.scrollHandler); var clientHeight = WalkontableDom.prototype.outerHeight(this.instance.wtScrollbars.vertical.scrollHandler); if (this.instance.wtScrollbars.horizontal.scrollHandler !== window) { offset.left = offset.left - WalkontableDom.prototype.offset(this.instance.wtScrollbars.horizontal.scrollHandler).left; } if (this.instance.wtScrollbars.vertical.scrollHandler !== window) { offset.top = offset.top - WalkontableDom.prototype.offset(this.instance.wtScrollbars.vertical.scrollHandler).top; } clientWidth -= 20; clientHeight -= 20; if (outerWidth < clientWidth) { if (offset.left < scrollX) { this.instance.wtScrollbars.horizontal.setScrollPosition(offset.left); } else if (offset.left + outerWidth > scrollX + clientWidth) { this.instance.wtScrollbars.horizontal.setScrollPosition(offset.left - clientWidth + outerWidth); } } if (outerHeight < clientHeight) { if (offset.top < scrollY) { this.instance.wtScrollbars.vertical.setScrollPosition(offset.top); } else if (offset.top + outerHeight > scrollY + clientHeight) { this.instance.wtScrollbars.vertical.setScrollPosition(offset.top - clientHeight + outerHeight); } } return; } } if (coords[0] < 0 || coords[0] > totalRows - 1) { throw new Error('row ' + coords[0] + ' does not exist'); } else if (coords[1] < 0 || coords[1] > totalColumns - 1) { throw new Error('column ' + coords[1] + ' does not exist'); } if (coords[0] > lastVisibleRow) { // this.scrollVertical(coords[0] - lastVisibleRow + 1); this.scrollVertical(coords[0] - fixedRowsTop - offsetRow); this.instance.wtTable.verticalRenderReverse = true; } else if (coords[0] === lastVisibleRow && this.instance.wtTable.rowStrategy.isLastIncomplete()) { // this.scrollVertical(coords[0] - lastVisibleRow + 1); this.scrollVertical(coords[0] - fixedRowsTop - offsetRow); this.instance.wtTable.verticalRenderReverse = true; } else if (coords[0] - fixedRowsTop < offsetRow) { this.scrollVertical(coords[0] - fixedRowsTop - offsetRow); } else { this.scrollVertical(0); //Craig's issue: remove row from the last scroll page should scroll viewport a row up if needed } if (this.instance.wtTable.isColumnBeforeViewport(coords[1])) { //scroll left this.instance.wtScrollbars.horizontal.scrollTo(coords[1] - fixedColumnsLeft); } else if (this.instance.wtTable.isColumnAfterViewport(coords[1]) || (this.instance.wtTable.getLastVisibleColumn() === coords[1] && !this.instance.wtTable.isLastColumnFullyVisible())) { //scroll right var sum = 0; for (var i = 0; i < fixedColumnsLeft; i++) { sum += this.instance.getSetting('columnWidth', i); } var scrollTo = coords[1]; sum += this.instance.getSetting('columnWidth', scrollTo); var available = this.instance.wtViewport.getViewportWidth(); if (sum < available) { var next = this.instance.getSetting('columnWidth', scrollTo - 1); while (sum + next <= available && scrollTo >= fixedColumnsLeft) { scrollTo--; sum += next; next = this.instance.getSetting('columnWidth', scrollTo - 1); } } this.instance.wtScrollbars.horizontal.scrollTo(scrollTo - fixedColumnsLeft); } /*else { //no scroll }*/ return this.instance; }; function WalkontableScrollbar() { } WalkontableScrollbar.prototype.init = function () { var that = this; //reference to instance this.$table = $(this.instance.wtTable.TABLE); //create elements this.slider = document.createElement('DIV'); this.sliderStyle = this.slider.style; this.sliderStyle.position = 'absolute'; this.sliderStyle.top = '0'; this.sliderStyle.left = '0'; this.sliderStyle.display = 'none'; this.slider.className = 'dragdealer ' + this.type; this.handle = document.createElement('DIV'); this.handleStyle = this.handle.style; this.handle.className = 'handle'; this.slider.appendChild(this.handle); this.container = this.instance.wtTable.holder; this.container.appendChild(this.slider); var firstRun = true; this.dragTimeout = null; var dragDelta; var dragRender = function () { that.onScroll(dragDelta); }; this.dragdealer = new Dragdealer(this.slider, { vertical: (this.type === 'vertical'), horizontal: (this.type === 'horizontal'), slide: false, speed: 100, animationCallback: function (x, y) { if (firstRun) { firstRun = false; return; } that.skipRefresh = true; dragDelta = that.type === 'vertical' ? y : x; if (that.dragTimeout === null) { that.dragTimeout = setInterval(dragRender, 100); dragRender(); } }, callback: function (x, y) { that.skipRefresh = false; clearInterval(that.dragTimeout); that.dragTimeout = null; dragDelta = that.type === 'vertical' ? y : x; that.onScroll(dragDelta); } }); this.skipRefresh = false; }; WalkontableScrollbar.prototype.onScroll = function (delta) { if (this.instance.drawn) { this.readSettings(); if (this.total > this.visibleCount) { var newOffset = Math.round(this.handlePosition * this.total / this.sliderSize); if (delta === 1) { if (this.type === 'vertical') { this.instance.scrollVertical(Infinity).draw(); } else { this.instance.scrollHorizontal(Infinity).draw(); } } else if (newOffset !== this.offset) { //is new offset different than old offset if (this.type === 'vertical') { this.instance.scrollVertical(newOffset - this.offset).draw(); } else { this.instance.scrollHorizontal(newOffset - this.offset).draw(); } } else { this.refresh(); } } } }; /** * Returns what part of the scroller should the handle take * @param viewportCount {Number} number of visible rows or columns * @param totalCount {Number} total number of rows or columns * @return {Number} 0..1 */ WalkontableScrollbar.prototype.getHandleSizeRatio = function (viewportCount, totalCount) { if (!totalCount || viewportCount > totalCount || viewportCount == totalCount) { return 1; } return 1 / totalCount; }; WalkontableScrollbar.prototype.prepare = function () { if (this.skipRefresh) { return; } var ratio = this.getHandleSizeRatio(this.visibleCount, this.total); if (((ratio === 1 || isNaN(ratio)) && this.scrollMode === 'auto') || this.scrollMode === 'none') { //isNaN is needed because ratio equals NaN when totalRows/totalColumns equals 0 this.visible = false; } else { this.visible = true; } }; WalkontableScrollbar.prototype.refresh = function () { if (this.skipRefresh) { return; } else if (!this.visible) { this.sliderStyle.display = 'none'; return; } var ratio , sliderSize , handleSize , handlePosition , visibleCount = this.visibleCount , tableWidth = this.instance.wtViewport.getWorkspaceWidth() , tableHeight = this.instance.wtViewport.getWorkspaceHeight(); if (tableWidth === Infinity) { tableWidth = this.instance.wtViewport.getWorkspaceActualWidth(); } if (tableHeight === Infinity) { tableHeight = this.instance.wtViewport.getWorkspaceActualHeight(); } if (this.type === 'vertical') { if (this.instance.wtTable.rowStrategy.isLastIncomplete()) { visibleCount--; } sliderSize = tableHeight - 2; //2 is sliders border-width this.sliderStyle.top = this.instance.wtDom.offset(this.$table[0]).top - this.instance.wtDom.offset(this.container).top + 'px'; this.sliderStyle.left = tableWidth - 1 + 'px'; //1 is sliders border-width this.sliderStyle.height = Math.max(sliderSize, 0) + 'px'; } else { //horizontal sliderSize = tableWidth - 2; //2 is sliders border-width this.sliderStyle.left = this.instance.wtDom.offset(this.$table[0]).left - this.instance.wtDom.offset(this.container).left + 'px'; this.sliderStyle.top = tableHeight - 1 + 'px'; //1 is sliders border-width this.sliderStyle.width = Math.max(sliderSize, 0) + 'px'; } ratio = this.getHandleSizeRatio(visibleCount, this.total); handleSize = Math.round(sliderSize * ratio); if (handleSize < 10) { handleSize = 15; } handlePosition = Math.floor(sliderSize * (this.offset / this.total)); if (handleSize + handlePosition > sliderSize) { handlePosition = sliderSize - handleSize; } if (this.type === 'vertical') { this.handleStyle.height = handleSize + 'px'; this.handleStyle.top = handlePosition + 'px'; } else { //horizontal this.handleStyle.width = handleSize + 'px'; this.handleStyle.left = handlePosition + 'px'; } this.sliderStyle.display = 'block'; }; WalkontableScrollbar.prototype.destroy = function () { clearInterval(this.dragdealer.interval); }; /// var WalkontableVerticalScrollbar = function (instance) { this.instance = instance; this.type = 'vertical'; this.init(); }; WalkontableVerticalScrollbar.prototype = new WalkontableScrollbar(); WalkontableVerticalScrollbar.prototype.scrollTo = function (cell) { this.instance.update('offsetRow', cell); }; WalkontableVerticalScrollbar.prototype.readSettings = function () { this.scrollMode = this.instance.getSetting('scrollV'); this.offset = this.instance.getSetting('offsetRow'); this.total = this.instance.getSetting('totalRows'); this.visibleCount = this.instance.wtTable.rowStrategy.countVisible(); if(this.visibleCount > 1 && this.instance.wtTable.rowStrategy.isLastIncomplete()) { this.visibleCount--; } this.handlePosition = parseInt(this.handleStyle.top, 10); this.sliderSize = parseInt(this.sliderStyle.height, 10); this.fixedCount = this.instance.getSetting('fixedRowsTop'); }; /// var WalkontableHorizontalScrollbar = function (instance) { this.instance = instance; this.type = 'horizontal'; this.init(); }; WalkontableHorizontalScrollbar.prototype = new WalkontableScrollbar(); WalkontableHorizontalScrollbar.prototype.scrollTo = function (cell) { this.instance.update('offsetColumn', cell); }; WalkontableHorizontalScrollbar.prototype.readSettings = function () { this.scrollMode = this.instance.getSetting('scrollH'); this.offset = this.instance.getSetting('offsetColumn'); this.total = this.instance.getSetting('totalColumns'); this.visibleCount = this.instance.wtTable.columnStrategy.countVisible(); if(this.visibleCount > 1 && this.instance.wtTable.columnStrategy.isLastIncomplete()) { this.visibleCount--; } this.handlePosition = parseInt(this.handleStyle.left, 10); this.sliderSize = parseInt(this.sliderStyle.width, 10); this.fixedCount = this.instance.getSetting('fixedColumnsLeft'); }; WalkontableHorizontalScrollbar.prototype.getHandleSizeRatio = function (viewportCount, totalCount) { if (!totalCount || viewportCount > totalCount || viewportCount == totalCount) { return 1; } return viewportCount / totalCount; }; function WalkontableCornerScrollbarNative(instance) { this.instance = instance; this.init(); this.clone = this.makeClone('corner'); } WalkontableCornerScrollbarNative.prototype = new WalkontableOverlay(); WalkontableCornerScrollbarNative.prototype.resetFixedPosition = function () { if (!this.instance.wtTable.holder.parentNode) { return; //removed from DOM } var elem = this.clone.wtTable.holder.parentNode; var box; if (this.scrollHandler === window) { box = this.instance.wtTable.hider.getBoundingClientRect(); var top = Math.ceil(box.top, 10); var bottom = Math.ceil(box.bottom, 10); if (top < 0 && bottom > 0) { elem.style.top = '0'; } else { elem.style.top = top + 'px'; } var left = Math.ceil(box.left, 10); var right = Math.ceil(box.right, 10); if (left < 0 && right > 0) { elem.style.left = '0'; } else { elem.style.left = left + 'px'; } } else { box = this.scrollHandler.getBoundingClientRect(); elem.style.top = Math.ceil(box.top, 10) + 'px'; elem.style.left = Math.ceil(box.left, 10) + 'px'; } elem.style.width = WalkontableDom.prototype.outerWidth(this.clone.wtTable.TABLE) + 4 + 'px'; elem.style.height = WalkontableDom.prototype.outerHeight(this.clone.wtTable.TABLE) + 4 + 'px'; }; WalkontableCornerScrollbarNative.prototype.prepare = function () { }; WalkontableCornerScrollbarNative.prototype.refresh = function (selectionsOnly) { this.measureBefore = 0; this.measureAfter = 0; this.clone && this.clone.draw(selectionsOnly); }; WalkontableCornerScrollbarNative.prototype.getScrollPosition = function () { }; WalkontableCornerScrollbarNative.prototype.getLastCell = function () { }; WalkontableCornerScrollbarNative.prototype.applyToDOM = function () { }; WalkontableCornerScrollbarNative.prototype.scrollTo = function () { }; WalkontableCornerScrollbarNative.prototype.readWindowSize = function () { }; WalkontableCornerScrollbarNative.prototype.readSettings = function () { }; function WalkontableHorizontalScrollbarNative(instance) { this.instance = instance; this.type = 'horizontal'; this.cellSize = 50; this.init(); this.clone = this.makeClone('left'); } WalkontableHorizontalScrollbarNative.prototype = new WalkontableOverlay(); //resetFixedPosition (in future merge it with this.refresh?) WalkontableHorizontalScrollbarNative.prototype.resetFixedPosition = function () { if (!this.instance.wtTable.holder.parentNode) { return; //removed from DOM } var elem = this.clone.wtTable.holder.parentNode; var box; if (this.scrollHandler === window) { box = this.instance.wtTable.hider.getBoundingClientRect(); var left = Math.ceil(box.left, 10); var right = Math.ceil(box.right, 10); if (left < 0 && right > 0) { elem.style.left = '0'; } else { elem.style.left = left + 'px'; } } else { box = this.scrollHandler.getBoundingClientRect(); elem.style.top = Math.ceil(box.top, 10) + 'px'; elem.style.left = Math.ceil(box.left, 10) + 'px'; } }; //react on movement of the other dimension scrollbar (in future merge it with this.refresh?) WalkontableHorizontalScrollbarNative.prototype.react = function () { if (!this.instance.wtTable.holder.parentNode) { return; //removed from DOM } var overlayContainer = this.clone.wtTable.holder.parentNode; if (this.instance.wtScrollbars.vertical.scrollHandler === window) { var box = this.instance.wtTable.hider.getBoundingClientRect(); overlayContainer.style.top = Math.ceil(box.top, 10) + 'px'; overlayContainer.style.height = WalkontableDom.prototype.outerHeight(this.clone.wtTable.TABLE) + 'px'; } else { this.clone.wtTable.holder.style.top = -(this.instance.wtScrollbars.vertical.windowScrollPosition - this.instance.wtScrollbars.vertical.measureBefore) + 'px'; overlayContainer.style.height = this.instance.wtViewport.getWorkspaceHeight() + 'px' } overlayContainer.style.width = WalkontableDom.prototype.outerWidth(this.clone.wtTable.TABLE) + 4 + 'px'; //4 is for the box shadow }; WalkontableHorizontalScrollbarNative.prototype.prepare = function () { }; WalkontableHorizontalScrollbarNative.prototype.refresh = function (selectionsOnly) { this.measureBefore = 0; this.measureAfter = 0; this.clone && this.clone.draw(selectionsOnly); }; WalkontableHorizontalScrollbarNative.prototype.getScrollPosition = function () { if (this.scrollHandler === window) { return this.scrollHandler.scrollX; } else { return this.scrollHandler.scrollLeft; } }; WalkontableHorizontalScrollbarNative.prototype.setScrollPosition = function (pos) { this.scrollHandler.scrollLeft = pos; }; WalkontableHorizontalScrollbarNative.prototype.onScroll = function () { WalkontableOverlay.prototype.onScroll.apply(this, arguments); this.instance.getSetting('onScrollHorizontally'); }; WalkontableHorizontalScrollbarNative.prototype.getLastCell = function () { return this.instance.wtTable.getLastVisibleColumn(); }; //applyToDOM (in future merge it with this.refresh?) WalkontableHorizontalScrollbarNative.prototype.applyToDOM = function () { this.fixedContainer.style.paddingLeft = this.measureBefore + 'px'; this.fixedContainer.style.paddingRight = this.measureAfter + 'px'; }; WalkontableHorizontalScrollbarNative.prototype.scrollTo = function (cell) { this.$scrollHandler.scrollLeft(this.tableParentOffset + cell * this.cellSize); }; //readWindowSize (in future merge it with this.prepare?) WalkontableHorizontalScrollbarNative.prototype.readWindowSize = function () { if (this.scrollHandler === window) { this.windowSize = document.documentElement.clientWidth; this.tableParentOffset = this.instance.wtTable.holderOffset.left; } else { this.windowSize = WalkontableDom.prototype.outerWidth(this.scrollHandler); this.tableParentOffset = 0; } this.windowScrollPosition = this.getScrollPosition(); }; //readSettings (in future merge it with this.prepare?) WalkontableHorizontalScrollbarNative.prototype.readSettings = function () { this.offset = this.instance.getSetting('offsetColumn'); this.total = this.instance.getSetting('totalColumns'); }; function WalkontableVerticalScrollbarNative(instance) { this.instance = instance; this.type = 'vertical'; this.cellSize = 23; this.init(); this.clone = this.makeClone('top'); } WalkontableVerticalScrollbarNative.prototype = new WalkontableOverlay(); //resetFixedPosition (in future merge it with this.refresh?) WalkontableVerticalScrollbarNative.prototype.resetFixedPosition = function () { if (!this.instance.wtTable.holder.parentNode) { return; //removed from DOM } var elem = this.clone.wtTable.holder.parentNode; var box; if (this.scrollHandler === window) { box = this.instance.wtTable.hider.getBoundingClientRect(); var top = Math.ceil(box.top, 10); var bottom = Math.ceil(box.bottom, 10); if (top < 0 && bottom > 0) { elem.style.top = '0'; } else { elem.style.top = top + 'px'; } } else { box = this.instance.wtScrollbars.horizontal.scrollHandler.getBoundingClientRect(); elem.style.top = Math.ceil(box.top, 10) + 'px'; elem.style.left = Math.ceil(box.left, 10) + 'px'; } if (this.instance.wtScrollbars.horizontal.scrollHandler === window) { elem.style.width = this.instance.wtViewport.getWorkspaceActualWidth() + 'px'; } else { elem.style.width = WalkontableDom.prototype.outerWidth(this.instance.wtTable.holder.parentNode) + 'px'; } elem.style.height = WalkontableDom.prototype.outerHeight(this.clone.wtTable.TABLE) + 4 + 'px'; }; //react on movement of the other dimension scrollbar (in future merge it with this.refresh?) WalkontableVerticalScrollbarNative.prototype.react = function () { if (!this.instance.wtTable.holder.parentNode) { return; //removed from DOM } if (this.instance.wtScrollbars.horizontal.scrollHandler !== window) { var elem = this.clone.wtTable.holder.parentNode; elem.firstChild.style.left = -this.instance.wtScrollbars.horizontal.windowScrollPosition + 'px'; } }; WalkontableVerticalScrollbarNative.prototype.getScrollPosition = function () { if (this.scrollHandler === window) { return this.scrollHandler.scrollY; } else { return this.scrollHandler.scrollTop; } }; WalkontableVerticalScrollbarNative.prototype.setScrollPosition = function (pos) { this.scrollHandler.scrollTop = pos; }; WalkontableVerticalScrollbarNative.prototype.onScroll = function (forcePosition) { WalkontableOverlay.prototype.onScroll.apply(this, arguments); var scrollDelta; var newOffset = 0; if (1 == 1 || this.windowScrollPosition > this.tableParentOffset) { scrollDelta = this.windowScrollPosition - this.tableParentOffset; partialOffset = 0; if (scrollDelta > 0) { var sum = 0; var last; for (var i = 0; i < this.total; i++) { last = this.instance.getSetting('rowHeight', i); sum += last; if (sum > scrollDelta) { break; } } if (this.offset > 0) { partialOffset = (sum - scrollDelta); } newOffset = i; newOffset = Math.min(newOffset, this.total); } } this.curOuts = newOffset > this.maxOuts ? this.maxOuts : newOffset; newOffset -= this.curOuts; this.instance.update('offsetRow', newOffset); this.readSettings(); //read new offset this.instance.draw(); this.instance.getSetting('onScrollVertically'); }; WalkontableVerticalScrollbarNative.prototype.getLastCell = function () { return this.instance.getSetting('offsetRow') + this.instance.wtTable.tbodyChildrenLength - 1; }; var partialOffset = 0; WalkontableVerticalScrollbarNative.prototype.sumCellSizes = function (from, length) { var sum = 0; while (from < length) { sum += this.instance.getSetting('rowHeight', from); from++; } return sum; }; //applyToDOM (in future merge it with this.refresh?) WalkontableVerticalScrollbarNative.prototype.applyToDOM = function () { var headerSize = this.instance.wtViewport.getColumnHeaderHeight(); this.fixedContainer.style.height = headerSize + this.sumCellSizes(0, this.total) + 4 + 'px'; //+4 is needed, otherwise vertical scroll appears in Chrome (window scroll mode) - maybe because of fill handle in last row or because of box shadow this.fixed.style.top = this.measureBefore + 'px'; this.fixed.style.bottom = ''; }; WalkontableVerticalScrollbarNative.prototype.scrollTo = function (cell) { var newY = this.tableParentOffset + cell * this.cellSize; this.$scrollHandler.scrollTop(newY); this.onScroll(newY); }; //readWindowSize (in future merge it with this.prepare?) WalkontableVerticalScrollbarNative.prototype.readWindowSize = function () { if (this.scrollHandler === window) { this.windowSize = document.documentElement.clientHeight; this.tableParentOffset = this.instance.wtTable.holderOffset.top; } else { //this.windowSize = WalkontableDom.prototype.outerHeight(this.scrollHandler); this.windowSize = this.scrollHandler.clientHeight; //returns height without DIV scrollbar this.tableParentOffset = 0; } this.windowScrollPosition = this.getScrollPosition(); }; //readSettings (in future merge it with this.prepare?) WalkontableVerticalScrollbarNative.prototype.readSettings = function () { this.offset = this.instance.getSetting('offsetRow'); this.total = this.instance.getSetting('totalRows'); }; function WalkontableScrollbars(instance) { this.instance = instance; if (instance.getSetting('nativeScrollbars')) { instance.update('scrollbarWidth', instance.wtDom.getScrollbarWidth()); instance.update('scrollbarHeight', instance.wtDom.getScrollbarWidth()); this.vertical = new WalkontableVerticalScrollbarNative(instance); this.horizontal = new WalkontableHorizontalScrollbarNative(instance); this.corner = new WalkontableCornerScrollbarNative(instance); if (instance.getSetting('debug')) { this.debug = new WalkontableDebugOverlay(instance); } this.registerListeners(); } else { this.vertical = new WalkontableVerticalScrollbar(instance); this.horizontal = new WalkontableHorizontalScrollbar(instance); } } WalkontableScrollbars.prototype.registerListeners = function () { var that = this; var oldVerticalScrollPosition , oldHorizontalScrollPosition , oldBoxTop , oldBoxLeft , oldBoxWidth , oldBoxHeight; function refreshAll() { if (!that.instance.wtTable.holder.parentNode) { //Walkontable was detached from DOM, but this handler was not removed that.destroy(); return; } that.vertical.windowScrollPosition = that.vertical.getScrollPosition(); that.horizontal.windowScrollPosition = that.horizontal.getScrollPosition(); that.box = that.instance.wtTable.hider.getBoundingClientRect(); if((that.box.width !== oldBoxWidth || that.box.height !== oldBoxHeight) && that.instance.rowHeightCache) { //that.instance.rowHeightCache.length = 0; //at this point the cached row heights may be invalid, but it is better not to reset the cache, which could cause scrollbar jumping when there are multiline cells outside of the rendered part of the table oldBoxWidth = that.box.width; oldBoxHeight = that.box.height; that.instance.draw(); } if (that.vertical.windowScrollPosition !== oldVerticalScrollPosition || that.horizontal.windowScrollPosition !== oldHorizontalScrollPosition || that.box.top !== oldBoxTop || that.box.left !== oldBoxLeft) { that.vertical.onScroll(); that.horizontal.onScroll(); //it's done here to make sure that all onScroll's are executed before changing styles that.vertical.react(); that.horizontal.react(); //it's done here to make sure that all onScroll's are executed before changing styles oldVerticalScrollPosition = that.vertical.windowScrollPosition; oldHorizontalScrollPosition = that.horizontal.windowScrollPosition; oldBoxTop = that.box.top; oldBoxLeft = that.box.left; } } var $window = $(window); this.vertical.$scrollHandler.on('scroll.' + this.instance.guid, refreshAll); if (this.vertical.scrollHandler !== this.horizontal.scrollHandler) { this.horizontal.$scrollHandler.on('scroll.' + this.instance.guid, refreshAll); } if (this.vertical.scrollHandler !== window && this.horizontal.scrollHandler !== window) { $window.on('scroll.' + this.instance.guid, refreshAll); } $window.on('load.' + this.instance.guid, refreshAll); $window.on('resize.' + this.instance.guid, refreshAll); $(document).on('ready.' + this.instance.guid, refreshAll); setInterval(refreshAll, 100); //Marcin - only idea I have to reposition scrollbars on CSS change of the container (container was moved using some styles after page was loaded) }; WalkontableScrollbars.prototype.destroy = function () { this.vertical && this.vertical.destroy(); this.horizontal && this.horizontal.destroy(); }; WalkontableScrollbars.prototype.refresh = function (selectionsOnly) { this.horizontal && this.horizontal.readSettings(); this.vertical && this.vertical.readSettings(); this.horizontal && this.horizontal.prepare(); this.vertical && this.vertical.prepare(); this.horizontal && this.horizontal.refresh(selectionsOnly); this.vertical && this.vertical.refresh(selectionsOnly); this.corner && this.corner.refresh(selectionsOnly); this.debug && this.debug.refresh(selectionsOnly); }; function WalkontableSelection(instance, settings) { this.instance = instance; this.settings = settings; this.selected = []; if (settings.border) { this.border = new WalkontableBorder(instance, settings); } } WalkontableSelection.prototype.add = function (coords) { this.selected.push(coords); }; WalkontableSelection.prototype.clear = function () { this.selected.length = 0; //http://jsperf.com/clear-arrayxxx }; /** * Returns the top left (TL) and bottom right (BR) selection coordinates * @returns {Object} */ WalkontableSelection.prototype.getCorners = function () { var minRow , minColumn , maxRow , maxColumn , i , ilen = this.selected.length; if (ilen > 0) { minRow = maxRow = this.selected[0][0]; minColumn = maxColumn = this.selected[0][1]; if (ilen > 1) { for (i = 1; i < ilen; i++) { if (this.selected[i][0] < minRow) { minRow = this.selected[i][0]; } else if (this.selected[i][0] > maxRow) { maxRow = this.selected[i][0]; } if (this.selected[i][1] < minColumn) { minColumn = this.selected[i][1]; } else if (this.selected[i][1] > maxColumn) { maxColumn = this.selected[i][1]; } } } } return [minRow, minColumn, maxRow, maxColumn]; }; WalkontableSelection.prototype.draw = function () { var corners, r, c, source_r, source_c; var visibleRows = this.instance.wtTable.rowStrategy.countVisible() , visibleColumns = this.instance.wtTable.columnStrategy.countVisible(); if (this.selected.length) { corners = this.getCorners(); for (r = 0; r < visibleRows; r++) { for (c = 0; c < visibleColumns; c++) { source_r = this.instance.wtTable.rowFilter.visibleToSource(r); source_c = this.instance.wtTable.columnFilter.visibleToSource(c); if (source_r >= corners[0] && source_r <= corners[2] && source_c >= corners[1] && source_c <= corners[3]) { //selected cell this.instance.wtTable.currentCellCache.add(r, c, this.settings.className); } else if (source_r >= corners[0] && source_r <= corners[2]) { //selection is in this row this.instance.wtTable.currentCellCache.add(r, c, this.settings.highlightRowClassName); } else if (source_c >= corners[1] && source_c <= corners[3]) { //selection is in this column this.instance.wtTable.currentCellCache.add(r, c, this.settings.highlightColumnClassName); } } } this.border && this.border.appear(corners); //warning! border.appear modifies corners! } else { this.border && this.border.disappear(); } }; function WalkontableSettings(instance, settings) { var that = this; this.instance = instance; //default settings. void 0 means it is required, null means it can be empty this.defaults = { table: void 0, debug: false, //shows WalkontableDebugOverlay //presentation mode scrollH: 'auto', //values: scroll (always show scrollbar), auto (show scrollbar if table does not fit in the container), none (never show scrollbar) scrollV: 'auto', //values: see above nativeScrollbars: false, //values: false (dragdealer), true (native) stretchH: 'hybrid', //values: hybrid, all, last, none currentRowClassName: null, currentColumnClassName: null, //data source data: void 0, offsetRow: 0, offsetColumn: 0, fixedColumnsLeft: 0, fixedRowsTop: 0, rowHeaders: function () { return [] }, //this must be array of functions: [function (row, TH) {}] columnHeaders: function () { return [] }, //this must be array of functions: [function (column, TH) {}] totalRows: void 0, totalColumns: void 0, width: null, height: null, cellRenderer: function (row, column, TD) { var cellData = that.getSetting('data', row, column); that.instance.wtDom.fastInnerText(TD, cellData === void 0 || cellData === null ? '' : cellData); }, columnWidth: 50, selections: null, hideBorderOnMouseDownOver: false, //callbacks onCellMouseDown: null, onCellMouseOver: null, // onCellMouseOut: null, onCellDblClick: null, onCellCornerMouseDown: null, onCellCornerDblClick: null, beforeDraw: null, onDraw: null, onScrollVertically: null, onScrollHorizontally: null, //constants scrollbarWidth: 10, scrollbarHeight: 10 }; //reference to settings 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]; } } } } /** * generic methods */ WalkontableSettings.prototype.update = function (settings, value) { if (value === void 0) { //settings is object for (var i in settings) { if (settings.hasOwnProperty(i)) { this.settings[i] = settings[i]; } } } else { //if value is defined then settings is the key this.settings[settings] = value; } return this.instance; }; WalkontableSettings.prototype.getSetting = function (key, param1, param2, param3) { if (this[key]) { return this[key](param1, param2, param3); } else { return this._getSetting(key, param1, param2, param3); } }; WalkontableSettings.prototype._getSetting = function (key, param1, param2, param3) { if (typeof this.settings[key] === 'function') { return this.settings[key](param1, param2, param3); } else if (param1 !== void 0 && Object.prototype.toString.call(this.settings[key]) === '[object Array]') { return this.settings[key][param1]; } else { return this.settings[key]; } }; WalkontableSettings.prototype.has = function (key) { return !!this.settings[key] }; /** * specific methods */ WalkontableSettings.prototype.rowHeight = function (row, TD) { if (!this.instance.rowHeightCache) { this.instance.rowHeightCache = []; //hack. This cache is being invalidated in WOT core.js } if (this.instance.rowHeightCache[row] === void 0) { var size = 23; //guess if (TD) { size = this.instance.wtDom.outerHeight(TD); //measure this.instance.rowHeightCache[row] = size; //cache only something we measured } return size; } else { return this.instance.rowHeightCache[row]; } }; function WalkontableTable(instance, table) { //reference to instance this.instance = instance; this.TABLE = table; this.wtDom = this.instance.wtDom; this.wtDom.removeTextNodes(this.TABLE); //wtSpreader var parent = this.TABLE.parentNode; if (!parent || parent.nodeType !== 1 || !this.wtDom.hasClass(parent, 'wtHolder')) { var spreader = document.createElement('DIV'); spreader.className = 'wtSpreader'; if (parent) { parent.insertBefore(spreader, this.TABLE); //if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it } spreader.appendChild(this.TABLE); } this.spreader = this.TABLE.parentNode; //wtHider parent = this.spreader.parentNode; if (!parent || parent.nodeType !== 1 || !this.wtDom.hasClass(parent, 'wtHolder')) { var hider = document.createElement('DIV'); hider.className = 'wtHider'; if (parent) { parent.insertBefore(hider, this.spreader); //if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it } hider.appendChild(this.spreader); } this.hider = this.spreader.parentNode; this.hiderStyle = this.hider.style; this.hiderStyle.position = 'relative'; //wtHolder parent = this.hider.parentNode; if (!parent || parent.nodeType !== 1 || !this.wtDom.hasClass(parent, 'wtHolder')) { var holder = document.createElement('DIV'); holder.style.position = 'relative'; holder.className = 'wtHolder'; if (parent) { parent.insertBefore(holder, this.hider); //if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it } holder.appendChild(this.hider); } this.holder = this.hider.parentNode; //bootstrap from settings this.TBODY = this.TABLE.getElementsByTagName('TBODY')[0]; if (!this.TBODY) { this.TBODY = document.createElement('TBODY'); this.TABLE.appendChild(this.TBODY); } this.THEAD = this.TABLE.getElementsByTagName('THEAD')[0]; if (!this.THEAD) { this.THEAD = document.createElement('THEAD'); this.TABLE.insertBefore(this.THEAD, this.TBODY); } this.COLGROUP = this.TABLE.getElementsByTagName('COLGROUP')[0]; if (!this.COLGROUP) { this.COLGROUP = document.createElement('COLGROUP'); this.TABLE.insertBefore(this.COLGROUP, this.THEAD); } if (this.instance.getSetting('columnHeaders').length) { if (!this.THEAD.childNodes.length) { var TR = document.createElement('TR'); this.THEAD.appendChild(TR); } } this.colgroupChildrenLength = this.COLGROUP.childNodes.length; this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0; this.tbodyChildrenLength = this.TBODY.childNodes.length; this.oldCellCache = new WalkontableClassNameCache(); this.currentCellCache = new WalkontableClassNameCache(); this.rowFilter = new WalkontableRowFilter(); this.columnFilter = new WalkontableColumnFilter(); this.verticalRenderReverse = false; } WalkontableTable.prototype.refreshHiderDimensions = function () { var height = this.instance.wtViewport.getWorkspaceHeight(); var width = this.instance.wtViewport.getWorkspaceWidth(); var spreaderStyle = this.spreader.style; if ((height !== Infinity || width !== Infinity) && !this.instance.getSetting('nativeScrollbars')) { if (height === Infinity) { height = this.instance.wtViewport.getWorkspaceActualHeight(); } if (width === Infinity) { width = this.instance.wtViewport.getWorkspaceActualWidth(); } this.hiderStyle.overflow = 'hidden'; spreaderStyle.position = 'absolute'; spreaderStyle.top = '0'; spreaderStyle.left = '0'; if (!this.instance.getSetting('nativeScrollbars')) { spreaderStyle.height = '4000px'; spreaderStyle.width = '4000px'; } if (height < 0) { //this happens with WalkontableOverlay and causes "Invalid argument" error in IE8 height = 0; } this.hiderStyle.height = height + 'px'; this.hiderStyle.width = width + 'px'; } else { spreaderStyle.position = 'relative'; spreaderStyle.width = 'auto'; spreaderStyle.height = 'auto'; } }; WalkontableTable.prototype.refreshStretching = function () { if (this.instance.cloneSource) { return; } var instance = this.instance , stretchH = instance.getSetting('stretchH') , totalRows = instance.getSetting('totalRows') , totalColumns = instance.getSetting('totalColumns') , offsetColumn = instance.getSetting('offsetColumn'); var containerWidthFn = function (cacheWidth) { var viewportWidth = that.instance.wtViewport.getViewportWidth(cacheWidth); if (viewportWidth < cacheWidth && that.instance.getSetting('nativeScrollbars')) { return Infinity; //disable stretching when viewport is bigger than sum of the cell widths } return viewportWidth; }; var that = this; var columnWidthFn = function (i) { var source_c = that.columnFilter.visibleToSource(i); if (source_c < totalColumns) { return instance.getSetting('columnWidth', source_c); } }; if (stretchH === 'hybrid') { if (offsetColumn > 0) { stretchH = 'last'; } else { stretchH = 'none'; } } var containerHeightFn = function (cacheHeight) { if (that.instance.getSetting('nativeScrollbars')) { if (that.instance.cloneOverlay instanceof WalkontableDebugOverlay) { return Infinity; } else { return 2 * that.instance.wtViewport.getViewportHeight(cacheHeight); } } return that.instance.wtViewport.getViewportHeight(cacheHeight); }; var rowHeightFn = function (i, TD) { if (that.instance.getSetting('nativeScrollbars')) { return 20; } var source_r = that.rowFilter.visibleToSource(i); if (source_r < totalRows) { if (that.verticalRenderReverse && i === 0) { return that.instance.getSetting('rowHeight', source_r, TD) - 1; } else { return that.instance.getSetting('rowHeight', source_r, TD); } } }; this.columnStrategy = new WalkontableColumnStrategy(instance, containerWidthFn, columnWidthFn, stretchH); this.rowStrategy = new WalkontableRowStrategy(instance, containerHeightFn, rowHeightFn); }; WalkontableTable.prototype.adjustAvailableNodes = function () { var displayTds , rowHeaders = this.instance.getSetting('rowHeaders') , displayThs = rowHeaders.length , columnHeaders = this.instance.getSetting('columnHeaders') , TR , TD , c; //adjust COLGROUP while (this.colgroupChildrenLength < displayThs) { this.COLGROUP.appendChild(document.createElement('COL')); this.colgroupChildrenLength++; } this.refreshStretching(); //actually it is wrong position because it assumes rowHeader would be always 50px wide (because we measure before it is filled with text). TODO: debug if (this.instance.cloneSource && (this.instance.cloneOverlay instanceof WalkontableHorizontalScrollbarNative || this.instance.cloneOverlay instanceof WalkontableCornerScrollbarNative)) { displayTds = this.instance.getSetting('fixedColumnsLeft'); } else { displayTds = this.columnStrategy.cellCount; } //adjust COLGROUP while (this.colgroupChildrenLength < displayTds + displayThs) { this.COLGROUP.appendChild(document.createElement('COL')); this.colgroupChildrenLength++; } while (this.colgroupChildrenLength > displayTds + displayThs) { this.COLGROUP.removeChild(this.COLGROUP.lastChild); this.colgroupChildrenLength--; } //adjust THEAD TR = this.THEAD.firstChild; if (columnHeaders.length) { if (!TR) { TR = document.createElement('TR'); this.THEAD.appendChild(TR); } this.theadChildrenLength = TR.childNodes.length; while (this.theadChildrenLength < displayTds + displayThs) { TR.appendChild(document.createElement('TH')); this.theadChildrenLength++; } while (this.theadChildrenLength > displayTds + displayThs) { TR.removeChild(TR.lastChild); this.theadChildrenLength--; } } else if (TR) { this.wtDom.empty(TR); } //draw COLGROUP for (c = 0; c < this.colgroupChildrenLength; c++) { if (c < displayThs) { this.wtDom.addClass(this.COLGROUP.childNodes[c], 'rowHeader'); } else { this.wtDom.removeClass(this.COLGROUP.childNodes[c], 'rowHeader'); } } //draw THEAD if (columnHeaders.length) { TR = this.THEAD.firstChild; if (displayThs) { TD = TR.firstChild; //actually it is TH but let's reuse single variable for (c = 0; c < displayThs; c++) { rowHeaders[c](-displayThs + c, TD); TD = TD.nextSibling; } } } for (c = 0; c < displayTds; c++) { if (columnHeaders.length) { columnHeaders[0](this.columnFilter.visibleToSource(c), TR.childNodes[displayThs + c]); } } }; WalkontableTable.prototype.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--; } }; WalkontableTable.prototype.draw = function (selectionsOnly) { if (this.instance.getSetting('nativeScrollbars')) { this.verticalRenderReverse = false; //this is only supported in dragdealer mode, not in native } this.rowFilter.readSettings(this.instance); this.columnFilter.readSettings(this.instance); if (!selectionsOnly) { if (this.instance.getSetting('nativeScrollbars')) { if (this.instance.cloneSource) { this.tableOffset = this.instance.cloneSource.wtTable.tableOffset; } else { this.holderOffset = this.wtDom.offset(this.holder); this.tableOffset = this.wtDom.offset(this.TABLE); this.instance.wtScrollbars.vertical.readWindowSize(); this.instance.wtScrollbars.horizontal.readWindowSize(); this.instance.wtViewport.resetSettings(); } } else { this.tableOffset = this.wtDom.offset(this.TABLE); this.instance.wtViewport.resetSettings(); } this._doDraw(); } else { this.instance.wtScrollbars && this.instance.wtScrollbars.refresh(true); } this.refreshPositions(selectionsOnly); if (!selectionsOnly) { if (this.instance.getSetting('nativeScrollbars')) { if (!this.instance.cloneSource) { this.instance.wtScrollbars.vertical.resetFixedPosition(); this.instance.wtScrollbars.horizontal.resetFixedPosition(); this.instance.wtScrollbars.corner.resetFixedPosition(); this.instance.wtScrollbars.debug && this.instance.wtScrollbars.debug.resetFixedPosition(); } } } this.instance.drawn = true; return this; }; WalkontableTable.prototype._doDraw = function () { var r = 0 , source_r , c , source_c , offsetRow = this.instance.getSetting('offsetRow') , totalRows = this.instance.getSetting('totalRows') , totalColumns = this.instance.getSetting('totalColumns') , displayTds , rowHeaders = this.instance.getSetting('rowHeaders') , displayThs = rowHeaders.length , TR , TD , TH , adjusted = false , workspaceWidth , mustBeInViewport , res; if (this.verticalRenderReverse) { mustBeInViewport = offsetRow; } var noPartial = false; if (this.verticalRenderReverse) { if (offsetRow === totalRows - this.rowFilter.fixedCount - 1) { noPartial = true; } else { this.instance.update('offsetRow', offsetRow + 1); //if we are scrolling reverse this.rowFilter.readSettings(this.instance); } } if (this.instance.cloneSource) { this.columnStrategy = this.instance.cloneSource.wtTable.columnStrategy; this.rowStrategy = this.instance.cloneSource.wtTable.rowStrategy; } //draw TBODY if (totalColumns > 0) { source_r = this.rowFilter.visibleToSource(r); var fixedRowsTop = this.instance.getSetting('fixedRowsTop'); var cloneLimit; if (this.instance.cloneSource) { //must be run after adjustAvailableNodes because otherwise this.rowStrategy is not yet defined if (this.instance.cloneOverlay instanceof WalkontableVerticalScrollbarNative || this.instance.cloneOverlay instanceof WalkontableCornerScrollbarNative) { cloneLimit = fixedRowsTop; } else if (this.instance.cloneOverlay instanceof WalkontableHorizontalScrollbarNative) { cloneLimit = this.rowStrategy.countVisible(); } //else if WalkontableDebugOverlay do nothing. No cloneLimit means render ALL rows } this.adjustAvailableNodes(); adjusted = true; if (this.instance.cloneSource && (this.instance.cloneOverlay instanceof WalkontableHorizontalScrollbarNative || this.instance.cloneOverlay instanceof WalkontableCornerScrollbarNative)) { displayTds = this.instance.getSetting('fixedColumnsLeft'); } else { displayTds = this.columnStrategy.cellCount; } if (!this.instance.cloneSource) { workspaceWidth = this.instance.wtViewport.getWorkspaceWidth(); this.columnStrategy.stretch(); } for (c = 0; c < displayTds; c++) { this.COLGROUP.childNodes[c + displayThs].style.width = this.columnStrategy.getSize(c) + 'px'; } while (source_r < totalRows && source_r >= 0) { if (r > 1000) { throw new Error('Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars.'); } if (cloneLimit !== void 0 && r === cloneLimit) { break; //we have as much rows as needed for this clone } if (r >= this.tbodyChildrenLength || (this.verticalRenderReverse && r >= this.rowFilter.fixedCount)) { TR = document.createElement('TR'); for (c = 0; c < displayThs; c++) { TR.appendChild(document.createElement('TH')); } if (this.verticalRenderReverse && r >= this.rowFilter.fixedCount) { this.TBODY.insertBefore(TR, this.TBODY.childNodes[this.rowFilter.fixedCount] || this.TBODY.firstChild); } else { this.TBODY.appendChild(TR); } this.tbodyChildrenLength++; } else if (r === 0) { TR = this.TBODY.firstChild; } else { TR = TR.nextSibling; //http://jsperf.com/nextsibling-vs-indexed-childnodes } //TH TH = TR.firstChild; for (c = 0; c < displayThs; c++) { //If the number of row headers increased we need to replace TD with TH if (TH.nodeName == 'TD') { TD = TH; TH = document.createElement('TH'); TR.insertBefore(TH, TD); TR.removeChild(TD); } rowHeaders[c](source_r, TH); //actually TH TH = TH.nextSibling; //http://jsperf.com/nextsibling-vs-indexed-childnodes } this.adjustColumns(TR, displayTds + displayThs); for (c = 0; c < displayTds; c++) { source_c = this.columnFilter.visibleToSource(c); if (c === 0) { TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(source_c)]; } else { TD = TD.nextSibling; //http://jsperf.com/nextsibling-vs-indexed-childnodes } //If the number of headers has been reduced, we need to replace excess TH with TD if (TD.nodeName == 'TH') { TH = TD; TD = document.createElement('TD'); TR.insertBefore(TD, TH); TR.removeChild(TH); } TD.className = ''; TD.removeAttribute('style'); this.instance.getSetting('cellRenderer', source_r, source_c, TD); } offsetRow = this.instance.getSetting('offsetRow'); //refresh the value //after last column is rendered, check if last cell is fully displayed if (this.verticalRenderReverse && noPartial) { if (-this.wtDom.outerHeight(TR.firstChild) < this.rowStrategy.remainingSize) { this.TBODY.removeChild(TR); this.instance.update('offsetRow', offsetRow + 1); this.tbodyChildrenLength--; this.rowFilter.readSettings(this.instance); break; } else if (!this.instance.cloneSource) { res = this.rowStrategy.add(r, TD, this.verticalRenderReverse); if (res === false) { this.rowStrategy.removeOutstanding(); } } } else if (!this.instance.cloneSource) { res = this.rowStrategy.add(r, TD, this.verticalRenderReverse); if (res === false) { if (!this.instance.getSetting('nativeScrollbars')) { this.rowStrategy.removeOutstanding(); } } if (this.rowStrategy.isLastIncomplete()) { if (this.verticalRenderReverse && !this.isRowInViewport(mustBeInViewport)) { //we failed because one of the cells was by far too large. Recover by rendering from top this.verticalRenderReverse = false; this.instance.update('offsetRow', mustBeInViewport); this.draw(); return; } break; } } if (this.instance.getSetting('nativeScrollbars')) { if (this.instance.cloneSource) { TR.style.height = this.instance.getSetting('rowHeight', source_r) + 'px'; //if I have 2 fixed columns with one-line content and the 3rd column has a multiline content, this is the way to make sure that the overlay will has same row height } else { this.instance.getSetting('rowHeight', source_r, TD); //this trick saves rowHeight in rowHeightCache. It is then read in WalkontableVerticalScrollbarNative.prototype.sumCellSizes and reset in Walkontable constructor } } if (this.verticalRenderReverse && r >= this.rowFilter.fixedCount) { if (offsetRow === 0) { break; } this.instance.update('offsetRow', offsetRow - 1); this.rowFilter.readSettings(this.instance); } else { r++; } source_r = this.rowFilter.visibleToSource(r); } } if (!adjusted) { this.adjustAvailableNodes(); } if (!(this.instance.cloneOverlay instanceof WalkontableDebugOverlay)) { r = this.rowStrategy.countVisible(); while (this.tbodyChildrenLength > r) { this.TBODY.removeChild(this.TBODY.lastChild); this.tbodyChildrenLength--; } } this.instance.wtScrollbars && this.instance.wtScrollbars.refresh(false); if (!this.instance.cloneSource) { if (workspaceWidth !== this.instance.wtViewport.getWorkspaceWidth()) { //workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching this.columnStrategy.stretch(); for (c = 0; c < this.columnStrategy.cellCount; c++) { this.COLGROUP.childNodes[c + displayThs].style.width = this.columnStrategy.getSize(c) + 'px'; } } } this.verticalRenderReverse = false; }; WalkontableTable.prototype.refreshPositions = function (selectionsOnly) { this.refreshHiderDimensions(); this.refreshSelections(selectionsOnly); }; WalkontableTable.prototype.refreshSelections = function (selectionsOnly) { var vr , r , vc , c , s , slen , classNames = [] , visibleRows = this.rowStrategy.countVisible() , visibleColumns = this.columnStrategy.countVisible(); this.oldCellCache = this.currentCellCache; this.currentCellCache = new WalkontableClassNameCache(); if (this.instance.selections) { for (r in this.instance.selections) { if (this.instance.selections.hasOwnProperty(r)) { this.instance.selections[r].draw(); if (this.instance.selections[r].settings.className) { classNames.push(this.instance.selections[r].settings.className); } if (this.instance.selections[r].settings.highlightRowClassName) { classNames.push(this.instance.selections[r].settings.highlightRowClassName); } if (this.instance.selections[r].settings.highlightColumnClassName) { classNames.push(this.instance.selections[r].settings.highlightColumnClassName); } } } } slen = classNames.length; for (vr = 0; vr < visibleRows; vr++) { for (vc = 0; vc < visibleColumns; vc++) { r = this.rowFilter.visibleToSource(vr); c = this.columnFilter.visibleToSource(vc); for (s = 0; s < slen; s++) { if (this.currentCellCache.test(vr, vc, classNames[s])) { this.wtDom.addClass(this.getCell([r, c]), classNames[s]); } else if (selectionsOnly && this.oldCellCache.test(vr, vc, classNames[s])) { this.wtDom.removeClass(this.getCell([r, c]), classNames[s]); } } } } }; /** * getCell * @param {Array} coords * @return {Object} HTMLElement on success or {Number} one of the exit codes on error: * -1 row before viewport * -2 row after viewport * -3 column before viewport * -4 column after viewport * */ WalkontableTable.prototype.getCell = function (coords) { if (this.isRowBeforeViewport(coords[0])) { return -1; //row before viewport } else if (this.isRowAfterViewport(coords[0])) { return -2; //row after viewport } else { if (this.isColumnBeforeViewport(coords[1])) { return -3; //column before viewport } else if (this.isColumnAfterViewport(coords[1])) { return -4; //column after viewport } else { return this.TBODY.childNodes[this.rowFilter.sourceToVisible(coords[0])].childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords[1])]; } } }; WalkontableTable.prototype.getCoords = function (TD) { return [ this.rowFilter.visibleToSource(this.wtDom.index(TD.parentNode)), this.columnFilter.visibleRowHeadedColumnToSourceColumn(TD.cellIndex) ]; }; //returns -1 if no row is visible WalkontableTable.prototype.getLastVisibleRow = function () { return this.rowFilter.visibleToSource(this.rowStrategy.cellCount - 1); }; //returns -1 if no column is visible WalkontableTable.prototype.getLastVisibleColumn = function () { return this.columnFilter.visibleToSource(this.columnStrategy.cellCount - 1); }; WalkontableTable.prototype.isRowBeforeViewport = function (r) { return (this.rowFilter.sourceToVisible(r) < this.rowFilter.fixedCount && r >= this.rowFilter.fixedCount); }; WalkontableTable.prototype.isRowAfterViewport = function (r) { return (r > this.getLastVisibleRow()); }; WalkontableTable.prototype.isColumnBeforeViewport = function (c) { return (this.columnFilter.sourceToVisible(c) < this.columnFilter.fixedCount && c >= this.columnFilter.fixedCount); }; WalkontableTable.prototype.isColumnAfterViewport = function (c) { return (c > this.getLastVisibleColumn()); }; WalkontableTable.prototype.isRowInViewport = function (r) { return (!this.isRowBeforeViewport(r) && !this.isRowAfterViewport(r)); }; WalkontableTable.prototype.isColumnInViewport = function (c) { return (!this.isColumnBeforeViewport(c) && !this.isColumnAfterViewport(c)); }; WalkontableTable.prototype.isLastRowFullyVisible = function () { return (this.getLastVisibleRow() === this.instance.getSetting('totalRows') - 1 && !this.rowStrategy.isLastIncomplete()); }; WalkontableTable.prototype.isLastColumnFullyVisible = function () { return (this.getLastVisibleColumn() === this.instance.getSetting('totalColumns') - 1 && !this.columnStrategy.isLastIncomplete()); }; function WalkontableViewport(instance) { this.instance = instance; this.resetSettings(); if (this.instance.getSetting('nativeScrollbars')) { var that = this; $(window).on('resize', function () { that.clientHeight = that.getWorkspaceHeight(); }); } } /*WalkontableViewport.prototype.isInSightVertical = function () { //is table outside viewport bottom edge if (tableTop > windowHeight + scrollTop) { return -1; } //is table outside viewport top edge else if (scrollTop > tableTop + tableFakeHeight) { return -2; } //table is in viewport but how much exactly? else { } };*/ //used by scrollbar WalkontableViewport.prototype.getWorkspaceHeight = function (proposedHeight) { if (this.instance.getSetting('nativeScrollbars')) { return this.instance.wtScrollbars.vertical.windowSize; } var height = this.instance.getSetting('height'); if (height === Infinity || height === void 0 || height === null || height < 1) { if (this.instance.wtScrollbars.vertical instanceof WalkontableOverlay) { height = this.instance.wtScrollbars.vertical.availableSize(); } else { height = Infinity; } } if (height !== Infinity) { if (proposedHeight >= height) { height -= this.instance.getSetting('scrollbarHeight'); } else if (this.instance.wtScrollbars.horizontal.visible) { height -= this.instance.getSetting('scrollbarHeight'); } } return height; }; WalkontableViewport.prototype.getWorkspaceWidth = function (proposedWidth) { var width = this.instance.getSetting('width'); if (width === Infinity || width === void 0 || width === null || width < 1) { if (this.instance.wtScrollbars.horizontal instanceof WalkontableOverlay) { width = this.instance.wtScrollbars.horizontal.availableSize(); } else { width = Infinity; } } if (width !== Infinity) { if (proposedWidth >= width) { width -= this.instance.getSetting('scrollbarWidth'); } else if (this.instance.wtScrollbars.vertical.visible) { width -= this.instance.getSetting('scrollbarWidth'); } } return width; }; WalkontableViewport.prototype.getWorkspaceActualHeight = function () { return this.instance.wtDom.outerHeight(this.instance.wtTable.TABLE); }; WalkontableViewport.prototype.getWorkspaceActualWidth = function () { return this.instance.wtDom.outerWidth(this.instance.wtTable.TABLE) || this.instance.wtDom.outerWidth(this.instance.wtTable.TBODY) || this.instance.wtDom.outerWidth(this.instance.wtTable.THEAD); //IE8 reports 0 as <table> offsetWidth; }; WalkontableViewport.prototype.getColumnHeaderHeight = function () { if (isNaN(this.columnHeaderHeight)) { var cellOffset = this.instance.wtDom.offset(this.instance.wtTable.TBODY) , tableOffset = this.instance.wtTable.tableOffset; this.columnHeaderHeight = cellOffset.top - tableOffset.top; } return this.columnHeaderHeight; }; WalkontableViewport.prototype.getViewportHeight = function (proposedHeight) { var containerHeight = this.getWorkspaceHeight(proposedHeight); if (containerHeight === Infinity) { return containerHeight; } var columnHeaderHeight = this.getColumnHeaderHeight(); if (columnHeaderHeight > 0) { return containerHeight - columnHeaderHeight; } else { return containerHeight; } }; WalkontableViewport.prototype.getRowHeaderWidth = function () { if (this.instance.cloneSource) { return this.instance.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, ilen = rowHeaders.length; i < ilen; i++) { if (TH) { this.rowHeaderWidth += this.instance.wtDom.outerWidth(TH); TH = TH.nextSibling; } else { this.rowHeaderWidth += 50; //yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring. TODO: proper fix } } } else { this.rowHeaderWidth = 0; } } return this.rowHeaderWidth; }; WalkontableViewport.prototype.getViewportWidth = function (proposedWidth) { var containerWidth = this.getWorkspaceWidth(proposedWidth); if (containerWidth === Infinity) { return containerWidth; } var rowHeaderWidth = this.getRowHeaderWidth(); if (rowHeaderWidth > 0) { return containerWidth - rowHeaderWidth; } else { return containerWidth; } }; WalkontableViewport.prototype.resetSettings = function () { this.rowHeaderWidth = NaN; this.columnHeaderHeight = NaN; }; function WalkontableWheel(instance) { if (instance.getSetting('nativeScrollbars')) { return; } //spreader === instance.wtTable.TABLE.parentNode $(instance.wtTable.spreader).on('mousewheel', function (event, delta, deltaX, deltaY) { if (!deltaX && !deltaY && delta) { //we are in IE8, see https://github.com/brandonaaron/jquery-mousewheel/issues/53 deltaY = delta; } if (!deltaX && !deltaY) { //this happens in IE8 test case return; } if (deltaY > 0 && instance.getSetting('offsetRow') === 0) { return; //attempt to scroll up when it's already showing first row } else if (deltaY < 0 && instance.wtTable.isLastRowFullyVisible()) { return; //attempt to scroll down when it's already showing last row } else if (deltaX < 0 && instance.getSetting('offsetColumn') === 0) { return; //attempt to scroll left when it's already showing first column } else if (deltaX > 0 && instance.wtTable.isLastColumnFullyVisible()) { return; //attempt to scroll right when it's already showing last column } //now we are sure we really want to scroll clearTimeout(instance.wheelTimeout); instance.wheelTimeout = setTimeout(function () { //timeout is needed because with fast-wheel scrolling mousewheel event comes dozen times per second if (deltaY) { //ceil is needed because jquery-mousewheel reports fractional mousewheel deltas on touchpad scroll //see http://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers if (instance.wtScrollbars.vertical.visible) { // if we see scrollbar instance.scrollVertical(-Math.ceil(deltaY)).draw(); } } else if (deltaX) { if (instance.wtScrollbars.horizontal.visible) { // if we see scrollbar instance.scrollHorizontal(Math.ceil(deltaX)).draw(); } } }, 0); event.preventDefault(); }); } /** * Dragdealer JS v0.9.5 - patched by Walkontable at lines 66, 309-310, 339-340 * http://code.ovidiu.ch/dragdealer-js * * Copyright (c) 2010, Ovidiu Chereches * MIT License * http://legal.ovidiu.ch/licenses/MIT */ /* Cursor */ var Cursor = { x: 0, y: 0, init: function() { this.setEvent('mouse'); this.setEvent('touch'); }, setEvent: function(type) { var moveHandler = document['on' + type + 'move'] || function(){}; document['on' + type + 'move'] = function(e) { moveHandler(e); Cursor.refresh(e); } }, refresh: function(e) { if(!e) { e = window.event; } if(e.type == 'mousemove') { this.set(e); } else if(e.touches) { this.set(e.touches[0]); } }, set: function(e) { if(e.pageX || e.pageY) { this.x = e.pageX; this.y = e.pageY; } else if(document.body && (e.clientX || e.clientY)) //need to check whether body exists, because of IE8 issue (#1084) { this.x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; this.y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } } }; Cursor.init(); /* Position */ var Position = { get: function(obj) { var curtop = 0, curleft = 0; //Walkontable patch. Original (var curleft = curtop = 0;) created curtop in global scope if(obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while((obj = obj.offsetParent)); } return [curleft, curtop]; } }; /* Dragdealer */ var Dragdealer = function(wrapper, options) { if(typeof(wrapper) == 'string') { wrapper = document.getElementById(wrapper); } if(!wrapper) { return; } var handle = wrapper.getElementsByTagName('div')[0]; if(!handle || handle.className.search(/(^|\s)handle(\s|$)/) == -1) { return; } this.init(wrapper, handle, options || {}); this.setup(); }; Dragdealer.prototype = { init: function(wrapper, handle, options) { this.wrapper = wrapper; this.handle = handle; this.options = options; this.disabled = this.getOption('disabled', false); this.horizontal = this.getOption('horizontal', true); this.vertical = this.getOption('vertical', false); this.slide = this.getOption('slide', true); this.steps = this.getOption('steps', 0); this.snap = this.getOption('snap', false); this.loose = this.getOption('loose', false); this.speed = this.getOption('speed', 10) / 100; this.xPrecision = this.getOption('xPrecision', 0); this.yPrecision = this.getOption('yPrecision', 0); this.callback = options.callback || null; this.animationCallback = options.animationCallback || null; this.bounds = { left: options.left || 0, right: -(options.right || 0), top: options.top || 0, bottom: -(options.bottom || 0), x0: 0, x1: 0, xRange: 0, y0: 0, y1: 0, yRange: 0 }; this.value = { prev: [-1, -1], current: [options.x || 0, options.y || 0], target: [options.x || 0, options.y || 0] }; this.offset = { wrapper: [0, 0], mouse: [0, 0], prev: [-999999, -999999], current: [0, 0], target: [0, 0] }; this.change = [0, 0]; this.activity = false; this.dragging = false; this.tapping = false; }, getOption: function(name, defaultValue) { return this.options[name] !== undefined ? this.options[name] : defaultValue; }, setup: function() { this.setWrapperOffset(); this.setBoundsPadding(); this.setBounds(); this.setSteps(); this.addListeners(); }, setWrapperOffset: function() { this.offset.wrapper = Position.get(this.wrapper); }, setBoundsPadding: function() { if(!this.bounds.left && !this.bounds.right) { this.bounds.left = Position.get(this.handle)[0] - this.offset.wrapper[0]; this.bounds.right = -this.bounds.left; } if(!this.bounds.top && !this.bounds.bottom) { this.bounds.top = Position.get(this.handle)[1] - this.offset.wrapper[1]; this.bounds.bottom = -this.bounds.top; } }, setBounds: function() { this.bounds.x0 = this.bounds.left; this.bounds.x1 = this.wrapper.offsetWidth + this.bounds.right; this.bounds.xRange = (this.bounds.x1 - this.bounds.x0) - this.handle.offsetWidth; this.bounds.y0 = this.bounds.top; this.bounds.y1 = this.wrapper.offsetHeight + this.bounds.bottom; this.bounds.yRange = (this.bounds.y1 - this.bounds.y0) - this.handle.offsetHeight; this.bounds.xStep = 1 / (this.xPrecision || Math.max(this.wrapper.offsetWidth, this.handle.offsetWidth)); this.bounds.yStep = 1 / (this.yPrecision || Math.max(this.wrapper.offsetHeight, this.handle.offsetHeight)); }, setSteps: function() { if(this.steps > 1) { this.stepRatios = []; for(var i = 0; i <= this.steps - 1; i++) { this.stepRatios[i] = i / (this.steps - 1); } } }, addListeners: function() { var self = this; this.wrapper.onselectstart = function() { return false; } this.handle.onmousedown = this.handle.ontouchstart = function(e) { self.handleDownHandler(e); }; this.wrapper.onmousedown = this.wrapper.ontouchstart = function(e) { self.wrapperDownHandler(e); }; var mouseUpHandler = document.onmouseup || function(){}; document.onmouseup = function(e) { mouseUpHandler(e); self.documentUpHandler(e); }; var touchEndHandler = document.ontouchend || function(){}; document.ontouchend = function(e) { touchEndHandler(e); self.documentUpHandler(e); }; var resizeHandler = window.onresize || function(){}; window.onresize = function(e) { resizeHandler(e); self.documentResizeHandler(e); }; this.wrapper.onmousemove = function(e) { self.activity = true; } this.wrapper.onclick = function(e) { return !self.activity; } this.interval = setInterval(function(){ self.animate() }, 25); self.animate(false, true); }, handleDownHandler: function(e) { this.activity = false; Cursor.refresh(e); this.preventDefaults(e, true); this.startDrag(); }, wrapperDownHandler: function(e) { Cursor.refresh(e); this.preventDefaults(e, true); this.startTap(); }, documentUpHandler: function(e) { this.stopDrag(); this.stopTap(); }, documentResizeHandler: function(e) { this.setWrapperOffset(); this.setBounds(); this.update(); }, enable: function() { this.disabled = false; this.handle.className = this.handle.className.replace(/\s?disabled/g, ''); }, disable: function() { this.disabled = true; this.handle.className += ' disabled'; }, setStep: function(x, y, snap) { this.setValue( this.steps && x > 1 ? (x - 1) / (this.steps - 1) : 0, this.steps && y > 1 ? (y - 1) / (this.steps - 1) : 0, snap ); }, setValue: function(x, y, snap) { this.setTargetValue([x, y || 0]); if(snap) { this.groupCopy(this.value.current, this.value.target); } }, startTap: function(target) { if(this.disabled) { return; } this.tapping = true; this.setWrapperOffset(); this.setBounds(); if(target === undefined) { target = [ Cursor.x - this.offset.wrapper[0] - (this.handle.offsetWidth / 2), Cursor.y - this.offset.wrapper[1] - (this.handle.offsetHeight / 2) ]; } this.setTargetOffset(target); }, stopTap: function() { if(this.disabled || !this.tapping) { return; } this.tapping = false; this.setTargetValue(this.value.current); this.result(); }, startDrag: function() { if(this.disabled) { return; } this.setWrapperOffset(); this.setBounds(); this.offset.mouse = [ Cursor.x - Position.get(this.handle)[0], Cursor.y - Position.get(this.handle)[1] ]; this.dragging = true; }, stopDrag: function() { if(this.disabled || !this.dragging) { return; } this.dragging = false; var target = this.groupClone(this.value.current); if(this.slide) { var ratioChange = this.change; target[0] += ratioChange[0] * 4; target[1] += ratioChange[1] * 4; } this.setTargetValue(target); this.result(); }, feedback: function() { var value = this.value.current; if(this.snap && this.steps > 1) { value = this.getClosestSteps(value); } if(!this.groupCompare(value, this.value.prev)) { if(typeof(this.animationCallback) == 'function') { this.animationCallback(value[0], value[1]); } this.groupCopy(this.value.prev, value); } }, result: function() { if(typeof(this.callback) == 'function') { this.callback(this.value.target[0], this.value.target[1]); } }, animate: function(direct, first) { if(direct && !this.dragging) { return; } if(this.dragging) { var prevTarget = this.groupClone(this.value.target); var offset = [ Cursor.x - this.offset.wrapper[0] - this.offset.mouse[0], Cursor.y - this.offset.wrapper[1] - this.offset.mouse[1] ]; this.setTargetOffset(offset, this.loose); this.change = [ this.value.target[0] - prevTarget[0], this.value.target[1] - prevTarget[1] ]; } if(this.dragging || first) { this.groupCopy(this.value.current, this.value.target); } if(this.dragging || this.glide() || first) { this.update(); this.feedback(); } }, glide: function() { var diff = [ this.value.target[0] - this.value.current[0], this.value.target[1] - this.value.current[1] ]; if(!diff[0] && !diff[1]) { return false; } if(Math.abs(diff[0]) > this.bounds.xStep || Math.abs(diff[1]) > this.bounds.yStep) { this.value.current[0] += diff[0] * this.speed; this.value.current[1] += diff[1] * this.speed; } else { this.groupCopy(this.value.current, this.value.target); } return true; }, update: function() { if(!this.snap) { this.offset.current = this.getOffsetsByRatios(this.value.current); } else { this.offset.current = this.getOffsetsByRatios( this.getClosestSteps(this.value.current) ); } this.show(); }, show: function() { if(!this.groupCompare(this.offset.current, this.offset.prev)) { if(this.horizontal) { this.handle.style.left = String(this.offset.current[0]) + 'px'; } if(this.vertical) { this.handle.style.top = String(this.offset.current[1]) + 'px'; } this.groupCopy(this.offset.prev, this.offset.current); } }, setTargetValue: function(value, loose) { var target = loose ? this.getLooseValue(value) : this.getProperValue(value); this.groupCopy(this.value.target, target); this.offset.target = this.getOffsetsByRatios(target); }, setTargetOffset: function(offset, loose) { var value = this.getRatiosByOffsets(offset); var target = loose ? this.getLooseValue(value) : this.getProperValue(value); this.groupCopy(this.value.target, target); this.offset.target = this.getOffsetsByRatios(target); }, getLooseValue: function(value) { var proper = this.getProperValue(value); return [ proper[0] + ((value[0] - proper[0]) / 4), proper[1] + ((value[1] - proper[1]) / 4) ]; }, getProperValue: function(value) { var proper = this.groupClone(value); proper[0] = Math.max(proper[0], 0); proper[1] = Math.max(proper[1], 0); proper[0] = Math.min(proper[0], 1); proper[1] = Math.min(proper[1], 1); if((!this.dragging && !this.tapping) || this.snap) { if(this.steps > 1) { proper = this.getClosestSteps(proper); } } return proper; }, getRatiosByOffsets: function(group) { return [ this.getRatioByOffset(group[0], this.bounds.xRange, this.bounds.x0), this.getRatioByOffset(group[1], this.bounds.yRange, this.bounds.y0) ]; }, getRatioByOffset: function(offset, range, padding) { return range ? (offset - padding) / range : 0; }, getOffsetsByRatios: function(group) { return [ this.getOffsetByRatio(group[0], this.bounds.xRange, this.bounds.x0), this.getOffsetByRatio(group[1], this.bounds.yRange, this.bounds.y0) ]; }, getOffsetByRatio: function(ratio, range, padding) { return Math.round(ratio * range) + padding; }, getClosestSteps: function(group) { return [ this.getClosestStep(group[0]), this.getClosestStep(group[1]) ]; }, getClosestStep: function(value) { var k = 0; var min = 1; for(var i = 0; i <= this.steps - 1; i++) { if(Math.abs(this.stepRatios[i] - value) < min) { min = Math.abs(this.stepRatios[i] - value); k = i; } } return this.stepRatios[k]; }, groupCompare: function(a, b) { return a[0] == b[0] && a[1] == b[1]; }, groupCopy: function(a, b) { a[0] = b[0]; a[1] = b[1]; }, groupClone: function(a) { return [a[0], a[1]]; }, preventDefaults: function(e, selection) { if(!e) { e = window.event; } if(e.preventDefault) { e.preventDefault(); } e.returnValue = false; if(selection && document.selection) { document.selection.empty(); } }, cancelEvent: function(e) { if(!e) { e = window.event; } if(e.stopPropagation) { e.stopPropagation(); } e.cancelBubble = true; } }; /*! Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.1.3 * * Requires: 1.2.2+ */ (function (factory) { if ( typeof define === 'function' && define.amd ) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS style for Browserify module.exports = factory; } else { // Browser globals factory(jQuery); } }(function ($) { var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll']; var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll']; var lowestDelta, lowestDeltaXY; if ( $.event.fixHooks ) { for ( var i = toFix.length; i; ) { $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; } } $.event.special.mousewheel = { setup: function() { if ( this.addEventListener ) { for ( var i = toBind.length; i; ) { this.addEventListener( toBind[--i], handler, false ); } } else { this.onmousewheel = handler; } }, teardown: function() { if ( this.removeEventListener ) { for ( var i = toBind.length; i; ) { this.removeEventListener( toBind[--i], handler, false ); } } else { this.onmousewheel = null; } } }; $.fn.extend({ mousewheel: function(fn) { return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); }, unmousewheel: function(fn) { return this.unbind("mousewheel", fn); } }); function handler(event) { var orgEvent = event || window.event, args = [].slice.call(arguments, 1), delta = 0, deltaX = 0, deltaY = 0, absDelta = 0, absDeltaXY = 0, fn; event = $.event.fix(orgEvent); event.type = "mousewheel"; // Old school scrollwheel delta if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; } if ( orgEvent.detail ) { delta = orgEvent.detail * -1; } // New school wheel delta (wheel event) if ( orgEvent.deltaY ) { deltaY = orgEvent.deltaY * -1; delta = deltaY; } if ( orgEvent.deltaX ) { deltaX = orgEvent.deltaX; delta = deltaX * -1; } // Webkit if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY; } if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; } // Look for lowest delta to normalize the delta values absDelta = Math.abs(delta); if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; } absDeltaXY = Math.max(Math.abs(deltaY), Math.abs(deltaX)); if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; } // Get a whole value for the deltas fn = delta > 0 ? 'floor' : 'ceil'; delta = Math[fn](delta / lowestDelta); deltaX = Math[fn](deltaX / lowestDeltaXY); deltaY = Math[fn](deltaY / lowestDeltaXY); // Add event and delta to the front of the arguments args.unshift(event, delta, deltaX, deltaY); return ($.event.dispatch || $.event.handle).apply(this, args); } })); })(jQuery, window, Handsontable); // numeral.js // version : 1.4.7 // author : Adam Draper // license : MIT // http://adamwdraper.github.com/Numeral-js/ (function () { /************************************ Constants ************************************/ var numeral, VERSION = '1.4.7', // internal storage for language config files languages = {}, currentLanguage = 'en', zeroFormat = null, // check for nodeJS hasModule = (typeof module !== 'undefined' && module.exports); /************************************ Constructors ************************************/ // Numeral prototype object function Numeral (number) { this._n = number; } /** * Implementation of toFixed() that treats floats more like decimals * * Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present * problems for accounting- and finance-related software. */ function toFixed (value, precision, optionals) { var power = Math.pow(10, precision), output; // Multiply up by precision, round accurately, then divide and use native toFixed(): output = (Math.round(value * power) / power).toFixed(precision); if (optionals) { var optionalsRegExp = new RegExp('0{1,' + optionals + '}$'); output = output.replace(optionalsRegExp, ''); } return output; } /************************************ Formatting ************************************/ // determine what type of formatting we need to do function formatNumeral (n, format) { var output; // figure out what kind of format we are dealing with if (format.indexOf('$') > -1) { // currency!!!!! output = formatCurrency(n, format); } else if (format.indexOf('%') > -1) { // percentage output = formatPercentage(n, format); } else if (format.indexOf(':') > -1) { // time output = formatTime(n, format); } else { // plain ol' numbers or bytes output = formatNumber(n, format); } // return string return output; } // revert to number function unformatNumeral (n, string) { if (string.indexOf(':') > -1) { n._n = unformatTime(string); } else { if (string === zeroFormat) { n._n = 0; } else { var stringOriginal = string; if (languages[currentLanguage].delimiters.decimal !== '.') { string = string.replace(/\./g,'').replace(languages[currentLanguage].delimiters.decimal, '.'); } // see if abbreviations are there so that we can multiply to the correct number var thousandRegExp = new RegExp(languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'), millionRegExp = new RegExp(languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'), billionRegExp = new RegExp(languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'), trillionRegExp = new RegExp(languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); // see if bytes are there so that we can multiply to the correct number var prefixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], bytesMultiplier = false; for (var power = 0; power <= prefixes.length; power++) { bytesMultiplier = (string.indexOf(prefixes[power]) > -1) ? Math.pow(1024, power + 1) : false; if (bytesMultiplier) { break; } } // do some math to create our number n._n = ((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) * Number(((string.indexOf('(') > -1) ? '-' : '') + string.replace(/[^0-9\.-]+/g, '')); // round if we are talking about bytes n._n = (bytesMultiplier) ? Math.ceil(n._n) : n._n; } } return n._n; } function formatCurrency (n, format) { var prependSymbol = (format.indexOf('$') <= 1) ? true : false; // remove $ for the moment var space = ''; // check for space before or after currency if (format.indexOf(' $') > -1) { space = ' '; format = format.replace(' $', ''); } else if (format.indexOf('$ ') > -1) { space = ' '; format = format.replace('$ ', ''); } else { format = format.replace('$', ''); } // format the number var output = formatNumeral(n, format); // position the symbol if (prependSymbol) { if (output.indexOf('(') > -1 || output.indexOf('-') > -1) { output = output.split(''); output.splice(1, 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) { var space = ''; // check for space before % if (format.indexOf(' %') > -1) { space = ' '; format = format.replace(' %', ''); } else { format = format.replace('%', ''); } n._n = n._n * 100; var output = formatNumeral(n, format); if (output.indexOf(')') > -1 ) { output = output.split(''); output.splice(-1, 0, space + '%'); output = output.join(''); } else { output = output + space + '%'; } return output; } function formatTime (n, format) { var hours = Math.floor(n._n/60/60), minutes = Math.floor((n._n - (hours * 60 * 60))/60), seconds = Math.round(n._n - (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; // turn hours and minutes into seconds and add them all up if (timeArray.length === 3) { // hours seconds = seconds + (Number(timeArray[0]) * 60 * 60); // minutes seconds = seconds + (Number(timeArray[1]) * 60); // seconds seconds = seconds + Number(timeArray[2]); } else if (timeArray.lenght === 2) { // minutes seconds = seconds + (Number(timeArray[0]) * 60); // seconds seconds = seconds + Number(timeArray[1]); } return Number(seconds); } function formatNumber (n, format) { var negP = false, optDec = false, abbr = '', bytes = '', ord = '', abs = Math.abs(n._n); // check if number is zero and a custom zero format has been set if (n._n === 0 && zeroFormat !== null) { return zeroFormat; } else { // see if we should use parentheses for negative number if (format.indexOf('(') > -1) { negP = true; format = format.slice(1, -1); } // see if abbreviation is wanted if (format.indexOf('a') > -1) { // check for space before abbreviation if (format.indexOf(' a') > -1) { abbr = ' '; format = format.replace(' a', ''); } else { format = format.replace('a', ''); } if (abs >= Math.pow(10, 12)) { // trillion abbr = abbr + languages[currentLanguage].abbreviations.trillion; n._n = n._n / Math.pow(10, 12); } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9)) { // billion abbr = abbr + languages[currentLanguage].abbreviations.billion; n._n = n._n / Math.pow(10, 9); } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6)) { // million abbr = abbr + languages[currentLanguage].abbreviations.million; n._n = n._n / Math.pow(10, 6); } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3)) { // thousand abbr = abbr + languages[currentLanguage].abbreviations.thousand; n._n = n._n / Math.pow(10, 3); } } // see if we are formatting bytes if (format.indexOf('b') > -1) { // check for space before if (format.indexOf(' b') > -1) { bytes = ' '; format = format.replace(' b', ''); } else { format = format.replace('b', ''); } var prefixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], min, max; for (var power = 0; power <= prefixes.length; power++) { min = Math.pow(1024, power); max = Math.pow(1024, power+1); if (n._n >= min && n._n < max) { bytes = bytes + prefixes[power]; if (min > 0) { n._n = n._n / min; } break; } } } // see if ordinal is wanted if (format.indexOf('o') > -1) { // check for space before if (format.indexOf(' o') > -1) { ord = ' '; format = format.replace(' o', ''); } else { format = format.replace('o', ''); } ord = ord + languages[currentLanguage].ordinal(n._n); } if (format.indexOf('[.]') > -1) { optDec = true; format = format.replace('[.]', '.'); } var w = n._n.toString().split('.')[0], precision = format.split('.')[1], thousands = format.indexOf(','), d = '', neg = false; if (precision) { if (precision.indexOf('[') > -1) { precision = precision.replace(']', ''); precision = precision.split('['); d = toFixed(n._n, (precision[0].length + precision[1].length), precision[1].length); } else { d = toFixed(n._n, precision.length); } w = d.split('.')[0]; if (d.split('.')[1].length) { d = languages[currentLanguage].delimiters.decimal + d.split('.')[1]; } else { d = ''; } if (optDec && Number(d) === 0) { d = ''; } } else { w = toFixed(n._n, null); } // format number 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) ? '-' : '') + w + d + ((ord) ? ord : '') + ((abbr) ? abbr : '') + ((bytes) ? bytes : '') + ((negP && neg) ? ')' : ''); } } /************************************ Top Level Functions ************************************/ numeral = function (input) { if (numeral.isNumeral(input)) { input = input.value(); } else if (!Number(input)) { input = 0; } return new Numeral(Number(input)); }; // version number numeral.version = VERSION; // compare numeral object numeral.isNumeral = function (obj) { return obj instanceof Numeral; }; // This function will load languages and then set the global language. If // no arguments are passed in, it will simply return the current global // language key. numeral.language = function (key, values) { if (!key) { return currentLanguage; } if (key && !values) { currentLanguage = key; } if (values || !languages[key]) { loadLanguage(key, values); } return numeral; }; 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) { if (typeof(format) === 'string') { zeroFormat = format; } else { zeroFormat = null; } }; /************************************ Helpers ************************************/ function loadLanguage(key, values) { languages[key] = values; } /************************************ Numeral Prototype ************************************/ numeral.fn = Numeral.prototype = { clone : function () { return numeral(this); }, format : function (inputString) { return formatNumeral(this, inputString ? inputString : numeral.defaultFormat); }, unformat : function (inputString) { return unformatNumeral(this, inputString ? inputString : numeral.defaultFormat); }, value : function () { return this._n; }, valueOf : function () { return this._n; }, set : function (value) { this._n = Number(value); return this; }, add : function (value) { this._n = this._n + Number(value); return this; }, subtract : function (value) { this._n = this._n - Number(value); return this; }, multiply : function (value) { this._n = this._n * Number(value); return this; }, divide : function (value) { this._n = this._n / Number(value); return this; }, difference : function (value) { var difference = this._n - Number(value); if (difference < 0) { difference = -difference; } return difference; } }; /************************************ Exposing Numeral ************************************/ // CommonJS module is defined if (hasModule) { module.exports = numeral; } /*global ender:false */ if (typeof ender === 'undefined') { // here, `this` means `window` in the browser, or `global` on the server // add `numeral` as a global object via a string identifier, // for Closure Compiler 'advanced' mode this['numeral'] = numeral; } /*global define:false */ if (typeof define === 'function' && define.amd) { define([], function () { return numeral; }); } }).call(this);
ajax/libs/react-dropzone/4.2.6/index.js
seogi1004/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react"), require("prop-types")); else if(typeof define === 'function' && define.amd) define(["react", "prop-types"], factory); else if(typeof exports === 'object') exports["Dropzone"] = factory(require("react"), require("prop-types")); else root["Dropzone"] = factory(root["react"], root["prop-types"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) { Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(2); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(3); var _propTypes2 = _interopRequireDefault(_propTypes); var _utils = __webpack_require__(4); var _styles = __webpack_require__(6); var _styles2 = _interopRequireDefault(_styles); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint prefer-template: 0 */ var Dropzone = function (_React$Component) { _inherits(Dropzone, _React$Component); function Dropzone(props, context) { _classCallCheck(this, Dropzone); var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context)); _this.renderChildren = function (children, isDragActive, isDragAccept, isDragReject) { if (typeof children === 'function') { return children(_extends({}, _this.state, { isDragActive: isDragActive, isDragAccept: isDragAccept, isDragReject: isDragReject })); } return children; }; _this.composeHandlers = _this.composeHandlers.bind(_this); _this.onClick = _this.onClick.bind(_this); _this.onDocumentDrop = _this.onDocumentDrop.bind(_this); _this.onDragEnter = _this.onDragEnter.bind(_this); _this.onDragLeave = _this.onDragLeave.bind(_this); _this.onDragOver = _this.onDragOver.bind(_this); _this.onDragStart = _this.onDragStart.bind(_this); _this.onDrop = _this.onDrop.bind(_this); _this.onFileDialogCancel = _this.onFileDialogCancel.bind(_this); _this.onInputElementClick = _this.onInputElementClick.bind(_this); _this.setRef = _this.setRef.bind(_this); _this.setRefs = _this.setRefs.bind(_this); _this.isFileDialogActive = false; _this.state = { draggedFiles: [], acceptedFiles: [], rejectedFiles: [] }; return _this; } _createClass(Dropzone, [{ key: 'componentDidMount', value: function componentDidMount() { var preventDropOnDocument = this.props.preventDropOnDocument; this.dragTargets = []; if (preventDropOnDocument) { document.addEventListener('dragover', _utils.onDocumentDragOver, false); document.addEventListener('drop', this.onDocumentDrop, false); } this.fileInputEl.addEventListener('click', this.onInputElementClick, false); // Tried implementing addEventListener, but didn't work out document.body.onfocus = this.onFileDialogCancel; } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { var preventDropOnDocument = this.props.preventDropOnDocument; if (preventDropOnDocument) { document.removeEventListener('dragover', _utils.onDocumentDragOver); document.removeEventListener('drop', this.onDocumentDrop); } if (this.fileInputEl != null) { this.fileInputEl.removeEventListener('click', this.onInputElementClick, false); } // Can be replaced with removeEventListener, if addEventListener works if (document != null) { document.body.onfocus = null; } } }, { key: 'composeHandlers', value: function composeHandlers(handler) { if (this.props.disabled) { return null; } return handler; } }, { key: 'onDocumentDrop', value: function onDocumentDrop(evt) { if (this.node && this.node.contains(evt.target)) { // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler return; } evt.preventDefault(); this.dragTargets = []; } }, { key: 'onDragStart', value: function onDragStart(evt) { if (this.props.onDragStart) { this.props.onDragStart.call(this, evt); } } }, { key: 'onDragEnter', value: function onDragEnter(evt) { evt.preventDefault(); // Count the dropzone and any children that are entered. if (this.dragTargets.indexOf(evt.target) === -1) { this.dragTargets.push(evt.target); } this.setState({ isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari. draggedFiles: (0, _utils.getDataTransferItems)(evt) }); if (this.props.onDragEnter) { this.props.onDragEnter.call(this, evt); } } }, { key: 'onDragOver', value: function onDragOver(evt) { // eslint-disable-line class-methods-use-this evt.preventDefault(); evt.stopPropagation(); try { // The file dialog on Chrome allows users to drag files from the dialog onto // the dropzone, causing the browser the crash when the file dialog is closed. // A drop effect of 'none' prevents the file from being dropped evt.dataTransfer.dropEffect = this.isFileDialogActive ? 'none' : 'copy'; // eslint-disable-line no-param-reassign } catch (err) { // continue regardless of error } if (this.props.onDragOver) { this.props.onDragOver.call(this, evt); } return false; } }, { key: 'onDragLeave', value: function onDragLeave(evt) { var _this2 = this; evt.preventDefault(); // Only deactivate once the dropzone and all children have been left. this.dragTargets = this.dragTargets.filter(function (el) { return el !== evt.target && _this2.node.contains(el); }); if (this.dragTargets.length > 0) { return; } // Clear dragging files state this.setState({ isDragActive: false, draggedFiles: [] }); if (this.props.onDragLeave) { this.props.onDragLeave.call(this, evt); } } }, { key: 'onDrop', value: function onDrop(evt) { var _this3 = this; var _props = this.props, onDrop = _props.onDrop, onDropAccepted = _props.onDropAccepted, onDropRejected = _props.onDropRejected, multiple = _props.multiple, disablePreview = _props.disablePreview, accept = _props.accept; var fileList = (0, _utils.getDataTransferItems)(evt); var acceptedFiles = []; var rejectedFiles = []; // Stop default browser behavior evt.preventDefault(); // Reset the counter along with the drag on a drop. this.dragTargets = []; this.isFileDialogActive = false; fileList.forEach(function (file) { if (!disablePreview) { try { file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign } catch (err) { if (process.env.NODE_ENV !== 'production') { console.error('Failed to generate preview for file', file, err); // eslint-disable-line no-console } } } if ((0, _utils.fileAccepted)(file, accept) && (0, _utils.fileMatchSize)(file, _this3.props.maxSize, _this3.props.minSize)) { acceptedFiles.push(file); } else { rejectedFiles.push(file); } }); if (!multiple) { // if not in multi mode add any extra accepted files to rejected. // This will allow end users to easily ignore a multi file drop in "single" mode. rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(1))); } if (onDrop) { onDrop.call(this, acceptedFiles, rejectedFiles, evt); } if (rejectedFiles.length > 0 && onDropRejected) { onDropRejected.call(this, rejectedFiles, evt); } if (acceptedFiles.length > 0 && onDropAccepted) { onDropAccepted.call(this, acceptedFiles, evt); } // Clear files value this.draggedFiles = null; // Reset drag state this.setState({ isDragActive: false, draggedFiles: [], acceptedFiles: acceptedFiles, rejectedFiles: rejectedFiles }); } }, { key: 'onClick', value: function onClick(evt) { var _props2 = this.props, onClick = _props2.onClick, disableClick = _props2.disableClick; if (!disableClick) { evt.stopPropagation(); if (onClick) { onClick.call(this, evt); } // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout // this is so react can handle state changes in the onClick prop above above // see: https://github.com/react-dropzone/react-dropzone/issues/450 setTimeout(this.open.bind(this), 0); } } }, { key: 'onInputElementClick', value: function onInputElementClick(evt) { evt.stopPropagation(); if (this.props.inputProps && this.props.inputProps.onClick) { this.props.inputProps.onClick(); } } }, { key: 'onFileDialogCancel', value: function onFileDialogCancel() { // timeout will not recognize context of this method var onFileDialogCancel = this.props.onFileDialogCancel; var fileInputEl = this.fileInputEl; var isFileDialogActive = this.isFileDialogActive; // execute the timeout only if the onFileDialogCancel is defined and FileDialog // is opened in the browser if (onFileDialogCancel && isFileDialogActive) { setTimeout(function () { // Returns an object as FileList var FileList = fileInputEl.files; if (!FileList.length) { isFileDialogActive = false; onFileDialogCancel(); } }, 300); } } }, { key: 'setRef', value: function setRef(ref) { this.node = ref; } }, { key: 'setRefs', value: function setRefs(ref) { this.fileInputEl = ref; } /** * Open system file upload dialog. * * @public */ }, { key: 'open', value: function open() { this.isFileDialogActive = true; this.fileInputEl.value = null; this.fileInputEl.click(); } }, { key: 'render', value: function render() { var _props3 = this.props, accept = _props3.accept, acceptClassName = _props3.acceptClassName, activeClassName = _props3.activeClassName, children = _props3.children, disabled = _props3.disabled, disabledClassName = _props3.disabledClassName, inputProps = _props3.inputProps, multiple = _props3.multiple, name = _props3.name, rejectClassName = _props3.rejectClassName, rest = _objectWithoutProperties(_props3, ['accept', 'acceptClassName', 'activeClassName', 'children', 'disabled', 'disabledClassName', 'inputProps', 'multiple', 'name', 'rejectClassName']); var acceptStyle = rest.acceptStyle, activeStyle = rest.activeStyle, _rest$className = rest.className, className = _rest$className === undefined ? '' : _rest$className, disabledStyle = rest.disabledStyle, rejectStyle = rest.rejectStyle, style = rest.style, props = _objectWithoutProperties(rest, ['acceptStyle', 'activeStyle', 'className', 'disabledStyle', 'rejectStyle', 'style']); var _state = this.state, isDragActive = _state.isDragActive, draggedFiles = _state.draggedFiles; var filesCount = draggedFiles.length; var isMultipleAllowed = multiple || filesCount <= 1; var isDragAccept = filesCount > 0 && (0, _utils.allFilesAccepted)(draggedFiles, this.props.accept); var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed); var noStyles = !className && !style && !activeStyle && !acceptStyle && !rejectStyle && !disabledStyle; if (isDragActive && activeClassName) { className += ' ' + activeClassName; } if (isDragAccept && acceptClassName) { className += ' ' + acceptClassName; } if (isDragReject && rejectClassName) { className += ' ' + rejectClassName; } if (disabled && disabledClassName) { className += ' ' + disabledClassName; } if (noStyles) { style = _styles2.default.default; activeStyle = _styles2.default.active; acceptStyle = style.active; rejectStyle = _styles2.default.rejected; disabledStyle = _styles2.default.disabled; } var appliedStyle = _extends({}, style); if (activeStyle && isDragActive) { appliedStyle = _extends({}, style, activeStyle); } if (acceptStyle && isDragAccept) { appliedStyle = _extends({}, appliedStyle, acceptStyle); } if (rejectStyle && isDragReject) { appliedStyle = _extends({}, appliedStyle, rejectStyle); } if (disabledStyle && disabled) { appliedStyle = _extends({}, style, disabledStyle); } var inputAttributes = { accept: accept, disabled: disabled, type: 'file', style: { display: 'none' }, multiple: _utils.supportMultiple && multiple, ref: this.setRefs, onChange: this.onDrop, autoComplete: 'off' }; if (name && name.length) { inputAttributes.name = name; } // Destructure custom props away from props used for the div element var acceptedFiles = props.acceptedFiles, preventDropOnDocument = props.preventDropOnDocument, disablePreview = props.disablePreview, disableClick = props.disableClick, onDropAccepted = props.onDropAccepted, onDropRejected = props.onDropRejected, onFileDialogCancel = props.onFileDialogCancel, maxSize = props.maxSize, minSize = props.minSize, divProps = _objectWithoutProperties(props, ['acceptedFiles', 'preventDropOnDocument', 'disablePreview', 'disableClick', 'onDropAccepted', 'onDropRejected', 'onFileDialogCancel', 'maxSize', 'minSize']); return _react2.default.createElement( 'div', _extends({ className: className, style: appliedStyle }, divProps /* expand user provided props first so event handlers are never overridden */, { onClick: this.composeHandlers(this.onClick), onDragStart: this.composeHandlers(this.onDragStart), onDragEnter: this.composeHandlers(this.onDragEnter), onDragOver: this.composeHandlers(this.onDragOver), onDragLeave: this.composeHandlers(this.onDragLeave), onDrop: this.composeHandlers(this.onDrop), ref: this.setRef, 'aria-disabled': disabled }), this.renderChildren(children, isDragActive, isDragAccept, isDragReject), _react2.default.createElement('input', _extends({}, inputProps /* expand user provided inputProps first so inputAttributes override them */, inputAttributes)) ); } }]); return Dropzone; }(_react2.default.Component); exports.default = Dropzone; Dropzone.propTypes = { /** * Allow specific types of files. See https://github.com/okonet/attr-accept for more information. * Keep in mind that mime type determination is not reliable across platforms. CSV files, * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under * Windows. In some cases there might not be a mime type set at all. * See: https://github.com/react-dropzone/react-dropzone/issues/276 */ accept: _propTypes2.default.string, /** * Contents of the dropzone */ children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), /** * Disallow clicking on the dropzone container to open file dialog */ disableClick: _propTypes2.default.bool, /** * Enable/disable the dropzone entirely */ disabled: _propTypes2.default.bool, /** * Enable/disable preview generation */ disablePreview: _propTypes2.default.bool, /** * If false, allow dropped items to take over the current browser window */ preventDropOnDocument: _propTypes2.default.bool, /** * Pass additional attributes to the `<input type="file"/>` tag */ inputProps: _propTypes2.default.object, /** * Allow dropping multiple files */ multiple: _propTypes2.default.bool, /** * `name` attribute for the input tag */ name: _propTypes2.default.string, /** * Maximum file size */ maxSize: _propTypes2.default.number, /** * Minimum file size */ minSize: _propTypes2.default.number, /** * className */ className: _propTypes2.default.string, /** * className for active state */ activeClassName: _propTypes2.default.string, /** * className for accepted state */ acceptClassName: _propTypes2.default.string, /** * className for rejected state */ rejectClassName: _propTypes2.default.string, /** * className for disabled state */ disabledClassName: _propTypes2.default.string, /** * CSS styles to apply */ style: _propTypes2.default.object, /** * CSS styles to apply when drag is active */ activeStyle: _propTypes2.default.object, /** * CSS styles to apply when drop will be accepted */ acceptStyle: _propTypes2.default.object, /** * CSS styles to apply when drop will be rejected */ rejectStyle: _propTypes2.default.object, /** * CSS styles to apply when dropzone is disabled */ disabledStyle: _propTypes2.default.object, /** * onClick callback * @param {Event} event */ onClick: _propTypes2.default.func, /** * onDrop callback */ onDrop: _propTypes2.default.func, /** * onDropAccepted callback */ onDropAccepted: _propTypes2.default.func, /** * onDropRejected callback */ onDropRejected: _propTypes2.default.func, /** * onDragStart callback */ onDragStart: _propTypes2.default.func, /** * onDragEnter callback */ onDragEnter: _propTypes2.default.func, /** * onDragOver callback */ onDragOver: _propTypes2.default.func, /** * onDragLeave callback */ onDragLeave: _propTypes2.default.func, /** * Provide a callback on clicking the cancel button of the file dialog */ onFileDialogCancel: _propTypes2.default.func }; Dropzone.defaultProps = { preventDropOnDocument: true, disabled: false, disablePreview: false, disableClick: false, multiple: true, maxSize: Infinity, minSize: 0 }; module.exports = exports['default']; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), /* 1 */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /* 2 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }), /* 3 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_3__; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.supportMultiple = undefined; exports.getDataTransferItems = getDataTransferItems; exports.fileAccepted = fileAccepted; exports.fileMatchSize = fileMatchSize; exports.allFilesAccepted = allFilesAccepted; exports.onDocumentDragOver = onDocumentDragOver; var _attrAccept = __webpack_require__(5); var _attrAccept2 = _interopRequireDefault(_attrAccept); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var supportMultiple = exports.supportMultiple = typeof document !== 'undefined' && document && document.createElement ? 'multiple' in document.createElement('input') : true; function getDataTransferItems(event) { var dataTransferItemsList = []; if (event.dataTransfer) { var dt = event.dataTransfer; if (dt.files && dt.files.length) { dataTransferItemsList = dt.files; } else if (dt.items && dt.items.length) { // During the drag even the dataTransfer.files is null // but Chrome implements some drag store, which is accesible via dataTransfer.items dataTransferItemsList = dt.items; } } else if (event.target && event.target.files) { dataTransferItemsList = event.target.files; } // Convert from DataTransferItemsList to the native Array return Array.prototype.slice.call(dataTransferItemsList); } // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with // that MIME type will always be accepted function fileAccepted(file, accept) { return file.type === 'application/x-moz-file' || (0, _attrAccept2.default)(file, accept); } function fileMatchSize(file, maxSize, minSize) { return file.size <= maxSize && file.size >= minSize; } function allFilesAccepted(files, accept) { return files.every(function (file) { return fileAccepted(file, accept); }); } // allow the entire document to be a drag target function onDocumentDragOver(evt) { evt.preventDefault(); } /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";n.__esModule=!0,r(8),r(9),n["default"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(","),e=t.name||"",o=t.type||"",i=o.replace(/\/.*$/,"");return{v:r.some(function(t){var n=t.trim();return"."===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):o===n})}}();if("object"==typeof r)return r.v}return!0},t.exports=n["default"]},function(t,n){var r=t.exports={version:"1.2.2"};"number"==typeof __e&&(__e=r)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c="prototype",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&"function"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(20)("wks"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))("Symbol."+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r(7)("match")]=!1,!"/./"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)("src"),u="toString",c=Function[u],f=(""+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){"function"==typeof r&&(o(r,i,t[n]?""+t[n]:f.join(String(n))),"name"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return"function"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(3),o=r(24),i=r(21),u="endsWith",c=""[u];e(e.P+e.F*r(14)(u),"String",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(","),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",u)}]); /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = { rejected: { borderStyle: 'solid', borderColor: '#c66', backgroundColor: '#eee' }, disabled: { opacity: 0.5 }, active: { borderStyle: 'solid', borderColor: '#6c6', backgroundColor: '#eee' }, default: { width: 200, height: 200, borderWidth: 2, borderColor: '#666', borderStyle: 'dashed', borderRadius: 5 } }; module.exports = exports['default']; /***/ }) /******/ ]); }); //# sourceMappingURL=index.js.map
tests/routes/Home/components/HomeView.spec.js
bhoomit/formula-editor
import React from 'react' import { HomeView } from 'routes/Home/components/HomeView' import { render } from 'enzyme' describe('(View) Home', () => { let _component beforeEach(() => { _component = render(<HomeView />) }) it('Renders a welcome message', () => { const welcome = _component.find('h2') expect(welcome).to.exist expect(welcome.text()).to.match(/Home View/) }) })
packages/material-ui-icons/src/ComputerRounded.js
kybarg/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H1c-.55 0-1 .45-1 1s.45 1 1 1h22c.55 0 1-.45 1-1s-.45-1-1-1h-3zM5 6h14c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1z" /> , 'ComputerRounded');
docs/public/static/examples/unversioned/tutorial/sharing-web-workaround.js
exponentjs/exponent
import React from 'react'; import { Image, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import * as ImagePicker from 'expo-image-picker'; import * as Sharing from 'expo-sharing'; import uploadToAnonymousFilesAsync from 'anonymous-files'; export default function App() { let [selectedImage, setSelectedImage] = React.useState(null); let openImagePickerAsync = async () => { let permissionResult = await ImagePicker.requestCameraRollPermissionsAsync(); if (permissionResult.granted === false) { alert('Permission to access camera roll is required!'); return; } let pickerResult = await ImagePicker.launchImageLibraryAsync(); if (pickerResult.cancelled === true) { return; } if (Platform.OS === 'web') { let remoteUri = await uploadToAnonymousFilesAsync(pickerResult.uri); setSelectedImage({ localUri: pickerResult.uri, remoteUri }); } else { setSelectedImage({ localUri: pickerResult.uri, remoteUri: null }); } }; let openShareDialogAsync = async () => { if (!(await Sharing.isAvailableAsync())) { alert(`The image is available for sharing at: ${selectedImage.remoteUri}`); return; } Sharing.shareAsync(selectedImage.remoteUri || selectedImage.localUri); }; if (selectedImage !== null) { return ( <View style={styles.container}> <Image source={{ uri: selectedImage.localUri }} style={styles.thumbnail} /> <TouchableOpacity onPress={openShareDialogAsync} style={styles.button}> <Text style={styles.buttonText}>Share this photo</Text> </TouchableOpacity> </View> ); } return ( <View style={styles.container}> <Image source={{ uri: 'https://i.imgur.com/TkIrScD.png' }} style={styles.logo} /> <Text style={styles.instructions}> To share a photo from your phone with a friend, just press the button below! </Text> <TouchableOpacity onPress={openImagePickerAsync} style={styles.button}> <Text style={styles.buttonText}>Pick a photo</Text> </TouchableOpacity> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, logo: { width: 305, height: 159, marginBottom: 20, }, instructions: { color: '#888', fontSize: 18, marginHorizontal: 15, marginBottom: 10, }, button: { backgroundColor: 'blue', padding: 20, borderRadius: 5, }, buttonText: { fontSize: 20, color: '#fff', }, thumbnail: { width: 300, height: 300, resizeMode: 'contain', }, });
ajax/libs/fixed-data-table/0.1.2/fixed-data-table.min.js
tmorin/cdnjs
/** * FixedDataTable v0.1.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ var FixedDataTable=function(e){function t(o){if(r[o])return r[o].exports;var i=r[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){r(2),r(4),r(6),r(8),r(10),r(12),e.exports=r(1)},function(e,t,r){"use strict";var o=r(15),i=r(16),n=r(17),s={Column:i,ColumnGroup:n,Table:o};s.version="0.1.2",e.exports=s},function(){},,function(){},,function(){},,function(){},,function(){},,function(){},,,function(e,t,r){var o=r(20),i=r(21),n=r(19),s=r(22),a=r(23),l=r(24),u=r(25),h=r(26),c=r(27),f=r(28),p=r(29),d=r(30),m=r(31),v=r(32),g=r(33),w=r(34),_=r(35),b=r(36),T=n.PropTypes,x=n.Children,D=o.renderToString,M={},R=["bodyFixedColumns","bodyScrollableColumns","headFixedColumns","headScrollableColumns","footFixedColumns","footScrollableColumns"],H=n.createClass({displayName:"FixedDataTable",propTypes:{width:T.number.isRequired,height:T.number,maxHeight:T.number,ownerHeight:T.number,overflowX:T.oneOf(["hidden","auto"]),overflowY:T.oneOf(["hidden","auto"]),rowsCount:T.number.isRequired,rowHeight:T.number.isRequired,rowHeightGetter:T.func,rowGetter:T.func.isRequired,rowClassNameGetter:T.func,groupHeaderHeight:T.number,headerHeight:T.number.isRequired,headerDataGetter:T.func,footerHeight:T.number,footerData:T.oneOfType([T.object,T.array]),scrollLeft:T.number,scrollToColumn:T.number,scrollTop:T.number,scrollToRow:T.number,onScrollEnd:T.func,onContentHeightChange:T.func,onRowClick:T.func,onRowMouseDown:T.func,onRowMouseEnter:T.func,onColumnResizeEndCallback:T.func,isColumnResizing:T.bool},getDefaultProps:function(){return{footerHeight:0,groupHeaderHeight:0,headerHeight:0,scrollLeft:0,scrollTop:0}},getInitialState:function(){var e=this.props,t=e.height-e.headerHeight-e.footerHeight-e.groupHeaderHeight;return this._scrollHelper=new f(e.rowsCount,e.rowHeight,t,e.rowHeightGetter),e.scrollTop&&this._scrollHelper.scrollTo(e.scrollTop),this._didScrollStop=v(this._didScrollStop,160,this),this._calculateState(this.props)},componentWillMount:function(){var e=this.props.scrollToRow;void 0!==e&&null!==e&&(this._rowToScrollTo=e);var t=this.props.scrollToColumn;void 0!==t&&null!==t&&(this._columnToScrollTo=t),this._wheelHandler=new a(this._onWheel,"hidden"!==this.props.overflowX,"hidden"!==this.props.overflowY)},_reportContentHeight:function(){var e,t=this.state.scrollContentHeight,r=this.state.reservedHeight,o=t+r;if(this.state.height>o&&this.props.ownerHeight)e=Math.max(o,this.props.ownerHeight);else{var i=t-this.state.bodyHeight;e=this.props.height+i}e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var r=e.scrollToColumn;void 0!==r&&null!==r&&(this._columnToScrollTo=r);var o=e.overflowX,i=e.overflowY;(o!==this.props.overflowX||i!==this.props.overflowY)&&(this._wheelHandler=new a(this._onWheel,"hidden"!==o,"hidden"!==i)),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,r=this.props;t.useGroupHeader&&(e=n.createElement(c,{key:"group_header",className:m("public/fixedDataTable/header"),data:t.groupHeaderData,width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns}));var o=this.state.scrollContentHeight-this.state.bodyHeight,i=t.maxScrollX>0&&"hidden"!==t.overflowX,s=o>0&&"hidden"!==t.overflowY,a=i?l.SIZE:0,u=t.height-a,f=t.useGroupHeader?t.groupHeaderHeight:0,p=f+t.headerHeight,d=0,v=p+t.bodyHeight,g=v+t.footerHeight;void 0!==r.ownerHeight&&r.ownerHeight<r.height&&(d=r.ownerHeight-r.height,v=Math.min(v,u+d-t.footerHeight),u=r.ownerHeight-a);var w;s&&(w=n.createElement(l,{size:u,contentSize:u+o,onScroll:this._onVerticalScroll,position:t.scrollY}));var _;if(i){var b=s?l.SIZE:0,T=t.width-b;_=n.createElement(y,{contentSize:T+t.maxScrollX,offset:d,onScroll:this._onHorizontalScroll,position:t.scrollX,size:T})}var x=n.createElement(h,{height:t.height,initialWidth:t.columnResizingData.width||0,minWidth:t.columnResizingData.minWidth||0,maxWidth:t.columnResizingData.maxWidth||Number.MAX_VALUE,visible:!!t.isColumnResizing,leftOffset:t.columnResizingData.left||0,knobHeight:t.headerHeight,initialEvent:t.columnResizingData.initialEvent,onColumnResizeEnd:r.onColumnResizeEndCallback,columnKey:t.columnResizingData.key}),D=null;t.footerHeight&&(D=n.createElement(c,{key:"footer",className:m("public/fixedDataTable/footer"),data:t.footerData,fixedColumns:t.footFixedColumns,height:t.footerHeight,index:-1,zIndex:1,offsetTop:v,scrollableColumns:t.footScrollableColumns,scrollLeft:t.scrollX,width:t.width}));var M,R=this._renderRows(p),H=n.createElement(c,{key:"header",className:m("public/fixedDataTable/header"),data:t.headData,width:t.width,height:t.headerHeight,index:-1,zIndex:1,offsetTop:f,scrollLeft:t.scrollX,fixedColumns:t.headFixedColumns,scrollableColumns:t.headScrollableColumns,onColumnResize:this._onColumnResize});return t.scrollY&&(M=n.createElement("div",{className:m("fixedDataTable/shadow"),style:{top:p}})),n.createElement("div",{className:m("public/fixedDataTable/main"),onWheel:this._wheelHandler.onWheel,style:{height:t.height,width:t.width}},n.createElement("div",{className:m("fixedDataTable/rowsContainer"),style:{height:g,width:t.width}},x,e,H,R,D,M),w,_)},_renderRows:function(e){var t=this.state;return n.createElement(u,{defaultRowHeight:t.rowHeight,firstRowIndex:t.firstRowIndex,firstRowOffset:t.firstRowOffset,fixedColumns:t.bodyFixedColumns,height:t.bodyHeight,offsetTop:e,onRowClick:t.onRowClick,onRowMouseDown:t.onRowMouseDown,onRowMouseEnter:t.onRowMouseEnter,rowClassNameGetter:t.rowClassNameGetter,rowsCount:t.rowsCount,rowGetter:t.rowGetter,rowHeightGetter:t.rowHeightGetter,scrollLeft:t.scrollX,scrollableColumns:t.bodyScrollableColumns,showLastRowBorder:!t.footerHeight,width:t.width})},_onColumnResize:function(e,t,r,o,n,s,a){i.isRTL()&&(t=-t),this.setState({isColumnResizing:!0,columnResizingData:{left:t+e-r,width:r,minWidth:o,maxWidth:n,initialEvent:{clientX:a.clientX,clientY:a.clientY,preventDefault:g},key:s}})},_populateColumnsAndColumnData:function(e,t){var r={},o=this._splitColumnTypes(e);r.bodyFixedColumns=o.fixed,r.bodyScrollableColumns=o.scrollable,r.headData=this._getHeadData(e);var i=this._splitColumnTypes(this._createHeadColumns(e));r.headFixedColumns=i.fixed,r.headScrollableColumns=i.scrollable;var n=this._splitColumnTypes(this._createFootColumns(e));if(r.footFixedColumns=n.fixed,r.footScrollableColumns=n.scrollable,t){r.groupHeaderData=this._getGroupHeaderData(t),t=this._createGroupHeaderColumns(t);var s=this._splitColumnTypes(t);r.groupHeaderFixedColumns=s.fixed,r.groupHeaderScrollableColumns=s.scrollable}return r},_calculateState:function(e,t){w(void 0!==e.height||void 0!==e.maxHeight,"You must set either a height or a maxHeight");var r,o,i=t&&t.firstRowIndex||0,n=t&&t.firstRowOffset||0;if(r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?o=t.scrollY:(a=this._scrollHelper.scrollTo(e.scrollTop),i=a.index,n=a.offset,o=a.position),void 0!==this._rowToScrollTo&&(a=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),i=a.index,n=a.offset,o=a.position,delete this._rowToScrollTo),t&&e.rowsCount!==t.rowsCount){var s=e.height-e.headerHeight-e.footerHeight-e.groupHeaderHeight;this._scrollHelper=new f(e.rowsCount,e.rowHeight,s,e.rowHeightGetter);var a=this._scrollHelper.scrollToRow(i,n);i=a.index,n=a.offset,o=a.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var u;u=e.isColumnResizing?t&&t.columnResizingData:M;var h=[];x.forEach(e.children,function(e){null!=e&&(w(e.type.__TableColumnGroup__||e.type.__TableColumn__,"child type should be <FixedDataTableColumn /> or <FixedDataTableColumnGroup />"),h.push(e))});var c=!1;h.length&&h[0].type.__TableColumnGroup__&&(c=!0);var d,m;if(c){var v=p.adjustColumnGroupWidths(h,e.width);d=v.columns,m=v.columnGroups}else d=p.adjustColumnWidths(h,e.width);var g=this._populateColumnsAndColumnData(d,m);if(t&&(g=this._tryReusingColumnSettings(g,t)),void 0!==this._columnToScrollTo){var b=g.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var T,D,R=0;for(T=0;T<g.bodyFixedColumns.length;++T)D=g.bodyFixedColumns[T],R+=D.props.width;var H=this._columnToScrollTo-b,y=0;for(T=0;H>T;++T)D=g.bodyScrollableColumns[T],y+=D.props.width;var S=e.width-R,C=g.bodyScrollableColumns[this._columnToScrollTo-b].props.width,$=y+C-S;$>r&&(r=$),r>y&&(r=y)}delete this._columnToScrollTo}var F=void 0===e.height,E=F?e.maxHeight:e.height,I=e.footerHeight+e.headerHeight+e.groupHeaderHeight,O=E-I,k=this._scrollHelper.getContentHeight(),z=k+I,B=p.getTotalWidth(d),P=B>e.width&&"hidden"!==e.overflowX;P&&(O-=l.SIZE,z+=l.SIZE,I+=l.SIZE);var N=Math.max(0,B-e.width),W=Math.max(0,k-O);r=Math.min(r,N),o=Math.min(o,W),W||(F&&(E=z),O=z-I),this._scrollHelper.setViewportHeight(O);var A=Object.assign({isColumnResizing:t&&t.isColumnResizing},g,e,{columnResizingData:u,firstRowIndex:i,firstRowOffset:n,horizontalScrollbarVisible:P,maxScrollX:N,reservedHeight:I,scrollContentHeight:k,scrollX:r,scrollY:o,bodyHeight:O,height:E,useGroupHeader:c});return t&&(_(t.headData,A.headData)&&(A.headData=t.headData),_(t.groupHeaderData,A.groupHeaderData)&&(A.groupHeaderData=t.groupHeaderData)),A},_tryReusingColumnSettings:function(e,t){return R.forEach(function(r){if(e[r].length===t[r].length){for(var o=!0,i=0;i<e[r].length;++i)if(!_(e[r][i].props,t[r][i].props)){o=!1;break}o&&(e[r]=t[r])}}),e},_createGroupHeaderColumns:function(e){for(var t=[],r=0;r<e.length;++r)t[r]=d(e[r],{dataKey:r,children:void 0,columnData:e[r].props.columnGroupData,isHeaderCell:!0});return t},_createHeadColumns:function(e){for(var t=[],r=0;r<e.length;++r){var o=e[r].props;t.push(d(e[r],{cellRenderer:o.headerRenderer||D,columnData:o.columnData,dataKey:o.dataKey,isHeaderCell:!0,label:o.label}))}return t},_createFootColumns:function(e){for(var t=[],r=0;r<e.length;++r){var o=e[r].props;t.push(d(e[r],{cellRenderer:o.footerRenderer||D,columnData:o.columnData,dataKey:o.dataKey,isFooterCell:!0}))}return t},_getHeadData:function(e){for(var t={},r=0;r<e.length;++r){var o=e[r].props;t[o.dataKey]=this.props.headerDataGetter?this.props.headerDataGetter(o.dataKey):o.label||""}return t},_getGroupHeaderData:function(e){for(var t=[],r=0;r<e.length;++r)t[r]=e[r].props.label||"";return t},_splitColumnTypes:function(e){for(var t=[],r=[],o=0;o<e.length;++o)e[o].props.fixed?t.push(e[o]):r.push(e[o]);return{fixed:t,scrollable:r}},_onWheel:function(e,t){if(this.isMounted()){var r=this.state.scrollX;if(Math.abs(t)>Math.abs(e)&&"hidden"!==this.props.overflowY){var o=this._scrollHelper.scrollBy(Math.round(t));this.setState({firstRowIndex:o.index,firstRowOffset:o.offset,scrollY:o.position,scrollContentHeight:o.contentHeight})}else e&&"hidden"!==this.props.overflowX&&(r+=e,r=0>r?0:r,r=r>this.state.maxScrollX?this.state.maxScrollX:r,this.setState({scrollX:r}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStop:function(){this.isMounted()&&this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY)}}),y=n.createClass({displayName:"HorizontalScrollbar",mixins:[s],propTypes:{contentSize:T.number.isRequired,offset:T.number.isRequired,onScroll:T.func.isRequired,position:T.number.isRequired,size:T.number.isRequired},render:function(){var e={height:l.SIZE,width:this.props.size},t={height:l.SIZE,position:"absolute",width:this.props.size};return b(t,0,this.props.offset),n.createElement("div",{className:m("fixedDataTable/horizontalScrollbar"),style:e},n.createElement("div",{style:t},n.createElement(l,n.__spread({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=H},function(e,t,r){var o=r(19),i=o.PropTypes,n=o.createClass({displayName:"FixedDataTableColumn",statics:{__TableColumn__:!0},propTypes:{align:i.oneOf(["left","center","right"]),cellClassName:i.string,cellRenderer:i.func,cellDataGetter:i.func,dataKey:i.oneOfType([i.string,i.number]).isRequired,headerRenderer:i.func,footerRenderer:i.func,columnData:i.object,label:i.string,width:i.number.isRequired,minWidth:i.number,maxWidth:i.number,flexGrow:i.number,isResizable:i.bool},render:function(){return null}});e.exports=n},function(e,t,r){var o=r(19),i=o.PropTypes,n=o.createClass({displayName:"FixedDataTableColumnGroup",statics:{__TableColumnGroup__:!0},propTypes:{align:i.oneOf(["left","center","right"]),fixed:i.bool.isRequired,columnGroupData:i.object,label:i.string,groupHeaderRenderer:i.func},render:function(){return null}});e.exports=n},,function(e,t,r){e.exports=r(37)},function(e,t,r){"use strict";function o(e){return null===e||void 0===e?"":String(e)}function i(e,t){a.Children.forEach(e,function(e){e.type===l.type?i(e.props.children,t):e.type===u.type&&t(e)})}function n(e,t){var r=[];return a.Children.forEach(e,function(e){var o=e;if(e.type===l.type){var n=!1,s=[];i(e.props.children,function(e){var r=t(e);r!==e&&(n=!0),s.push(r)}),n&&(o=h(e,{children:s}))}else e.type===u.type&&(o=t(e));r.push(o)}),r}var s=r(21),a=r(19),l=r(17),u=r(16),h=r(30),c=s.isRTL()?-1:1,f=5,p={DIR_SIGN:c,CELL_VISIBILITY_TOLERANCE:f,renderToString:o,forEachColumn:i,mapColumns:n};e.exports=p},function(e){"use strict";var t={isRTL:function(){return!1},getDirection:function(){return"LTR"}};e.exports=t},function(e,t,r){e.exports=r(60)},function(e,t,r){"use strict";function o(e,t,r,o){this.$ReactWheelHandler_animationFrameID=null,this.$ReactWheelHandler_deltaX=0,this.$ReactWheelHandler_deltaY=0,this.$ReactWheelHandler_didWheel=this.$ReactWheelHandler_didWheel.bind(this),this.$ReactWheelHandler_handleScrollX=t,this.$ReactWheelHandler_handleScrollY=r,this.$ReactWheelHandler_stopPropagation=!!o,this.$ReactWheelHandler_onWheelCallback=e,this.onWheel=this.onWheel.bind(this)}var i=r(46),n=r(47);o.prototype.onWheel=function(e){(this.$ReactWheelHandler_handleScrollX||this.$ReactWheelHandler_handleScrollY)&&e.preventDefault();var t=i(e);this.$ReactWheelHandler_deltaX+=this.$ReactWheelHandler_handleScrollX?t.pixelX:0,this.$ReactWheelHandler_deltaY+=this.$ReactWheelHandler_handleScrollY?t.pixelY:0;var r;(0!==this.$ReactWheelHandler_deltaX||0!==this.$ReactWheelHandler_deltaY)&&(this.$ReactWheelHandler_stopPropagation&&e.stopPropagation(),r=!0),r===!0&&null===this.$ReactWheelHandler_animationFrameID&&(this.$ReactWheelHandler_animationFrameID=n(this.$ReactWheelHandler_didWheel))},o.prototype.$ReactWheelHandler_didWheel=function(){this.$ReactWheelHandler_animationFrameID=null,this.$ReactWheelHandler_onWheelCallback(this.$ReactWheelHandler_deltaX,this.$ReactWheelHandler_deltaY),this.$ReactWheelHandler_deltaX=0,this.$ReactWheelHandler_deltaY=0},e.exports=o},function(e,t,r){var o=r(38),i=r(39),n=r(19),s=r(22),a=r(23),l=r(40),u=r(31),h=r(33),c=r(36),f=n.PropTypes,p={position:0,scrollable:!1},d=parseInt(l("scrollbar-face-margin"),10),m=2*d,v=30,g=40,w=null,_=n.createClass({displayName:"Scrollbar",mixins:[s],propTypes:{contentSize:f.number.isRequired,defaultPosition:f.number,isOpaque:f.bool,orientation:f.oneOf(["vertical","horizontal"]),onScroll:f.func,position:f.number,size:f.number.isRequired,trackColor:f.oneOf(["gray"]),zIndex:f.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:h,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,r=this.props.size,o=this.state.isHorizontal,i=!o,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,h=this.props.isOpaque,f=u({"public/Scrollbar/main":!0,"public/Scrollbar/mainHorizontal":o,"public/Scrollbar/mainVertical":i,"Scrollbar/mainActive":s,"Scrollbar/mainOpaque":h}),p=u({"Scrollbar/face":!0,"Scrollbar/faceHorizontal":o,"Scrollbar/faceVertical":i,"Scrollbar/faceActive":s}),v=this.state.position*this.state.scale+d;return o?(e={width:r},t={width:a-m},c(t,v,0)):(e={height:r},t={height:a-m},c(t,0,v)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=l("ads-cf-bg-color-gray")),n.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:f,style:e,tabIndex:0},n.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new a(t,e,!e)},componentDidMount:function(){this._mouseMoveTracker=new o(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_calculateState:function(e,t,r,o){if(1>t||t>=r)return p;e=e||0;var i="horizontal"===o,n=t/r,s=Math.round(t*n);v>s&&(n=(t-v)/(r-v),s=v);var a=!0,l=r-t;0>e?e=0:e>l&&(e=l);var u=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1;return e=Math.round(e),s=Math.round(s),{faceSize:s,isDragging:u,isHorizontal:i,position:e,scale:n,scrollable:a}},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==this.refs.face.getDOMNode()){var r=e.nativeEvent,o=this.state.isHorizontal?r.offsetX||r.layerX:r.offsetY||r.layerY,i=this.props;o/=this.state.scale,t=this._calculateState(o-.5*this.state.faceSize/this.state.scale,i.size,i.contentSize,i.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),this.getDOMNode().focus()},_onMouseMove:function(e,t){var r=this.props,o=this.state.isHorizontal?e:t;o/=this.state.scale,this._setNextState(this._calculateState(this.state.position+o,r.size,r.contentSize,r.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==i.TAB){var r=g,o=0;if(this.state.isHorizontal)switch(t){case i.HOME:o=-1,r=this.props.contentSize;break;case i.LEFT:o=-1;break;case i.RIGHT:o=1;break;default:return}if(!this.state.isHorizontal)switch(t){case i.SPACE:o=e.shiftKey?-1:1;break;case i.HOME:o=-1,r=this.props.contentSize;break;case i.UP:o=-1;break;case i.DOWN:o=1;break;case i.PAGE_UP:o=-1,r=this.props.size;break;case i.PAGE_DOWN:o=1,r=this.props.size;break;default:return}e.preventDefault();var n=this.props;this._setNextState(this._calculateState(this.state.position+r*o,n.size,n.contentSize,n.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),this.getDOMNode().blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var r=t.position,o=this.state.position!==e.position;if(void 0===r){var i=o?this._didScroll:void 0;this.setState(e,i)}else{if(r!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}o&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});_.KEYBOARD_SCROLL_AMOUNT=g,_.SIZE=parseInt(l("scrollbar-size"),10),e.exports=_},function(e,t,r){var o=r(19),i=r(41),n=r(27),s=r(31),a=r(33),l=r(42),u=o.PropTypes,h=o.createClass({displayName:"FixedDataTableBufferedRows",propTypes:{defaultRowHeight:u.number.isRequired,firstRowIndex:u.number.isRequired,firstRowOffset:u.number.isRequired,fixedColumns:u.array.isRequired,height:u.number.isRequired,offsetTop:u.number.isRequired,onRowClick:u.func,onRowMouseDown:u.func,onRowMouseEnter:u.func,rowClassNameGetter:u.func,rowsCount:u.number.isRequired,rowGetter:u.func.isRequired,rowHeightGetter:u.func,scrollLeft:u.number.isRequired,scrollableColumns:u.array.isRequired,showLastRowBorder:u.bool,width:u.number.isRequired},getInitialState:function(){return this._rowBuffer=new i(this.props.rowsCount,this.props.defaultRowHeight,this.props.height,this._getRowHeight),{rowsToRender:this._rowBuffer.getRows(this.props.firstRowIndex,this.props.firstRowOffset)}},componentWillMount:function(){this._staticRowArray=[]},componentDidMount:function(){this._bufferUpdateTimer=setTimeout(this._updateBuffer,500)},componentWillReceiveProps:function(e){(e.rowsCount!==this.props.rowsCount||e.defaultRowHeight!==this.props.defaultRowHeight||e.height!==this.props.height)&&(this._rowBuffer=new i(e.rowsCount,e.defaultRowHeight,e.height,this._getRowHeight)),this.setState({rowsToRender:this._rowBuffer.getRows(e.firstRowIndex,e.firstRowOffset)}),this._bufferUpdateTimer&&clearTimeout(this._bufferUpdateTimer),this._bufferUpdateTimer=setTimeout(this._updateBuffer,400)},_updateBuffer:function(){this._bufferUpdateTimer=null,this.isMounted()&&this.setState({rowsToRender:this._rowBuffer.getRowsWithUpdatedBuffer()})},shouldComponentUpdate:function(){return!0},componentWillUnmount:function(){this._staticRowArray.length=0},render:function(){var e=this.props,t=e.offsetTop,r=e.rowClassNameGetter||a,i=e.rowGetter,u=this.state.rowsToRender;this._staticRowArray.length=u.length;for(var h=0;h<u.length;++h){var c=u[h],f=c.rowIndex,p=c.offsetTop,d=this._getRowHeight(f),m=f===e.rowsCount-1&&e.showLastRowBorder;this._staticRowArray[h]=o.createElement(n,{key:h,index:f,data:i(f),width:e.width,height:d,scrollLeft:Math.round(e.scrollLeft),offsetTop:Math.round(t+p),fixedColumns:e.fixedColumns,scrollableColumns:e.scrollableColumns,onClick:e.onRowClick,onMouseDown:e.onRowMouseDown,onMouseEnter:e.onRowMouseEnter,className:l(r(f),s("public/fixedDataTable/bodyRow"),m?s("fixedDataTable/hasBottomBorder"):null)})}return o.createElement("div",null,this._staticRowArray)},_getRowHeight:function(e){return this.props.rowHeightGetter?this.props.rowHeightGetter(e):this.props.defaultRowHeight}});e.exports=h},function(e,t,r){var o=r(38),i=r(21),n=r(19),s=r(22),a=r(43),l=r(31),u=n.PropTypes,h=n.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new o(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return i.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,n.createElement("div",{className:l({"fixedDataTableColumnResizerLine/main":!0,"fixedDataTableColumnResizerLine/hiddenElem":!this.props.visible}),style:e},n.createElement("div",{className:l("fixedDataTableColumnResizerLine/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){i.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,r=a(this.props.minWidth,t,this.props.maxWidth);this.setState({width:r,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,r){"use strict";var o=r(20),i=r(19),n=r(22),s=r(44),a=r(31),l=r(42),u=r(36),h=o.DIR_SIGN,c=i.PropTypes,f=i.createClass({displayName:"FixedDataTableRowImpl",mixins:[n],propTypes:{data:c.oneOfType([c.object,c.array]),fixedColumns:c.array.isRequired,height:c.number.isRequired,index:c.number.isRequired,scrollableColumns:c.array.isRequired,scrollLeft:c.number.isRequired,width:c.number.isRequired,onClick:c.func,onColumnResize:c.func},render:function(){var e={width:this.props.width,height:this.props.height},t=a({"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1});if(!this.props.data)return i.createElement("div",{className:l(t,this.props.className),style:e});var r=i.createElement(s,{key:"fixed_cells",height:this.props.height,left:0,zIndex:2,columns:this.props.fixedColumns,data:this.props.data,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),o=this._getColumnsWidth(this.props.fixedColumns),n=this._renderColumnsShadow(o),u=i.createElement(s,{key:"scrollable_cells",height:this.props.height,left:(o-this.props.scrollLeft)*h,zIndex:0,columns:this.props.scrollableColumns,data:this.props.data,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return i.createElement("div",{className:l(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,style:e},i.createElement("div",{className:a("fixedDataTableRow/body")},r,u,n))},_getColumnsWidth:function(e){for(var t=0,r=0;r<e.length;++r)t+=e[r].props.width;return t},_renderColumnsShadow:function(e){if(e>0){var t=a({"fixedDataTableRow/fixedColumnsDivider":!0,"fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),r={left:e,height:this.props.height};return i.createElement("div",{className:t,style:r})}},_onClick:function(e){this.props.onClick(e,this.props.index,this.props.data)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index,this.props.data)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index,this.props.data)}}),p=i.createClass({displayName:"FixedDataTableRow",mixins:[n],propTypes:{height:c.number.isRequired,zIndex:c.number,offsetTop:c.number.isRequired,width:c.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return u(e,0,this.props.offsetTop),i.createElement("div",{style:e,className:a("fixedDataTableRow/rowWrapper")},i.createElement(f,i.__spread({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=p},function(e,t,r){"use strict";function o(e,t,r,o){this.$FixedDataTableScrollHelper_rowOffsets=new i(e,t),this.$FixedDataTableScrollHelper_storedHeights=new Array(e);for(var n=0;e>n;++n)this.$FixedDataTableScrollHelper_storedHeights[n]=t;this.$FixedDataTableScrollHelper_rowCount=e,this.$FixedDataTableScrollHelper_position=0,this.$FixedDataTableScrollHelper_contentHeight=e*t,this.$FixedDataTableScrollHelper_defaultRowHeight=t,this.$FixedDataTableScrollHelper_rowHeightGetter=o?o:function(){return t},this.$FixedDataTableScrollHelper_viewportHeight=r,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.$FixedDataTableScrollHelper_updateHeightsInViewport(0,0)}var i=r(45),n=r(43),s=5;o.prototype.setRowHeightGetter=function(e){this.$FixedDataTableScrollHelper_rowHeightGetter=e},o.prototype.setViewportHeight=function(e){this.$FixedDataTableScrollHelper_viewportHeight=e},o.prototype.getContentHeight=function(){return this.$FixedDataTableScrollHelper_contentHeight},o.prototype.$FixedDataTableScrollHelper_updateHeightsInViewport=function(e,t){for(var r=t,o=e;r<=this.$FixedDataTableScrollHelper_viewportHeight&&o<this.$FixedDataTableScrollHelper_rowCount;)this.$FixedDataTableScrollHelper_updateRowHeight(o),r+=this.$FixedDataTableScrollHelper_storedHeights[o],o++},o.prototype.$FixedDataTableScrollHelper_updateHeightsAboveViewport=function(e){for(var t=e-1;t>=0&&t>=e-s;){var r=this.$FixedDataTableScrollHelper_updateRowHeight(t);this.$FixedDataTableScrollHelper_position+=r,t--}},o.prototype.$FixedDataTableScrollHelper_updateRowHeight=function(e){if(0>e||e>=this.$FixedDataTableScrollHelper_rowCount)return 0;var t=this.$FixedDataTableScrollHelper_rowHeightGetter(e);if(t!==this.$FixedDataTableScrollHelper_storedHeights[e]){var r=t-this.$FixedDataTableScrollHelper_storedHeights[e];return this.$FixedDataTableScrollHelper_rowOffsets.set(e,t),this.$FixedDataTableScrollHelper_storedHeights[e]=t,this.$FixedDataTableScrollHelper_contentHeight+=r,r}return 0},o.prototype.scrollBy=function(e){var t=this.$FixedDataTableScrollHelper_rowOffsets.upperBound(this.$FixedDataTableScrollHelper_position),r=t.value-this.$FixedDataTableScrollHelper_storedHeights[t.index],o=t.index,i=this.$FixedDataTableScrollHelper_position,s=this.$FixedDataTableScrollHelper_updateRowHeight(o);0!==r&&(i+=s);var a=this.$FixedDataTableScrollHelper_storedHeights[o]-(i-r);if(e>=0)for(;e>0&&o<this.$FixedDataTableScrollHelper_rowCount;)a>e?(i+=e,e=0):(e-=a,i+=a,o++),o<this.$FixedDataTableScrollHelper_rowCount&&(this.$FixedDataTableScrollHelper_updateRowHeight(o),a=this.$FixedDataTableScrollHelper_storedHeights[o]);else if(0>e){e=-e;for(var l=this.$FixedDataTableScrollHelper_storedHeights[o]-a;e>0&&o>=0;)if(l>e?(i-=e,e=0):(i-=l,e-=l,o--),o>=0){var u=this.$FixedDataTableScrollHelper_updateRowHeight(o);l=this.$FixedDataTableScrollHelper_storedHeights[o],i+=u}}var h=this.$FixedDataTableScrollHelper_contentHeight-this.$FixedDataTableScrollHelper_viewportHeight;i=n(0,i,h),this.$FixedDataTableScrollHelper_position=i;var c=this.$FixedDataTableScrollHelper_rowOffsets.upperBound(i),f=c.index;r=c.value-this.$FixedDataTableScrollHelper_rowHeightGetter(f);var p=r-i;return this.$FixedDataTableScrollHelper_updateHeightsInViewport(f,p),this.$FixedDataTableScrollHelper_updateHeightsAboveViewport(f),{index:f,offset:p,position:this.$FixedDataTableScrollHelper_position,contentHeight:this.$FixedDataTableScrollHelper_contentHeight}},o.prototype.$FixedDataTableScrollHelper_getRowAtEndPosition=function(e){this.$FixedDataTableScrollHelper_updateRowHeight(e);for(var t=e,r=this.$FixedDataTableScrollHelper_storedHeights[t];r<this.$FixedDataTableScrollHelper_viewportHeight&&t>=0;)t--,t>=0&&(this.$FixedDataTableScrollHelper_updateRowHeight(t),r+=this.$FixedDataTableScrollHelper_storedHeights[t]);var o=this.$FixedDataTableScrollHelper_rowOffsets.get(e).value-this.$FixedDataTableScrollHelper_viewportHeight;return 0>o&&(o=0),o},o.prototype.scrollTo=function(e){if(0>=e)return this.$FixedDataTableScrollHelper_position=0,this.$FixedDataTableScrollHelper_updateHeightsInViewport(0,0),{index:0,offset:0,position:this.$FixedDataTableScrollHelper_position,contentHeight:this.$FixedDataTableScrollHelper_contentHeight};if(e>=this.$FixedDataTableScrollHelper_contentHeight-this.$FixedDataTableScrollHelper_viewportHeight){var t=this.$FixedDataTableScrollHelper_rowCount-1;e=this.$FixedDataTableScrollHelper_getRowAtEndPosition(t)}this.$FixedDataTableScrollHelper_position=e; var r=this.$FixedDataTableScrollHelper_rowOffsets.upperBound(e),o=Math.max(r.index,0),i=r.value-this.$FixedDataTableScrollHelper_rowHeightGetter(o),n=i-e;return this.$FixedDataTableScrollHelper_updateHeightsInViewport(o,n),this.$FixedDataTableScrollHelper_updateHeightsAboveViewport(o),{index:o,offset:n,position:this.$FixedDataTableScrollHelper_position,contentHeight:this.$FixedDataTableScrollHelper_contentHeight}},o.prototype.scrollToRow=function(e,t){e=n(0,e,this.$FixedDataTableScrollHelper_rowCount-1),t=n(-this.$FixedDataTableScrollHelper_storedHeights[e],t,0);var r=this.$FixedDataTableScrollHelper_rowOffsets.get(e);return this.scrollTo(r.value-this.$FixedDataTableScrollHelper_storedHeights[e]-t)},o.prototype.scrollRowIntoView=function(e){e=n(0,e,this.$FixedDataTableScrollHelper_rowCount-1);var t=this.$FixedDataTableScrollHelper_rowOffsets.get(e).value,r=t-this.$FixedDataTableScrollHelper_storedHeights[e];if(r<this.$FixedDataTableScrollHelper_position)return this.scrollTo(r);if(t>this.$FixedDataTableScrollHelper_position+this.$FixedDataTableScrollHelper_viewportHeight){var o=this.$FixedDataTableScrollHelper_getRowAtEndPosition(e);return this.scrollTo(o)}return this.scrollTo(this.$FixedDataTableScrollHelper_position)},e.exports=o},function(e,t,r){"use strict";function o(e){for(var t=0,r=0;r<e.length;++r)t+=e[r].props.width;return t}function i(e){for(var t=0,r=0;r<e.length;++r)t+=e[r].props.flexGrow||0;return t}function n(e,t){if(0>=t)return{columns:e,width:o(e)};for(var r=i(e),n=t,s=[],a=0,l=0;l<e.length;++l){var h=e[l];if(h.props.flexGrow){var c=Math.floor(h.props.flexGrow/r*n),f=Math.floor(h.props.width+c);a+=f,r-=h.props.flexGrow,n-=c,s.push(u(h,{width:f}))}else a+=h.props.width,s.push(h)}return{columns:s,width:a}}function s(e,t){var r,s=[];for(r=0;r<e.length;++r)l.Children.forEach(e[r].props.children,function(e){s.push(e)});var a=o(s),h=i(s),c=Math.max(t-a,0),f=[],p=[];for(r=0;r<e.length;++r){var d=e[r],m=[];l.Children.forEach(d.props.children,function(e){m.push(e)});var v=i(m),g=Math.floor(v/h*c),w=n(m,g);h-=v,c-=g;for(var _=0;_<w.columns.length;++_)f.push(w.columns[_]);p.push(u(d,{width:w.width}))}return{columns:f,columnGroups:p}}function a(e,t){var r=o(e);return t>r?n(e,t-r).columns:e}var l=r(19),u=r(30),h={getTotalWidth:o,getTotalFlexGrow:i,distributeFlexWidth:n,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=h},function(e,t,r){e.exports=r(61)},function(e){function t(e){return i[e]?i[e]:(i[e]=e.replace(o,"_"),i[e])}function r(e){var r;return r="object"==typeof e?Object.keys(e).filter(function(t){return e[t]}):Array.prototype.slice.call(arguments),r.map(t).join(" ")}var o=/\//g,i={};e.exports=r},function(e){function t(e,t,r,o,i){function n(){for(var i=[],a=0,l=arguments.length;l>a;a++)i.push(arguments[a]);n.reset(),s=o(function(){e.apply(r,i)},t)}o=o||setTimeout,i=i||clearTimeout;var s;return n.reset=function(){i(s)},n}e.exports=t},function(e){function t(e){return function(){return e}}function r(){}r.thatReturns=t,r.thatReturnsFalse=t(!1),r.thatReturnsTrue=t(!0),r.thatReturnsNull=t(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e){"use strict";var t=function(e,t,r,o,i,n,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,o,i,n,s,a],h=0;l=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return u[h++]}))}throw l.framesToPop=1,l}};e.exports=t},function(e){"use strict";function t(e,t){if(e===t)return!0;var r;for(r in e)if(e.hasOwnProperty(r)&&(!t.hasOwnProperty(r)||e[r]!==t[r]))return!1;for(r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return!1;return!0}e.exports=t},function(e,t,r){(function(t){"use strict";var o=r(48),i=r(49),n=i("transform"),s=i("backfaceVisibility"),a=function(){if(o.hasCSSTransforms()){var e=t.window?t.window.navigator.userAgent:"UNKNOWN",r=/Safari\//.test(e)&&!/Chrome\//.test(e);return!r&&o.hasCSS3DTransforms()?function(e,t,r){e[n]="translate3d("+t+"px,"+r+"px,0)",e[s]="hidden"}:function(e,t,r){e[n]="translate("+t+"px,"+r+"px)"}}return function(e,t,r){e.left=t+"px",e.top=r+"px"}}();e.exports=a}).call(t,function(){return this}())},function(e){e.exports=React},function(e,t,r){"use strict";function o(e,t,r){this.$DOMMouseMoveTracker_isDragging=!1,this.$DOMMouseMoveTracker_animationFrameID=null,this.$DOMMouseMoveTracker_domNode=r,this.$DOMMouseMoveTracker_onMove=e,this.$DOMMouseMoveTracker_onMoveEnd=t,this.$DOMMouseMoveTracker_onMouseMove=this.$DOMMouseMoveTracker_onMouseMove.bind(this),this.$DOMMouseMoveTracker_onMouseUp=this.$DOMMouseMoveTracker_onMouseUp.bind(this),this.$DOMMouseMoveTracker_didMouseMove=this.$DOMMouseMoveTracker_didMouseMove.bind(this)}var i=r(50),n=r(51),s=r(47);o.prototype.captureMouseMoves=function(e){this.$DOMMouseMoveTracker_eventMoveToken||this.$DOMMouseMoveTracker_eventUpToken||(this.$DOMMouseMoveTracker_eventMoveToken=i.listen(this.$DOMMouseMoveTracker_domNode,"mousemove",this.$DOMMouseMoveTracker_onMouseMove),this.$DOMMouseMoveTracker_eventUpToken=i.listen(this.$DOMMouseMoveTracker_domNode,"mouseup",this.$DOMMouseMoveTracker_onMouseUp)),this.$DOMMouseMoveTracker_isDragging||(this.$DOMMouseMoveTracker_deltaX=0,this.$DOMMouseMoveTracker_deltaY=0,this.$DOMMouseMoveTracker_isDragging=!0,this.$DOMMouseMoveTracker_x=e.clientX,this.$DOMMouseMoveTracker_y=e.clientY),e.preventDefault()},o.prototype.releaseMouseMoves=function(){this.$DOMMouseMoveTracker_eventMoveToken&&this.$DOMMouseMoveTracker_eventUpToken&&(this.$DOMMouseMoveTracker_eventMoveToken.remove(),this.$DOMMouseMoveTracker_eventMoveToken=null,this.$DOMMouseMoveTracker_eventUpToken.remove(),this.$DOMMouseMoveTracker_eventUpToken=null),null!==this.$DOMMouseMoveTracker_animationFrameID&&(n(this.$DOMMouseMoveTracker_animationFrameID),this.$DOMMouseMoveTracker_animationFrameID=null),this.$DOMMouseMoveTracker_isDragging&&(this.$DOMMouseMoveTracker_isDragging=!1,this.$DOMMouseMoveTracker_x=null,this.$DOMMouseMoveTracker_y=null)},o.prototype.isDragging=function(){return this.$DOMMouseMoveTracker_isDragging},o.prototype.$DOMMouseMoveTracker_onMouseMove=function(e){var t=e.clientX,r=e.clientY;this.$DOMMouseMoveTracker_deltaX+=t-this.$DOMMouseMoveTracker_x,this.$DOMMouseMoveTracker_deltaY+=r-this.$DOMMouseMoveTracker_y,null===this.$DOMMouseMoveTracker_animationFrameID&&(this.$DOMMouseMoveTracker_animationFrameID=s(this.$DOMMouseMoveTracker_didMouseMove)),this.$DOMMouseMoveTracker_x=t,this.$DOMMouseMoveTracker_y=r,e.preventDefault()},o.prototype.$DOMMouseMoveTracker_didMouseMove=function(){this.$DOMMouseMoveTracker_animationFrameID=null,this.$DOMMouseMoveTracker_onMove(this.$DOMMouseMoveTracker_deltaX,this.$DOMMouseMoveTracker_deltaY),this.$DOMMouseMoveTracker_deltaX=0,this.$DOMMouseMoveTracker_deltaY=0},o.prototype.$DOMMouseMoveTracker_onMouseUp=function(){this.$DOMMouseMoveTracker_animationFrameID&&this.$DOMMouseMoveTracker_didMouseMove(),this.$DOMMouseMoveTracker_onMoveEnd()},e.exports=o},function(e){e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(e){"use strict";function t(e){if(r.hasOwnProperty(e))return r[e];throw new Error('cssVar("'+e+'"): Unexpected class transformation.')}var r={"scrollbar-face-active-color":"#7d7d7d","scrollbar-face-color":"#c2c2c2","scrollbar-face-margin":"4px","scrollbar-face-radius":"6px","scrollbar-size":"15px","scrollbar-size-large":"17px","scrollbar-track-color":"rgba(255, 255, 255, 0.8)"};t.CSS_VARS=r,e.exports=t},function(e,t,r){"use strict";function o(e,t,r,o){s(0!==t,"defaultRowHeight musn't be equal 0 in FixedDataTableRowBuffer"),this.$FixedDataTableRowBuffer_bufferSet=new i,this.$FixedDataTableRowBuffer_defaultRowHeight=t,this.$FixedDataTableRowBuffer_viewportRowsBegin=0,this.$FixedDataTableRowBuffer_viewportRowsEnd=0,this.$FixedDataTableRowBuffer_maxVisibleRowCount=Math.ceil(r/t)+1,this.$FixedDataTableRowBuffer_bufferRowsCount=n(a,Math.floor(this.$FixedDataTableRowBuffer_maxVisibleRowCount/2),l),this.$FixedDataTableRowBuffer_rowsCount=e,this.$FixedDataTableRowBuffer_rowHeightGetter=o,this.$FixedDataTableRowBuffer_rows=[],this.$FixedDataTableRowBuffer_viewportHeight=r,this.getRows=this.getRows.bind(this),this.getRowsWithUpdatedBuffer=this.getRowsWithUpdatedBuffer.bind(this)}var i=r(52),n=r(43),s=r(34),a=5,l=15;o.prototype.getRowsWithUpdatedBuffer=function(){for(var e=2*this.$FixedDataTableRowBuffer_bufferRowsCount,t=Math.max(this.$FixedDataTableRowBuffer_viewportRowsBegin-this.$FixedDataTableRowBuffer_bufferRowsCount,0);t<this.$FixedDataTableRowBuffer_viewportRowsBegin;)this.$FixedDataTableRowBuffer_addRowToBuffer(t,this.$FixedDataTableRowBuffer_viewportHeight,this.$FixedDataTableRowBuffer_viewportRowsBegin,this.$FixedDataTableRowBuffer_viewportRowsEnd-1),t++,e--;for(t=this.$FixedDataTableRowBuffer_viewportRowsEnd;t<this.$FixedDataTableRowBuffer_rowsCount&&e>0;)this.$FixedDataTableRowBuffer_addRowToBuffer(t,this.$FixedDataTableRowBuffer_viewportHeight,this.$FixedDataTableRowBuffer_viewportRowsBegin,this.$FixedDataTableRowBuffer_viewportRowsEnd-1),t++,e--;return this.$FixedDataTableRowBuffer_rows},o.prototype.getRows=function(e,t){this.$FixedDataTableRowBuffer_hideAllRows();var r=t,o=r,i=e,n=Math.min(e+this.$FixedDataTableRowBuffer_maxVisibleRowCount,this.$FixedDataTableRowBuffer_rowsCount);for(this.$FixedDataTableRowBuffer_viewportRowsBegin=e;n>i||o<this.$FixedDataTableRowBuffer_viewportHeight&&i<this.$FixedDataTableRowBuffer_rowsCount;)this.$FixedDataTableRowBuffer_addRowToBuffer(i,o,e,n-1),o+=this.$FixedDataTableRowBuffer_rowHeightGetter(i),++i,this.$FixedDataTableRowBuffer_viewportRowsEnd=i;return this.$FixedDataTableRowBuffer_rows},o.prototype.$FixedDataTableRowBuffer_addRowToBuffer=function(e,t,r,o){var i=this.$FixedDataTableRowBuffer_bufferSet.getValuePosition(e),n=o-r+1,s=n+2*this.$FixedDataTableRowBuffer_bufferRowsCount;null===i&&this.$FixedDataTableRowBuffer_bufferSet.getSize()>=s&&(i=this.$FixedDataTableRowBuffer_bufferSet.replaceFurthestValuePosition(r,o,e)),null===i?(i=this.$FixedDataTableRowBuffer_bufferSet.getNewPositionForValue(e),this.$FixedDataTableRowBuffer_rows[i]={rowIndex:e,offsetTop:t}):(this.$FixedDataTableRowBuffer_rows[i].rowIndex=e,this.$FixedDataTableRowBuffer_rows[i].offsetTop=t)},o.prototype.$FixedDataTableRowBuffer_hideAllRows=function(){for(var e=this.$FixedDataTableRowBuffer_rows.length-1;e>-1;)this.$FixedDataTableRowBuffer_rows[e].offsetTop=this.$FixedDataTableRowBuffer_viewportHeight,e--},e.exports=o},function(e){"use strict";function t(e){e||(e="");var t,r=arguments.length;if(r>1)for(var o=1;r>o;o++)t=arguments[o],t&&(e=(e?e+" ":"")+t);return e}e.exports=t},function(e){function t(e,t,r){return e>t?e:t>r?r:t}e.exports=t},function(e,t,r){"use strict";var o=r(20),i=r(53),n=r(19),s=r(22),a=r(54),l=r(31),u=o.renderToString,h=r(36),c=n.PropTypes,f=new i({}),p=n.createClass({displayName:"FixedDataTableCellGroupImpl",mixins:[s],propTypes:{columns:c.array.isRequired,data:c.oneOfType([c.object,c.array]),onColumnResize:c.func,rowHeight:c.number.isRequired,rowIndex:c.number.isRequired,zIndex:c.number.isRequired},render:function(){for(var e=this.props,t=e.columns,r=[],o=0,i=0,s=t.length;s>i;i++){var a=t[i].props;o+=a.width;var u="cell_"+i;r.push(this._renderCell(e.data,e.rowIndex,e.rowHeight,a,o,u))}var h={width:o,height:e.height,zIndex:e.zIndex};return n.createElement("div",{className:l("fixedDataTableCellGroup/cellGroup"),style:h},r)},_renderCell:function(e,t,r,o,i,s){var l,h=o.cellRenderer||u,c=o.columnData||f,p=o.dataKey,d=o.isFooterCell,m=o.isHeaderCell;if(m||d)l=e[p];else{var v=o.cellDataGetter;l=v?v(p,e):e[p]}var g=o.isResizable&&this.props.onColumnResize,w=g?this.props.onColumnResize:null;return n.createElement(a,{align:o.align,cellData:l,cellDataKey:p,cellRenderer:h,className:o.cellClassName,columnData:c,height:r,isFooterCell:d,isHeaderCell:m,key:s,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:w,rowData:e,rowIndex:t,width:o.width,widthOffset:i})}}),d=n.createClass({displayName:"FixedDataTableCellGroup",mixins:[s],propTypes:{height:c.number.isRequired,left:c.number,zIndex:c.number.isRequired},render:function(){var e=this.props,t=e.left,r=function(e,t){var r={},o=Object.prototype.hasOwnProperty;if(null==e)throw new TypeError;for(var i in e)o.call(e,i)&&!o.call(t,i)&&(r[i]=e[i]);return r}(e,{left:1}),o={height:r.height};t&&h(o,t,0);var i=r.onColumnResize?this._onColumnResize:null;return n.createElement("div",{style:o,className:l("fixedDataTableCellGroup/cellGroupWrapper")},n.createElement(p,n.__spread({},r,{onColumnResize:i})))},_onColumnResize:function(e,t,r,o,i,n){this.props.onColumnResize&&this.props.onColumnResize(e,this.props.left,t,r,o,i,n)}});e.exports=d},function(e,t){(function(t){"use strict";function r(e,r){var o=this.getInternalLeafCount(e);this.$PrefixIntervalTree_leafCount=e,this.$PrefixIntervalTree_internalLeafCount=o;var i=2*o,n=t.Int32Array||Array;this.$PrefixIntervalTree_value=new n(i),this.$PrefixIntervalTree_initTables(r||0),this.get=this.get.bind(this),this.set=this.set.bind(this),this.lowerBound=this.lowerBound.bind(this),this.upperBound=this.upperBound.bind(this)}r.prototype.getInternalLeafCount=function(e){for(var t=1;e>t;)t*=2;return t},r.prototype.$PrefixIntervalTree_initTables=function(e){var t,r=this.$PrefixIntervalTree_internalLeafCount,o=this.$PrefixIntervalTree_internalLeafCount+this.$PrefixIntervalTree_leafCount-1;for(t=r;o>=t;++t)this.$PrefixIntervalTree_value[t]=e;var i=this.$PrefixIntervalTree_internalLeafCount-1;for(t=i;t>0;--t)this.$PrefixIntervalTree_value[t]=this.$PrefixIntervalTree_value[2*t]+this.$PrefixIntervalTree_value[2*t+1]},r.prototype.set=function(e,t){var r=e+this.$PrefixIntervalTree_internalLeafCount;for(this.$PrefixIntervalTree_value[r]=t,r=Math.floor(r/2);0!==r;)this.$PrefixIntervalTree_value[r]=this.$PrefixIntervalTree_value[2*r]+this.$PrefixIntervalTree_value[2*r+1],r=Math.floor(r/2)},r.prototype.get=function(e){e=Math.min(e,this.$PrefixIntervalTree_leafCount);for(var t=e+this.$PrefixIntervalTree_internalLeafCount,r=this.$PrefixIntervalTree_value[t];t>1;)t%2===1&&(r=this.$PrefixIntervalTree_value[t-1]+r),t=Math.floor(t/2);return{index:e,value:r}},r.prototype.upperBound=function(e){var t=this.$PrefixIntervalTree_upperBoundImpl(1,0,this.$PrefixIntervalTree_internalLeafCount-1,e);return t.index>this.$PrefixIntervalTree_leafCount-1&&(t.index=this.$PrefixIntervalTree_leafCount-1),t},r.prototype.lowerBound=function(e){var t=this.upperBound(e);if(t.value>e&&t.index>0){var r=t.value-this.$PrefixIntervalTree_value[this.$PrefixIntervalTree_internalLeafCount+t.index];r===e&&(t.value=r,t.index--)}return t},r.prototype.$PrefixIntervalTree_upperBoundImpl=function(e,t,r,o){if(t===r)return{index:e-this.$PrefixIntervalTree_internalLeafCount,value:this.$PrefixIntervalTree_value[e]};var i=Math.floor((t+r+1)/2);if(o<this.$PrefixIntervalTree_value[2*e])return this.$PrefixIntervalTree_upperBoundImpl(2*e,t,i-1,o);var n=this.$PrefixIntervalTree_upperBoundImpl(2*e+1,i,r,o-this.$PrefixIntervalTree_value[2*e]);return n.value+=this.$PrefixIntervalTree_value[2*e],n},e.exports=r}).call(t,function(){return this}())},function(e,t,r){"use strict";function o(e){var t=0,r=0,o=0,i=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),o=t*s,i=r*s,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||i)&&e.deltaMode&&(1==e.deltaMode?(o*=a,i*=a):(o*=l,i*=l)),o&&!t&&(t=1>o?-1:1),i&&!r&&(r=1>i?-1:1),{spinX:t,spinY:r,pixelX:o,pixelY:i}}var i=r(55),n=r(56),s=10,a=40,l=800;o.getEventType=function(){return i.firefox()?"DOMMouseScroll":n("wheel")?"wheel":"mousewheel"},e.exports=o},function(e,t,r){(function(t){var o=r(33),i=r(57),n=0,s=i||function(e){var r=Date.now(),o=Math.max(0,16-(r-n));return n=r+o,t.setTimeout(function(){e(Date.now())},o)};s(o),e.exports=s}).call(t,function(){return this}())},function(e,t,r){var o=r(49),i={hasCSSAnimations:function(){return!!o("animationName")},hasCSSTransforms:function(){return!!o("transform")},hasCSS3DTransforms:function(){return!!o("perspective")},hasCSSTransitions:function(){return!!o("transition")}};e.exports=i},function(e,t,r){function o(e){for(var t=0;t<u.length;t++){var r=u[t]+e;if(r in c)return r}return null}function i(e){var t=s(e);if(void 0===l[t]){var r=t.charAt(0).toUpperCase()+t.slice(1);h.test(r)&&a(!1,"getVendorPrefixedName must only be called with unprefixedCSS property names. It was called with %s",e),l[t]=t in c?t:o(r)}return l[t]}var n=r(58),s=r(59),a=r(34),l={},u=["Webkit","ms","Moz","O"],h=new RegExp("^("+u.join("|")+")"),c=n.canUseDOM?document.createElement("div").style:{};e.exports=i},function(e,t,r){var o=r(33),i={listen:function(e,t,r){return e.addEventListener?(e.addEventListener(t,r,!1),{remove:function(){e.removeEventListener(t,r,!1)}}):e.attachEvent?(e.attachEvent("on"+t,r),{remove:function(){e.detachEvent("on"+t,r)}}):void 0},capture:function(e,t,r){return e.addEventListener?(e.addEventListener(t,r,!0),{remove:function(){e.removeEventListener(t,r,!0)}}):{remove:o}},registerDefault:function(){}};e.exports=i},function(e,t){(function(t){var r=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||t.msCancelAnimationFrame||t.clearTimeout;e.exports=r}).call(t,function(){return this}())},function(e,t,r){"use strict";function o(){this.$IntegerBufferSet_valueToPositionMap={},this.$IntegerBufferSet_size=0,this.$IntegerBufferSet_smallValues=new i([],this.$IntegerBufferSet_smallerComparator),this.$IntegerBufferSet_largeValues=new i([],this.$IntegerBufferSet_greaterComparator),this.getNewPositionForValue=this.getNewPositionForValue.bind(this),this.getValuePosition=this.getValuePosition.bind(this),this.getSize=this.getSize.bind(this),this.replaceFurthestValuePosition=this.replaceFurthestValuePosition.bind(this)}var i=r(62),n=r(34);o.prototype.getSize=function(){return this.$IntegerBufferSet_size},o.prototype.getValuePosition=function(e){return void 0===this.$IntegerBufferSet_valueToPositionMap[e]?null:this.$IntegerBufferSet_valueToPositionMap[e]},o.prototype.getNewPositionForValue=function(e){n(void 0===this.$IntegerBufferSet_valueToPositionMap[e],"Shouldn't try to find new position for value already stored in BufferSet");var t=this.$IntegerBufferSet_size;return this.$IntegerBufferSet_size++,this.$IntegerBufferSet_pushToHeaps(t,e),this.$IntegerBufferSet_valueToPositionMap[e]=t,t},o.prototype.replaceFurthestValuePosition=function(e,t,r){if(n(void 0===this.$IntegerBufferSet_valueToPositionMap[r],"Shouldn't try to replace values with value already stored value in BufferSet"),this.$IntegerBufferSet_cleanHeaps(),this.$IntegerBufferSet_smallValues.empty()||this.$IntegerBufferSet_largeValues.empty())return null;var o=this.$IntegerBufferSet_smallValues.peek().value,i=this.$IntegerBufferSet_largeValues.peek().value;if(o>=e&&t>=i)return null;var s;e-o>i-t?(s=o,this.$IntegerBufferSet_smallValues.pop()):(s=i,this.$IntegerBufferSet_largeValues.pop());var a=this.$IntegerBufferSet_valueToPositionMap[s];return delete this.$IntegerBufferSet_valueToPositionMap[s],this.$IntegerBufferSet_valueToPositionMap[r]=a,this.$IntegerBufferSet_pushToHeaps(a,r),a},o.prototype.$IntegerBufferSet_pushToHeaps=function(e,t){var r={position:e,value:t};this.$IntegerBufferSet_smallValues.push(r),this.$IntegerBufferSet_largeValues.push(r)},o.prototype.$IntegerBufferSet_cleanHeaps=function(){this.$IntegerBufferSet_cleanHeap(this.$IntegerBufferSet_smallValues),this.$IntegerBufferSet_cleanHeap(this.$IntegerBufferSet_largeValues);var e=Math.min(this.$IntegerBufferSet_smallValues.size(),this.$IntegerBufferSet_largeValues.size()),t=Math.max(this.$IntegerBufferSet_smallValues.size(),this.$IntegerBufferSet_largeValues.size());t>10*e&&this.$IntegerBufferSet_recreateHeaps()},o.prototype.$IntegerBufferSet_recreateHeaps=function(){for(var e=this.$IntegerBufferSet_smallValues.size()<this.$IntegerBufferSet_largeValues.size()?this.$IntegerBufferSet_smallValues:this.$IntegerBufferSet_largeValues,t=new i([],this.$IntegerBufferSet_smallerComparator),r=new i([],this.$IntegerBufferSet_greaterComparator);!e.empty();){var o=e.pop();void 0!==this.$IntegerBufferSet_valueToPositionMap[o.value]&&(t.push(o),r.push(o))}this.$IntegerBufferSet_smallValues=t,this.$IntegerBufferSet_largeValues=r},o.prototype.$IntegerBufferSet_cleanHeap=function(e){for(;!e.empty()&&void 0===this.$IntegerBufferSet_valueToPositionMap[e.peek().value];)e.pop()},o.prototype.$IntegerBufferSet_smallerComparator=function(e,t){return e.value<t.value},o.prototype.$IntegerBufferSet_greaterComparator=function(e,t){return e.value>t.value},e.exports=o},function(e,t,r){"use strict";function o(e){a(e instanceof s,"ImmutableObject: Attempted to set fields on an object that is not an instance of ImmutableValue.")}function i(){s.call(this,s[f]),s.mergeAllPropertiesInto(this,arguments)}function n(e,t){h(e,t);for(var r={},o=Object.keys(e),a=0;a<o.length;a++){var l=o[a];r[l]=t.hasOwnProperty(l)?c(e[l])||c(t[l])?t[l]:n(e[l],t[l]):e[l]}var u=Object.keys(t);for(a=0;a<u.length;a++){var f=u[a];e.hasOwnProperty(f)||(r[f]=t[f])}return e instanceof s?new i(r):t instanceof s?new i(r):r}var s=r(63),a=r(34),l=r(64),u=r(65),h=u.checkMergeObjectArgs,c=u.isTerminal,f=l({_DONT_EVER_TYPE_THIS_SECRET_KEY:null});for(var p in s)s.hasOwnProperty(p)&&(i[p]=s[p]);var d=null===s?null:s.prototype;i.prototype=Object.create(d),i.prototype.constructor=i,i.__superConstructor__=s,i.create=function(){var e=Object.create(i.prototype);return i.apply(e,arguments),e},i.set=function(e,t){return o(e),a("object"==typeof t&&void 0!==t&&!Array.isArray(t),"Invalid ImmutableMap.set argument `put`"),new i(e,t)},i.setProperty=function(e,t,r){var o={};return o[t]=r,i.set(e,o)},i.deleteProperty=function(e,t){var r={};for(var o in e)o!==t&&e.hasOwnProperty(o)&&(r[o]=e[o]);return new i(r)},i.setDeep=function(e,t){return o(e),n(e,t)},i.values=function(e){return Object.keys(e).map(function(t){return e[t]})},e.exports=i},function(e,t,r){var o=r(53),i=r(19),n=r(30),s=r(31),a=r(42),l=i.PropTypes,u=new o({align:"left",highlighted:!1,isFooterCell:!1,isHeaderCell:!1}),h=i.createClass({displayName:"FixedDataTableCell",propTypes:{align:l.oneOf(["left","center","right"]),className:l.string,highlighted:l.bool,isFooterCell:l.bool,isHeaderCell:l.bool,width:l.number.isRequired,minWidth:l.number,maxWidth:l.number,height:l.number.isRequired,cellData:l.any,cellDataKey:l.oneOfType([l.string.isRequired,l.number.isRequired]),cellRenderer:l.func.isRequired,columnData:l.any,rowData:l.oneOfType([l.object.isRequired,l.array.isRequired]),rowIndex:l.number.isRequired,onColumnResize:l.func,widthOffset:l.number,left:l.number},shouldComponentUpdate:function(e){var t,r=this.props;for(t in r)if(r[t]!==e[t]&&"left"!==t)return!0;for(t in e)if(r[t]!==e[t]&&"left"!==t)return!0;return!1},getDefaultProps:function(){return u},render:function(){var e,t=this.props,r={width:t.width,height:t.height},o=a(s({"public/fixedDataTableCell/main":!0,"public/fixedDataTableCell/highlighted":t.highlighted,"public/fixedDataTableCell/lastChild":t.lastChild,"public/fixedDataTableCell/alignRight":"right"===t.align,"public/fixedDataTableCell/alignCenter":"center"===t.align}),t.className);e=t.isHeaderCell||t.isFooterCell?t.cellRenderer(t.cellData,t.cellDataKey,t.columnData,t.rowData,t.width):t.cellRenderer(t.cellData,t.cellDataKey,t.rowData,t.rowIndex,t.columnData,t.width);var l=s("public/fixedDataTableCell/cellContent");e=i.isValidElement(e)?n(e,{className:l}):i.createElement("div",{className:l},e);var u;if(t.onColumnResize){var h={height:t.height};u=i.createElement("div",{className:s("fixedDataTableCell/columnResizerContainer"),style:h,onMouseDown:this._onColumnResizerMouseDown},i.createElement("div",{className:s("fixedDataTableCell/columnResizerKnob"),style:h}))}return i.createElement("div",{className:o,style:r},u,i.createElement("div",{className:s("public/fixedDataTableCell/wrap1"),style:r},i.createElement("div",{className:s("public/fixedDataTableCell/wrap2")},i.createElement("div",{className:s("public/fixedDataTableCell/wrap3")},e))))},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.widthOffset,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.cellDataKey,e)}});e.exports=h},function(e){function t(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),w=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),d=/\b(iP[ao]d)/.exec(e),c=/Android/i.exec(e),m=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),f=!!/Win64/.exec(e),t){r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):0/0,r&&document&&document.documentMode&&(r=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(e);a=_?parseFloat(_[1])+4:r,o=t[2]?parseFloat(t[2]):0/0,i=t[3]?parseFloat(t[3]):0/0,n=t[4]?parseFloat(t[4]):0/0,n?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),s=t&&t[1]?parseFloat(t[1]):0/0):s=0/0}else r=o=i=s=n=0/0;if(w){if(w[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=b?parseFloat(b[1].replace("_",".")):!0}else l=!1;u=!!w[2],h=!!w[3]}else l=u=h=!1}}var r,o,i,n,s,a,l,u,h,c,f,p,d,m,v,g=!1,w={ie:function(){return t()||r},ieCompatibilityMode:function(){return t()||a>r},ie64:function(){return w.ie()&&f},firefox:function(){return t()||o},opera:function(){return t()||i},webkit:function(){return t()||n},safari:function(){return w.webkit()},chrome:function(){return t()||s},windows:function(){return t()||u},osx:function(){return t()||l},linux:function(){return t()||h},iphone:function(){return t()||p},mobile:function(){return t()||p||d||c||v},nativeApp:function(){return t()||m},android:function(){return t()||c},ipad:function(){return t()||d}};e.exports=w},function(e,t,r){"use strict";function o(e,t){if(!n.canUseDOM||t&&!("addEventListener"in document))return!1;var r="on"+e,o=r in document;if(!o){var s=document.createElement("div");s.setAttribute(r,"return;"),o="function"==typeof s[r]}return!o&&i&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}var i,n=r(58);n.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=o},function(e,t){(function(t){var r=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=r}).call(t,function(){return this}())},function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=r},function(e){function t(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=t},function(e,t,r){"use strict";var o=r(72),i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,r){(function(t){"use strict";function o(e,r){"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?a(!e.ref,"You are calling cloneWithProps() on a child with a ref. This is dangerous because you're creating a new child which will not be added as a ref to its parent."):null);var o=n.mergeProps(r,e.props);return!o.hasOwnProperty(l)&&e.props.hasOwnProperty(l)&&(o.children=e.props.children),i.createElement(e.type,o)}var i=r(68),n=r(69),s=r(70),a=r(71),l=s({children:null});e.exports=o}).call(t,r(73))},function(e){"use strict";function t(e,t){return t>e}function r(e,r){this._items=e||[],this._size=this._items.length,this._comparator=r||t,this._heapify()}r.prototype.empty=function(){return 0===this._size},r.prototype.pop=function(){if(0!==this._size){var e=this._items[0],t=this._items.pop();return this._size--,this._size>0&&(this._items[0]=t,this._sinkDown(0)),e}},r.prototype.push=function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)},r.prototype.size=function(){return this._size},r.prototype.peek=function(){return 0!==this._size?this._items[0]:void 0},r.prototype._heapify=function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)},r.prototype._bubbleUp=function(e){for(var t=this._items[e];e>0;){var r=Math.floor((e+1)/2)-1,o=this._items[r];if(this._comparator(o,t))return;this._items[r]=t,this._items[e]=o,e=r}},r.prototype._sinkDown=function(e){for(var t=this._items[e];;){var r=2*(e+1)-1,o=2*(e+1),i=-1;if(r<this._size){var n=this._items[r];this._comparator(n,t)&&(i=r)}if(o<this._size){var s=this._items[o];this._comparator(s,t)&&(-1===i||this._comparator(s,this._items[i]))&&(i=o)}if(-1===i)return;this._items[e]=this._items[i],this._items[i]=t,e=i}},e.exports=r},function(e,t,r){"use strict";function o(e){i(e===o[a],"Only certain classes should create instances of `ImmutableValue`.You probably want something like ImmutableValueObject.create.")}var i=r(34),n=r(66),s=r(64),a=s({_DONT_EVER_TYPE_THIS_SECRET_KEY:null});o.mergeAllPropertiesInto=function(e,t){for(var r=t.length,o=0;r>o;o++)Object.assign(e,t[o])},o.deepFreezeRootNode=function(e){if(!n(e)){Object.freeze(e);for(var t in e)e.hasOwnProperty(t)&&o.recurseDeepFreeze(e[t]);Object.seal(e)}},o.recurseDeepFreeze=function(e){if(!n(e)&&o.shouldRecurseFreeze(e)){Object.freeze(e);for(var t in e)e.hasOwnProperty(t)&&o.recurseDeepFreeze(e[t]);Object.seal(e)}},o.shouldRecurseFreeze=function(e){return"object"==typeof e&&!(e instanceof o)&&null!==e},o._DONT_EVER_TYPE_THIS_SECRET_KEY=Math.random(),e.exports=o},function(e){var t=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=t},function(e,t,r){"use strict";var o=r(34),i=r(67),n=36,s=function(e){return"object"!=typeof e||e instanceof Date||null===e},a={MAX_MERGE_DEPTH:n,isTerminal:s,normalizeMergeArg:function(e){return void 0===e||null===e?{}:e},checkMergeArrayArgs:function(e,t){o(Array.isArray(e)&&Array.isArray(t),"Tried to merge arrays, instead got %s and %s.",e,t)},checkMergeObjectArgs:function(e,t){a.checkMergeObjectArg(e),a.checkMergeObjectArg(t)},checkMergeObjectArg:function(e){o(!s(e)&&!Array.isArray(e),"Tried to merge an object, instead got %s.",e)},checkMergeIntoObjectArg:function(e){o(!(s(e)&&"function"!=typeof e||Array.isArray(e)),"Tried to merge into an object, instead got %s.",e)},checkMergeLevel:function(e){o(n>e,"Maximum deep merge depth exceeded. You may be attempting to merge circular structures in an unsupported way.")},checkArrayStrategy:function(e){o(void 0===e||e in a.ArrayStrategies,"You must provide an array strategy to deep merge functions to instruct the deep merge how to resolve merging two arrays.")},ArrayStrategies:i({Clobber:!0,IndexByIndex:!0})};e.exports=a},function(e){function t(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=t},function(e,t,r){"use strict";var o=r(34),i=function(e){var t,r={};o(e instanceof Object&&!Array.isArray(e),"keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};e.exports=i},function(e,t,r){(function(t){"use strict";function o(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[r]:null},set:function(e){"production"!==t.env.NODE_ENV?a(!1,"Don't set the "+r+" property of the component. Mutate the existing props object instead."):null,this._store[r]=e}})}function i(e){try{var t={props:!0};for(var r in t)o(e,r);u=!0}catch(i){}}var n=r(78),s=r(79),a=r(71),l={key:!0,ref:!0},u=!1,h=function(e,r,o,i,n,s){return this.type=e,this.key=r,this.ref=o,this._owner=i,this._context=n,"production"!==t.env.NODE_ENV&&(this._store={validated:!1,props:s},u)?void Object.freeze(this):void(this.props=s) };h.prototype={_isReactElement:!0},"production"!==t.env.NODE_ENV&&i(h.prototype),h.createElement=function(e,r,o){var i,u={},c=null,f=null;if(null!=r){f=void 0===r.ref?null:r.ref,"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?a(null!==r.key,"createElement(...): Encountered component with a `key` of null. In a future version, this will be treated as equivalent to the string 'null'; instead, provide an explicit key or use undefined."):null),c=null==r.key?null:""+r.key;for(i in r)r.hasOwnProperty(i)&&!l.hasOwnProperty(i)&&(u[i]=r[i])}var p=arguments.length-2;if(1===p)u.children=o;else if(p>1){for(var d=Array(p),m=0;p>m;m++)d[m]=arguments[m+2];u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(i in v)"undefined"==typeof u[i]&&(u[i]=v[i])}return new h(e,c,f,s.current,n.current,u)},h.createFactory=function(e){var t=h.createElement.bind(null,e);return t.type=e,t},h.cloneAndReplaceProps=function(e,r){var o=new h(e.type,e.key,e.ref,e._owner,e._context,r);return"production"!==t.env.NODE_ENV&&(o._store.validated=e._store.validated),o},h.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},e.exports=h}).call(t,r(73))},function(e,t,r){(function(t){"use strict";function o(e){return function(t,r,o){t[r]=t.hasOwnProperty(r)?e(t[r],o):o}}function i(e,t){for(var r in t)if(t.hasOwnProperty(r)){var o=f[r];o&&f.hasOwnProperty(r)?o(e,r,t[r]):e.hasOwnProperty(r)||(e[r]=t[r])}return e}var n=r(74),s=r(75),a=r(76),l=r(77),u=r(71),h=!1,c=o(function(e,t){return n({},t,e)}),f={children:s,className:o(l),style:c},p={TransferStrategies:f,mergeProps:function(e,t){return i(n({},e),t)},Mixin:{transferPropsTo:function(e){return"production"!==t.env.NODE_ENV?a(e._owner===this,"%s: You can't call transferPropsTo() on a component that you don't own, %s. This usually means you are calling transferPropsTo() on a component passed in as props or children.",this.constructor.displayName,"string"==typeof e.type?e.type:e.type.displayName):a(e._owner===this),"production"!==t.env.NODE_ENV&&(h||(h=!0,"production"!==t.env.NODE_ENV?u(!1,"transferPropsTo is deprecated. See http://fb.me/react-transferpropsto for more information."):null)),i(e.props,this.props),e}}};e.exports=p}).call(t,r(73))},function(e){var t=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=t},function(e,t,r){(function(t){"use strict";var o=r(75),i=o;"production"!==t.env.NODE_ENV&&(i=function(e,t){for(var r=[],o=2,i=arguments.length;i>o;o++)r.push(arguments[o]);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(!e){var n=0;console.warn("Warning: "+t.replace(/%s/g,function(){return r[n++]}))}}),e.exports=i}).call(t,r(73))},function(e){"use strict";function t(e,t){if(e===t)return!0;var r;for(r in e)if(e.hasOwnProperty(r)&&(!t.hasOwnProperty(r)||e[r]!==t[r]))return!1;for(r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return!1;return!0}e.exports=t},function(e){function t(){}var r=e.exports={};r.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};var o=[];if(t){var i=document.createElement("div"),n=new MutationObserver(function(){var e=o.slice();o.length=0,e.forEach(function(e){e()})});return n.observe(i,{attributes:!0}),function(e){o.length||i.setAttribute("yes","no"),o.push(e)}}return r?(window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),o.length>0)){var r=o.shift();r()}},!0),function(e){o.push(e),window.postMessage("process-tick","*")}):function(e){setTimeout(e,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=t,r.addListener=t,r.once=t,r.off=t,r.removeListener=t,r.removeAllListeners=t,r.emit=t,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},function(e){function t(e){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var t=Object(e),r=Object.prototype.hasOwnProperty,o=1;o<arguments.length;o++){var i=arguments[o];if(null!=i){var n=Object(i);for(var s in n)r.call(n,s)&&(t[s]=n[s])}}return t}e.exports=t},function(e){function t(e){return function(){return e}}function r(){}r.thatReturns=t,r.thatReturnsFalse=t(!1),r.thatReturnsTrue=t(!0),r.thatReturnsNull=t(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,r){(function(t){"use strict";var r=function(e,r,o,i,n,s,a,l){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var u;if(void 0===r)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[o,i,n,s,a,l],c=0;u=new Error("Invariant Violation: "+r.replace(/%s/g,function(){return h[c++]}))}throw u.framesToPop=1,u}};e.exports=r}).call(t,r(73))},function(e){"use strict";function t(e){e||(e="");var t,r=arguments.length;if(r>1)for(var o=1;r>o;o++)t=arguments[o],t&&(e=(e?e+" ":"")+t);return e}e.exports=t},function(e,t,r){"use strict";var o=r(74),i={current:{},withContext:function(e,t){var r,n=i.current;i.current=o({},n,e);try{r=t()}finally{i.current=n}return r}};e.exports=i},function(e){"use strict";var t={current:null};e.exports=t}]);
ajax/libs/F2/1.2.1/f2.no-bootstrap.min.js
stefanneculai/cdnjs
/*! F2 - v1.2.2 - 08-22-2013 - See below for copyright and license */ (function(exports){if(!exports.F2||exports.F2_TESTING_MODE){/*! JSON.org requires the following notice to accompany json2: Copyright (c) 2002 JSON.org http://json.org 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 shall be used for Good, not Evil. 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. */ "object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,s=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?c+"":"null";case"boolean":case"null":return c+"";case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(i=c.length,n=0;i>n;n+=1)a[n]=str(n,c)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;i>n;n+=1)"string"==typeof rep[n]&&(r=rep[n],o=str(r,c),o&&a.push(quote(r)+(gap?": ":":")+o));else for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(o=str(r,c),o&&a.push(quote(r)+(gap?": ":":")+o));return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),/*! * jQuery JavaScript Library v1.8.3 * The jQuery Foundation and other contributors require the following notice to accompany jQuery: * * Copyright (c) 2013 jQuery Foundation and other contributors * * http://jquery.com * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software * is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ function(e,t){function n(e){var t=ht[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var o="data-"+n.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(o),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:gt.test(r)?Y.parseJSON(r):r}catch(i){}Y.data(e,n,r)}else r=t}return r}function o(e){var t;for(t in e)if(("data"!==t||!Y.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function l(e,t,n){if(t=t||0,Y.isFunction(t))return Y.grep(e,function(e,r){var o=!!t.call(e,r,e);return o===n});if(t.nodeType)return Y.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=Y.grep(e,function(e){return 1===e.nodeType});if(Pt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e){return Y.inArray(e,t)>=0===n})}function u(e){var t=Lt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function p(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function f(e,t){if(1===t.nodeType&&Y.hasData(e)){var n,r,o,i=Y._data(e),a=Y._data(t,i),s=i.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,o=s[n].length;o>r;r++)Y.event.add(t,n,s[n][r])}a.data&&(a.data=Y.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),Y.support.html5Clone&&e.innerHTML&&!Y.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Xt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Y.expando))}function h(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function g(e){Xt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,o=vn.length;o--;)if(t=vn[o]+n,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Y.css(e,"display")||!Y.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,o=[],i=0,a=e.length;a>i;i++)n=e[i],n.style&&(o[i]=Y._data(n,"olddisplay"),t?(o[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&y(n)&&(o[i]=Y._data(n,"olddisplay",x(n.nodeName)))):(r=nn(n,"display"),o[i]||"none"===r||Y._data(n,"olddisplay",r)));for(i=0;a>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?o[i]||"":"none"));return e}function b(e,t,n){var r=pn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function _(e,t,n,r){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,i=0;4>o;o+=2)"margin"===n&&(i+=Y.css(e,n+yn[o],!0)),r?("content"===n&&(i-=parseFloat(nn(e,"padding"+yn[o]))||0),"margin"!==n&&(i-=parseFloat(nn(e,"border"+yn[o]+"Width"))||0)):(i+=parseFloat(nn(e,"padding"+yn[o]))||0,"padding"!==n&&(i+=parseFloat(nn(e,"border"+yn[o]+"Width"))||0));return i}function C(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,o=!0,i=Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing");if(0>=r||null==r){if(r=nn(e,t),(0>r||null==r)&&(r=e.style[t]),fn.test(r))return r;o=i&&(Y.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+_(e,t,n||(i?"border":"content"),o)+"px"}function x(e){if(hn[e])return hn[e];var t=Y("<"+e+">").appendTo(Q.body),n=t.css("display");return t.remove(),("none"===n||""===n)&&(rn=Q.body.appendChild(rn||Y.extend(Q.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write("<!doctype html><html><body>"),on.close()),t=on.body.appendChild(on.createElement(e)),n=nn(t,"display"),Q.body.removeChild(rn)),hn[e]=n,n}function w(e,t,n,r){var o;if(Y.isArray(t))Y.each(t,function(t,o){n||Cn.test(e)?r(e,o):w(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==Y.type(t))r(e,t);else for(o in t)w(e+"["+o+"]",t[o],n,r)}function A(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o,i,a=t.toLowerCase().split(tt),s=0,c=a.length;if(Y.isFunction(n))for(;c>s;s++)r=a[s],i=/^\+/.test(r),i&&(r=r.substr(1)||"*"),o=e[r]=e[r]||[],o[i?"unshift":"push"](n)}}function F(e,n,r,o,i,a){i=i||n.dataTypes[0],a=a||{},a[i]=!0;for(var s,c=e[i],l=0,u=c?c.length:0,p=e===Hn;u>l&&(p||!s);l++)s=c[l](n,r,o),"string"==typeof s&&(!p||a[s]?s=t:(n.dataTypes.unshift(s),s=F(e,n,r,o,s,a)));return!p&&s||a["*"]||(s=F(e,n,r,o,"*",a)),s}function k(e,n){var r,o,i=Y.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((i[r]?e:o||(o={}))[r]=n[r]);o&&Y.extend(!0,e,o)}function E(e,n,r){var o,i,a,s,c=e.contents,l=e.dataTypes,u=e.responseFields;for(i in u)i in r&&(n[u[i]]=r[i]);for(;"*"===l[0];)l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("content-type"));if(o)for(i in c)if(c[i]&&c[i].test(o)){l.unshift(i);break}if(l[0]in r)a=l[0];else{for(i in r){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}s||(s=i)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function T(e,t){var n,r,o,i,a=e.dataTypes.slice(),s=a[0],c={},l=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)c[n.toLowerCase()]=e.converters[n];for(;o=a[++l];)if("*"!==o){if("*"!==s&&s!==o){if(n=c[s+" "+o]||c["* "+o],!n)for(r in c)if(i=r.split(" "),i[1]===o&&(n=c[s+" "+i[0]]||c["* "+i[0]])){n===!0?n=c[r]:c[r]!==!0&&(o=i[0],a.splice(l--,0,o));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(u){return{state:"parsererror",error:n?u:"No conversion from "+s+" to "+o}}}s=o}return{state:"success",data:t}}function N(){try{return new e.XMLHttpRequest}catch(t){}}function R(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function S(){return setTimeout(function(){Vn=t},0),Vn=Y.now()}function j(e,t){Y.each(t,function(t,n){for(var r=(er[t]||[]).concat(er["*"]),o=0,i=r.length;i>o;o++)if(r[o].call(e,t,n))return})}function O(e,t,n){var r,o=0,i=Zn.length,a=Y.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Vn||S(),n=Math.max(0,c.startTime+c.duration-t),r=n/c.duration||0,o=1-r,i=0,s=c.tweens.length;s>i;i++)c.tweens[i].run(o);return a.notifyWith(e,[c,o,n]),1>o&&s?n:(a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:Y.extend({},t),opts:Y.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Vn||S(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Y.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){for(var n=0,r=t?c.tweens.length:0;r>n;n++)c.tweens[n].run(1);return t?a.resolveWith(e,[c,t]):a.rejectWith(e,[c,t]),this}}),l=c.props;for(I(l,c.opts.specialEasing);i>o;o++)if(r=Zn[o].call(c,e,l,c.opts))return r;return j(c,l),Y.isFunction(c.opts.start)&&c.opts.start.call(e,c),Y.fx.timer(Y.extend(s,{anim:c,queue:c.opts.queue,elem:e})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function I(e,t){var n,r,o,i,a;for(n in e)if(r=Y.camelCase(n),o=t[r],i=e[n],Y.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),a=Y.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete e[r];for(n in i)n in e||(e[n]=i[n],t[n]=o)}else t[r]=o}function M(e,t,n){var r,o,i,a,s,c,l,u,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(u=Y._queueHooks(e,"fx"),null==u.unqueued&&(u.unqueued=0,p=u.empty.fire,u.empty.fire=function(){u.unqueued||p()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Y.queue(e,"fx").length||u.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===Y.css(e,"display")&&"none"===Y.css(e,"float")&&(Y.support.inlineBlockNeedsLayout&&"inline"!==x(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",Y.support.shrinkWrapBlocks||f.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Kn.exec(i)){if(delete t[r],c=c||"toggle"===i,i===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=Y._data(e,"fxshow")||Y._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),c&&(s.hidden=!m),m?Y(e).show():f.done(function(){Y(e).hide()}),f.done(function(){var t;Y.removeData(e,"fxshow",!0);for(t in h)Y.style(e,t,h[t])});for(r=0;a>r;r++)o=g[r],l=f.createTween(o,m?s[o]:0),h[o]=s[o]||Y.style(e,o),o in s||(s[o]=l.start,m&&(l.end=l.start,l.start="width"===o||"height"===o?1:0))}}function P(e,t,n,r,o){return new P.prototype.init(e,t,n,r,o)}function H(e,t){var n,r={height:e},o=0;for(t=t?1:0;4>o;o+=2-t)n=yn[o],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function D(e){return Y.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var L,B,Q=e.document,U=e.location,q=e.navigator,W=e.jQuery,$=e.$,z=Array.prototype.push,J=Array.prototype.slice,V=Array.prototype.indexOf,X=Object.prototype.toString,K=Object.prototype.hasOwnProperty,G=String.prototype.trim,Y=function(e,t){return new Y.fn.init(e,t,L)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,nt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,ot=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,it=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,st=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,ct=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,lt=/^-ms-/,ut=/-([\da-z])/gi,pt=function(e,t){return(t+"").toUpperCase()},ft=function(){Q.addEventListener?(Q.removeEventListener("DOMContentLoaded",ft,!1),Y.ready()):"complete"===Q.readyState&&(Q.detachEvent("onreadystatechange",ft),Y.ready())},dt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var o,i,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(o="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:rt.exec(e),!o||!o[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(o[1])return n=n instanceof Y?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:Q,e=Y.parseHTML(o[1],a,!0),ot.test(o[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);if(i=Q.getElementById(o[2]),i&&i.parentNode){if(i.id!==o[2])return r.find(e);this.length=1,this[0]=i}return this.context=Q,this.selector=e,this}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return J.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(J.apply(this,arguments),"slice",J.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,o,i,a,s=arguments[0]||{},c=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},c=2),"object"==typeof s||Y.isFunction(s)||(s={}),l===c&&(s=this,--c);l>c;c++)if(null!=(e=arguments[c]))for(n in e)r=s[n],o=e[n],s!==o&&(u&&o&&(Y.isPlainObject(o)||(i=Y.isArray(o)))?(i?(i=!1,a=r&&Y.isArray(r)?r:[]):a=r&&Y.isPlainObject(r)?r:{},s[n]=Y.extend(u,a,o)):o!==t&&(s[n]=o));return s},Y.extend({noConflict:function(t){return e.$===Y&&(e.$=$),t&&e.jQuery===Y&&(e.jQuery=W),Y},isReady:!1,readyWait:1,holdReady:function(e){e?Y.readyWait++:Y.ready(!0)},ready:function(e){if(e===!0?!--Y.readyWait:!Y.isReady){if(!Q.body)return setTimeout(Y.ready,1);Y.isReady=!0,e!==!0&&--Y.readyWait>0||(B.resolveWith(Q,[Y]),Y.fn.trigger&&Y(Q).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Y.type(e)},isArray:Array.isArray||function(e){return"array"===Y.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":dt[X.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Y.type(e)||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!K.call(e,"constructor")&&!K.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||K.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||Q,(r=ot.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(n){return n&&"string"==typeof n?(n=Y.trim(n),e.JSON&&e.JSON.parse?e.JSON.parse(n):it.test(n.replace(st,"@").replace(ct,"]").replace(at,""))?Function("return "+n)():(Y.error("Invalid JSON: "+n),t)):null},parseXML:function(n){var r,o;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(o=new DOMParser,r=o.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(i){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(lt,"ms-").replace(ut,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var o,i=0,a=e.length,s=a===t||Y.isFunction(e);if(r)if(s){for(o in e)if(n.apply(e[o],r)===!1)break}else for(;a>i&&n.apply(e[i++],r)!==!1;);else if(s){for(o in e)if(n.call(e[o],o,e[o])===!1)break}else for(;a>i&&n.call(e[i],i,e[i++])!==!1;);return e},trim:G&&!G.call(" ")?function(e){return null==e?"":G.call(e)}:function(e){return null==e?"":(e+"").replace(nt,"")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=Y.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||Y.isWindow(e)?z.call(r,e):Y.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(V)return V.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,o=e.length,i=0;if("number"==typeof r)for(;r>i;i++)e[o++]=n[i];else for(;n[i]!==t;)e[o++]=n[i++];return e.length=o,e},grep:function(e,t,n){var r,o=[],i=0,a=e.length;for(n=!!n;a>i;i++)r=!!t(e[i],i),n!==r&&o.push(e[i]);return o},map:function(e,n,r){var o,i,a=[],s=0,c=e.length,l=e instanceof Y||c!==t&&"number"==typeof c&&(c>0&&e[0]&&e[c-1]||0===c||Y.isArray(e));if(l)for(;c>s;s++)o=n(e[s],s,r),null!=o&&(a[a.length]=o);else for(i in e)o=n(e[i],i,r),null!=o&&(a[a.length]=o);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,o,i;return"string"==typeof n&&(r=e[n],n=e,e=r),Y.isFunction(e)?(o=J.call(arguments,2),i=function(){return e.apply(n,o.concat(J.call(arguments)))},i.guid=e.guid=e.guid||Y.guid++,i):t},access:function(e,n,r,o,i,a,s){var c,l=null==r,u=0,p=e.length;if(r&&"object"==typeof r){for(u in r)Y.access(e,n,u,r[u],1,a,o);i=1}else if(o!==t){if(c=s===t&&Y.isFunction(o),l&&(c?(c=n,n=function(e,t,n){return c.call(Y(e),n)}):(n.call(e,o),n=null)),n)for(;p>u;u++)n(e[u],r,c?o.call(e[u],u,n(e[u],r)):o,s);i=1}return i?e:l?n.call(e):p?n(e[0],r):a},now:function(){return(new Date).getTime()}}),Y.ready.promise=function(t){if(!B)if(B=Y.Deferred(),"complete"===Q.readyState)setTimeout(Y.ready,1);else if(Q.addEventListener)Q.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",Y.ready,!1);else{Q.attachEvent("onreadystatechange",ft),e.attachEvent("onload",Y.ready);var n=!1;try{n=null==e.frameElement&&Q.documentElement}catch(r){}n&&n.doScroll&&function o(){if(!Y.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}Y.ready()}}()}return B.promise(t)},Y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),L=Y(Q);var ht={};Y.Callbacks=function(e){e="string"==typeof e?ht[e]||n(e):Y.extend({},e);var r,o,i,a,s,c,l=[],u=!e.once&&[],p=function(t){for(r=e.memory&&t,o=!0,c=a||0,a=0,s=l.length,i=!0;l&&s>c;c++)if(l[c].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}i=!1,l&&(u?u.length&&p(u.shift()):r?l=[]:f.disable())},f={add:function(){if(l){var t=l.length;(function n(t){Y.each(t,function(t,r){var o=Y.type(r);"function"===o?e.unique&&f.has(r)||l.push(r):r&&r.length&&"string"!==o&&n(r)})})(arguments),i?s=l.length:r&&(a=t,p(r))}return this},remove:function(){return l&&Y.each(arguments,function(e,t){for(var n;(n=Y.inArray(t,l,n))>-1;)l.splice(n,1),i&&(s>=n&&s--,c>=n&&c--)}),this},has:function(e){return Y.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||f.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||o&&!u||(i?u.push(t):p(t)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var i=r[0],a=e[t];o[r[1]](Y.isFunction(a)?function(){var e=a.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[i+"With"](this===o?n:this,[e])}:n[i])}),e=null}).promise()},promise:function(e){return null!=e?Y.extend(e,r):r}},o={};return r.pipe=r.then,Y.each(t,function(e,i){var a=i[2],s=i[3];r[i[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),o[i[0]]=a.fire,o[i[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,r,o=0,i=J.call(arguments),a=i.length,s=1!==a||e&&Y.isFunction(e.promise)?a:0,c=1===s?e:Y.Deferred(),l=function(e,n,r){return function(o){n[e]=this,r[e]=arguments.length>1?J.call(arguments):o,r===t?c.notifyWith(n,r):--s||c.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>o;o++)i[o]&&Y.isFunction(i[o].promise)?i[o].promise().done(l(o,r,i)).fail(c.reject).progress(l(o,n,t)):--s;return s||c.resolveWith(r,i),c.promise()}}),Y.support=function(){var n,r,o,i,a,s,c,l,u,p,f,d=Q.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=d.getElementsByTagName("*"),o=d.getElementsByTagName("a")[0],!r||!o||!r.length)return{};i=Q.createElement("select"),a=i.appendChild(Q.createElement("option")),s=d.getElementsByTagName("input")[0],o.style.cssText="top:1px;float:left;opacity:.5",n={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(o.getAttribute("style")),hrefNormalized:"/a"===o.getAttribute("href"),opacity:/^0.5/.test(o.style.opacity),cssFloat:!!o.style.cssFloat,checkOn:"on"===s.value,optSelected:a.selected,getSetAttribute:"t"!==d.className,enctype:!!Q.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==Q.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===Q.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,n.optDisabled=!a.disabled;try{delete d.test}catch(h){n.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",f=function(){n.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",f)),s=Q.createElement("input"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),d.appendChild(s),c=Q.createDocumentFragment(),c.appendChild(d.lastChild),n.checkClone=c.cloneNode(!0).cloneNode(!0).lastChild.checked,n.appendChecked=s.checked,c.removeChild(s),c.appendChild(d),d.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})l="on"+u,p=l in d,p||(d.setAttribute(l,"return;"),p="function"==typeof d[l]),n[u+"Bubbles"]=p;return Y(function(){var r,o,i,a,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",c=Q.getElementsByTagName("body")[0];c&&(r=Q.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",c.insertBefore(r,c.firstChild),o=Q.createElement("div"),r.appendChild(o),o.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=o.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",n.reliableHiddenOffsets=p&&0===i[0].offsetHeight,o.innerHTML="",o.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===o.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==c.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(o,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(o,null)||{width:"4px"}).width,a=Q.createElement("div"),a.style.cssText=o.style.cssText=s,a.style.marginRight=a.style.width="0",o.style.width="1px",o.appendChild(a),n.reliableMarginRight=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight)),o.style.zoom!==t&&(o.innerHTML="",o.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===o.offsetWidth,o.style.display="block",o.style.overflow="visible",o.innerHTML="<div></div>",o.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==o.offsetWidth,r.style.zoom=1),c.removeChild(r),r=o=i=a=null)}),c.removeChild(d),r=o=i=a=s=c=d=null,n}();var gt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!o(e)},data:function(e,n,r,o){if(Y.acceptData(e)){var i,a,s=Y.expando,c="string"==typeof n,l=e.nodeType,u=l?Y.cache:e,p=l?e[s]:e[s]&&s;if(p&&u[p]&&(o||u[p].data)||!c||r!==t)return p||(l?e[s]=p=Y.deletedIds.pop()||Y.guid++:p=s),u[p]||(u[p]={},l||(u[p].toJSON=Y.noop)),("object"==typeof n||"function"==typeof n)&&(o?u[p]=Y.extend(u[p],n):u[p].data=Y.extend(u[p].data,n)),i=u[p],o||(i.data||(i.data={}),i=i.data),r!==t&&(i[Y.camelCase(n)]=r),c?(a=i[n],null==a&&(a=i[Y.camelCase(n)])):a=i,a}},removeData:function(e,t,n){if(Y.acceptData(e)){var r,i,a,s=e.nodeType,c=s?Y.cache:e,l=s?e[Y.expando]:Y.expando;if(c[l]){if(t&&(r=n?c[l]:c[l].data)){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t=t in r?[t]:t.split(" ")));for(i=0,a=t.length;a>i;i++)delete r[t[i]];if(!(n?o:Y.isEmptyObject)(r))return}(n||(delete c[l].data,o(c[l])))&&(s?Y.cleanData([e],!0):Y.support.deleteExpando||c!=c.window?delete c[l]:c[l]=null)}}},_data:function(e,t,n){return Y.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&Y.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Y.fn.extend({data:function(e,n){var o,i,a,s,c,l=this[0],u=0,p=null;if(e===t){if(this.length&&(p=Y.data(l),1===l.nodeType&&!Y._data(l,"parsedAttrs"))){for(a=l.attributes,c=a.length;c>u;u++)s=a[u].name,s.indexOf("data-")||(s=Y.camelCase(s.substring(5)),r(l,s,p[s]));Y._data(l,"parsedAttrs",!0)}return p}return"object"==typeof e?this.each(function(){Y.data(this,e)}):(o=e.split(".",2),o[1]=o[1]?"."+o[1]:"",i=o[1]+"!",Y.access(this,function(n){return n===t?(p=this.triggerHandler("getData"+i,[o[0]]),p===t&&l&&(p=Y.data(l,e),p=r(l,e,p)),p===t&&o[1]?this.data(o[0]):p):(o[1]=n,this.each(function(){var t=Y(this);t.triggerHandler("setData"+i,o),Y.data(this,e,n),t.triggerHandler("changeData"+i,o)}),t)},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,n,r){var o;return e?(n=(n||"fx")+"queue",o=Y._data(e,n),r&&(!o||Y.isArray(r)?o=Y._data(e,n,Y.makeArray(r)):o.push(r)),o||[]):t},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,o=n.shift(),i=Y._queueHooks(e,t),a=function(){Y.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?Y.queue(this[0],e):n===t?this:this.each(function(){var t=Y.queue(this,e,n);Y._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Y.dequeue(this,e)})},delay:function(e,t){return e=Y.fx?Y.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,o=1,i=Y.Deferred(),a=this,s=this.length,c=function(){--o||i.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=Y._data(a[s],e+"queueHooks"),r&&r.empty&&(o++,r.empty.add(c));return c(),i.promise(n)}});var yt,vt,bt,_t=/[\t\r\n]/g,Ct=/\r/g,xt=/^(?:button|input)$/i,wt=/^(?:button|input|object|select|textarea)$/i,At=/^a(?:rea|)$/i,Ft=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,kt=Y.support.getSetAttribute;Y.fn.extend({attr:function(e,t){return Y.access(this,Y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,o,i,a,s;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),n=0,r=this.length;r>n;n++)if(o=this[n],1===o.nodeType)if(o.className||1!==t.length){for(i=" "+o.className+" ",a=0,s=t.length;s>a;a++)0>i.indexOf(" "+t[a]+" ")&&(i+=t[a]+" ");o.className=Y.trim(i)}else o.className=e;return this},removeClass:function(e){var n,r,o,i,a,s,c;if(Y.isFunction(e))return this.each(function(t){Y(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(tt),s=0,c=this.length;c>s;s++)if(o=this[s],1===o.nodeType&&o.className){for(r=(" "+o.className+" ").replace(_t," "),i=0,a=n.length;a>i;i++)for(;r.indexOf(" "+n[i]+" ")>=0;)r=r.replace(" "+n[i]+" "," ");o.className=e?Y.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var o,i=0,a=Y(this),s=t,c=e.split(tt);o=c[i++];)s=r?s:!a.hasClass(o),a[s?"addClass":"removeClass"](o);else("undefined"===n||"boolean"===n)&&(this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(_t," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,o,i=this[0];{if(arguments.length)return o=Y.isFunction(e),this.each(function(r){var i,a=Y(this);1===this.nodeType&&(i=o?e.call(this,r,a.val()):e,null==i?i="":"number"==typeof i?i+="":Y.isArray(i)&&(i=Y.map(i,function(e){return null==e?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,i,"value")!==t||(this.value=i))});if(i)return n=Y.valHooks[i.type]||Y.valHooks[i.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(i,"value"))!==t?r:(r=i.value,"string"==typeof r?r.replace(Ct,""):null==r?"":r)}}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,o=e.selectedIndex,i="select-one"===e.type||0>o,a=i?null:[],s=i?o+1:r.length,c=0>o?s:i?o:0;s>c;c++)if(n=r[c],!(!n.selected&&c!==o||(Y.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Y.nodeName(n.parentNode,"optgroup"))){if(t=Y(n).val(),i)return t;a.push(t)}return a},set:function(e,t){var n=Y.makeArray(t);return Y(e).find("option").each(function(){this.selected=Y.inArray(Y(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,o){var i,a,s,c=e.nodeType;if(e&&3!==c&&8!==c&&2!==c)return o&&Y.isFunction(Y.fn[n])?Y(e)[n](r):e.getAttribute===t?Y.prop(e,n,r):(s=1!==c||!Y.isXMLDoc(e),s&&(n=n.toLowerCase(),a=Y.attrHooks[n]||(Ft.test(n)?vt:yt)),r!==t?null===r?(Y.removeAttr(e,n),t):a&&"set"in a&&s&&(i=a.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):a&&"get"in a&&s&&null!==(i=a.get(e,n))?i:(i=e.getAttribute(n),null===i?t:i))},removeAttr:function(e,t){var n,r,o,i,a=0;if(t&&1===e.nodeType)for(r=t.split(tt);r.length>a;a++)o=r[a],o&&(n=Y.propFix[o]||o,i=Ft.test(o),i||Y.attr(e,o,""),e.removeAttribute(kt?o:n),i&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(xt.test(e.nodeName)&&e.parentNode)Y.error("type property can't be changed");else if(!Y.support.radioValue&&"radio"===t&&Y.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return yt&&Y.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,n,r){return yt&&Y.nodeName(e,"button")?yt.set(e,n,r):(e.value=n,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var o,i,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!Y.isXMLDoc(e),a&&(n=Y.propFix[n]||n,i=Y.propHooks[n]),r!==t?i&&"set"in i&&(o=i.set(e,r,n))!==t?o:e[n]=r:i&&"get"in i&&null!==(o=i.get(e,n))?o:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):wt.test(e.nodeName)||At.test(e.nodeName)&&e.href?0:t}}}}),vt={get:function(e,n){var r,o=Y.prop(e,n);return o===!0||"boolean"!=typeof o&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?Y.removeAttr(e,n):(r=Y.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},kt||(bt={name:!0,id:!0,coords:!0},yt=Y.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(bt[n]?""!==r.value:r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=Q.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},Y.each(["width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})}),Y.attrHooks.contenteditable={get:yt.get,set:function(e,t,n){""===t&&(t="false"),yt.set(e,t,n) }}),Y.support.hrefNormalized||Y.each(["href","src","width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null===r?t:r}})}),Y.support.style||(Y.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),Y.support.optSelected||(Y.propHooks.selected=Y.extend(Y.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Y.support.enctype||(Y.propFix.enctype="encoding"),Y.support.checkOn||Y.each(["radio","checkbox"],function(){Y.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),Y.each(["radio","checkbox"],function(){Y.valHooks[this]=Y.extend(Y.valHooks[this],{set:function(e,n){return Y.isArray(n)?e.checked=Y.inArray(Y(e).val(),n)>=0:t}})});var Et=/^(?:textarea|input|select)$/i,Tt=/^([^\.]*|)(?:\.(.+)|)$/,Nt=/(?:^|\s)hover(\.\S+|)\b/,Rt=/^key/,St=/^(?:mouse|contextmenu)|click/,jt=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){return Y.event.special.hover?e:e.replace(Nt,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,o,i){var a,s,c,l,u,p,f,d,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&r&&(a=Y._data(e))){for(r.handler&&(h=r,r=h.handler,i=h.selector),r.guid||(r.guid=Y.guid++),c=a.events,c||(a.events=c={}),s=a.handle,s||(a.handle=s=function(e){return Y===t||e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=Y.trim(Ot(n)).split(" "),l=0;n.length>l;l++)u=Tt.exec(n[l])||[],p=u[1],f=(u[2]||"").split(".").sort(),m=Y.event.special[p]||{},p=(i?m.delegateType:m.bindType)||p,m=Y.event.special[p]||{},d=Y.extend({type:p,origType:u[1],data:o,handler:r,guid:r.guid,selector:i,needsContext:i&&Y.expr.match.needsContext.test(i),namespace:f.join(".")},h),g=c[p],g||(g=c[p]=[],g.delegateCount=0,m.setup&&m.setup.call(e,o,f,s)!==!1||(e.addEventListener?e.addEventListener(p,s,!1):e.attachEvent&&e.attachEvent("on"+p,s))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),i?g.splice(g.delegateCount++,0,d):g.push(d),Y.event.global[p]=!0;e=null}},global:{},remove:function(e,t,n,r,o){var i,a,s,c,l,u,p,f,d,h,g,m=Y.hasData(e)&&Y._data(e);if(m&&(f=m.events)){for(t=Y.trim(Ot(t||"")).split(" "),i=0;t.length>i;i++)if(a=Tt.exec(t[i])||[],s=c=a[1],l=a[2],s){for(d=Y.event.special[s]||{},s=(r?d.delegateType:d.bindType)||s,h=f[s]||[],u=h.length,l=l?RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0;h.length>p;p++)g=h[p],!o&&c!==g.origType||n&&n.guid!==g.guid||l&&!l.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(h.splice(p--,1),g.selector&&h.delegateCount--,d.remove&&d.remove.call(e,g));0===h.length&&u!==h.length&&(d.teardown&&d.teardown.call(e,l,m.handle)!==!1||Y.removeEvent(e,s,m.handle),delete f[s])}else for(s in f)Y.event.remove(e,s+t[i],n,r,!0);Y.isEmptyObject(f)&&(delete m.handle,Y.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,o,i){if(!o||3!==o.nodeType&&8!==o.nodeType){var a,s,c,l,u,p,f,d,h,g,m=n.type||n,y=[];if(!jt.test(m+Y.event.triggered)&&(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),o&&!Y.event.customEvent[m]||Y.event.global[m]))if(n="object"==typeof n?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0>m.indexOf(":")?"on"+m:"",o){if(n.result=t,n.target||(n.target=o),r=null!=r?Y.makeArray(r):[],r.unshift(n),f=Y.event.special[m]||{},!f.trigger||f.trigger.apply(o,r)!==!1){if(h=[[o,f.bindType||m]],!i&&!f.noBubble&&!Y.isWindow(o)){for(g=f.delegateType||m,l=jt.test(g+m)?o:o.parentNode,u=o;l;l=l.parentNode)h.push([l,g]),u=l;u===(o.ownerDocument||Q)&&h.push([u.defaultView||u.parentWindow||e,g])}for(c=0;h.length>c&&!n.isPropagationStopped();c++)l=h[c][0],n.type=h[c][1],d=(Y._data(l,"events")||{})[n.type]&&Y._data(l,"handle"),d&&d.apply(l,r),d=p&&l[p],d&&Y.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=m,i||n.isDefaultPrevented()||f._default&&f._default.apply(o.ownerDocument,r)!==!1||"click"===m&&Y.nodeName(o,"a")||!Y.acceptData(o)||p&&o[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!Y.isWindow(o)&&(u=o[p],u&&(o[p]=null),Y.event.triggered=m,o[m](),Y.event.triggered=t,u&&(o[p]=u)),n.result}}else{a=Y.cache;for(c in a)a[c].events&&a[c].events[m]&&Y.event.trigger(n,r,a[c].handle.elem,!0)}}},dispatch:function(n){n=Y.event.fix(n||e.event);var r,o,i,a,s,c,l,u,p,f=(Y._data(this,"events")||{})[n.type]||[],d=f.delegateCount,h=J.call(arguments),g=!n.exclusive&&!n.namespace,m=Y.event.special[n.type]||{},y=[];if(h[0]=n,n.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,n)!==!1){if(d&&(!n.button||"click"!==n.type))for(i=n.target;i!=this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==n.type){for(s={},l=[],r=0;d>r;r++)u=f[r],p=u.selector,s[p]===t&&(s[p]=u.needsContext?Y(p,this).index(i)>=0:Y.find(p,this,null,[i]).length),s[p]&&l.push(u);l.length&&y.push({elem:i,matches:l})}for(f.length>d&&y.push({elem:this,matches:f.slice(d)}),r=0;y.length>r&&!n.isPropagationStopped();r++)for(c=y[r],n.currentTarget=c.elem,o=0;c.matches.length>o&&!n.isImmediatePropagationStopped();o++)u=c.matches[o],(g||!n.namespace&&!u.namespace||n.namespace_re&&n.namespace_re.test(u.namespace))&&(n.data=u.data,n.handleObj=u,a=((Y.event.special[u.origType]||{}).handle||u.handler).apply(c.elem,h),a!==t&&(n.result=a,a===!1&&(n.preventDefault(),n.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,o,i,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||Q,o=r.documentElement,i=r.body,e.pageX=n.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[Y.expando])return e;var t,n,r=e,o=Y.event.fixHooks[e.type]||{},i=o.props?this.props.concat(o.props):this.props;for(e=Y.Event(r),t=i.length;t;)n=i[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||Q),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){Y.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var o=Y.extend(new Y.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?Y.event.trigger(o,null,t):Y.event.dispatch.call(t,o),o.isDefaultPrevented()&&n.preventDefault()}},Y.event.handle=Y.event.dispatch,Y.removeEvent=Q.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var o="on"+n;e.detachEvent&&(e[o]===t&&(e[o]=null),e.detachEvent(o,r))},Y.Event=function(e,n){return this instanceof Y.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?a:i):this.type=e,n&&Y.extend(this,n),this.timeStamp=e&&e.timeStamp||Y.now(),this[Y.expando]=!0,t):new Y.Event(e,n)},Y.Event.prototype={preventDefault:function(){this.isDefaultPrevented=a;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=a;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()},isDefaultPrevented:i,isPropagationStopped:i,isImmediatePropagationStopped:i},Y.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Y.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return i.selector,(!o||o!==r&&!Y.contains(r,o))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),Y.support.submitBubbles||(Y.event.special.submit={setup:function(){return Y.nodeName(this,"form")?!1:(Y.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=Y.nodeName(n,"input")||Y.nodeName(n,"button")?n.form:t;r&&!Y._data(r,"_submit_attached")&&(Y.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),Y._data(r,"_submit_attached",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Y.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Y.nodeName(this,"form")?!1:(Y.event.remove(this,"._submit"),t)}}),Y.support.changeBubbles||(Y.event.special.change={setup:function(){return Et.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Y.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Y.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Y.event.simulate("change",this,e,!0)})),!1):(Y.event.add(this,"beforeactivate._change",function(e){var t=e.target;Et.test(t.nodeName)&&!Y._data(t,"_change_attached")&&(Y.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||Y.event.simulate("change",this.parentNode,e,!0)}),Y._data(t,"_change_attached",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return Y.event.remove(this,"._change"),!Et.test(this.nodeName)}}),Y.support.focusinBubbles||Y.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){Y.event.simulate(t,e.target,Y.event.fix(e),!0)};Y.event.special[t]={setup:function(){0===n++&&Q.addEventListener(e,r,!0)},teardown:function(){0===--n&&Q.removeEventListener(e,r,!0)}}}),Y.fn.extend({on:function(e,n,r,o,a){var s,c;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(c in e)this.on(c,n,r,e[c],a);return this}if(null==r&&null==o?(o=n,r=n=t):null==o&&("string"==typeof n?(o=r,r=t):(o=r,r=n,n=t)),o===!1)o=i;else if(!o)return this;return 1===a&&(s=o,o=function(e){return Y().off(e),s.apply(this,arguments)},o.guid=s.guid||(s.guid=Y.guid++)),this.each(function(){Y.event.add(this,e,o,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var o,a;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,Y(e.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof e){for(a in e)this.off(a,n,e[a]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=i),this.each(function(){Y.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return Y(this.context).on(e,this.selector,t,n),this},die:function(e,t){return Y(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){Y.event.trigger(e,t,this)})},triggerHandler:function(e,n){return this[0]?Y.event.trigger(e,n,this[0],!0):t},toggle:function(e){var t=arguments,n=e.guid||Y.guid++,r=0,o=function(n){var o=(Y._data(this,"lastToggle"+e.guid)||0)%r;return Y._data(this,"lastToggle"+e.guid,o+1),n.preventDefault(),t[o].apply(this,arguments)||!1};for(o.guid=n;t.length>r;)t[r++].guid=n;return this.click(o)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Y.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Y.fn[t]=function(e,n){return null==n&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Rt.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),St.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),/*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ function(e,t){function n(e,t,n,r){n=n||[],t=t||S;var o,i,a,s,c=t.nodeType;if(!e||"string"!=typeof e)return n;if(1!==c&&9!==c)return[];if(a=C(t),!a&&!r&&(o=nt.exec(e)))if(s=o[1]){if(9===c){if(i=t.getElementById(s),!i||!i.parentNode)return n;if(i.id===s)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(s))&&x(t,i)&&i.id===s)return n.push(i),n}else{if(o[2])return P.apply(n,H.call(t.getElementsByTagName(e),0)),n;if((s=o[3])&&ft&&t.getElementsByClassName)return P.apply(n,H.call(t.getElementsByClassName(s),0)),n}return g(e.replace(G,"$1"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function o(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function i(e){return L(function(t){return t=+t,L(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,o,i,a,s,c,l,u=U[N][e+" "];if(u)return t?0:u.slice(0);for(s=e,c=[],l=b.preFilter;s;){(!r||(o=Z.exec(s)))&&(o&&(s=s.slice(o[0].length)||s),c.push(i=[])),r=!1,(o=et.exec(s))&&(i.push(r=new R(o.shift())),s=s.slice(r.length),r.type=o[0].replace(G," "));for(a in b.filter)!(o=st[a].exec(s))||l[a]&&!(o=l[a](o))||(i.push(r=new R(o.shift())),s=s.slice(r.length),r.type=a,r.matches=o);if(!r)break}return t?s.length:s?n.error(e):U(e,c).slice(0)}function c(e,t,n){var r=t.dir,o=n&&"parentNode"===t.dir,i=I++;return t.first?function(t,n,i){for(;t=t[r];)if(o||1===t.nodeType)return e(t,n,i)}:function(t,n,a){if(a){for(;t=t[r];)if((o||1===t.nodeType)&&e(t,n,a))return t}else for(var s,c=O+" "+i+" ",l=c+y;t=t[r];)if(o||1===t.nodeType){if((s=t[N])===l)return t.sizset;if("string"==typeof s&&0===s.indexOf(c)){if(t.sizset)return t}else{if(t[N]=l,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function l(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function u(e,t,n,r,o){for(var i,a=[],s=0,c=e.length,l=null!=t;c>s;s++)(i=e[s])&&(!n||n(i,r,o))&&(a.push(i),l&&t.push(s));return a}function p(e,t,n,r,o,i){return r&&!r[N]&&(r=p(r)),o&&!o[N]&&(o=p(o,i)),L(function(i,a,s,c){var l,p,f,d=[],g=[],m=a.length,y=i||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!i&&t?y:u(y,d,e,s,c),b=n?o||(i?e:m||r)?[]:a:v;if(n&&n(v,b,s,c),r)for(l=u(b,g),r(l,[],s,c),p=l.length;p--;)(f=l[p])&&(b[g[p]]=!(v[g[p]]=f));if(i){if(o||e){if(o){for(l=[],p=b.length;p--;)(f=b[p])&&l.push(v[p]=f);o(null,b=[],l,c)}for(p=b.length;p--;)(f=b[p])&&(l=o?D.call(i,f):d[p])>-1&&(i[l]=!(a[l]=f))}}else b=u(b===a?b.splice(m,b.length):b),o?o(null,a,b,c):P.apply(a,b)})}function f(e){for(var t,n,r,o=e.length,i=b.relative[e[0].type],a=i||b.relative[" "],s=i?1:0,u=c(function(e){return e===t},a,!0),d=c(function(e){return D.call(t,e)>-1},a,!0),h=[function(e,n,r){return!i&&(r||n!==k)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];o>s;s++)if(n=b.relative[e[s].type])h=[c(l(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[N]){for(r=++s;o>r&&!b.relative[e[r].type];r++);return p(s>1&&l(h),s>1&&e.slice(0,s-1).join("").replace(G,"$1"),n,r>s&&f(e.slice(s,r)),o>r&&f(e=e.slice(r)),o>r&&e.join(""))}h.push(n)}return l(h)}function d(e,t){var r=t.length>0,o=e.length>0,i=function(a,s,c,l,p){var f,d,h,g=[],m=0,v="0",_=a&&[],C=null!=p,x=k,w=a||o&&b.find.TAG("*",p&&s.parentNode||s),A=O+=null==x?1:Math.E;for(C&&(k=s!==S&&s,y=i.el);null!=(f=w[v]);v++){if(o&&f){for(d=0;h=e[d];d++)if(h(f,s,c)){l.push(f);break}C&&(O=A,y=++i.el)}r&&((f=!h&&f)&&m--,a&&_.push(f))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(_,g,s,c);if(a){if(m>0)for(;v--;)_[v]||g[v]||(g[v]=M.call(l));g=u(g)}P.apply(l,g),C&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(l)}return C&&(O=A,k=x),_};return i.el=0,r?L(i):i}function h(e,t,r){for(var o=0,i=t.length;i>o;o++)n(e,t[o],r);return r}function g(e,t,n,r,o){var i,a,c,l,u,p=s(e);if(p.length,!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(c=a[0]).type&&9===t.nodeType&&!o&&b.relative[a[1].type]){if(t=b.find.ID(c.matches[0].replace(at,""),t,o)[0],!t)return n;e=e.slice(a.shift().length)}for(i=st.POS.test(e)?-1:a.length-1;i>=0&&(c=a[i],!b.relative[l=c.type]);i--)if((u=b.find[l])&&(r=u(c.matches[0].replace(at,""),rt.test(a[0].type)&&t.parentNode||t,o))){if(a.splice(i,1),e=r.length&&a.join(""),!e)return P.apply(n,H.call(r,0)),n;break}}return w(e,p)(r,t,o,n,rt.test(e)),n}function m(){}var y,v,b,_,C,x,w,A,F,k,E=!0,T="undefined",N=("sizcache"+Math.random()).replace(".",""),R=String,S=e.document,j=S.documentElement,O=0,I=0,M=[].pop,P=[].push,H=[].slice,D=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},L=function(e,t){return e[N]=null==t||t,e},B=function(){var e={},t=[];return L(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},Q=B(),U=B(),q=B(),W="[\\x20\\t\\r\\n\\f]",$="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",z=$.replace("w","w#"),J="([*^$|!~]?=)",V="\\["+W+"*("+$+")"+W+"*(?:"+J+W+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+z+")|)|)"+W+"*\\]",X=":("+$+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+V+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+W+"*((?:-\\d)?\\d*)"+W+"*\\)|)(?=[^-]|$)",G=RegExp("^"+W+"+|((?:^|[^\\\\])(?:\\\\.)*)"+W+"+$","g"),Z=RegExp("^"+W+"*,"+W+"*"),et=RegExp("^"+W+"*([\\x20\\t\\r\\n\\f>+~])"+W+"*"),tt=RegExp(X),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,ot=/h\d/i,it=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:RegExp("^#("+$+")"),CLASS:RegExp("^\\.("+$+")"),NAME:RegExp("^\\[name=['\"]?("+$+")['\"]?\\]"),TAG:RegExp("^("+$.replace("w","w*")+")"),ATTR:RegExp("^"+V),PSEUDO:RegExp("^"+X),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+W+"*(even|odd|(([+-]|)(\\d*)n|)"+W+"*(?:([+-]|)"+W+"*(\\d+)|))"+W+"*\\)|)","i"),needsContext:RegExp("^"+W+"*[>+~]|"+K,"i")},ct=function(e){var t=S.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},lt=ct(function(e){return e.appendChild(S.createComment("")),!e.getElementsByTagName("*").length}),ut=ct(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==T&&"#"===e.firstChild.getAttribute("href")}),pt=ct(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ft=ct(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),dt=ct(function(e){e.id=N+0,e.innerHTML="<a name='"+N+"'></a><div name='"+N+"'></div>",j.insertBefore(e,j.firstChild);var t=S.getElementsByName&&S.getElementsByName(N).length===2+S.getElementsByName(N+0).length;return v=!S.getElementById(N),j.removeChild(e),t});try{H.call(j.childNodes,0)[0].nodeType}catch(ht){H=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},_=n.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=_(t);return n},C=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},x=n.contains=j.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:j.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=C(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:L,match:st,attrHandle:ut?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==T&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==T&&!r){var o=n.getElementById(e);return o?o.id===e||typeof o.getAttributeNode!==T&&o.getAttributeNode("id").value===e?[o]:t:[]}},TAG:lt?function(e,n){return typeof n.getElementsByTagName!==T?n.getElementsByTagName(e):t}:function(e,t){var n=t.getElementsByTagName(e);if("*"===e){for(var r,o=[],i=0;r=n[i];i++)1===r.nodeType&&o.push(r);return o}return n},NAME:dt&&function(e,n){return typeof n.getElementsByName!==T?n.getElementsByName(name):t},CLASS:ft&&function(e,n,r){return typeof n.getElementsByClassName===T||r?t:n.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return st.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(n=s(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==T&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=Q[N][e+" "];return t||(t=RegExp("(^|"+W+")"+e+"("+W+"|$)"))&&Q(e,function(e){return t.test(e.className||typeof e.getAttribute!==T&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(o){var i=n.attr(o,e);return null==i?"!="===t:t?(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.substr(i.length-r.length)===r:"~="===t?(" "+i+" ").indexOf(r)>-1:"|="===t?i===r||i.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return"nth"===e?function(e){var t,o,i=e.parentNode;if(1===n&&0===r)return!0;if(i)for(o=0,t=i.firstChild;t&&(1!==t.nodeType||(o++,e!==t));t=t.nextSibling);return o-=r,o===n||0===o%n&&o/n>=0}:function(t){var n=t;switch(e){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===e)return!0;n=t;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,o=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return o[N]?o(t):o.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?L(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)r=D.call(e,i[a]),e[r]=!(n[r]=i[a])}):function(e){return o(e,0,r)}):o}},pseudos:{not:L(function(e){var t=[],n=[],r=w(e.replace(G,"$1"));return r[N]?L(function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:L(function(e){return function(t){return n(e,t).length>0}}),contains:L(function(e){return function(t){return(t.textContent||t.innerText||_(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return ot.test(e.nodeName)},text:function(e){var t,n;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(n=e.getAttribute("type"))||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:o("submit"),reset:o("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return it.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:i(function(){return[0]}),last:i(function(e,t){return[t-1]}),eq:i(function(e,t,n){return[0>n?n+t:n]}),even:i(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:i(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:i(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:i(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},A=j.compareDocumentPosition?function(e,t){return e===t?(F=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return F=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,o=[],i=[],s=e.parentNode,c=t.parentNode,l=s;if(s===c)return a(e,t);if(!s)return-1;if(!c)return 1;for(;l;)o.unshift(l),l=l.parentNode;for(l=c;l;)i.unshift(l),l=l.parentNode;n=o.length,r=i.length;for(var u=0;n>u&&r>u;u++)if(o[u]!==i[u])return a(o[u],i[u]);return u===n?a(e,i[u],-1):a(o[u],t,1)},[0,0].sort(A),E=!F,n.uniqueSort=function(e){var t,n=[],r=1,o=0;if(F=E,e.sort(A),F){for(;t=e[r];r++)t===e[r-1]&&(o=n.push(r));for(;o--;)e.splice(n[o],1)}return e},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},w=n.compile=function(e,t){var n,r=[],o=[],i=q[N][e+" "];if(!i){for(t||(t=s(e)),n=t.length;n--;)i=f(t[n]),i[N]?r.push(i):o.push(i);i=q(e,d(o,r))}return i},S.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,o=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],a=[":active"],c=j.matchesSelector||j.mozMatchesSelector||j.webkitMatchesSelector||j.oMatchesSelector||j.msMatchesSelector;ct(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+W+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),ct(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+W+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=RegExp(i.join("|")),g=function(e,n,o,a,c){if(!a&&!c&&!i.test(e)){var l,u,p=!0,f=N,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(l=s(e),(p=n.getAttribute("id"))?f=p.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=l.length;u--;)l[u]=f+l[u].join("");d=rt.test(e)&&n.parentNode||n,h=l.join(",")}if(h)try{return P.apply(o,H.call(d.querySelectorAll(h),0)),o}catch(g){}finally{p||n.removeAttribute("id")}}return t(e,n,o,a,c)},c&&(ct(function(t){e=c.call(t,"div");try{c.call(t,"[test!='']:sizzle"),a.push("!=",X)}catch(n){}}),a=RegExp(a.join("|")),n.matchesSelector=function(t,r){if(r=r.replace(o,"='$1']"),!C(t)&&!a.test(r)&&!i.test(r))try{var s=c.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(l){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var It=/Until$/,Mt=/^(?:parents|prev(?:Until|All))/,Pt=/^.[^:#\[\.,]*$/,Ht=Y.expr.match.needsContext,Dt={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,o,i,a,s=this;if("string"!=typeof e)return Y(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(Y.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;n>t;t++)if(r=a.length,Y.find(e,this[t],a),t>0)for(o=r;a.length>o;o++)for(i=0;r>i;i++)if(a[i]===a[o]){a.splice(o--,1);break}return a},has:function(e){var t,n=Y(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(Y.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(l(this,e,!1),"not",e)},filter:function(e){return this.pushStack(l(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?Ht.test(e)?Y(e,this.context).index(this[0])>=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,o=this.length,i=[],a=Ht.test(e)||"string"!=typeof e?Y(e,t||this.context):0;o>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:Y.find.matchesSelector(n,e)){i.push(n);break}n=n.parentNode}return i=i.length>1?Y.unique(i):i,this.pushStack(i,"closest",e)},index:function(e){return e?"string"==typeof e?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var o=Y.map(this,t,n);return It.test(e)||(r=n),r&&"string"==typeof r&&(o=Y.filter(r,o)),o=this.length>1&&!Dt[e]?Y.unique(o):o,this.length>1&&Mt.test(e)&&(o=o.reverse()),this.pushStack(o,e,J.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){for(var o=[],i=e[n];i&&9!==i.nodeType&&(r===t||1!==i.nodeType||!Y(i).is(r));)1===i.nodeType&&o.push(i),i=i[n];return o},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Lt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,Qt=/^\s+/,Ut=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,qt=/<([\w:]+)/,Wt=/<tbody/i,$t=/<|&#?\w+;/,zt=/<(?:script|style|link)/i,Jt=/<(?:script|object|embed|option|style)/i,Vt=RegExp("<(?:"+Lt+")[\\s/>]","i"),Xt=/^(?:checkbox|radio)$/,Kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Zt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},en=u(Q),tn=en.appendChild(Q.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X<div>","</div>"]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||Q).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||Y.filter(e,[n]).length)&&(t||1!==n.nodeType||(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Y.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,o=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Bt,""):t;if(!("string"!=typeof e||zt.test(e)||!Y.support.htmlSerialize&&Vt.test(e)||!Y.support.leadingWhitespace&&Qt.test(e)||Zt[(qt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Ut,"<$1></$2>");try{for(;o>r;r++)n=this[r]||{},1===n.nodeType&&(Y.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(i){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(Y(Y.isFunction(e)?e():e),"replaceWith",e):this:Y.isFunction(e)?this.each(function(t){var n=Y(this),r=n.html();n.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Y(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;Y(this).remove(),t?Y(t).before(e):Y(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var o,i,a,s,c=0,l=e[0],u=[],f=this.length;if(!Y.support.checkClone&&f>1&&"string"==typeof l&&Kt.test(l))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(l))return this.each(function(o){var i=Y(this);e[0]=l.call(this,o,n?i.html():t),i.domManip(e,n,r)});if(this[0]){if(o=Y.buildFragment(e,this,u),a=o.fragment,i=a.firstChild,1===a.childNodes.length&&(a=i),i)for(n=n&&Y.nodeName(i,"tr"),s=o.cacheable||f-1;f>c;c++)r.call(n&&Y.nodeName(this[c],"table")?p(this[c],"tbody"):this[c],c===s?a:Y.clone(a,!0,!0));a=i=null,u.length&&Y.each(u,function(e,t){t.src?Y.ajax?Y.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Y.error("no ajax"):Y.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Yt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Y.buildFragment=function(e,n,r){var o,i,a,s=e[0];return n=n||Q,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,!(1===e.length&&"string"==typeof s&&512>s.length&&n===Q&&"<"===s.charAt(0))||Jt.test(s)||!Y.support.checkClone&&Kt.test(s)||!Y.support.html5Clone&&Vt.test(s)||(i=!0,o=Y.fragments[s],a=o!==t),o||(o=n.createDocumentFragment(),Y.clean(e,n,o,r),i&&(Y.fragments[s]=a&&o)),{fragment:o,cacheable:i}},Y.fragments={},Y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Y.fn[e]=function(n){var r,o=0,i=[],a=Y(n),s=a.length,c=1===this.length&&this[0].parentNode;if((null==c||c&&11===c.nodeType&&1===c.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>o;o++)r=(o>0?this.clone(!0):this).get(),Y(a[o])[t](r),i=i.concat(r);return this.pushStack(i,e,a.selector)}}),Y.extend({clone:function(e,t,n){var r,o,i,a;if(Y.support.html5Clone||Y.isXMLDoc(e)||!Vt.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(a=tn.firstChild)),!(Y.support.noCloneEvent&&Y.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Y.isXMLDoc(e)))for(d(e,a),r=h(e),o=h(a),i=0;r[i];++i)o[i]&&d(r[i],o[i]);if(t&&(f(e,a),n))for(r=h(e),o=h(a),i=0;r[i];++i)f(r[i],o[i]);return r=o=null,a},clean:function(e,n,r,o){var i,a,s,c,l,p,f,d,h,m,y,v=n===Q&&en,b=[];for(n&&n.createDocumentFragment!==t||(n=Q),i=0;null!=(s=e[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if($t.test(s)){for(v=v||u(n),f=n.createElement("div"),v.appendChild(f),s=s.replace(Ut,"<$1></$2>"),c=(qt.exec(s)||["",""])[1].toLowerCase(),l=Zt[c]||Zt._default,p=l[0],f.innerHTML=l[1]+s+l[2];p--;)f=f.lastChild;if(!Y.support.tbody)for(d=Wt.test(s),h="table"!==c||d?"<table>"!==l[1]||d?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,a=h.length-1;a>=0;--a)Y.nodeName(h[a],"tbody")&&!h[a].childNodes.length&&h[a].parentNode.removeChild(h[a]);!Y.support.leadingWhitespace&&Qt.test(s)&&f.insertBefore(n.createTextNode(Qt.exec(s)[0]),f.firstChild),s=f.childNodes,f.parentNode.removeChild(f)}else s=n.createTextNode(s);s.nodeType?b.push(s):Y.merge(b,s)}if(f&&(s=f=v=null),!Y.support.appendChecked)for(i=0;null!=(s=b[i]);i++)Y.nodeName(s,"input")?g(s):s.getElementsByTagName!==t&&Y.grep(s.getElementsByTagName("input"),g);if(r)for(m=function(e){return!e.type||Gt.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},i=0;null!=(s=b[i]);i++)Y.nodeName(s,"script")&&m(s)||(r.appendChild(s),s.getElementsByTagName!==t&&(y=Y.grep(Y.merge([],s.getElementsByTagName("script")),m),b.splice.apply(b,[i+1,0].concat(y)),i+=y.length));return b},cleanData:function(e,t){for(var n,r,o,i,a=0,s=Y.expando,c=Y.cache,l=Y.support.deleteExpando,u=Y.event.special;null!=(o=e[a]);a++)if((t||Y.acceptData(o))&&(r=o[s],n=r&&c[r])){if(n.events)for(i in n.events)u[i]?Y.event.remove(o,i):Y.removeEvent(o,i,n.handle);c[r]&&(delete c[r],l?delete o[s]:o.removeAttribute?o.removeAttribute(s):o[s]=null,Y.deletedIds.push(r))}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(q.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e(Q);return e}}();var nn,rn,on,an=/alpha\([^)]*\)/i,sn=/opacity=([^)]*)/,cn=/^(top|right|bottom|left)$/,ln=/^(none|table(?!-c[ea]).+)/,un=/^margin/,pn=RegExp("^("+Z+")(.*)$","i"),fn=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),dn=RegExp("^([-+])=("+Z+")","i"),hn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],vn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n="boolean"==typeof e;return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:y(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,s,c=Y.camelCase(n),l=e.style;if(n=Y.cssProps[c]||(Y.cssProps[c]=m(l,c)),s=Y.cssHooks[n]||Y.cssHooks[c],r===t)return s&&"get"in s&&(i=s.get(e,!1,o))!==t?i:l[n];if(a=typeof r,"string"===a&&(i=dn.exec(r))&&(r=(i[1]+1)*i[2]+parseFloat(Y.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||Y.cssNumber[c]||(r+="px"),s&&"set"in s&&(r=s.set(e,r,o))===t)))try{l[n]=r}catch(u){}}},css:function(e,n,r,o){var i,a,s,c=Y.camelCase(n);return n=Y.cssProps[c]||(Y.cssProps[c]=m(e.style,c)),s=Y.cssHooks[n]||Y.cssHooks[c],s&&"get"in s&&(i=s.get(e,!0,o)),i===t&&(i=nn(e,n)),"normal"===i&&n in mn&&(i=mn[n]),r||o!==t?(a=parseFloat(i),r||Y.isNumeric(a)?a||0:i):i},swap:function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];r=n.call(e);for(o in t)e.style[o]=i[o];return r}}),e.getComputedStyle?nn=function(t,n){var r,o,i,a,s=e.getComputedStyle(t,null),c=t.style;return s&&(r=s.getPropertyValue(n)||s[n],""!==r||Y.contains(t.ownerDocument,t)||(r=Y.style(t,n)),fn.test(r)&&un.test(n)&&(o=c.width,i=c.minWidth,a=c.maxWidth,c.minWidth=c.maxWidth=c.width=r,r=s.width,c.width=o,c.minWidth=i,c.maxWidth=a)),r}:Q.documentElement.currentStyle&&(nn=function(e,t){var n,r,o=e.currentStyle&&e.currentStyle[t],i=e.style;return null==o&&i&&i[t]&&(o=i[t]),fn.test(o)&&!cn.test(t)&&(n=i.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),i.left="fontSize"===t?"1em":o,o=i.pixelLeft+"px",i.left=n,r&&(e.runtimeStyle.left=r)),""===o?"auto":o}),Y.each(["height","width"],function(e,n){Y.cssHooks[n]={get:function(e,r,o){return r?0===e.offsetWidth&&ln.test(nn(e,"display"))?Y.swap(e,gn,function(){return C(e,n,o)}):C(e,n,o):t},set:function(e,t,r){return b(e,t,r?_(e,n,r,Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing")):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return sn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,o=Y.isNumeric(t)?"alpha(opacity="+100*t+")":"",i=r&&r.filter||n.filter||"";n.zoom=1,t>=1&&""===Y.trim(i.replace(an,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=an.test(i)?i.replace(an,o):i+" "+o)}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,n){return Y.swap(e,{display:"inline-block"},function(){return n?nn(e,"marginRight"):t})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return fn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Y.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||nn(e,"display"))},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,o="string"==typeof n?n.split(" "):[n],i={};for(r=0;4>r;r++)i[e+yn[r]+t]=o[r]||o[r-2]||o[0];return i}},un.test(e)||(Y.cssHooks[e+t].set=b)});var _n=/%20/g,Cn=/\[\]$/,xn=/\r?\n/g,wn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,An=/^(?:select|textarea)/i; Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||An.test(this.nodeName)||wn.test(this.type))}).map(function(e,t){var n=Y(this).val();return null==n?null:Y.isArray(n)?Y.map(n,function(e){return{name:t.name,value:e.replace(xn,"\r\n")}}):{name:t.name,value:n.replace(xn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,o=[],i=function(e,t){t=Y.isFunction(t)?t():null==t?"":t,o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional),Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){i(this.name,this.value)});else for(r in e)w(r,e[r],n,i);return o.join("&").replace(_n,"+")};var Fn,kn,En=/#.*$/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Rn=/^(?:GET|HEAD)$/,Sn=/^\/\//,jn=/\?/,On=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,In=/([?&])_=[^&]*/,Mn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Pn=Y.fn.load,Hn={},Dn={},Ln=["*/"]+["*"];try{kn=U.href}catch(Bn){kn=Q.createElement("a"),kn.href="",kn=kn.href}Fn=Mn.exec(kn.toLowerCase())||[],Y.fn.load=function(e,n,r){if("string"!=typeof e&&Pn)return Pn.apply(this,arguments);if(!this.length)return this;var o,i,a,s=this,c=e.indexOf(" ");return c>=0&&(o=e.slice(c,e.length),e=e.slice(0,c)),Y.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(i="POST"),Y.ajax({url:e,type:i,dataType:"html",data:n,complete:function(e,t){r&&s.each(r,a||[e.responseText,t,e])}}).done(function(e){a=arguments,s.html(o?Y("<div>").append(e.replace(On,"")).find(o):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,o,i){return Y.isFunction(r)&&(i=i||o,o=r,r=t),Y.ajax({type:n,url:e,data:r,success:o,dataType:i})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?k(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),k(e,t),e},ajaxSettings:{url:kn,isLocal:Nn.test(Fn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ln},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:A(Hn),ajaxTransport:A(Dn),ajax:function(e,n){function r(e,n,r,a){var l,p,v,b,C,w=n;2!==_&&(_=2,c&&clearTimeout(c),s=t,i=a||"",x.readyState=e>0?4:0,r&&(b=E(f,x,r)),e>=200&&300>e||304===e?(f.ifModified&&(C=x.getResponseHeader("Last-Modified"),C&&(Y.lastModified[o]=C),C=x.getResponseHeader("Etag"),C&&(Y.etag[o]=C)),304===e?(w="notmodified",l=!0):(l=T(f,b),w=l.state,p=l.data,v=l.error,l=!v)):(v=w,(!w||e)&&(w="error",0>e&&(e=0))),x.status=e,x.statusText=(n||w)+"",l?g.resolveWith(d,[p,w,x]):g.rejectWith(d,[x,w,v]),x.statusCode(y),y=t,u&&h.trigger("ajax"+(l?"Success":"Error"),[x,f,l?p:v]),m.fireWith(d,[x,w]),u&&(h.trigger("ajaxComplete",[x,f]),--Y.active||Y.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var o,i,a,s,c,l,u,p,f=Y.ajaxSetup({},n),d=f.context||f,h=d!==f&&(d.nodeType||d instanceof Y)?Y(d):Y.event,g=Y.Deferred(),m=Y.Callbacks("once memory"),y=f.statusCode||{},v={},b={},_=0,C="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!_){var n=e.toLowerCase();e=b[n]=b[n]||e,v[e]=t}return this},getAllResponseHeaders:function(){return 2===_?i:null},getResponseHeader:function(e){var n;if(2===_){if(!a)for(a={};n=Tn.exec(i);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return _||(f.mimeType=e),this},abort:function(e){return e=e||C,s&&s.abort(e),r(0,e),this}};if(g.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(2>_)for(t in e)y[t]=[y[t],e[t]];else t=e[x.status],x.always(t)}return this},f.url=((e||f.url)+"").replace(En,"").replace(Sn,Fn[1]+"//"),f.dataTypes=Y.trim(f.dataType||"*").toLowerCase().split(tt),null==f.crossDomain&&(l=Mn.exec(f.url.toLowerCase()),f.crossDomain=!(!l||l[1]===Fn[1]&&l[2]===Fn[2]&&(l[3]||("http:"===l[1]?80:443))==(Fn[3]||("http:"===Fn[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Y.param(f.data,f.traditional)),F(Hn,f,n,x),2===_)return x;if(u=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Rn.test(f.type),u&&0===Y.active++&&Y.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(jn.test(f.url)?"&":"?")+f.data,delete f.data),o=f.url,f.cache===!1)){var w=Y.now(),A=f.url.replace(In,"$1_="+w);f.url=A+(A===f.url?(jn.test(f.url)?"&":"?")+"_="+w:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(o=o||f.url,Y.lastModified[o]&&x.setRequestHeader("If-Modified-Since",Y.lastModified[o]),Y.etag[o]&&x.setRequestHeader("If-None-Match",Y.etag[o])),x.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ln+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)x.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(f.beforeSend.call(d,x,f)===!1||2===_))return x.abort();C="abort";for(p in{success:1,error:1,complete:1})x[p](f[p]);if(s=F(Dn,f,n,x)){x.readyState=1,u&&h.trigger("ajaxSend",[x,f]),f.async&&f.timeout>0&&(c=setTimeout(function(){x.abort("timeout")},f.timeout));try{_=1,s.send(v,r)}catch(k){if(!(2>_))throw k;r(-1,k)}}else r(-1,"No Transport");return x},active:0,lastModified:{},etag:{}});var Qn=[],Un=/\?/,qn=/(=)\?(?=&|$)|\?\?/,Wn=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Qn.pop()||Y.expando+"_"+Wn++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,o){var i,a,s,c=n.data,l=n.url,u=n.jsonp!==!1,p=u&&qn.test(l),f=u&&!p&&"string"==typeof c&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&qn.test(c);return"jsonp"===n.dataTypes[0]||p||f?(i=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=e[i],p?n.url=l.replace(qn,"$1"+i):f?n.data=c.replace(qn,"$1"+i):u&&(n.url+=(Un.test(l)?"&":"?")+n.jsonp+"="+i),n.converters["script json"]=function(){return s||Y.error(i+" was not called"),s[0]},n.dataTypes[0]="json",e[i]=function(){s=arguments},o.always(function(){e[i]=a,n[i]&&(n.jsonpCallback=r.jsonpCallback,Qn.push(i)),s&&Y.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=Q.head||Q.getElementsByTagName("head")[0]||Q.documentElement;return{send:function(o,i){n=Q.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,o){(o||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,o||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var $n,zn=e.ActiveXObject?function(){for(var e in $n)$n[e](0,1)}:!1,Jn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&N()||R()}:N,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(o,i){var a,s,c=n.xhr();if(n.username?c.open(n.type,n.url,n.async,n.username,n.password):c.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)c[s]=n.xhrFields[s];n.mimeType&&c.overrideMimeType&&c.overrideMimeType(n.mimeType),n.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");try{for(s in o)c.setRequestHeader(s,o[s])}catch(l){}c.send(n.hasContent&&n.data||null),r=function(e,o){var s,l,u,p,f;try{if(r&&(o||4===c.readyState))if(r=t,a&&(c.onreadystatechange=Y.noop,zn&&delete $n[a]),o)4!==c.readyState&&c.abort();else{s=c.status,u=c.getAllResponseHeaders(),p={},f=c.responseXML,f&&f.documentElement&&(p.xml=f);try{p.text=c.responseText}catch(d){}try{l=c.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(h){o||i(-1,h)}p&&i(s,l,p,u)},n.async?4===c.readyState?setTimeout(r,0):(a=++Jn,zn&&($n||($n={},Y(e).unload(zn)),$n[a]=r),c.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Vn,Xn,Kn=/^(?:toggle|show|hide)$/,Gn=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[M],er={"*":[function(e,t){var n,r,o=this.createTween(e,t),i=Gn.exec(t),a=o.cur(),s=+a||0,c=1,l=20;if(i){if(n=+i[2],r=i[3]||(Y.cssNumber[e]?"":"px"),"px"!==r&&s){s=Y.css(o.elem,e,!0)||n||1;do c=c||".5",s/=c,Y.style(o.elem,e,s+r);while(c!==(c=o.cur()/a)&&1!==c&&--l)}o.unit=r,o.start=s,o.end=i[1]?s+(i[1]+1)*n:n}return o}]};Y.Animation=Y.extend(O,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,o=e.length;o>r;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),Y.Tween=P,P.prototype={constructor:P,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(Y.cssNumber[n]?"":"px")},cur:function(){var e=P.propHooks[this.prop];return e&&e.get?e.get(this):P.propHooks._default.get(this)},run:function(e){var t,n=P.propHooks[this.prop];return this.pos=t=this.options.duration?Y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):P.propHooks._default.set(this),this}},P.prototype.init.prototype=P.prototype,P.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Y.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Y.fx.step[e.prop]?Y.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Y.cssProps[e.prop]]||Y.cssHooks[e.prop])?Y.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},P.propHooks.scrollTop=P.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Y.each(["toggle","show","hide"],function(e,t){var n=Y.fn[t];Y.fn[t]=function(r,o,i){return null==r||"boolean"==typeof r||!e&&Y.isFunction(r)&&Y.isFunction(o)?n.apply(this,arguments):this.animate(H(t,!0),r,o,i)}}),Y.fn.extend({fadeTo:function(e,t,n,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=Y.isEmptyObject(e),i=Y.speed(t,n,r),a=function(){var t=O(this,Y.extend({},e),i);o&&t.stop(!0)};return o||i.queue===!1?this.each(a):this.queue(i.queue,a)},stop:function(e,n,r){var o=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",i=Y.timers,a=Y._data(this);if(n)a[n]&&a[n].stop&&o(a[n]);else for(n in a)a[n]&&a[n].stop&&Yn.test(n)&&o(a[n]);for(n=i.length;n--;)i[n].elem!==this||null!=e&&i[n].queue!==e||(i[n].anim.stop(r),t=!1,i.splice(n,1));(t||!r)&&Y.dequeue(this,e)})}}),Y.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Y.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Y.speed=function(e,t,n){var r=e&&"object"==typeof e?Y.extend({},e):{complete:n||!n&&t||Y.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Y.isFunction(t)&&t};return r.duration=Y.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Y.fx.speeds?Y.fx.speeds[r.duration]:Y.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Y.isFunction(r.old)&&r.old.call(this),r.queue&&Y.dequeue(this,r.queue)},r},Y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Y.timers=[],Y.fx=P.prototype.init,Y.fx.tick=function(){var e,n=Y.timers,r=0;for(Vn=Y.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||Y.fx.stop(),Vn=t},Y.fx.timer=function(e){e()&&Y.timers.push(e)&&!Xn&&(Xn=setInterval(Y.fx.tick,Y.fx.interval))},Y.fx.interval=13,Y.fx.stop=function(){clearInterval(Xn),Xn=null},Y.fx.speeds={slow:600,fast:200,_default:400},Y.fx.step={},Y.expr&&Y.expr.filters&&(Y.expr.filters.animated=function(e){return Y.grep(Y.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Y.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Y.offset.setOffset(this,e,t)});var n,r,o,i,a,s,c,l={top:0,left:0},u=this[0],p=u&&u.ownerDocument;if(p)return(r=p.body)===u?Y.offset.bodyOffset(u):(n=p.documentElement,Y.contains(n,u)?(u.getBoundingClientRect!==t&&(l=u.getBoundingClientRect()),o=D(p),i=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,s=o.pageYOffset||n.scrollTop,c=o.pageXOffset||n.scrollLeft,{top:l.top+s-i,left:l.left+c-a}):l)},Y.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return Y.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Y.css(e,"marginTop"))||0,n+=parseFloat(Y.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=Y.css(e,"position");"static"===r&&(e.style.position="relative");var o,i,a=Y(e),s=a.offset(),c=Y.css(e,"top"),l=Y.css(e,"left"),u=("absolute"===r||"fixed"===r)&&Y.inArray("auto",[c,l])>-1,p={},f={};u?(f=a.position(),o=f.top,i=f.left):(o=parseFloat(c)||0,i=parseFloat(l)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+o),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):a.css(p)}},Y.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Q.body;e&&!tr.test(e.nodeName)&&"static"===Y.css(e,"position");)e=e.offsetParent;return e||Q.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(o){return Y.access(this,function(e,o,i){var a=D(e);return i===t?a?n in a?a[n]:a.document.documentElement[o]:e[o]:(a?a.scrollTo(r?Y(a).scrollLeft():i,r?i:Y(a).scrollTop()):e[o]=i,t)},e,o,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,o){Y.fn[o]=function(o,i){var a=arguments.length&&(r||"boolean"!=typeof o),s=r||(o===!0||i===!0?"margin":"border");return Y.access(this,function(n,r,o){var i;return Y.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(i=n.documentElement,Math.max(n.body["scroll"+e],i["scroll"+e],n.body["offset"+e],i["offset"+e],i["client"+e])):o===t?Y.css(n,r,o,s):Y.style(n,r,o,s)},n,a?o:t,a,null)}})}),e.jQuery=e.$=Y,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})}(window);/*! * This file creates $ and jQuery variables within the F2 closure scope */ var $,jQuery=$=window.jQuery.noConflict(!0);/*! * Hij1nx requires the following notice to accompany EventEmitter: * * Copyright (c) 2011 hij1nx * * http://www.twitter.com/hij1nx * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the 'Software'), to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ !function(e){function t(){this._events={}}function n(e){e&&(e.delimiter&&(this.delimiter=e.delimiter),e.wildcard&&(this.wildcard=e.wildcard),this.wildcard&&(this.listenerTree={}))}function r(e){this._events={},n.call(this,e)}function o(e,t,n,r){if(!n)return[];var i,a,s,c,l,u,p,f=[],d=t.length,h=t[r],g=t[r+1];if(r===d&&n._listeners){if("function"==typeof n._listeners)return e&&e.push(n._listeners),[n];for(i=0,a=n._listeners.length;a>i;i++)e&&e.push(n._listeners[i]);return[n]}if("*"===h||"**"===h||n[h]){if("*"===h){for(s in n)"_listeners"!==s&&n.hasOwnProperty(s)&&(f=f.concat(o(e,t,n[s],r+1)));return f}if("**"===h){p=r+1===d||r+2===d&&"*"===g,p&&n._listeners&&(f=f.concat(o(e,t,n,d)));for(s in n)"_listeners"!==s&&n.hasOwnProperty(s)&&("*"===s||"**"===s?(n[s]._listeners&&!p&&(f=f.concat(o(e,t,n[s],d))),f=f.concat(o(e,t,n[s],r))):f=s===g?f.concat(o(e,t,n[s],r+2)):f.concat(o(e,t,n[s],r)));return f}f=f.concat(o(e,t,n[h],r+1))}if(c=n["*"],c&&o(e,t,c,r+1),l=n["**"])if(d>r){l._listeners&&o(e,t,l,d);for(s in l)"_listeners"!==s&&l.hasOwnProperty(s)&&(s===g?o(e,t,l[s],r+2):s===h?o(e,t,l[s],r+1):(u={},u[s]=l[s],o(e,t,{"**":u},r+1)))}else l._listeners?o(e,t,l,d):l["*"]&&l["*"]._listeners&&o(e,t,l["*"],d);return f}function i(e,t){e="string"==typeof e?e.split(this.delimiter):e.slice();for(var n=0,r=e.length;r>n+1;n++)if("**"===e[n]&&"**"===e[n+1])return;for(var o=this.listenerTree,i=e.shift();i;){if(o[i]||(o[i]={}),o=o[i],0===e.length){if(o._listeners){if("function"==typeof o._listeners)o._listeners=[o._listeners,t];else if(a(o._listeners)&&(o._listeners.push(t),!o._listeners.warned)){var c=s;this._events.maxListeners!==undefined&&(c=this._events.maxListeners),c>0&&o._listeners.length>c&&(o._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",o._listeners.length),console.trace())}}else o._listeners=t;return!0}i=e.shift()}return!0}var a=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=10;r.prototype.delimiter=".",r.prototype.setMaxListeners=function(e){this._events||t.call(this),this._events.maxListeners=e},r.prototype.event="",r.prototype.once=function(e,t){return this.many(e,1,t),this},r.prototype.many=function(e,t,n){function r(){0===--t&&o.off(e,r),n.apply(this,arguments)}var o=this;if("function"!=typeof n)throw Error("many only accepts instances of Function");return r._origin=n,this.on(e,r),o},r.prototype.emit=function(){this._events||t.call(this);var e=arguments[0];if("newListener"===e&&!this._events.newListener)return!1;if(this._all){for(var n=arguments.length,r=Array(n-1),i=1;n>i;i++)r[i-1]=arguments[i];for(i=0,n=this._all.length;n>i;i++)this.event=e,this._all[i].apply(this,r)}if("error"===e&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");var a;if(this.wildcard){a=[];var s="string"==typeof e?e.split(this.delimiter):e.slice();o.call(this,a,s,this.listenerTree,0)}else a=this._events[e];if("function"==typeof a){if(this.event=e,1===arguments.length)a.call(this);else if(arguments.length>1)switch(arguments.length){case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:for(var n=arguments.length,r=Array(n-1),i=1;n>i;i++)r[i-1]=arguments[i];a.apply(this,r)}return!0}if(a){for(var n=arguments.length,r=Array(n-1),i=1;n>i;i++)r[i-1]=arguments[i];for(var c=a.slice(),i=0,n=c.length;n>i;i++)this.event=e,c[i].apply(this,r);return c.length>0||this._all}return this._all},r.prototype.on=function(e,n){if("function"==typeof e)return this.onAny(e),this;if("function"!=typeof n)throw Error("on only accepts instances of Function");if(this._events||t.call(this),this.emit("newListener",e,n),this.wildcard)return i.call(this,e,n),this;if(this._events[e]){if("function"==typeof this._events[e])this._events[e]=[this._events[e],n];else if(a(this._events[e])&&(this._events[e].push(n),!this._events[e].warned)){var r=s;this._events.maxListeners!==undefined&&(r=this._events.maxListeners),r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}else this._events[e]=n;return this},r.prototype.onAny=function(e){if(this._all||(this._all=[]),"function"!=typeof e)throw Error("onAny only accepts instances of Function");return this._all.push(e),this},r.prototype.addListener=r.prototype.on,r.prototype.off=function(e,t){if("function"!=typeof t)throw Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();r=o.call(this,null,i,this.listenerTree,0)}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var s=0;r.length>s;s++){var c=r[s];if(n=c._listeners,a(n)){for(var l=-1,u=0,p=n.length;p>u;u++)if(n[u]===t||n[u].listener&&n[u].listener===t||n[u]._origin&&n[u]._origin===t){l=u;break}if(0>l)return this;this.wildcard?c._listeners.splice(l,1):this._events[e].splice(l,1),0===n.length&&(this.wildcard?delete c._listeners:delete this._events[e])}else(n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete c._listeners:delete this._events[e])}return this},r.prototype.offAny=function(e){var t,n=0,r=0;if(e&&this._all&&this._all.length>0){for(t=this._all,n=0,r=t.length;r>n;n++)if(e===t[n])return t.splice(n,1),this}else this._all=[];return this},r.prototype.removeListener=r.prototype.off,r.prototype.removeAllListeners=function(e){if(0===arguments.length)return!this._events||t.call(this),this;if(this.wildcard)for(var n="string"==typeof e?e.split(this.delimiter):e.slice(),r=o.call(this,null,n,this.listenerTree,0),i=0;r.length>i;i++){var a=r[i];a._listeners=null}else{if(!this._events[e])return this;this._events[e]=null}return this},r.prototype.listeners=function(e){if(this.wildcard){var n=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return o.call(this,n,r,this.listenerTree,0),n}return this._events||t.call(this),this._events[e]||(this._events[e]=[]),a(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},r.prototype.listenersAny=function(){return this._all?this._all:[]},e.EventEmitter2=r}("undefined"!=typeof process&&process.title!==void 0&&exports!==void 0?exports:window),/*! * Øyvind Sean Kinsey and others require the following notice to accompany easyXDM: * * http://easyxdm.net/ * Copyright(c) 2009-2011, Øyvind Sean Kinsey, [email protected]. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ function(e,t,n,r,o,i){function a(e,t){var n=typeof e[t];return"function"==n||!("object"!=n||!e[t])||"unknown"==n}function s(e,t){return!("object"!=typeof e[t]||!e[t])}function c(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(){try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return T=Array.prototype.slice.call(e.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1),N=parseInt(T[0],10)>9&&parseInt(T[1],10)>0,e=null,!0}catch(t){return!1}}function u(){if(!W){W=!0;for(var e=0;$.length>e;e++)$[e]();$.length=0}}function p(e,t){return W?(e.call(t),void 0):($.push(function(){e.call(t)}),void 0)}function f(){var e=parent;if(""!==D)for(var t=0,n=D.split(".");n.length>t;t++)e=e[n[t]];return e.easyXDM}function d(t){return e.easyXDM=B,D=t,D&&(Q="easyXDM_"+D.replace(".","_")+"_"),L}function h(e){return e.match(M)[3]}function g(e){return e.match(M)[4]||""}function m(e){var t=e.toLowerCase().match(M),n=t[2],r=t[3],o=t[4]||"";return("http:"==n&&":80"==o||"https:"==n&&":443"==o)&&(o=""),n+"//"+r+o}function y(e){if(e=e.replace(H,"$1/"),!e.match(/^(http||https):\/\//)){var t="/"===e.substring(0,1)?"":n.pathname;"/"!==t.substring(t.length-1)&&(t=t.substring(0,t.lastIndexOf("/")+1)),e=n.protocol+"//"+n.host+t+e}for(;P.test(e);)e=e.replace(P,"");return e}function v(e,t){var n="",r=e.indexOf("#");-1!==r&&(n=e.substring(r),e=e.substring(0,r));var o=[];for(var a in t)t.hasOwnProperty(a)&&o.push(a+"="+i(t[a]));return e+(U?"#":-1==e.indexOf("?")?"?":"&")+o.join("&")+n}function b(e){return e===void 0}function _(e,t,n){var r;for(var o in t)t.hasOwnProperty(o)&&(o in e?(r=t[o],"object"==typeof r?_(e[o],r,n):n||(e[o]=t[o])):e[o]=t[o]);return e}function C(){var e=t.body.appendChild(t.createElement("form")),n=e.appendChild(t.createElement("input"));n.name=Q+"TEST"+O,E=n!==e.elements[n.name],t.body.removeChild(e)}function x(e){b(E)&&C();var n;E?n=t.createElement('<iframe name="'+e.props.name+'"/>'):(n=t.createElement("IFRAME"),n.name=e.props.name),n.id=n.name=e.props.name,delete e.props.name,e.onLoad&&R(n,"load",e.onLoad),"string"==typeof e.container&&(e.container=t.getElementById(e.container)),e.container||(_(n.style,{position:"absolute",top:"-2000px"}),e.container=t.body);var r=e.props.src;return delete e.props.src,_(n,e.props),n.border=n.frameBorder=0,n.allowTransparency=!0,e.container.appendChild(n),n.src=r,e.props.src=r,n}function w(e,t){"string"==typeof e&&(e=[e]);for(var n,r=e.length;r--;)if(n=e[r],n=RegExp("^"==n.substr(0,1)?n:"^"+n.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$"),n.test(t))return!0;return!1}function A(r){var o,i=r.protocol;if(r.isHost=r.isHost||b(J.xdm_p),U=r.hash||!1,r.props||(r.props={}),r.isHost)r.remote=y(r.remote),r.channel=r.channel||"default"+O++,r.secret=Math.random().toString(16).substring(2),b(i)&&(m(n.href)==m(r.remote)?i="4":a(e,"postMessage")||a(t,"postMessage")?i="1":r.swf&&a(e,"ActiveXObject")&&l()?i="6":"Gecko"===navigator.product&&"frameElement"in e&&-1==navigator.userAgent.indexOf("WebKit")?i="5":r.remoteHelper?(r.remoteHelper=y(r.remoteHelper),i="2"):i="0");else if(r.channel=J.xdm_c,r.secret=J.xdm_s,r.remote=J.xdm_e,i=J.xdm_p,r.acl&&!w(r.acl,r.remote))throw Error("Access denied for "+r.remote);switch(r.protocol=i,i){case"0":if(_(r,{interval:100,delay:2e3,useResize:!0,useParent:!1,usePolling:!1},!0),r.isHost){if(!r.local){for(var s,c=n.protocol+"//"+n.host,u=t.body.getElementsByTagName("img"),p=u.length;p--;)if(s=u[p],s.src.substring(0,c.length)===c){r.local=s.src;break}r.local||(r.local=e)}var f={xdm_c:r.channel,xdm_p:0};r.local===e?(r.usePolling=!0,r.useParent=!0,r.local=n.protocol+"//"+n.host+n.pathname+n.search,f.xdm_e=r.local,f.xdm_pa=1):f.xdm_e=y(r.local),r.container&&(r.useResize=!1,f.xdm_po=1),r.remote=v(r.remote,f)}else _(r,{channel:J.xdm_c,remote:J.xdm_e,useParent:!b(J.xdm_pa),usePolling:!b(J.xdm_po),useResize:r.useParent?!1:r.useResize});o=[new L.stack.HashTransport(r),new L.stack.ReliableBehavior({}),new L.stack.QueueBehavior({encode:!0,maxLength:4e3-r.remote.length}),new L.stack.VerifyBehavior({initiate:r.isHost})];break;case"1":o=[new L.stack.PostMessageTransport(r)];break;case"2":o=[new L.stack.NameTransport(r),new L.stack.QueueBehavior,new L.stack.VerifyBehavior({initiate:r.isHost})];break;case"3":o=[new L.stack.NixTransport(r)];break;case"4":o=[new L.stack.SameOriginTransport(r)];break;case"5":o=[new L.stack.FrameElementTransport(r)];break;case"6":T||l(),o=[new L.stack.FlashTransport(r)]}return o.push(new L.stack.QueueBehavior({lazy:r.lazy,remove:!0})),o}function F(e){for(var t,n={incoming:function(e,t){this.up.incoming(e,t)},outgoing:function(e,t){this.down.outgoing(e,t)},callback:function(e){this.up.callback(e)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}},r=0,o=e.length;o>r;r++)t=e[r],_(t,n,!0),0!==r&&(t.down=e[r-1]),r!==o-1&&(t.up=e[r+1]);return t}function k(e){e.up.down=e.down,e.down.up=e.up,e.up=e.down=null}var E,T,N,R,S,j=this,O=Math.floor(1e4*Math.random()),I=Function.prototype,M=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,P=/[\-\w]+\/\.\.\//,H=/([^:])\/\//g,D="",L={},B=e.easyXDM,Q="easyXDM_",U=!1;if(a(e,"addEventListener"))R=function(e,t,n){e.addEventListener(t,n,!1)},S=function(e,t,n){e.removeEventListener(t,n,!1)};else{if(!a(e,"attachEvent"))throw Error("Browser not supported");R=function(e,t,n){e.attachEvent("on"+t,n)},S=function(e,t,n){e.detachEvent("on"+t,n)}}var q,W=!1,$=[];if("readyState"in t?(q=t.readyState,W="complete"==q||~navigator.userAgent.indexOf("AppleWebKit/")&&("loaded"==q||"interactive"==q)):W=!!t.body,!W){if(a(e,"addEventListener"))R(t,"DOMContentLoaded",u);else if(R(t,"readystatechange",function(){"complete"==t.readyState&&u()}),t.documentElement.doScroll&&e===top){var z=function(){if(!W){try{t.documentElement.doScroll("left")}catch(e){return r(z,1),void 0}u()}};z()}R(e,"load",u)}var J=function(e){e=e.substring(1).split("&");for(var t,n={},r=e.length;r--;)t=e[r].split("="),n[t[0]]=o(t[1]);return n}(/xdm_e=/.test(n.search)?n.search:n.hash),V=function(){var e={},t={a:[1,2,3]},n='{"a":[1,2,3]}';return"undefined"!=typeof JSON&&"function"==typeof JSON.stringify&&JSON.stringify(t).replace(/\s/g,"")===n?JSON:(Object.toJSON&&Object.toJSON(t).replace(/\s/g,"")===n&&(e.stringify=Object.toJSON),"function"==typeof String.prototype.evalJSON&&(t=n.evalJSON(),t.a&&3===t.a.length&&3===t.a[2]&&(e.parse=function(e){return e.evalJSON()})),e.stringify&&e.parse?(V=function(){return e},e):null)};_(L,{version:"2.4.15.118",query:J,stack:{},apply:_,getJSONObject:V,whenReady:p,noConflict:d}),L.DomHelper={on:R,un:S,requiresJSON:function(n){s(e,"JSON")||t.write('<script type="text/javascript" src="'+n+'"><'+"/script>")}},function(){var e={};L.Fn={set:function(t,n){e[t]=n},get:function(t,n){var r=e[t];return n&&delete e[t],r}}}(),L.Socket=function(e){var t=F(A(e).concat([{incoming:function(t,n){e.onMessage(t,n)},callback:function(t){e.onReady&&e.onReady(t)}}])),n=m(e.remote);this.origin=m(e.remote),this.destroy=function(){t.destroy()},this.postMessage=function(e){t.outgoing(e,n)},t.init()},L.Rpc=function(e,t){if(t.local)for(var n in t.local)if(t.local.hasOwnProperty(n)){var r=t.local[n];"function"==typeof r&&(t.local[n]={method:r})}var o=F(A(e).concat([new L.stack.RpcBehavior(this,t),{callback:function(t){e.onReady&&e.onReady(t)}}]));this.origin=m(e.remote),this.destroy=function(){o.destroy()},o.init()},L.stack.SameOriginTransport=function(e){var t,o,i,a;return t={outgoing:function(e,t,n){i(e),n&&n()},destroy:function(){o&&(o.parentNode.removeChild(o),o=null)},onDOMReady:function(){a=m(e.remote),e.isHost?(_(e.props,{src:v(e.remote,{xdm_e:n.protocol+"//"+n.host+n.pathname,xdm_c:e.channel,xdm_p:4}),name:Q+e.channel+"_provider"}),o=x(e),L.Fn.set(e.channel,function(e){return i=e,r(function(){t.up.callback(!0)},0),function(e){t.up.incoming(e,a)}})):(i=f().Fn.get(e.channel,!0)(function(e){t.up.incoming(e,a)}),r(function(){t.up.callback(!0)},0))},init:function(){p(t.onDOMReady,t)}}},L.stack.FlashTransport=function(e){function o(e){r(function(){a.up.incoming(e,c)},0)}function i(n){var r=e.swf+"?host="+e.isHost,o="easyXDM_swf_"+Math.floor(1e4*Math.random());L.Fn.set("flash_loaded"+n.replace(/[\-.]/g,"_"),function(){L.stack.FlashTransport[n].swf=l=u.firstChild;for(var e=L.stack.FlashTransport[n].queue,t=0;e.length>t;t++)e[t]();e.length=0}),e.swfContainer?u="string"==typeof e.swfContainer?t.getElementById(e.swfContainer):e.swfContainer:(u=t.createElement("div"),_(u.style,N&&e.swfNoThrottle?{height:"20px",width:"20px",position:"fixed",right:0,top:0}:{height:"1px",width:"1px",position:"absolute",overflow:"hidden",right:0,top:0}),t.body.appendChild(u));var i="callback=flash_loaded"+n.replace(/[\-.]/g,"_")+"&proto="+j.location.protocol+"&domain="+h(j.location.href)+"&port="+g(j.location.href)+"&ns="+D;u.innerHTML="<object height='20' width='20' type='application/x-shockwave-flash' id='"+o+"' data='"+r+"'>"+"<param name='allowScriptAccess' value='always'></param>"+"<param name='wmode' value='transparent'>"+"<param name='movie' value='"+r+"'></param>"+"<param name='flashvars' value='"+i+"'></param>"+"<embed type='application/x-shockwave-flash' FlashVars='"+i+"' allowScriptAccess='always' wmode='transparent' src='"+r+"' height='1' width='1'></embed>"+"</object>"}var a,s,c,l,u;return a={outgoing:function(t,n,r){l.postMessage(e.channel,""+t),r&&r()},destroy:function(){try{l.destroyChannel(e.channel)}catch(t){}l=null,s&&(s.parentNode.removeChild(s),s=null)},onDOMReady:function(){c=e.remote,L.Fn.set("flash_"+e.channel+"_init",function(){r(function(){a.up.callback(!0)})}),L.Fn.set("flash_"+e.channel+"_onMessage",o),e.swf=y(e.swf);var t=h(e.swf),u=function(){L.stack.FlashTransport[t].init=!0,l=L.stack.FlashTransport[t].swf,l.createChannel(e.channel,e.secret,m(e.remote),e.isHost),e.isHost&&(N&&e.swfNoThrottle&&_(e.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"}),_(e.props,{src:v(e.remote,{xdm_e:m(n.href),xdm_c:e.channel,xdm_p:6,xdm_s:e.secret}),name:Q+e.channel+"_provider"}),s=x(e))};L.stack.FlashTransport[t]&&L.stack.FlashTransport[t].init?u():L.stack.FlashTransport[t]?L.stack.FlashTransport[t].queue.push(u):(L.stack.FlashTransport[t]={queue:[u]},i(t))},init:function(){p(a.onDOMReady,a)}}},L.stack.PostMessageTransport=function(t){function o(e){if(e.origin)return m(e.origin);if(e.uri)return m(e.uri);if(e.domain)return n.protocol+"//"+e.domain;throw"Unable to retrieve the origin of the event"}function i(e){var n=o(e);n==l&&e.data.substring(0,t.channel.length+1)==t.channel+" "&&a.up.incoming(e.data.substring(t.channel.length+1),n)}var a,s,c,l;return a={outgoing:function(e,n,r){c.postMessage(t.channel+" "+e,n||l),r&&r()},destroy:function(){S(e,"message",i),s&&(c=null,s.parentNode.removeChild(s),s=null)},onDOMReady:function(){if(l=m(t.remote),t.isHost){var o=function(n){n.data==t.channel+"-ready"&&(c="postMessage"in s.contentWindow?s.contentWindow:s.contentWindow.document,S(e,"message",o),R(e,"message",i),r(function(){a.up.callback(!0)},0))};R(e,"message",o),_(t.props,{src:v(t.remote,{xdm_e:m(n.href),xdm_c:t.channel,xdm_p:1}),name:Q+t.channel+"_provider"}),s=x(t)}else R(e,"message",i),c="postMessage"in e.parent?e.parent:e.parent.document,c.postMessage(t.channel+"-ready",l),r(function(){a.up.callback(!0)},0)},init:function(){p(a.onDOMReady,a)}}},L.stack.FrameElementTransport=function(o){var i,a,s,c;return i={outgoing:function(e,t,n){s.call(this,e),n&&n()},destroy:function(){a&&(a.parentNode.removeChild(a),a=null)},onDOMReady:function(){c=m(o.remote),o.isHost?(_(o.props,{src:v(o.remote,{xdm_e:m(n.href),xdm_c:o.channel,xdm_p:5}),name:Q+o.channel+"_provider"}),a=x(o),a.fn=function(e){return delete a.fn,s=e,r(function(){i.up.callback(!0)},0),function(e){i.up.incoming(e,c)}}):(t.referrer&&m(t.referrer)!=J.xdm_e&&(e.top.location=J.xdm_e),s=e.frameElement.fn(function(e){i.up.incoming(e,c)}),i.up.callback(!0))},init:function(){p(i.onDOMReady,i)}}},L.stack.NameTransport=function(e){function t(t){var n=e.remoteHelper+(s?"#_3":"#_2")+e.channel;c.contentWindow.sendMessage(t,n)}function n(){s?2!==++u&&s||a.up.callback(!0):(t("ready"),a.up.callback(!0))}function o(e){a.up.incoming(e,d)}function i(){f&&r(function(){f(!0)},0)}var a,s,c,l,u,f,d,h;return a={outgoing:function(e,n,r){f=r,t(e)},destroy:function(){c.parentNode.removeChild(c),c=null,s&&(l.parentNode.removeChild(l),l=null)},onDOMReady:function(){s=e.isHost,u=0,d=m(e.remote),e.local=y(e.local),s?(L.Fn.set(e.channel,function(t){s&&"ready"===t&&(L.Fn.set(e.channel,o),n())}),h=v(e.remote,{xdm_e:e.local,xdm_c:e.channel,xdm_p:2}),_(e.props,{src:h+"#"+e.channel,name:Q+e.channel+"_provider"}),l=x(e)):(e.remoteHelper=e.remote,L.Fn.set(e.channel,o)),c=x({props:{src:e.local+"#_4"+e.channel},onLoad:function t(){var o=c||this;S(o,"load",t),L.Fn.set(e.channel+"_load",i),function a(){"function"==typeof o.contentWindow.sendMessage?n():r(a,50)}()}})},init:function(){p(a.onDOMReady,a)}}},L.stack.HashTransport=function(t){function n(e){if(g){var n=t.remote+"#"+d++ +"_"+e;(c||!y?g.contentWindow:g).location=n}}function o(e){f=e,s.up.incoming(f.substring(f.indexOf("_")+1),v)}function i(){if(h){var e=h.location.href,t="",n=e.indexOf("#");-1!=n&&(t=e.substring(n)),t&&t!=f&&o(t)}}function a(){l=setInterval(i,u)}var s,c,l,u,f,d,h,g,y,v;return s={outgoing:function(e){n(e)},destroy:function(){e.clearInterval(l),(c||!y)&&g.parentNode.removeChild(g),g=null},onDOMReady:function(){if(c=t.isHost,u=t.interval,f="#"+t.channel,d=0,y=t.useParent,v=m(t.remote),c){if(t.props={src:t.remote,name:Q+t.channel+"_provider"},y)t.onLoad=function(){h=e,a(),s.up.callback(!0)};else{var n=0,o=t.delay/50;(function i(){if(++n>o)throw Error("Unable to reference listenerwindow");try{h=g.contentWindow.frames[Q+t.channel+"_consumer"]}catch(e){}h?(a(),s.up.callback(!0)):r(i,50)})()}g=x(t)}else h=e,a(),y?(g=parent,s.up.callback(!0)):(_(t,{props:{src:t.remote+"#"+t.channel+new Date,name:Q+t.channel+"_consumer"},onLoad:function(){s.up.callback(!0)}}),g=x(t))},init:function(){p(s.onDOMReady,s)}}},L.stack.ReliableBehavior=function(){var e,t,n=0,r=0,o="";return e={incoming:function(i,a){var s=i.indexOf("_"),c=i.substring(0,s).split(",");i=i.substring(s+1),c[0]==n&&(o="",t&&t(!0)),i.length>0&&(e.down.outgoing(c[1]+","+n+"_"+o,a),r!=c[1]&&(r=c[1],e.up.incoming(i,a)))},outgoing:function(i,a,s){o=i,t=s,e.down.outgoing(r+","+ ++n+"_"+i,a)}}},L.stack.QueueBehavior=function(e){function t(){if(e.remove&&0===s.length)return k(n),void 0;if(!c&&0!==s.length&&!a){c=!0;var o=s.shift();n.down.outgoing(o.data,o.origin,function(e){c=!1,o.callback&&r(function(){o.callback(e)},0),t()})}}var n,a,s=[],c=!0,l="",u=0,p=!1,f=!1;return n={init:function(){b(e)&&(e={}),e.maxLength&&(u=e.maxLength,f=!0),e.lazy?p=!0:n.down.init()},callback:function(e){c=!1;var r=n.up;t(),r.callback(e)},incoming:function(t,r){if(f){var i=t.indexOf("_"),a=parseInt(t.substring(0,i),10);l+=t.substring(i+1),0===a&&(e.encode&&(l=o(l)),n.up.incoming(l,r),l="")}else n.up.incoming(t,r)},outgoing:function(r,o,a){e.encode&&(r=i(r));var c,l=[];if(f){for(;0!==r.length;)c=r.substring(0,u),r=r.substring(c.length),l.push(c);for(;c=l.shift();)s.push({data:l.length+"_"+c,origin:o,callback:0===l.length?a:null})}else s.push({data:r,origin:o,callback:a});p?n.down.init():t()},destroy:function(){a=!0,n.down.destroy()}}},L.stack.VerifyBehavior=function(e){function t(){r=Math.random().toString(16).substring(2),n.down.outgoing(r)}var n,r,o;return n={incoming:function(i,a){var s=i.indexOf("_");-1===s?i===r?n.up.callback(!0):o||(o=i,e.initiate||t(),n.down.outgoing(i)):i.substring(0,s)===o&&n.up.incoming(i.substring(s+1),a)},outgoing:function(e,t,o){n.down.outgoing(r+"_"+e,t,o)},callback:function(){e.initiate&&t()}}},L.stack.RpcBehavior=function(e,t){function n(e){e.jsonrpc="2.0",i.down.outgoing(a.stringify(e))}function r(e,t){var r=Array.prototype.slice;return function(){var o,i=arguments.length,a={method:t};i>0&&"function"==typeof arguments[i-1]?(i>1&&"function"==typeof arguments[i-2]?(o={success:arguments[i-2],error:arguments[i-1]},a.params=r.call(arguments,0,i-2)):(o={success:arguments[i-1]},a.params=r.call(arguments,0,i-1)),l[""+ ++s]=o,a.id=s):a.params=r.call(arguments,0),e.namedParams&&1===a.params.length&&(a.params=a.params[0]),n(a)}}function o(e,t,r,o){if(!r)return t&&n({id:t,error:{code:-32601,message:"Procedure not found."}}),void 0;var i,a;t?(i=function(e){i=I,n({id:t,result:e})},a=function(e,r){a=I;var o={id:t,error:{code:-32099,message:e}};r&&(o.error.data=r),n(o)}):i=a=I,c(o)||(o=[o]);try{var s=r.method.apply(r.scope,o.concat([i,a]));b(s)||i(s)}catch(l){a(l.message)}}var i,a=t.serializer||V(),s=0,l={};return i={incoming:function(e){var r=a.parse(e);if(r.method)t.handle?t.handle(r,n):o(r.method,r.id,t.local[r.method],r.params);else{var i=l[r.id];r.error?i.error&&i.error(r.error):i.success&&i.success(r.result),delete l[r.id]}},init:function(){if(t.remote)for(var n in t.remote)t.remote.hasOwnProperty(n)&&(e[n]=r(t.remote[n],n));i.down.init()},destroy:function(){for(var n in t.remote)t.remote.hasOwnProperty(n)&&e.hasOwnProperty(n)&&delete e[n];i.down.destroy()}}},j.easyXDM=L}(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent);/*! * F2 v1.2.2 08-22-2013 * Copyright (c) 2013 Markit On Demand, Inc. http://www.openf2.org * * "F2" is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific * language governing permissions and limitations under the License. * * Please note that F2 ("Software") may contain third party material that Markit * On Demand Inc. has a license to use and include within the Software (the * "Third Party Material"). A list of the software comprising the Third Party Material * and the terms and conditions under which such Third Party Material is distributed * are reproduced in the ThirdPartyMaterial.md file available at: * * https://github.com/OpenF2/F2/blob/master/ThirdPartyMaterial.md * * The inclusion of the Third Party Material in the Software does not grant, provide * nor result in you having acquiring any rights whatsoever, other than as stipulated * in the terms and conditions related to the specific Third Party Material, if any. * */ var F2;F2=function(){var e=function(e,n){function r(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}return n=t(n||""),e=t(e||""),n&&e?(n.protocol||e.protocol)+(n.protocol||n.authority?n.authority:e.authority)+r(n.protocol||n.authority||"/"===n.pathname.charAt(0)?n.pathname:n.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+n.pathname:e.pathname)+(n.protocol||n.authority||n.pathname?n.search:n.search||e.search)+n.hash:null},t=function(e){var t=(e+"").replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null};return{appConfigReplacer:function(e,t){return"root"==e||"ui"==e||"height"==e?void 0:t},Apps:{},extend:function(e,t,n){var r="function"==typeof t,o=e?e.split("."):[],i=this;t=t||{},"F2"===o[0]&&(o=o.slice(1));for(var a=0,s=o.length;s>a;a++)i[o[a]]||(i[o[a]]=r&&a+1==s?t:{}),i=i[o[a]];if(!r)for(var c in t)(i[c]===void 0||n)&&(i[c]=t[c]);return i},guid:function(){var e=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},inArray:function(e,t){return jQuery.inArray(e,t)>-1},isLocalRequest:function(t){var n,r,o=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,i=t.toLowerCase(),a=o.exec(i);try{n=location.href}catch(s){n=document.createElement("a"),n.href="",n=n.href}n=n.toLowerCase(),a||(i=e(n,i).toLowerCase(),a=o.exec(i)),r=o.exec(n)||[];var c=!(a&&(a[1]!==r[1]||a[2]!==r[2]||(a[3]||("http:"===a[1]?"80":"443"))!==(r[3]||("http:"===r[1]?"80":"443"))));return c},isNativeDOMNode:function(e){var t="object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n="object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName;return t||n},log:function(){for(var e,t,n,r="log",o=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],a=i.length,s=window.console=window.console||{};a--;)t=i[a],s[t]||(s[t]=o),arguments&&arguments.length>1&&arguments[0]==t&&(r=t,n=Array.prototype.slice.call(arguments,1));e=Function.prototype.bind?Function.prototype.bind.call(s[r],s):function(){Function.prototype.apply.call(s[r],s,n||arguments)},e.apply(this,n||arguments)},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"{{sdk.version}}"}}}(),F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appDestroy:function(e){e&&e.app&&e.app.destroy&&"function"==typeof e.app.destroy?e.app.destroy():e&&e.app&&e.app.destroy&&F2.log(e.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(500,function(){jQuery(this).remove()})}},o=function(e,t,n,r){i(e);var o={func:n,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!o.func&&!o.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(o.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return o},i=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},a=function(e,t,r){if(i(e),r||t)if(!r&&t)n[t]=[];else if(r&&!t){r=r.toLowerCase();for(var o in n){for(var a=n[o],s=[],c=0,l=a.length;l>c;c++){var u=a[c];u&&(u.namespace&&u.namespace.toLowerCase()==r||s.push(u))}a=s}}else if(r&&n[t]){r=r.toLowerCase();for(var p=[],f=0,d=n[t].length;d>f;f++){var h=n[t][f];h&&(h.namespace&&h.namespace.toLowerCase()==r||p.push(h))}n[t]=p}};return{getToken:function(){return delete this.getToken,e},__f2GetToken:function(){return delete this.__f2GetToken,t},__trigger:function(e,o){if(e!=t)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!n||!n[o])throw"Invalid EventKey passed. Check your inputs and try again.";for(var i=[],a=2,s=arguments.length;s>a;a++)i.push(arguments[a]);if(0===n[o].length&&r[o])return r[o].apply(F2,i),this;if(0===n[o].length&&!n[o])return this;for(var c=0,l=n[o].length;l>c;c++){var u=n[o][c];if(u.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var p=jQuery(arguments[2].root).append(arguments[3]);jQuery(u.domNode).append(p)}else u.domNode&&arguments[2]&&!arguments[2].root&&arguments[3]?(arguments[2].root=jQuery(arguments[3]).get(0),jQuery(u.domNode).append(arguments[2].root)):u.func.apply(F2,i)}return this},on:function(e,t,r){var i=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var a=t.split(".");t=a[0],i=a[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(o(e,i,r,"appRender"==t)),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var o=t.split(".");t=o[0],r=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return a(e,t,r),this}}}()),F2.extend("Constants",{AppHandlers:function(){return{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}()}),F2.extend("",{App:function(){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(){},appRender:function(){},beforeAppRender:function(){},debugMode:!1,scriptErrorTimeout:7e3,isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(){},type:function(){},url:function(){}}}}),F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()),F2.extend("Rpc",function(){var e={},t="",n={},r=RegExp("^"+F2.Constants.Sockets.EVENT),o=RegExp("^"+F2.Constants.Sockets.RPC),i=RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),a=RegExp("^"+F2.Constants.Sockets.LOAD),s=RegExp("^"+F2.Constants.Sockets.UI_RPC),c=function(){var e,t=!1,r=[],o=new easyXDM.Socket({onMessage:function(i,s){if(!t&&a.test(i)){i=i.replace(a,"");var c=F2.parse(i);2==c.length&&(e=c[0],n[e.instanceId]={config:e,socket:o},F2.registerApps([e],[c[1]]),jQuery.each(r,function(){p(e,i,s)}),t=!0)}else t?p(e,i,s):r.push(i)}})},l=function(e,n){var r=jQuery(e.root);if(r.is("."+F2.Constants.Css.APP_CONTAINER)||r.find("."+F2.Constants.Css.APP_CONTAINER),!r.length)return F2.log("Unable to locate app in order to establish secure connection."),void 0;var o={scrolling:"no",style:{width:"100%"}};e.height&&(o.style.height=e.height+"px");var i=new easyXDM.Socket({remote:t,container:r.get(0),props:o,onMessage:function(t,n){p(e,t,n)},onReady:function(){i.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return i},u=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},p=function(t,n){function a(e,t){for(var n=(t+"").split("."),r=0;n.length>r;r++){if(void 0===e[n[r]]){e=void 0;break}e=e[n[r]]}return e}function c(e,t,n){var r=F2.parse(t.replace(e,""));return r.params&&r.params.length&&r.callbacks&&r.callbacks.length&&jQuery.each(r.callbacks,function(e,t){jQuery.each(r.params,function(e,o){t==o&&(r.params[e]=u(n,t))})}),r}var l,p;s.test(n)?(l=c(s,n,t.instanceId),p=a(t.ui,l.functionName),void 0!==p?p.apply(t.ui,l.params):F2.log("Unable to locate UI RPC function: "+l.functionName)):o.test(n)?(l=c(o,n,t.instanceId),p=a(window,l.functionName),void 0!==p?p.apply(p,l.params):F2.log("Unable to locate RPC function: "+l.functionName)):i.test(n)?(l=c(i,n,t.instanceId),void 0!==e[l.functionName]&&(e[l.functionName].apply(e[l.functionName],l.params),delete e[l.functionName])):r.test(n)&&(l=c(r,n,t.instanceId),F2.Events._socketEmit.apply(F2.Events,l))},f=function(t){var n=F2.guid();return e[n]=t,n};return{broadcast:function(e,t){var r=e+F2.stringify(t);jQuery.each(n,function(e,t){t.socket.postMessage(r)})},call:function(e,t,r,o){var i=[];jQuery.each(o,function(e,t){if("function"==typeof t){var n=f(t);o[e]=n,i.push(n)}}),n[e].socket.postMessage(t+F2.stringify({functionName:r,params:o,callbacks:i}))},init:function(e){t=e,t||c()},isRemote:function(e){return void 0!==n[e]&&n[e].config.isSecure&&0===jQuery(n[e].config.root).find("iframe").length},register:function(e,t){e&&t?n[e.instanceId]={config:e,socket:l(e,t)}:F2.log("Unable to register socket connection. Please check container configuration.")}}}()),F2.extend("UI",function(){var e,t=function(e){var t=e,n=jQuery(e.root),r=function(e){e=e||jQuery(t.root).outerHeight(),F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"updateHeight",[e]):(t.height=e,n.find("iframe").height(t.height))};return{hideMask:function(e){F2.UI.hideMask(t.instanceId,e)},Modals:function(){var e=function(e){return['<div class="modal">','<header class="modal-header">',"<h3>Alert!</h3>","</header>",'<div class="modal-body">',"<p>",e,"</p>","</div>",'<div class="modal-footer">','<button class="btn btn-primary btn-ok">OK</button>',"</div>","</div>"].join("")},n=function(e){return['<div class="modal">','<header class="modal-header">',"<h3>Confirm</h3>","</header>",'<div class="modal-body">',"<p>",e,"</p>","</div>",'<div class="modal-footer">','<button type="button" class="btn btn-primary btn-ok">OK</button>','<button type="button" class="btn btn-cancel">Cancel</button">',"</div>","</div>"].join("")};return{alert:function(n,r){return F2.isInit()?(F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.alert()"),void 0)},confirm:function(e,r,o){return F2.isInit()?(F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(o||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.confirm()"),void 0)}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,o=/change/i;e.setMaxListeners(0);var i=function(e){return o.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(o){"function"==typeof o?this.on("change",o):"string"==typeof o&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(o,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+o+'"]',n).removeClass("hide"),r(),e.emit("change",o)))},off:function(t,n){i(t)&&e.off(t,n)},on:function(t,n){i(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.hideMask()"),void 0;if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t);n.find("> ."+F2.Constants.Css.MASK).remove(),n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.showMask()"),void 0;if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var o=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),i=jQuery("<div>").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||i.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+100*e.UI.Mask.opacity+")",opacity:e.UI.Mask.opacity}),"static"===o.css("position")&&(o.css({position:"relative"}),o.data(F2.Constants.Css.MASK_CONTAINER,!0)),o.append(i)}},t}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);return _config.afterAppRender&&!r?(F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"),void 0):(jQuery(r).addClass(F2.Constants.Css.APP),r.get(0))},_appRender=function(e,t){return t=_outerHtml(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),_outerHtml(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_createAppConfig=function(e){return e=jQuery.extend(!0,{},e),e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME),e},_hydrateContainerConfig=function(e){e.scriptErrorTimeout||(e.scriptErrorTimeout=F2.ContainerConfig.scriptErrorTimeout),e.debugMode!==!0&&(e.debugMode=F2.ContainerConfig.debugMode)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_createAppInstance=function(e,t){e.ui=new F2.UI(e),void 0!==F2.Apps[e.appId]&&("function"==typeof F2.Apps[e.appId]?setTimeout(function(){_apps[e.instanceId].app=new F2.Apps[e.appId](e,t,e.root),void 0!==_apps[e.instanceId].app.init&&_apps[e.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+e.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return _loadSecureApp(appConfigs[0],appManifest),void 0;if(appConfigs.length!=appManifest.apps.length)return F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest),void 0;var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){_createAppInstance(t,appManifest.apps[e])})},isFileReady=function(e){return!e||"loaded"==e||"complete"==e||"uninitialized"==e},_onload=function(e){if("load"==e.type||isFileReady((e.currentTarget||e.srcElement).readyState)){var t=e.currentTarget||e.srcElement;t.detachEvent?t.detachEvent("onreadystatechange",_onload):(removeEventListener(t,_onload,"load"),removeEventListener(t,_error,"error"))}++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},_error=function(e){setTimeout(function(){var t={src:e.target.src,appId:appConfigs[0].appId};F2.log("Script defined in '"+t.appId+"' failed to load '"+t.src+"'"),F2.Events.emit("RESOURCE_FAILED_TO_LOAD",t)},_config.scriptErrorTimeout)},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=null,useCreateStyleSheet=!!document.createStyleSheet;jQuery.each(styles,function(e,t){useCreateStyleSheet?document.createStyleSheet(t):(stylesFragment=stylesFragment||[],stylesFragment.push('<link rel="stylesheet" type="text/css" href="'+t+'"/>'))}),stylesFragment&&jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(_bUsesAppHandlers){F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],_outerHtml(t.html));var n=appConfigs[e].appId;if(!appConfigs[e].root)throw"Root for "+n+" must be a native DOM element and cannot be null or undefined. Check your AppHandler callbacks to ensure you have set App root to a native DOM element.";var r=jQuery(appConfigs[e].root);if(0===r.parents("body:first").length)throw"App root for "+n+" was not appended to the DOM. Check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]),!F2.isNativeDOMNode(appConfigs[e].root))throw"App root for "+n+" must be a native DOM element. Check your AppHandler callbacks to ensure you have set app root to a native DOM element.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+n)}else appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){var n=document,r=n.createElement("script"),o=t;_config.debugMode&&(o+="?cachebuster="+(new Date).getTime()),r.async=!1,r.src=o,r.type="text/javascript",r.charset="utf-8",!r.attachEvent||r.attachEvent.toString&&0>(""+r.attachEvent).indexOf("[native code")?(r.addEventListener("load",_onload,!1),r.addEventListener("error",_error,!1)):r.attachEvent("onreadystatechange",_onload),n.body.appendChild(r)}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(_bUsesAppHandlers){var n=jQuery(e.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html),0===n.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e),!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}else e.root=_afterAppRender(e,_appRender(e,"<div></div>"));e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(e){return jQuery("<div></div>").append(e).html()},_validateApp=function(e){return e.appId?e.root||e.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(e){return{appId:e.config.appId}}):(F2.log("F2.init() must be called before F2.getContainerState()"),void 0)},init:function(e){_config=e||{},_validateContainerConfig(),_hydrateContainerConfig(_config),_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit())return F2.log("F2.init() must be called before F2.registerApps()"),void 0;if(!e)return F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0;var n=[],r={},o={},i=!1;return e=[].concat(e),t=[].concat(t||[]),i=!!t.length,e.length?e.length&&i&&e.length!=t.length?(F2.log('The length of "apps" does not equal the length of "appManifests"'),void 0):(jQuery.each(e,function(e,o){if(o=_createAppConfig(o),o.root=o.root||null,_validateApp(o)){if(_apps[o.instanceId]={config:o},o.root){if(!o.root&&"string"!=typeof o.root&&!F2.isNativeDOMNode(o.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",o),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(o.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",o),F2.log("Number of dom node instances:",jQuery(o.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(o),_initAppEvents(o),void 0}_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,o),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,o)):o.root=_beforeAppRender(o),i?_loadApps(o,t[e]):o.enableBatchRequests&&!o.isSecure?(r[o.manifestUrl.toLowerCase()]=r[o.manifestUrl.toLowerCase()]||[],r[o.manifestUrl.toLowerCase()].push(o)):n.push({apps:[o],url:o.manifestUrl})}}),i||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;o[n]=o[n]||[],o[n].push(t)}),jQuery.each(o,function(e,t){var n=function(r,o){if(o){var i=o.url,a="GET",s="jsonp",c=function(){n(e,t.pop())},l=function(){jQuery.each(o.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},u=function(e){_loadApps(o.apps,e)};if(_config.xhr&&_config.xhr.dataType&&(s=_config.xhr.dataType(o.url,o.apps),"string"!=typeof s))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(a=_config.xhr.type(o.url,o.apps),"string"!=typeof a))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(i=_config.xhr.url(o.url,o.apps),"string"!=typeof i))throw"ContainerConfig.xhr.url should return a string";var p=_config.xhr;"function"!=typeof p&&(p=function(e,t,n,i,c){jQuery.ajax({url:e,type:a,data:{params:F2.stringify(o.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:s,success:n,error:function(e,t,n){F2.log("Failed to load app(s)",""+n,o.apps),i()},complete:c})}),p(i,o.apps,u,l,c)}};n(e,t.pop())})),void 0):(F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0)},removeAllApps:function(){return _isInit()?(jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)}),void 0):(F2.log("F2.init() must be called before F2.removeAllApps()"),void 0)},removeApp:function(e){return _isInit()?(_apps[e]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e]),delete _apps[e]),void 0):(F2.log("F2.init() must be called before F2.removeApp()"),void 0)}}}()),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}})("undefined"!=typeof exports?exports:window);
src/renderer/ast_renderers/javascript/module-renderers.js
mizki9577/ast-editor
// @flow import type babylon from 'babylon' import React from 'react' import { NodeRenderer, NodeWrapper, BracketRenderer, PunctuationRenderer } from './index.js' import { FunctionDeclarationRenderer, ClassDeclarationRenderer } from './declaration-renderers.js' import * as reservedKeywords from './reserved-keywords.js' export const ImportDeclarationRenderer = ({ node }: { node: babylon.ImportDeclaration }) => ( <NodeWrapper block> <reservedKeywords.Import /> { node.specifiers.map((specifier, i) => <NodeRenderer key={ i } node={ specifier } />) } <reservedKeywords.From /> <NodeRenderer node={ node.source } /> </NodeWrapper> ) export const ImportSpecifierRenderer = ({ node }: { node: babylon.ImportSpecifier }) => ( <NodeWrapper inline> <BracketRenderer bracket="{" /> <NodeRenderer node={ node.imported } /> <reservedKeywords.As /> <NodeRenderer node={ node.local } /> <BracketRenderer bracket="}" /> </NodeWrapper> ) export const ImportDefaultSpecifierRenderer = ({ node }: { node: babylon.ImportDefaultSpecifier }) => ( <NodeWrapper inline> <NodeRenderer node={ node.local } /> </NodeWrapper> ) export const ImportNamespaceSpecifierRenderer = ({ node }: { node: babylon.ImportNamespaceSpecifier }) => ( <NodeWrapper inline> <PunctuationRenderer punctuation="*" /> <reservedKeywords.As /> <NodeRenderer node={ node.local } /> </NodeWrapper> ) export const ExportNamedDeclarationRenderer = ({ node }: { node: babylon.ExportNamedDeclaration }) => ( <NodeWrapper block className="export-named-declaration"> <reservedKeywords.Export /> <NodeRenderer node={ node.declaration } /> { node.specifiers.map((specifier, i) => <NodeRenderer key={ i } node={ specifier } />) } { node.source !== null ? <reservedKeywords.From /> : null } <NodeRenderer node={ node.source } /> </NodeWrapper> ) export const ExportSpecifierRenderer = ({ node }: { node: babylon.ExportSpecifier }) => ( <NodeWrapper inline> <NodeRenderer node={ node.local } /> <reservedKeywords.As /> <NodeRenderer node={ node.exported } /> </NodeWrapper> ) export const ExportDefaultDeclarationRenderer = ({ node }: { node: babylon.ExportDefaultDeclaration }) => ( <NodeWrapper block> <reservedKeywords.Export /> <reservedKeywords.Default /> <NodeRenderer node={ node.declaration } /> </NodeWrapper> ) const OptFunctionDeclarationRenderer = ({ node }: { node: babylon.OptFunctionDeclaration }) => ( <NodeWrapper inline> <FunctionDeclarationRenderer node={ node } /> </NodeWrapper> ) const OptClassDeclarationRenderer = ({ node }: { node: babylon.OptClassDeclaration }) => ( <NodeWrapper inline> <ClassDeclarationRenderer node={ node } /> </NodeWrapper> ) export const ExportAllDeclarationRenderer = ({ node }: { node: babylon.ExportAllDeclaration }) => ( <NodeWrapper block> <reservedKeywords.Export /> <PunctuationRenderer punctuation="*" /> <reservedKeywords.From /> <NodeRenderer node={ node.source } /> </NodeWrapper> ) // vim: set ts=2 sw=2 et:
ajax/libs/react-bootstrap-table/0.9.6/react-bootstrap-table.min.js
sajochiu/cdnjs
!function e(t,n,o){function r(s,l){if(!n[s]){if(!t[s]){var i="function"==typeof require&&require;if(!l&&i)return i(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<o.length;s++)r(o[s]);return r}({"./src/index.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=o(e("./BootstrapTable")),a=o(e("./TableHeaderColumn")),s=e("./store/TableDataStore").TableDataSet;t.exports={BootstrapTable:r,TableHeaderColumn:a,TableDataSet:s}},{"./BootstrapTable":"/Users/allen/Node/react-bootstrap-table/src/BootstrapTable.js","./TableHeaderColumn":"/Users/allen/Node/react-bootstrap-table/src/TableHeaderColumn.js","./store/TableDataStore":"/Users/allen/Node/react-bootstrap-table/src/store/TableDataStore.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/events/events.js":[function(e,t,n){function o(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function a(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function l(e){return void 0===e}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0,o.defaultMaxListeners=10,o.prototype.setMaxListeners=function(e){if(!a(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},o.prototype.emit=function(e){var t,n,o,a,i,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],l(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,a=new Array(o-1),i=1;o>i;i++)a[i-1]=arguments[i];n.apply(this,a)}else if(s(n)){for(o=arguments.length,a=new Array(o-1),i=1;o>i;i++)a[i-1]=arguments[i];for(c=n.slice(),o=c.length,i=0;o>i;i++)c[i].apply(this,a)}return!0},o.prototype.addListener=function(e,t){var n;if(!r(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned){var n;n=l(this._maxListeners)?o.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},o.prototype.removeListener=function(e,t){var n,o,a,l;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(l=a;l-- >0;)if(n[l]===t||n[l].listener&&n[l].listener===t){o=l;break}if(0>o)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},o.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},o.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},o.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?r(e._events[t])?1:e._events[t].length:0}},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js":[function(e,t,n){function o(){if(!l){l=!0;for(var e,t=s.length;t;){e=s,s=[];for(var n=-1;++n<t;)e[n]();t=s.length}l=!1}}function r(){}var a=t.exports={},s=[],l=!1;a.nextTick=function(e){s.push(e),l||setTimeout(o,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=r,a.addListener=r,a.once=r,a.off=r,a.removeListener=r,a.removeAllListeners=r,a.emit=r,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js":[function(e,t,n){function o(){for(var e,t="",n=0;n<arguments.length;n++)if(e=arguments[n])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+o.apply(null,e);else if("object"==typeof e)for(var r in e)e.hasOwnProperty(r)&&e[r]&&(t+=" "+r);return t.substr(1)}"undefined"!=typeof t&&t.exports&&(t.exports=o),"undefined"!=typeof define&&define.amd&&define("classnames",[],function(){return o})},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js":[function(e,t,n){"use strict";var o=e("./focusNode"),r={componentDidMount:function(){this.props.autoFocus&&o(this.getDOMNode())}};t.exports=r},{"./focusNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/focusNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/BeforeInputEventPlugin.js":[function(e,t,n){"use strict";function o(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function a(e){switch(e){case j.topCompositionStart:return D.compositionStart;case j.topCompositionEnd:return D.compositionEnd;case j.topCompositionUpdate:return D.compositionUpdate}}function s(e,t){return e===j.topKeyDown&&t.keyCode===E}function l(e,t){switch(e){case j.topKeyUp:return-1!==_.indexOf(t.keyCode);case j.topKeyDown:return t.keyCode!==E;case j.topKeyPress:case j.topMouseDown:case j.topBlur:return!0;default:return!1}}function i(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function c(e,t,n,o){var r,c;if(N?r=a(e):M?l(e,o)&&(r=D.compositionEnd):s(e,o)&&(r=D.compositionStart),!r)return null;O&&(M||r!==D.compositionStart?r===D.compositionEnd&&M&&(c=M.getData()):M=f.getPooled(t));var u=v.getPooled(r,n,o);if(c)u.data=c;else{var d=i(o);null!==d&&(u.data=d)}return m.accumulateTwoPhaseDispatches(u),u}function u(e,t){switch(e){case j.topCompositionEnd:return i(t);case j.topKeyPress:var n=t.which;return n!==w?null:(P=!0,U);case j.topTextInput:var o=t.data;return o===U&&P?null:o;default:return null}}function d(e,t){if(M){if(e===j.topCompositionEnd||l(e,t)){var n=M.getData();return f.release(M),M=null,n}return null}switch(e){case j.topPaste:return null;case j.topKeyPress:return t.which&&!r(t)?String.fromCharCode(t.which):null;case j.topCompositionEnd:return O?null:t.data;default:return null}}function p(e,t,n,o){var r;if(r=R?u(e,o):d(e,o),!r)return null;var a=y.getPooled(D.beforeInput,n,o);return a.data=r,m.accumulateTwoPhaseDispatches(a),a}var b=e("./EventConstants"),m=e("./EventPropagators"),h=e("./ExecutionEnvironment"),f=e("./FallbackCompositionState"),v=e("./SyntheticCompositionEvent"),y=e("./SyntheticInputEvent"),g=e("./keyOf"),_=[9,13,27,32],E=229,N=h.canUseDOM&&"CompositionEvent"in window,C=null;h.canUseDOM&&"documentMode"in document&&(C=document.documentMode);var R=h.canUseDOM&&"TextEvent"in window&&!C&&!o(),O=h.canUseDOM&&(!N||C&&C>8&&11>=C),w=32,U=String.fromCharCode(w),j=b.topLevelTypes,D={beforeInput:{phasedRegistrationNames:{bubbled:g({onBeforeInput:null}),captured:g({onBeforeInputCapture:null})},dependencies:[j.topCompositionEnd,j.topKeyPress,j.topTextInput,j.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:g({onCompositionEnd:null}),captured:g({onCompositionEndCapture:null})},dependencies:[j.topBlur,j.topCompositionEnd,j.topKeyDown,j.topKeyPress,j.topKeyUp,j.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:g({onCompositionStart:null}),captured:g({onCompositionStartCapture:null})},dependencies:[j.topBlur,j.topCompositionStart,j.topKeyDown,j.topKeyPress,j.topKeyUp,j.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:g({onCompositionUpdate:null}),captured:g({onCompositionUpdateCapture:null})},dependencies:[j.topBlur,j.topCompositionUpdate,j.topKeyDown,j.topKeyPress,j.topKeyUp,j.topMouseDown]}},P=!1,M=null,T={eventTypes:D,extractEvents:function(e,t,n,o){return[c(e,t,n,o),p(e,t,n,o)]}};t.exports=T},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./FallbackCompositionState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/FallbackCompositionState.js","./SyntheticCompositionEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticCompositionEvent.js","./SyntheticInputEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticInputEvent.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSProperty.js":[function(e,t,n){"use strict";function o(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},a=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){a.forEach(function(t){r[o(t,e)]=r[e]})});var s={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},l={isUnitlessNumber:r,shorthandPropertyExpansions:s};t.exports=l},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js":[function(e,t,n){(function(n){"use strict";var o=e("./CSSProperty"),r=e("./ExecutionEnvironment"),a=e("./camelizeStyleName"),s=e("./dangerousStyleValue"),l=e("./hyphenateStyleName"),i=e("./memoizeStringOnly"),c=e("./warning"),u=i(function(e){return l(e)}),d="cssFloat";if(r.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(d="styleFloat"),"production"!==n.env.NODE_ENV)var p=/^(?:webkit|moz|o)[A-Z]/,b=/;\s*$/,m={},h={},f=function(e){m.hasOwnProperty(e)&&m[e]||(m[e]=!0,"production"!==n.env.NODE_ENV?c(!1,"Unsupported style property %s. Did you mean %s?",e,a(e)):null)},v=function(e){m.hasOwnProperty(e)&&m[e]||(m[e]=!0,"production"!==n.env.NODE_ENV?c(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):null)},y=function(e,t){h.hasOwnProperty(t)&&h[t]||(h[t]=!0,"production"!==n.env.NODE_ENV?c(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,t.replace(b,"")):null)},g=function(e,t){e.indexOf("-")>-1?f(e):p.test(e)?v(e):b.test(t)&&y(e,t)};var _={createMarkupForStyles:function(e){var t="";for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];"production"!==n.env.NODE_ENV&&g(o,r),null!=r&&(t+=u(o)+":",t+=s(o,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var a in t)if(t.hasOwnProperty(a)){"production"!==n.env.NODE_ENV&&g(a,t[a]);var l=s(a,t[a]);if("float"===a&&(a=d),l)r[a]=l;else{var i=o.shorthandPropertyExpansions[a];if(i)for(var c in i)r[c]="";else r[a]=""}}}};t.exports=_}).call(this,e("_process"))},{"./CSSProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSProperty.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./camelizeStyleName":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/camelizeStyleName.js","./dangerousStyleValue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/dangerousStyleValue.js","./hyphenateStyleName":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/hyphenateStyleName.js","./memoizeStringOnly":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/memoizeStringOnly.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js":[function(e,t,n){(function(n){"use strict";function o(){this._callbacks=null,this._contexts=null}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("./invariant");a(o.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){"production"!==n.env.NODE_ENV?s(e.length===t.length,"Mismatched list of contexts in callback queue"):s(e.length===t.length),this._callbacks=null,this._contexts=null;for(var o=0,r=e.length;r>o;o++)e[o].call(t[o]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(o),t.exports=o}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ChangeEventPlugin.js":[function(e,t,n){"use strict";function o(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=C.getPooled(j.change,P,e);_.accumulateTwoPhaseDispatches(t),N.batchedUpdates(a,t)}function a(e){g.enqueueEvents(e),g.processEventQueue()}function s(e,t){D=e,P=t,D.attachEvent("onchange",r)}function l(){D&&(D.detachEvent("onchange",r),D=null,P=null)}function i(e,t,n){return e===U.topChange?n:void 0}function c(e,t,n){e===U.topFocus?(l(),s(t,n)):e===U.topBlur&&l()}function u(e,t){D=e,P=t,M=e.value,T=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(D,"value",I),D.attachEvent("onpropertychange",p)}function d(){D&&(delete D.value,D.detachEvent("onpropertychange",p),D=null,P=null,M=null,T=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==M&&(M=t,r(e))}}function b(e,t,n){return e===U.topInput?n:void 0}function m(e,t,n){e===U.topFocus?(d(),u(t,n)):e===U.topBlur&&d()}function h(e,t,n){return e!==U.topSelectionChange&&e!==U.topKeyUp&&e!==U.topKeyDown||!D||D.value===M?void 0:(M=D.value,P)}function f(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===U.topClick?n:void 0}var y=e("./EventConstants"),g=e("./EventPluginHub"),_=e("./EventPropagators"),E=e("./ExecutionEnvironment"),N=e("./ReactUpdates"),C=e("./SyntheticEvent"),R=e("./isEventSupported"),O=e("./isTextInputElement"),w=e("./keyOf"),U=y.topLevelTypes,j={change:{phasedRegistrationNames:{bubbled:w({onChange:null}),captured:w({onChangeCapture:null})},dependencies:[U.topBlur,U.topChange,U.topClick,U.topFocus,U.topInput,U.topKeyDown,U.topKeyUp,U.topSelectionChange]}},D=null,P=null,M=null,T=null,x=!1;E.canUseDOM&&(x=R("change")&&(!("documentMode"in document)||document.documentMode>8));var S=!1;E.canUseDOM&&(S=R("input")&&(!("documentMode"in document)||document.documentMode>9));var I={get:function(){return T.get.call(this)},set:function(e){M=""+e,T.set.call(this,e)}},k={eventTypes:j,extractEvents:function(e,t,n,r){var a,s;if(o(t)?x?a=i:s=c:O(t)?S?a=b:(a=h,s=m):f(t)&&(a=v),a){var l=a(e,t,n);if(l){var u=C.getPooled(j.change,l,r);return _.accumulateTwoPhaseDispatches(u),u}}s&&s(e,t,n)}};t.exports=k},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ClientReactRootIndex.js":[function(e,t,n){"use strict";var o=0,r={createReactRootIndex:function(){return o++}};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js":[function(e,t,n){(function(n){"use strict";function o(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r=e("./Danger"),a=e("./ReactMultiChildUpdateTypes"),s=e("./setTextContent"),l=e("./invariant"),i={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,updateTextContent:s,processUpdates:function(e,t){for(var i,c=null,u=null,d=0;d<e.length;d++)if(i=e[d],i.type===a.MOVE_EXISTING||i.type===a.REMOVE_NODE){var p=i.fromIndex,b=i.parentNode.childNodes[p],m=i.parentID;"production"!==n.env.NODE_ENV?l(b,"processUpdates(): Unable to find child %s of element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",p,m):l(b),c=c||{},c[m]=c[m]||[],c[m][p]=b,u=u||[],u.push(b)}var h=r.dangerouslyRenderMarkup(t);if(u)for(var f=0;f<u.length;f++)u[f].parentNode.removeChild(u[f]);for(var v=0;v<e.length;v++)switch(i=e[v],i.type){case a.INSERT_MARKUP:o(i.parentNode,h[i.markupIndex],i.toIndex);break;case a.MOVE_EXISTING:o(i.parentNode,c[i.parentID][i.fromIndex],i.toIndex);break;case a.TEXT_CONTENT:s(i.parentNode,i.textContent);break;case a.REMOVE_NODE:}}};t.exports=i}).call(this,e("_process"))},{"./Danger":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setTextContent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js":[function(e,t,n){(function(n){"use strict";function o(e,t){return(e&t)===t}var r=e("./invariant"),a={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=e.Properties||{},s=e.DOMAttributeNames||{},i=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&l._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var u in t){"production"!==n.env.NODE_ENV?r(!l.isStandardName.hasOwnProperty(u),"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",u):r(!l.isStandardName.hasOwnProperty(u)),l.isStandardName[u]=!0;var d=u.toLowerCase();if(l.getPossibleStandardName[d]=u,s.hasOwnProperty(u)){var p=s[u];l.getPossibleStandardName[p]=u,l.getAttributeName[u]=p}else l.getAttributeName[u]=d;l.getPropertyName[u]=i.hasOwnProperty(u)?i[u]:u,c.hasOwnProperty(u)?l.getMutationMethod[u]=c[u]:l.getMutationMethod[u]=null;var b=t[u];l.mustUseAttribute[u]=o(b,a.MUST_USE_ATTRIBUTE),l.mustUseProperty[u]=o(b,a.MUST_USE_PROPERTY),l.hasSideEffects[u]=o(b,a.HAS_SIDE_EFFECTS),l.hasBooleanValue[u]=o(b,a.HAS_BOOLEAN_VALUE),l.hasNumericValue[u]=o(b,a.HAS_NUMERIC_VALUE),l.hasPositiveNumericValue[u]=o(b,a.HAS_POSITIVE_NUMERIC_VALUE),l.hasOverloadedBooleanValue[u]=o(b,a.HAS_OVERLOADED_BOOLEAN_VALUE),"production"!==n.env.NODE_ENV?r(!l.mustUseAttribute[u]||!l.mustUseProperty[u],"DOMProperty: Cannot require using both attribute and property: %s",u):r(!l.mustUseAttribute[u]||!l.mustUseProperty[u]),"production"!==n.env.NODE_ENV?r(l.mustUseProperty[u]||!l.hasSideEffects[u],"DOMProperty: Properties that have side effects must use property: %s",u):r(l.mustUseProperty[u]||!l.hasSideEffects[u]),"production"!==n.env.NODE_ENV?r(!!l.hasBooleanValue[u]+!!l.hasNumericValue[u]+!!l.hasOverloadedBooleanValue[u]<=1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",u):r(!!l.hasBooleanValue[u]+!!l.hasNumericValue[u]+!!l.hasOverloadedBooleanValue[u]<=1)}}},s={},l={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<l._isCustomAttributeFunctions.length;t++){var n=l._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,o=s[e];return o||(s[e]=o={}),t in o||(n=document.createElement(e),o[t]=n[t]),o[t]},injection:a};t.exports=l}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js":[function(e,t,n){(function(n){"use strict";function o(e,t){return null==t||r.hasBooleanValue[e]&&!t||r.hasNumericValue[e]&&isNaN(t)||r.hasPositiveNumericValue[e]&&1>t||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e("./DOMProperty"),a=e("./quoteAttributeValueForBrowser"),s=e("./warning");if("production"!==n.env.NODE_ENV)var l={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},i={},c=function(e){if(!(l.hasOwnProperty(e)&&l[e]||i.hasOwnProperty(e)&&i[e])){i[e]=!0;var t=e.toLowerCase(),o=r.isCustomAttribute(t)?t:r.getPossibleStandardName.hasOwnProperty(t)?r.getPossibleStandardName[t]:null;"production"!==n.env.NODE_ENV?s(null==o,"Unknown DOM property %s. Did you mean %s?",e,o):null}};var u={createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+a(e)},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(o(e,t))return"";var s=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?s:s+"="+a(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+a(t):("production"!==n.env.NODE_ENV&&c(e),null)},setValueForProperty:function(e,t,a){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var s=r.getMutationMethod[t];if(s)s(e,a);else if(o(t,a))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+a);else{var l=r.getPropertyName[t];r.hasSideEffects[t]&&""+e[l]==""+a||(e[l]=a)}}else r.isCustomAttribute(t)?null==a?e.removeAttribute(t):e.setAttribute(t,""+a):"production"!==n.env.NODE_ENV&&c(t)},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var o=r.getMutationMethod[t];if(o)o(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var a=r.getPropertyName[t],s=r.getDefaultValueForProperty(e.nodeName,a);r.hasSideEffects[t]&&""+e[a]===s||(e[a]=s)}}else r.isCustomAttribute(t)?e.removeAttribute(t):"production"!==n.env.NODE_ENV&&c(t)}};t.exports=u}).call(this,e("_process"))},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./quoteAttributeValueForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/quoteAttributeValueForBrowser.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Danger.js":[function(e,t,n){(function(n){"use strict";function o(e){return e.substring(1,e.indexOf(" "))}var r=e("./ExecutionEnvironment"),a=e("./createNodesFromMarkup"),s=e("./emptyFunction"),l=e("./getMarkupWrap"),i=e("./invariant"),c=/^(<[^ \/>]+)/,u="data-danger-index",d={dangerouslyRenderMarkup:function(e){"production"!==n.env.NODE_ENV?i(r.canUseDOM,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use React.renderToString for server rendering."):i(r.canUseDOM);for(var t,d={},p=0;p<e.length;p++)"production"!==n.env.NODE_ENV?i(e[p],"dangerouslyRenderMarkup(...): Missing markup."):i(e[p]),t=o(e[p]),t=l(t)?t:"*",d[t]=d[t]||[],d[t][p]=e[p];var b=[],m=0;for(t in d)if(d.hasOwnProperty(t)){var h,f=d[t];for(h in f)if(f.hasOwnProperty(h)){var v=f[h];f[h]=v.replace(c,"$1 "+u+'="'+h+'" ')}for(var y=a(f.join(""),s),g=0;g<y.length;++g){var _=y[g];_.hasAttribute&&_.hasAttribute(u)?(h=+_.getAttribute(u),_.removeAttribute(u),"production"!==n.env.NODE_ENV?i(!b.hasOwnProperty(h),"Danger: Assigning to an already-occupied result index."):i(!b.hasOwnProperty(h)),b[h]=_,m+=1):"production"!==n.env.NODE_ENV&&console.error("Danger: Discarding unexpected node:",_)}}return"production"!==n.env.NODE_ENV?i(m===b.length,"Danger: Did not assign to every index of resultList."):i(m===b.length),"production"!==n.env.NODE_ENV?i(b.length===e.length,"Danger: Expected markup to render %s nodes, but rendered %s.",e.length,b.length):i(b.length===e.length),b},dangerouslyReplaceNodeWithMarkup:function(e,t){"production"!==n.env.NODE_ENV?i(r.canUseDOM,"dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use React.renderToString for server rendering."):i(r.canUseDOM),"production"!==n.env.NODE_ENV?i(t,"dangerouslyReplaceNodeWithMarkup(...): Missing markup."):i(t),"production"!==n.env.NODE_ENV?i("html"!==e.tagName.toLowerCase(),"dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See React.renderToString()."):i("html"!==e.tagName.toLowerCase());var o=a(t,s)[0];e.parentNode.replaceChild(o,e)}};t.exports=d}).call(this,e("_process"))},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./createNodesFromMarkup":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/createNodesFromMarkup.js","./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js","./getMarkupWrap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getMarkupWrap.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DefaultEventPluginOrder.js":[function(e,t,n){"use strict";var o=e("./keyOf"),r=[o({ResponderEventPlugin:null}),o({SimpleEventPlugin:null}),o({TapEventPlugin:null}),o({EnterLeaveEventPlugin:null}),o({ChangeEventPlugin:null}),o({SelectEventPlugin:null}),o({BeforeInputEventPlugin:null}),o({AnalyticsEventPlugin:null}),o({MobileSafariClickEventPlugin:null})];t.exports=r},{"./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EnterLeaveEventPlugin.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),r=e("./EventPropagators"),a=e("./SyntheticMouseEvent"),s=e("./ReactMount"),l=e("./keyOf"),i=o.topLevelTypes,c=s.getFirstReactDOM,u={mouseEnter:{registrationName:l({onMouseEnter:null}),dependencies:[i.topMouseOut,i.topMouseOver]},mouseLeave:{registrationName:l({onMouseLeave:null}),dependencies:[i.topMouseOut,i.topMouseOver]}},d=[null,null],p={eventTypes:u,extractEvents:function(e,t,n,o){if(e===i.topMouseOver&&(o.relatedTarget||o.fromElement))return null;if(e!==i.topMouseOut&&e!==i.topMouseOver)return null;var l;if(t.window===t)l=t;else{var p=t.ownerDocument;l=p?p.defaultView||p.parentWindow:window}var b,m;if(e===i.topMouseOut?(b=t,m=c(o.relatedTarget||o.toElement)||l):(b=l,m=t),b===m)return null;var h=b?s.getID(b):"",f=m?s.getID(m):"",v=a.getPooled(u.mouseLeave,h,o);v.type="mouseleave",v.target=b,v.relatedTarget=m;var y=a.getPooled(u.mouseEnter,f,o);return y.type="mouseenter",y.target=m,y.relatedTarget=b,r.accumulateEnterLeaveDispatches(v,y,h,f),d[0]=v,d[1]=y,d}};t.exports=p},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js":[function(e,t,n){"use strict";var o=e("./keyMirror"),r=o({bubbled:null,captured:null}),a=o({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null, topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),s={topLevelTypes:a,PropagationPhases:r};t.exports=s},{"./keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventListener.js":[function(e,t,n){(function(n){var o=e("./emptyFunction"),r={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,r){return e.addEventListener?(e.addEventListener(t,r,!0),{remove:function(){e.removeEventListener(t,r,!0)}}):("production"!==n.env.NODE_ENV&&console.error("Attempted to listen to events during the capture phase on a browser that does not support the capture phase. Your application will not receive some events."),{remove:o})},registerDefault:function(){}};t.exports=r}).call(this,e("_process"))},{"./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js":[function(e,t,n){(function(n){"use strict";function o(){var e=p&&p.traverseTwoPhase&&p.traverseEnterLeave;"production"!==n.env.NODE_ENV?i(e,"InstanceHandle not injected before use!"):i(e)}var r=e("./EventPluginRegistry"),a=e("./EventPluginUtils"),s=e("./accumulateInto"),l=e("./forEachAccumulated"),i=e("./invariant"),c={},u=null,d=function(e){if(e){var t=a.executeDispatch,n=r.getPluginModuleForEvent(e);n&&n.executeDispatch&&(t=n.executeDispatch),a.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},p=null,b={injection:{injectMount:a.injection.injectMount,injectInstanceHandle:function(e){p=e,"production"!==n.env.NODE_ENV&&o()},getInstanceHandle:function(){return"production"!==n.env.NODE_ENV&&o(),p},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,o){"production"!==n.env.NODE_ENV?i(!o||"function"==typeof o,"Expected %s listener to be a function, instead got type %s",t,typeof o):i(!o||"function"==typeof o);var r=c[t]||(c[t]={});r[e]=o},getListener:function(e,t){var n=c[t];return n&&n[e]},deleteListener:function(e,t){var n=c[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in c)delete c[t][e]},extractEvents:function(e,t,n,o){for(var a,l=r.plugins,i=0,c=l.length;c>i;i++){var u=l[i];if(u){var d=u.extractEvents(e,t,n,o);d&&(a=s(a,d))}}return a},enqueueEvents:function(e){e&&(u=s(u,e))},processEventQueue:function(){var e=u;u=null,l(e,d),"production"!==n.env.NODE_ENV?i(!u,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):i(!u)},__purge:function(){c={}},__getListenerBank:function(){return c}};t.exports=b}).call(this,e("_process"))},{"./EventPluginRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js","./EventPluginUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js":[function(e,t,n){(function(n){"use strict";function o(){if(l)for(var e in i){var t=i[e],o=l.indexOf(e);if("production"!==n.env.NODE_ENV?s(o>-1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):s(o>-1),!c.plugins[o]){"production"!==n.env.NODE_ENV?s(t.extractEvents,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):s(t.extractEvents),c.plugins[o]=t;var a=t.eventTypes;for(var u in a)"production"!==n.env.NODE_ENV?s(r(a[u],t,u),"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",u,e):s(r(a[u],t,u))}}}function r(e,t,o){"production"!==n.env.NODE_ENV?s(!c.eventNameDispatchConfigs.hasOwnProperty(o),"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",o):s(!c.eventNameDispatchConfigs.hasOwnProperty(o)),c.eventNameDispatchConfigs[o]=e;var r=e.phasedRegistrationNames;if(r){for(var l in r)if(r.hasOwnProperty(l)){var i=r[l];a(i,t,o)}return!0}return e.registrationName?(a(e.registrationName,t,o),!0):!1}function a(e,t,o){"production"!==n.env.NODE_ENV?s(!c.registrationNameModules[e],"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):s(!c.registrationNameModules[e]),c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[o].dependencies}var s=e("./invariant"),l=null,i={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){"production"!==n.env.NODE_ENV?s(!l,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):s(!l),l=Array.prototype.slice.call(e),o()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];i.hasOwnProperty(r)&&i[r]===a||("production"!==n.env.NODE_ENV?s(!i[r],"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",r):s(!i[r]),i[r]=a,t=!0)}t&&o()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var o=c.registrationNameModules[t.phasedRegistrationNames[n]];if(o)return o}return null},_resetEventPlugins:function(){l=null;for(var e in i)i.hasOwnProperty(e)&&delete i[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var o=c.registrationNameModules;for(var r in o)o.hasOwnProperty(r)&&delete o[r]}};t.exports=c}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js":[function(e,t,n){(function(n){"use strict";function o(e){return e===v.topMouseUp||e===v.topTouchEnd||e===v.topTouchCancel}function r(e){return e===v.topMouseMove||e===v.topTouchMove}function a(e){return e===v.topMouseDown||e===v.topTouchStart}function s(e,t){var o=e._dispatchListeners,r=e._dispatchIDs;if("production"!==n.env.NODE_ENV&&b(e),Array.isArray(o))for(var a=0;a<o.length&&!e.isPropagationStopped();a++)t(e,o[a],r[a]);else o&&t(e,o,r)}function l(e,t,n){e.currentTarget=f.Mount.getNode(n);var o=t(e,n);return e.currentTarget=null,o}function i(e,t){s(e,t),e._dispatchListeners=null,e._dispatchIDs=null}function c(e){var t=e._dispatchListeners,o=e._dispatchIDs;if("production"!==n.env.NODE_ENV&&b(e),Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,o[r]))return o[r]}else if(t&&t(e,o))return o;return null}function u(e){var t=c(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function d(e){"production"!==n.env.NODE_ENV&&b(e);var t=e._dispatchListeners,o=e._dispatchIDs;"production"!==n.env.NODE_ENV?h(!Array.isArray(t),"executeDirectDispatch(...): Invalid `event`."):h(!Array.isArray(t));var r=t?t(e,o):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function p(e){return!!e._dispatchListeners}var b,m=e("./EventConstants"),h=e("./invariant"),f={Mount:null,injectMount:function(e){f.Mount=e,"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?h(e&&e.getNode,"EventPluginUtils.injection.injectMount(...): Injected Mount module is missing getNode."):h(e&&e.getNode))}},v=m.topLevelTypes;"production"!==n.env.NODE_ENV&&(b=function(e){var t=e._dispatchListeners,o=e._dispatchIDs,r=Array.isArray(t),a=Array.isArray(o),s=a?o.length:o?1:0,l=r?t.length:t?1:0;"production"!==n.env.NODE_ENV?h(a===r&&s===l,"EventPluginUtils: Invalid `event`."):h(a===r&&s===l)});var y={isEndish:o,isMoveish:r,isStartish:a,executeDirectDispatch:d,executeDispatch:l,executeDispatchesInOrder:i,executeDispatchesInOrderStopAtTrue:u,hasDispatches:p,injection:f,useTouchEvents:!1};t.exports=y}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js":[function(e,t,n){(function(n){"use strict";function o(e,t,n){var o=t.dispatchConfig.phasedRegistrationNames[n];return f(e,o)}function r(e,t,r){if("production"!==n.env.NODE_ENV&&!e)throw new Error("Dispatching id must not be null");var a=t?h.bubbled:h.captured,s=o(e,r,a);s&&(r._dispatchListeners=b(r._dispatchListeners,s),r._dispatchIDs=b(r._dispatchIDs,e))}function a(e){e&&e.dispatchConfig.phasedRegistrationNames&&p.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,r,e)}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var o=n.dispatchConfig.registrationName,r=f(e,o);r&&(n._dispatchListeners=b(n._dispatchListeners,r),n._dispatchIDs=b(n._dispatchIDs,e))}}function l(e){e&&e.dispatchConfig.registrationName&&s(e.dispatchMarker,null,e)}function i(e){m(e,a)}function c(e,t,n,o){p.injection.getInstanceHandle().traverseEnterLeave(n,o,s,e,t)}function u(e){m(e,l)}var d=e("./EventConstants"),p=e("./EventPluginHub"),b=e("./accumulateInto"),m=e("./forEachAccumulated"),h=d.PropagationPhases,f=p.getListener,v={accumulateTwoPhaseDispatches:i,accumulateDirectDispatches:u,accumulateEnterLeaveDispatches:c};t.exports=v}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js":[function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/FallbackCompositionState.js":[function(e,t,n){"use strict";function o(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("./getTextContentAccessor");a(o.prototype,{getText:function(){return"value"in this._root?this._root.value:this._root[s()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,o=n.length,r=this.getText(),a=r.length;for(e=0;o>e&&n[e]===r[e];e++);var s=o-e;for(t=1;s>=t&&n[o-t]===r[a-t];t++);var l=t>1?1-t:void 0;return this._fallbackText=r.slice(e,l),this._fallbackText}}),r.addPoolingTo(o),t.exports=o},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./getTextContentAccessor":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/HTMLDOMPropertyConfig.js":[function(e,t,n){"use strict";var o,r=e("./DOMProperty"),a=e("./ExecutionEnvironment"),s=r.injection.MUST_USE_ATTRIBUTE,l=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,c=r.injection.HAS_SIDE_EFFECTS,u=r.injection.HAS_NUMERIC_VALUE,d=r.injection.HAS_POSITIVE_NUMERIC_VALUE,p=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(a.canUseDOM){var b=document.implementation;o=b&&b.hasFeature&&b.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var m={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:s|i,allowTransparency:s,alt:null,async:i,autoComplete:null,autoPlay:i,cellPadding:null,cellSpacing:null,charSet:s,checked:l|i,classID:s,className:o?s:l,cols:s|d,colSpan:null,content:null,contentEditable:null,contextMenu:s,controls:l|i,coords:null,crossOrigin:null,data:null,dateTime:s,defer:i,dir:null,disabled:s|i,download:p,draggable:null,encType:null,form:s,formAction:s,formEncType:s,formMethod:s,formNoValidate:i,formTarget:s,frameBorder:s,headers:null,height:s,hidden:s|i,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:l,label:null,lang:null,list:s,loop:l|i,low:null,manifest:s,marginHeight:null,marginWidth:null,max:null,maxLength:s,media:s,mediaGroup:null,method:null,min:null,multiple:l|i,muted:l|i,name:null,noValidate:i,open:i,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:l|i,rel:null,required:i,role:s,rows:s|d,rowSpan:null,sandbox:null,scope:null,scoped:i,scrolling:null,seamless:s|i,selected:l|i,shape:null,size:s|d,sizes:s,span:d,spellCheck:null,src:null,srcDoc:l,srcSet:s,start:u,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:l|c,width:s,wmode:s,autoCapitalize:null,autoCorrect:null,itemProp:s,itemScope:s|i,itemType:s,itemID:s,itemRef:s,property:null,unselectable:s},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=m},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js":[function(e,t,n){(function(n){"use strict";function o(e){"production"!==n.env.NODE_ENV?c(null==e.props.checkedLink||null==e.props.valueLink,"Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don't want to use valueLink and vice versa."):c(null==e.props.checkedLink||null==e.props.valueLink)}function r(e){o(e),"production"!==n.env.NODE_ENV?c(null==e.props.value&&null==e.props.onChange,"Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don't want to use valueLink."):c(null==e.props.value&&null==e.props.onChange)}function a(e){o(e),"production"!==n.env.NODE_ENV?c(null==e.props.checked&&null==e.props.onChange,"Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don't want to use checkedLink"):c(null==e.props.checked&&null==e.props.onChange)}function s(e){this.props.valueLink.requestChange(e.target.value)}function l(e){this.props.checkedLink.requestChange(e.target.checked)}var i=e("./ReactPropTypes"),c=e("./invariant"),u={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},d={Mixin:{propTypes:{value:function(e,t,n){return!e[t]||u[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:i.func}},getValue:function(e){return e.props.valueLink?(r(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(a(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(r(e),s):e.props.checkedLink?(a(e),l):e.props.onChange}};t.exports=d}).call(this,e("_process"))},{"./ReactPropTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js":[function(e,t,n){(function(n){"use strict";function o(e){e.remove()}var r=e("./ReactBrowserEventEmitter"),a=e("./accumulateInto"),s=e("./forEachAccumulated"),l=e("./invariant"),i={trapBubbledEvent:function(e,t){"production"!==n.env.NODE_ENV?l(this.isMounted(),"Must be mounted to trap events"):l(this.isMounted());var o=this.getDOMNode();"production"!==n.env.NODE_ENV?l(o,"LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered."):l(o);var s=r.trapBubbledEvent(e,t,o);this._localEventListeners=a(this._localEventListeners,s)},componentWillUnmount:function(){this._localEventListeners&&s(this._localEventListeners,o)}};t.exports=i}).call(this,e("_process"))},{"./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/MobileSafariClickEventPlugin.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),r=e("./emptyFunction"),a=o.topLevelTypes,s={eventTypes:null,extractEvents:function(e,t,n,o){if(e===a.topTouchStart){var s=o.target;s&&!s.onclick&&(s.onclick=r)}}};t.exports=s},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js":[function(e,t,n){"use strict";function o(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),o=Object.prototype.hasOwnProperty,r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a){var s=Object(a);for(var l in s)o.call(s,l)&&(n[l]=s[l])}}return n}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js":[function(e,t,n){(function(n){"use strict";var o=e("./invariant"),r=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},a=function(e,t){var n=this;if(n.instancePool.length){var o=n.instancePool.pop();return n.call(o,e,t),o}return new n(e,t)},s=function(e,t,n){var o=this;if(o.instancePool.length){var r=o.instancePool.pop();return o.call(r,e,t,n),r}return new o(e,t,n)},l=function(e,t,n,o,r){var a=this;if(a.instancePool.length){var s=a.instancePool.pop();return a.call(s,e,t,n,o,r),s}return new a(e,t,n,o,r)},i=function(e){var t=this;"production"!==n.env.NODE_ENV?o(e instanceof t,"Trying to release an instance into a pool of a different type."):o(e instanceof t),e.destructor&&e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},c=10,u=r,d=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||u,n.poolSize||(n.poolSize=c),n.release=i,n},p={addPoolingTo:d,oneArgumentPooler:r,twoArgumentPooler:a,threeArgumentPooler:s,fiveArgumentPooler:l};t.exports=p}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/React.js":[function(e,t,n){(function(n){"use strict";var o=e("./EventPluginUtils"),r=e("./ReactChildren"),a=e("./ReactComponent"),s=e("./ReactClass"),l=e("./ReactContext"),i=e("./ReactCurrentOwner"),c=e("./ReactElement"),u=e("./ReactElementValidator"),d=e("./ReactDOM"),p=e("./ReactDOMTextComponent"),b=e("./ReactDefaultInjection"),m=e("./ReactInstanceHandles"),h=e("./ReactMount"),f=e("./ReactPerf"),v=e("./ReactPropTypes"),y=e("./ReactReconciler"),g=e("./ReactServerRendering"),_=e("./Object.assign"),E=e("./findDOMNode"),N=e("./onlyChild");b.inject();var C=c.createElement,R=c.createFactory,O=c.cloneElement;"production"!==n.env.NODE_ENV&&(C=u.createElement,R=u.createFactory,O=u.cloneElement);var w=f.measure("React","render",h.render),U={Children:{map:r.map,forEach:r.forEach,count:r.count,only:N},Component:a,DOM:d,PropTypes:v,initializeTouchEvents:function(e){o.useTouchEvents=e},createClass:s.createClass,createElement:C,cloneElement:O,createFactory:R,createMixin:function(e){return e},constructAndRenderComponent:h.constructAndRenderComponent,constructAndRenderComponentByID:h.constructAndRenderComponentByID,findDOMNode:E,render:w,renderToString:g.renderToString,renderToStaticMarkup:g.renderToStaticMarkup,unmountComponentAtNode:h.unmountComponentAtNode,isValidElement:c.isValidElement,withContext:l.withContext,__spread:_};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:i,InstanceHandles:m,Mount:h,Reconciler:y,TextComponent:p}),"production"!==n.env.NODE_ENV){var j=e("./ExecutionEnvironment");if(j.canUseDOM&&window.top===window.self){navigator.userAgent.indexOf("Chrome")>-1&&"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");for(var D=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze],P=0;P<D.length;P++)if(!D[P]){console.error("One or more ES5 shim/shams expected by React are not available: https://fb.me/react-warning-polyfills");break}}}U.version="0.13.3",t.exports=U}).call(this,e("_process"))},{"./EventPluginUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildren.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponent.js","./ReactContext":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOM":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOM.js","./ReactDOMTextComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDefaultInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactPropTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactServerRendering":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRendering.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js","./onlyChild":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/onlyChild.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js":[function(e,t,n){"use strict";var o=e("./findDOMNode"),r={getDOMNode:function(){return o(this)}};t.exports=r},{"./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js":[function(e,t,n){"use strict";function o(e){return Object.prototype.hasOwnProperty.call(e,h)||(e[h]=b++,d[e[h]]={}),d[e[h]]}var r=e("./EventConstants"),a=e("./EventPluginHub"),s=e("./EventPluginRegistry"),l=e("./ReactEventEmitterMixin"),i=e("./ViewportMetrics"),c=e("./Object.assign"),u=e("./isEventSupported"),d={},p=!1,b=0,m={topBlur:"blur",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topWheel:"wheel"},h="_reactListenersID"+String(Math.random()).slice(2),f=c({},l,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(f.handleTopLevel),f.ReactEventListener=e}},setEnabled:function(e){f.ReactEventListener&&f.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!f.ReactEventListener||!f.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,a=o(n),l=s.registrationNameDependencies[e],i=r.topLevelTypes,c=0,d=l.length;d>c;c++){var p=l[c];a.hasOwnProperty(p)&&a[p]||(p===i.topWheel?u("wheel")?f.ReactEventListener.trapBubbledEvent(i.topWheel,"wheel",n):u("mousewheel")?f.ReactEventListener.trapBubbledEvent(i.topWheel,"mousewheel",n):f.ReactEventListener.trapBubbledEvent(i.topWheel,"DOMMouseScroll",n):p===i.topScroll?u("scroll",!0)?f.ReactEventListener.trapCapturedEvent(i.topScroll,"scroll",n):f.ReactEventListener.trapBubbledEvent(i.topScroll,"scroll",f.ReactEventListener.WINDOW_HANDLE):p===i.topFocus||p===i.topBlur?(u("focus",!0)?(f.ReactEventListener.trapCapturedEvent(i.topFocus,"focus",n),f.ReactEventListener.trapCapturedEvent(i.topBlur,"blur",n)):u("focusin")&&(f.ReactEventListener.trapBubbledEvent(i.topFocus,"focusin",n),f.ReactEventListener.trapBubbledEvent(i.topBlur,"focusout",n)),a[i.topBlur]=!0,a[i.topFocus]=!0):m.hasOwnProperty(p)&&f.ReactEventListener.trapBubbledEvent(p,m[p],n),a[p]=!0)}},trapBubbledEvent:function(e,t,n){return f.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return f.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!p){var e=i.refreshScrollValues;f.ReactEventListener.monitorScrollValue(e),p=!0}},eventNameDispatchConfigs:a.eventNameDispatchConfigs,registrationNameModules:a.registrationNameModules,putListener:a.putListener,getListener:a.getListener,deleteListener:a.deleteListener,deleteAllListeners:a.deleteAllListeners});t.exports=f},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./EventPluginRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactEventEmitterMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventEmitterMixin.js","./ViewportMetrics":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildReconciler.js":[function(e,t,n){"use strict";var o=e("./ReactReconciler"),r=e("./flattenChildren"),a=e("./instantiateReactComponent"),s=e("./shouldUpdateReactComponent"),l={instantiateChildren:function(e,t,n){var o=r(e);for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],i=a(l,null);o[s]=i}return o},updateChildren:function(e,t,n,l){var i=r(t);if(!i&&!e)return null;var c;for(c in i)if(i.hasOwnProperty(c)){var u=e&&e[c],d=u&&u._currentElement,p=i[c];if(s(d,p))o.receiveComponent(u,p,n,l),i[c]=u;else{u&&o.unmountComponent(u,c);var b=a(p,null);i[c]=b}}for(c in e)!e.hasOwnProperty(c)||i&&i.hasOwnProperty(c)||o.unmountComponent(e[c]);return i},unmountChildren:function(e){for(var t in e){var n=e[t];o.unmountComponent(n)}}};t.exports=l},{"./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./flattenChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/flattenChildren.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildren.js":[function(e,t,n){(function(n){"use strict";function o(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,o){var r=e;r.forEachFunction.call(r.forEachContext,t,o)}function a(e,t,n){if(null==e)return e;var a=o.getPooled(t,n);b(e,r,a),o.release(a)}function s(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function l(e,t,o,r){var a=e,s=a.mapResult,l=!s.hasOwnProperty(o);if("production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?m(l,"ReactChildren.map(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",o):null), l){var i=a.mapFunction.call(a.mapContext,t,r);s[o]=i}}function i(e,t,n){if(null==e)return e;var o={},r=s.getPooled(o,t,n);return b(e,l,r),s.release(r),p.create(o)}function c(e,t,n,o){return null}function u(e,t){return b(e,c,null)}var d=e("./PooledClass"),p=e("./ReactFragment"),b=e("./traverseAllChildren"),m=e("./warning"),h=d.twoArgumentPooler,f=d.threeArgumentPooler;d.addPoolingTo(o,h),d.addPoolingTo(s,f);var v={forEach:a,map:i,count:u};t.exports=v}).call(this,e("_process"))},{"./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactFragment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js":[function(e,t,n){(function(n){"use strict";function o(e,t,o){for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?O("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",g[o],r):null)}function r(e,t){var o=D.hasOwnProperty(t)?D[t]:null;T.hasOwnProperty(t)&&("production"!==n.env.NODE_ENV?N(o===U.OVERRIDE_BASE,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t):N(o===U.OVERRIDE_BASE)),e.hasOwnProperty(t)&&("production"!==n.env.NODE_ENV?N(o===U.DEFINE_MANY||o===U.DEFINE_MANY_MERGED,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t):N(o===U.DEFINE_MANY||o===U.DEFINE_MANY_MERGED))}function a(e,t){if(t){"production"!==n.env.NODE_ENV?N("function"!=typeof t,"ReactClass: You're attempting to use a component class as a mixin. Instead, just use a regular object."):N("function"!=typeof t),"production"!==n.env.NODE_ENV?N(!m.isValidElement(t),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object."):N(!m.isValidElement(t));var o=e.prototype;t.hasOwnProperty(w)&&P.mixins(e,t.mixins);for(var a in t)if(t.hasOwnProperty(a)&&a!==w){var s=t[a];if(r(o,a),P.hasOwnProperty(a))P[a](e,s);else{var l=D.hasOwnProperty(a),u=o.hasOwnProperty(a),d=s&&s.__reactDontBind,p="function"==typeof s,b=p&&!l&&!u&&!d;if(b)o.__reactAutoBindMap||(o.__reactAutoBindMap={}),o.__reactAutoBindMap[a]=s,o[a]=s;else if(u){var h=D[a];"production"!==n.env.NODE_ENV?N(l&&(h===U.DEFINE_MANY_MERGED||h===U.DEFINE_MANY),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",h,a):N(l&&(h===U.DEFINE_MANY_MERGED||h===U.DEFINE_MANY)),h===U.DEFINE_MANY_MERGED?o[a]=i(o[a],s):h===U.DEFINE_MANY&&(o[a]=c(o[a],s))}else o[a]=s,"production"!==n.env.NODE_ENV&&"function"==typeof s&&t.displayName&&(o[a].displayName=t.displayName+"_"+a)}}}}function s(e,t){if(t)for(var o in t){var r=t[o];if(t.hasOwnProperty(o)){var a=o in P;"production"!==n.env.NODE_ENV?N(!a,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o):N(!a);var s=o in e;"production"!==n.env.NODE_ENV?N(!s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o):N(!s),e[o]=r}}}function l(e,t){"production"!==n.env.NODE_ENV?N(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."):N(e&&t&&"object"==typeof e&&"object"==typeof t);for(var o in t)t.hasOwnProperty(o)&&("production"!==n.env.NODE_ENV?N(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o):N(void 0===e[o]),e[o]=t[o]);return e}function i(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return l(r,n),l(r,o),r}}function c(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function u(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,a=o.bind;o.bind=function(s){for(var l=[],i=1,c=arguments.length;c>i;i++)l.push(arguments[i]);if(s!==e&&null!==s)"production"!==n.env.NODE_ENV?O(!1,"bind(): React component methods may only be bound to the component instance. See %s",r):null;else if(!l.length)return"production"!==n.env.NODE_ENV?O(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",r):null,o;var u=a.apply(o,arguments);return u.__reactBoundContext=e,u.__reactBoundMethod=t,u.__reactBoundArguments=l,u}}return o}function d(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=u(e,h.guard(n,e.constructor.displayName+"."+t))}}var p=e("./ReactComponent"),b=e("./ReactCurrentOwner"),m=e("./ReactElement"),h=e("./ReactErrorUtils"),f=e("./ReactInstanceMap"),v=e("./ReactLifeCycle"),y=e("./ReactPropTypeLocations"),g=e("./ReactPropTypeLocationNames"),_=e("./ReactUpdateQueue"),E=e("./Object.assign"),N=e("./invariant"),C=e("./keyMirror"),R=e("./keyOf"),O=e("./warning"),w=R({mixins:null}),U=C({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),j=[],D={mixins:U.DEFINE_MANY,statics:U.DEFINE_MANY,propTypes:U.DEFINE_MANY,contextTypes:U.DEFINE_MANY,childContextTypes:U.DEFINE_MANY,getDefaultProps:U.DEFINE_MANY_MERGED,getInitialState:U.DEFINE_MANY_MERGED,getChildContext:U.DEFINE_MANY_MERGED,render:U.DEFINE_ONCE,componentWillMount:U.DEFINE_MANY,componentDidMount:U.DEFINE_MANY,componentWillReceiveProps:U.DEFINE_MANY,shouldComponentUpdate:U.DEFINE_ONCE,componentWillUpdate:U.DEFINE_MANY,componentDidUpdate:U.DEFINE_MANY,componentWillUnmount:U.DEFINE_MANY,updateComponent:U.OVERRIDE_BASE},P={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)a(e,t[n])},childContextTypes:function(e,t){"production"!==n.env.NODE_ENV&&o(e,t,y.childContext),e.childContextTypes=E({},e.childContextTypes,t)},contextTypes:function(e,t){"production"!==n.env.NODE_ENV&&o(e,t,y.context),e.contextTypes=E({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=i(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){"production"!==n.env.NODE_ENV&&o(e,t,y.prop),e.propTypes=E({},e.propTypes,t)},statics:function(e,t){s(e,t)}},M={enumerable:!1,get:function(){var e=this.displayName||this.name||"Component";return"production"!==n.env.NODE_ENV?O(!1,"%s.type is deprecated. Use %s directly to access the class.",e,e):null,Object.defineProperty(this,"type",{value:this}),this}},T={replaceState:function(e,t){_.enqueueReplaceState(this,e),t&&_.enqueueCallback(this,t)},isMounted:function(){if("production"!==n.env.NODE_ENV){var e=b.current;null!==e&&("production"!==n.env.NODE_ENV?O(e._warnedAboutRefsInRender,"%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",e.getName()||"A component"):null,e._warnedAboutRefsInRender=!0)}var t=f.get(this);return t&&t!==v.currentlyMountingInstance},setProps:function(e,t){_.enqueueSetProps(this,e),t&&_.enqueueCallback(this,t)},replaceProps:function(e,t){_.enqueueReplaceProps(this,e),t&&_.enqueueCallback(this,t)}},x=function(){};E(x.prototype,p.prototype,T);var S={createClass:function(e){var t=function(e,o){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?O(this instanceof t,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"):null),this.__reactAutoBindMap&&d(this),this.props=e,this.context=o,this.state=null;var r=this.getInitialState?this.getInitialState():null;"production"!==n.env.NODE_ENV&&"undefined"==typeof r&&this.getInitialState._isMockFunction&&(r=null),"production"!==n.env.NODE_ENV?N("object"==typeof r&&!Array.isArray(r),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"):N("object"==typeof r&&!Array.isArray(r)),this.state=r};t.prototype=new x,t.prototype.constructor=t,j.forEach(a.bind(null,t)),a(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),"production"!==n.env.NODE_ENV&&(t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved={}),t.prototype.getInitialState&&(t.prototype.getInitialState.isReactClassApproved={})),"production"!==n.env.NODE_ENV?N(t.prototype.render,"createClass(...): Class specification must implement a `render` method."):N(t.prototype.render),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?O(!t.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"):null);for(var o in D)t.prototype[o]||(t.prototype[o]=null);if(t.type=t,"production"!==n.env.NODE_ENV)try{Object.defineProperty(t,"type",M)}catch(r){}return t},injection:{injectMixin:function(e){j.push(e)}}};t.exports=S}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponent.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactErrorUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactLifeCycle":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyMirror.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponent.js":[function(e,t,n){(function(n){"use strict";function o(e,t){this.props=e,this.context=t}var r=e("./ReactUpdateQueue"),a=e("./invariant"),s=e("./warning");if(o.prototype.setState=function(e,t){"production"!==n.env.NODE_ENV?a("object"==typeof e||"function"==typeof e||null==e,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."):a("object"==typeof e||"function"==typeof e||null==e),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?s(null!=e,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."):null),r.enqueueSetState(this,e),t&&r.enqueueCallback(this,t)},o.prototype.forceUpdate=function(e){r.enqueueForceUpdate(this),e&&r.enqueueCallback(this,e)},"production"!==n.env.NODE_ENV){var l={getDOMNode:["getDOMNode","Use React.findDOMNode(component) instead."],isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceProps:["replaceProps","Instead, call React.render again at the top level."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."],setProps:["setProps","Instead, call React.render again at the top level."]},i=function(e,t){try{Object.defineProperty(o.prototype,e,{get:function(){"production"!==n.env.NODE_ENV?s(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1]):null}})}catch(r){}};for(var c in l)l.hasOwnProperty(c)&&i(c,l[c])}t.exports=o}).call(this,e("_process"))},{"./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js":[function(e,t,n){"use strict";var o=e("./ReactDOMIDOperations"),r=e("./ReactMount"),a={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:o.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){r.purgeID(e)}};t.exports=a},{"./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js":[function(e,t,n){(function(n){"use strict";var o=e("./invariant"),r=!1,a={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){"production"!==n.env.NODE_ENV?o(!r,"ReactCompositeComponent: injectEnvironment() can only be called once."):o(!r),a.unmountIDFromEnvironment=e.unmountIDFromEnvironment,a.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,a.processChildrenUpdates=e.processChildrenUpdates,r=!0}}};t.exports=a}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCompositeComponent.js":[function(e,t,n){(function(n){"use strict";function o(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}var r=e("./ReactComponentEnvironment"),a=e("./ReactContext"),s=e("./ReactCurrentOwner"),l=e("./ReactElement"),i=e("./ReactElementValidator"),c=e("./ReactInstanceMap"),u=e("./ReactLifeCycle"),d=e("./ReactNativeComponent"),p=e("./ReactPerf"),b=e("./ReactPropTypeLocations"),m=e("./ReactPropTypeLocationNames"),h=e("./ReactReconciler"),f=e("./ReactUpdates"),v=e("./Object.assign"),y=e("./emptyObject"),g=e("./invariant"),_=e("./shouldUpdateReactComponent"),E=e("./warning"),N=1,C={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._isTopLevel=!1,this._pendingCallbacks=null},mountComponent:function(e,t,o){this._context=o,this._mountOrder=N++,this._rootNodeID=e;var r=this._processProps(this._currentElement.props),a=this._processContext(this._currentElement._context),s=d.getComponentClassForElement(this._currentElement),l=new s(r,a);"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?E(null!=l.render,"%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render` in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.",s.displayName||s.name||"Component"):null),l.props=r,l.context=a,l.refs=y,this._instance=l,c.set(l,this),"production"!==n.env.NODE_ENV&&this._warnIfContextsDiffer(this._currentElement._context,o),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?E(!l.getInitialState||l.getInitialState.isReactClassApproved,"getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",this.getName()||"a component"):null,"production"!==n.env.NODE_ENV?E(!l.getDefaultProps||l.getDefaultProps.isReactClassApproved,"getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",this.getName()||"a component"):null,"production"!==n.env.NODE_ENV?E(!l.propTypes,"propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",this.getName()||"a component"):null,"production"!==n.env.NODE_ENV?E(!l.contextTypes,"contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",this.getName()||"a component"):null,"production"!==n.env.NODE_ENV?E("function"!=typeof l.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",this.getName()||"A component"):null);var i=l.state;void 0===i&&(l.state=i=null),"production"!==n.env.NODE_ENV?g("object"==typeof i&&!Array.isArray(i),"%s.state: must be set to an object or null",this.getName()||"ReactCompositeComponent"):g("object"==typeof i&&!Array.isArray(i)),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var p,b,m=u.currentlyMountingInstance;u.currentlyMountingInstance=this;try{l.componentWillMount&&(l.componentWillMount(),this._pendingStateQueue&&(l.state=this._processPendingState(l.props,l.context))),p=this._getValidatedChildContext(o),b=this._renderValidatedComponent(p)}finally{u.currentlyMountingInstance=m}this._renderedComponent=this._instantiateReactComponent(b,this._currentElement.type);var f=h.mountComponent(this._renderedComponent,e,t,this._mergeChildContext(o,p));return l.componentDidMount&&t.getReactMountReady().enqueue(l.componentDidMount,l),f},unmountComponent:function(){var e=this._instance;if(e.componentWillUnmount){var t=u.currentlyUnmountingInstance;u.currentlyUnmountingInstance=this;try{e.componentWillUnmount()}finally{u.currentlyUnmountingInstance=t}}h.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,c.remove(e)},_setPropsInternal:function(e,t){var n=this._pendingElement||this._currentElement;this._pendingElement=l.cloneAndReplaceProps(n,v({},n.props,e)),f.enqueueUpdate(this,t)},_maskContext:function(e){var t=null;if("string"==typeof this._currentElement.type)return y;var n=this._currentElement.type.contextTypes;if(!n)return y;t={};for(var o in n)t[o]=e[o];return t},_processContext:function(e){var t=this._maskContext(e);if("production"!==n.env.NODE_ENV){var o=d.getComponentClassForElement(this._currentElement);o.contextTypes&&this._checkPropTypes(o.contextTypes,t,b.context)}return t},_getValidatedChildContext:function(e){var t=this._instance,o=t.getChildContext&&t.getChildContext();if(o){"production"!==n.env.NODE_ENV?g("object"==typeof t.constructor.childContextTypes,"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",this.getName()||"ReactCompositeComponent"):g("object"==typeof t.constructor.childContextTypes),"production"!==n.env.NODE_ENV&&this._checkPropTypes(t.constructor.childContextTypes,o,b.childContext);for(var r in o)"production"!==n.env.NODE_ENV?g(r in t.constructor.childContextTypes,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',this.getName()||"ReactCompositeComponent",r):g(r in t.constructor.childContextTypes);return o}return null},_mergeChildContext:function(e,t){return t?v({},e,t):e},_processProps:function(e){if("production"!==n.env.NODE_ENV){var t=d.getComponentClassForElement(this._currentElement);t.propTypes&&this._checkPropTypes(t.propTypes,e,b.prop)}return e},_checkPropTypes:function(e,t,r){var a=this.getName();for(var s in e)if(e.hasOwnProperty(s)){var l;try{"production"!==n.env.NODE_ENV?g("function"==typeof e[s],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",a||"React class",m[r],s):g("function"==typeof e[s]),l=e[s](t,s,a,r)}catch(i){l=i}if(l instanceof Error){var c=o(this);r===b.prop?"production"!==n.env.NODE_ENV?E(!1,"Failed Composite propType: %s%s",l.message,c):null:"production"!==n.env.NODE_ENV?E(!1,"Failed Context Types: %s%s",l.message,c):null}}},receiveComponent:function(e,t,n){var o=this._currentElement,r=this._context;this._pendingElement=null,this.updateComponent(t,o,e,r,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&h.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&("production"!==n.env.NODE_ENV&&i.checkAndWarnForMutatedProps(this._currentElement),this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context))},_warnIfContextsDiffer:function(e,t){e=this._maskContext(e),t=this._maskContext(t);for(var o=Object.keys(t).sort(),r=this.getName()||"ReactCompositeComponent",a=0;a<o.length;a++){var s=o[a];"production"!==n.env.NODE_ENV?E(e[s]===t[s],"owner-based and parent-based contexts differ (values: `%s` vs `%s`) for key (%s) while mounting %s (see: http://fb.me/react-context-by-parent)",e[s],t[s],s,r):null}},updateComponent:function(e,t,o,r,a){var s=this._instance,l=s.context,i=s.props;t!==o&&(l=this._processContext(o._context),i=this._processProps(o.props),"production"!==n.env.NODE_ENV&&null!=a&&this._warnIfContextsDiffer(o._context,a),s.componentWillReceiveProps&&s.componentWillReceiveProps(i,l));var c=this._processPendingState(i,l),u=this._pendingForceUpdate||!s.shouldComponentUpdate||s.shouldComponentUpdate(i,c,l);"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?E("undefined"!=typeof u,"%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",this.getName()||"ReactCompositeComponent"):null),u?(this._pendingForceUpdate=!1,this._performComponentUpdate(o,i,c,l,e,a)):(this._currentElement=o,this._context=a,s.props=i,s.state=c,s.context=l)},_processPendingState:function(e,t){var n=this._instance,o=this._pendingStateQueue,r=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!o)return n.state;if(r&&1===o.length)return o[0];for(var a=v({},r?o[0]:n.state),s=r?1:0;s<o.length;s++){var l=o[s];v(a,"function"==typeof l?l.call(n,a,e,t):l)}return a},_performComponentUpdate:function(e,t,n,o,r,a){var s=this._instance,l=s.props,i=s.state,c=s.context;s.componentWillUpdate&&s.componentWillUpdate(t,n,o),this._currentElement=e,this._context=a,s.props=t,s.state=n,s.context=o,this._updateRenderedComponent(r,a),s.componentDidUpdate&&r.getReactMountReady().enqueue(s.componentDidUpdate.bind(s,l,i,c),s)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,o=n._currentElement,r=this._getValidatedChildContext(),a=this._renderValidatedComponent(r);if(_(o,a))h.receiveComponent(n,a,e,this._mergeChildContext(t,r));else{var s=this._rootNodeID,l=n._rootNodeID;h.unmountComponent(n),this._renderedComponent=this._instantiateReactComponent(a,this._currentElement.type);var i=h.mountComponent(this._renderedComponent,s,e,this._mergeChildContext(t,r));this._replaceNodeWithMarkupByID(l,i)}},_replaceNodeWithMarkupByID:function(e,t){r.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return"production"!==n.env.NODE_ENV&&"undefined"==typeof t&&e.render._isMockFunction&&(t=null),t},_renderValidatedComponent:function(e){var t,o=a.current;a.current=this._mergeChildContext(this._currentElement._context,e),s.current=this;try{t=this._renderValidatedComponentWithoutOwnerOrContext()}finally{a.current=o,s.current=null}return"production"!==n.env.NODE_ENV?g(null===t||t===!1||l.isValidElement(t),"%s.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.",this.getName()||"ReactCompositeComponent"):g(null===t||t===!1||l.isValidElement(t)),t},attachRef:function(e,t){var n=this.getPublicInstance(),o=n.refs===y?n.refs={}:n.refs;o[e]=t.getPublicInstance()},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){return this._instance},_instantiateReactComponent:null};p.measureMethods(C,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var R={Mixin:C};t.exports=R}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactContext":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactLifeCycle":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactContext.js":[function(e,t,n){(function(n){"use strict";var o=e("./Object.assign"),r=e("./emptyObject"),a=e("./warning"),s=!1,l={current:r,withContext:function(e,t){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?a(s,"withContext is deprecated and will be removed in a future version. Use a wrapper component with getChildContext instead."):null,s=!0);var r,i=l.current;l.current=o({},i,e);try{r=t()}finally{l.current=i}return r}};t.exports=l}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js":[function(e,t,n){"use strict";var o={current:null};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOM.js":[function(e,t,n){(function(n){"use strict";function o(e){return"production"!==n.env.NODE_ENV?a.createFactory(e):r.createFactory(e)}var r=e("./ReactElement"),a=e("./ReactElementValidator"),s=e("./mapObject"),l=s({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},o);t.exports=l}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./mapObject":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/mapObject.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMButton.js":[function(e,t,n){"use strict";var o=e("./AutoFocusMixin"),r=e("./ReactBrowserComponentMixin"),a=e("./ReactClass"),s=e("./ReactElement"),l=e("./keyMirror"),i=s.createFactory("button"),c=l({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),u=a.createClass({displayName:"ReactDOMButton",tagName:"BUTTON",mixins:[o,r],render:function(){var e={};for(var t in this.props)!this.props.hasOwnProperty(t)||this.props.disabled&&c[t]||(e[t]=this.props[t]); return i(e,this.props.children)}});t.exports=u},{"./AutoFocusMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js":[function(e,t,n){(function(n){"use strict";function o(e){e&&(null!=e.dangerouslySetInnerHTML&&("production"!==n.env.NODE_ENV?v(null==e.children,"Can only set one of `children` or `props.dangerouslySetInnerHTML`."):v(null==e.children),"production"!==n.env.NODE_ENV?v("object"==typeof e.dangerouslySetInnerHTML&&"__html"in e.dangerouslySetInnerHTML,"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information."):v("object"==typeof e.dangerouslySetInnerHTML&&"__html"in e.dangerouslySetInnerHTML)),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?_(null==e.innerHTML,"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."):null,"production"!==n.env.NODE_ENV?_(!e.contentEditable||null==e.children,"A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."):null),"production"!==n.env.NODE_ENV?v(null==e.style||"object"==typeof e.style,"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."):v(null==e.style||"object"==typeof e.style))}function r(e,t,o,r){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?_("onScroll"!==t||y("scroll",!0),"This browser doesn't support the `onScroll` event"):null);var a=p.findReactContainerForID(e);if(a){var s=a.nodeType===w?a.ownerDocument:a;N(t,s)}r.getPutListenerQueue().enqueuePutListener(e,t,o)}function a(e){M.call(P,e)||("production"!==n.env.NODE_ENV?v(D.test(e),"Invalid tag: %s",e):v(D.test(e)),P[e]=!0)}function s(e){a(e),this._tag=e,this._renderedChildren=null,this._previousStyleCopy=null,this._rootNodeID=null}var l=e("./CSSPropertyOperations"),i=e("./DOMProperty"),c=e("./DOMPropertyOperations"),u=e("./ReactBrowserEventEmitter"),d=e("./ReactComponentBrowserEnvironment"),p=e("./ReactMount"),b=e("./ReactMultiChild"),m=e("./ReactPerf"),h=e("./Object.assign"),f=e("./escapeTextContentForBrowser"),v=e("./invariant"),y=e("./isEventSupported"),g=e("./keyOf"),_=e("./warning"),E=u.deleteListener,N=u.listenTo,C=u.registrationNameModules,R={string:!0,number:!0},O=g({style:null}),w=1,U=null,j={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},D=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P={},M={}.hasOwnProperty;s.displayName="ReactDOMComponent",s.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e,o(this._currentElement.props);var r=j[this._tag]?"":"</"+this._tag+">";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,n)+r},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(null!=a)if(C.hasOwnProperty(o))r(this._rootNodeID,o,a,e);else{o===O&&(a&&(a=this._previousStyleCopy=h({},t.style)),a=l.createMarkupForStyles(a));var s=c.createMarkupForProperty(o,a);s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n+">";var i=c.createMarkupForID(this._rootNodeID);return n+" "+i+">"},_createContentMarkup:function(e,t){var n="";"listing"!==this._tag&&"pre"!==this._tag&&"textarea"!==this._tag||(n="\n");var o=this._currentElement.props,r=o.dangerouslySetInnerHTML;if(null!=r){if(null!=r.__html)return n+r.__html}else{var a=R[typeof o.children]?o.children:null,s=null!=a?null:o.children;if(null!=a)return n+f(a);if(null!=s){var l=this.mountChildren(s,e,t);return n+l.join("")}}return n},receiveComponent:function(e,t,n){var o=this._currentElement;this._currentElement=e,this.updateComponent(t,o,e,n)},updateComponent:function(e,t,n,r){o(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,r)},_updateDOMProperties:function(e,t){var n,o,a,s=this._currentElement.props;for(n in e)if(!s.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===O){var l=this._previousStyleCopy;for(o in l)l.hasOwnProperty(o)&&(a=a||{},a[o]="");this._previousStyleCopy=null}else C.hasOwnProperty(n)?E(this._rootNodeID,n):(i.isStandardName[n]||i.isCustomAttribute(n))&&U.deletePropertyByID(this._rootNodeID,n);for(n in s){var c=s[n],u=n===O?this._previousStyleCopy:e[n];if(s.hasOwnProperty(n)&&c!==u)if(n===O)if(c?c=this._previousStyleCopy=h({},c):this._previousStyleCopy=null,u){for(o in u)!u.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(a=a||{},a[o]="");for(o in c)c.hasOwnProperty(o)&&u[o]!==c[o]&&(a=a||{},a[o]=c[o])}else a=c;else C.hasOwnProperty(n)?r(this._rootNodeID,n,c,t):(i.isStandardName[n]||i.isCustomAttribute(n))&&U.updatePropertyByID(this._rootNodeID,n,c)}a&&U.updateStylesByID(this._rootNodeID,a)},_updateDOMChildren:function(e,t,n){var o=this._currentElement.props,r=R[typeof e.children]?e.children:null,a=R[typeof o.children]?o.children:null,s=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,l=o.dangerouslySetInnerHTML&&o.dangerouslySetInnerHTML.__html,i=null!=r?null:e.children,c=null!=a?null:o.children,u=null!=r||null!=s,d=null!=a||null!=l;null!=i&&null==c?this.updateChildren(null,t,n):u&&!d&&this.updateTextContent(""),null!=a?r!==a&&this.updateTextContent(""+a):null!=l?s!==l&&U.updateInnerHTMLByID(this._rootNodeID,l):null!=c&&this.updateChildren(c,t,n)},unmountComponent:function(){this.unmountChildren(),u.deleteAllListeners(this._rootNodeID),d.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},m.measureMethods(s,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),h(s.prototype,s.Mixin,b.Mixin),s.injection={injectIDOperations:function(e){s.BackendIDOperations=U=e}},t.exports=s}).call(this,e("_process"))},{"./CSSPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js","./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMForm.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),r=e("./LocalEventTrapMixin"),a=e("./ReactBrowserComponentMixin"),s=e("./ReactClass"),l=e("./ReactElement"),i=l.createFactory("form"),c=s.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[a,r],render:function(){return i(this.props)},componentDidMount:function(){this.trapBubbledEvent(o.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(o.topLevelTypes.topSubmit,"submit")}});t.exports=c},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js":[function(e,t,n){(function(n){"use strict";var o=e("./CSSPropertyOperations"),r=e("./DOMChildrenOperations"),a=e("./DOMPropertyOperations"),s=e("./ReactMount"),l=e("./ReactPerf"),i=e("./invariant"),c=e("./setInnerHTML"),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},d={updatePropertyByID:function(e,t,o){var r=s.getNode(e);"production"!==n.env.NODE_ENV?i(!u.hasOwnProperty(t),"updatePropertyByID(...): %s",u[t]):i(!u.hasOwnProperty(t)),null!=o?a.setValueForProperty(r,t,o):a.deleteValueForProperty(r,t)},deletePropertyByID:function(e,t,o){var r=s.getNode(e);"production"!==n.env.NODE_ENV?i(!u.hasOwnProperty(t),"updatePropertyByID(...): %s",u[t]):i(!u.hasOwnProperty(t)),a.deleteValueForProperty(r,t,o)},updateStylesByID:function(e,t){var n=s.getNode(e);o.setValueForStyles(n,t)},updateInnerHTMLByID:function(e,t){var n=s.getNode(e);c(n,t)},updateTextContentByID:function(e,t){var n=s.getNode(e);r.updateTextContent(n,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=s.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=s.getNode(e[n].parentID);r.processUpdates(e,t)}};l.measureMethods(d,"ReactDOMIDOperations",{updatePropertyByID:"updatePropertyByID",deletePropertyByID:"deletePropertyByID",updateStylesByID:"updateStylesByID",updateInnerHTMLByID:"updateInnerHTMLByID",updateTextContentByID:"updateTextContentByID",dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),t.exports=d}).call(this,e("_process"))},{"./CSSPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js","./DOMChildrenOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIframe.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),r=e("./LocalEventTrapMixin"),a=e("./ReactBrowserComponentMixin"),s=e("./ReactClass"),l=e("./ReactElement"),i=l.createFactory("iframe"),c=s.createClass({displayName:"ReactDOMIframe",tagName:"IFRAME",mixins:[a,r],render:function(){return i(this.props)},componentDidMount:function(){this.trapBubbledEvent(o.topLevelTypes.topLoad,"load")}});t.exports=c},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMImg.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),r=e("./LocalEventTrapMixin"),a=e("./ReactBrowserComponentMixin"),s=e("./ReactClass"),l=e("./ReactElement"),i=l.createFactory("img"),c=s.createClass({displayName:"ReactDOMImg",tagName:"IMG",mixins:[a,r],render:function(){return i(this.props)},componentDidMount:function(){this.trapBubbledEvent(o.topLevelTypes.topLoad,"load"),this.trapBubbledEvent(o.topLevelTypes.topError,"error")}});t.exports=c},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMInput.js":[function(e,t,n){(function(n){"use strict";function o(){this.isMounted()&&this.forceUpdate()}var r=e("./AutoFocusMixin"),a=e("./DOMPropertyOperations"),s=e("./LinkedValueUtils"),l=e("./ReactBrowserComponentMixin"),i=e("./ReactClass"),c=e("./ReactElement"),u=e("./ReactMount"),d=e("./ReactUpdates"),p=e("./Object.assign"),b=e("./invariant"),m=c.createFactory("input"),h={},f=i.createClass({displayName:"ReactDOMInput",tagName:"INPUT",mixins:[r,s.Mixin,l],getInitialState:function(){var e=this.props.defaultValue;return{initialChecked:this.props.defaultChecked||!1,initialValue:null!=e?e:null}},render:function(){var e=p({},this.props);e.defaultChecked=null,e.defaultValue=null;var t=s.getValue(this);e.value=null!=t?t:this.state.initialValue;var n=s.getChecked(this);return e.checked=null!=n?n:this.state.initialChecked,e.onChange=this._handleChange,m(e,this.props.children)},componentDidMount:function(){var e=u.getID(this.getDOMNode());h[e]=this},componentWillUnmount:function(){var e=this.getDOMNode(),t=u.getID(e);delete h[t]},componentDidUpdate:function(e,t,n){var o=this.getDOMNode();null!=this.props.checked&&a.setValueForProperty(o,"checked",this.props.checked||!1);var r=s.getValue(this);null!=r&&a.setValueForProperty(o,"value",""+r)},_handleChange:function(e){var t,r=s.getOnChange(this);r&&(t=r.call(this,e)),d.asap(o,this);var a=this.props.name;if("radio"===this.props.type&&null!=a){for(var l=this.getDOMNode(),i=l;i.parentNode;)i=i.parentNode;for(var c=i.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),p=0,m=c.length;m>p;p++){var f=c[p];if(f!==l&&f.form===l.form){var v=u.getID(f);"production"!==n.env.NODE_ENV?b(v,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."):b(v);var y=h[v];"production"!==n.env.NODE_ENV?b(y,"ReactDOMInput: Unknown radio button ID %s.",v):b(y),d.asap(o,y)}}}return t}});t.exports=f}).call(this,e("_process"))},{"./AutoFocusMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMOption.js":[function(e,t,n){(function(n){"use strict";var o=e("./ReactBrowserComponentMixin"),r=e("./ReactClass"),a=e("./ReactElement"),s=e("./warning"),l=a.createFactory("option"),i=r.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[o],componentWillMount:function(){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?s(null==this.props.selected,"Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."):null)},render:function(){return l(this.props,this.props.children)}});t.exports=i}).call(this,e("_process"))},{"./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js":[function(e,t,n){"use strict";function o(){if(this._pendingUpdate){this._pendingUpdate=!1;var e=l.getValue(this);null!=e&&this.isMounted()&&a(this,e)}}function r(e,t,n){if(null==e[t])return null;if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be an array if `multiple` is true.")}else if(Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be a scalar value if `multiple` is false.")}function a(e,t){var n,o,r,a=e.getDOMNode().options;if(e.props.multiple){for(n={},o=0,r=t.length;r>o;o++)n[""+t[o]]=!0;for(o=0,r=a.length;r>o;o++){var s=n.hasOwnProperty(a[o].value);a[o].selected!==s&&(a[o].selected=s)}}else{for(n=""+t,o=0,r=a.length;r>o;o++)if(a[o].value===n)return void(a[o].selected=!0);a.length&&(a[0].selected=!0)}}var s=e("./AutoFocusMixin"),l=e("./LinkedValueUtils"),i=e("./ReactBrowserComponentMixin"),c=e("./ReactClass"),u=e("./ReactElement"),d=e("./ReactUpdates"),p=e("./Object.assign"),b=u.createFactory("select"),m=c.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[s,l.Mixin,i],propTypes:{defaultValue:r,value:r},render:function(){var e=p({},this.props);return e.onChange=this._handleChange,e.value=null,b(e,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var e=l.getValue(this);null!=e?a(this,e):null!=this.props.defaultValue&&a(this,this.props.defaultValue)},componentDidUpdate:function(e){var t=l.getValue(this);null!=t?(this._pendingUpdate=!1,a(this,t)):!e.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?a(this,this.props.defaultValue):a(this,this.props.multiple?[]:""))},_handleChange:function(e){var t,n=l.getOnChange(this);return n&&(t=n.call(this,e)),this._pendingUpdate=!0,d.asap(o,this),t}});t.exports=m},{"./AutoFocusMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelection.js":[function(e,t,n){"use strict";function o(e,t,n,o){return e===n&&t===o}function r(e){var t=document.selection,n=t.createRange(),o=n.text.length,r=n.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",n);var a=r.text.length,s=a+o;return{start:a,end:s}}function a(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,a=t.focusNode,s=t.focusOffset,l=t.getRangeAt(0),i=o(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),c=i?0:l.toString().length,u=l.cloneRange();u.selectNodeContents(e),u.setEnd(l.startContainer,l.startOffset);var d=o(u.startContainer,u.startOffset,u.endContainer,u.endOffset),p=d?0:u.toString().length,b=p+c,m=document.createRange();m.setStart(n,r),m.setEnd(a,s);var h=m.collapsed;return{start:h?b:p,end:h?p:b}}function s(e,t){var n,o,r=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,o=n):t.start>t.end?(n=t.end,o=t.start):(n=t.start,o=t.end),r.moveToElementText(e),r.moveStart("character",n),r.setEndPoint("EndToStart",r),r.moveEnd("character",o-n),r.select()}function l(e,t){if(window.getSelection){var n=window.getSelection(),o=e[u()].length,r=Math.min(t.start,o),a="undefined"==typeof t.end?r:Math.min(t.end,o);if(!n.extend&&r>a){var s=a;a=r,r=s}var l=c(e,r),i=c(e,a);if(l&&i){var d=document.createRange();d.setStart(l.node,l.offset),n.removeAllRanges(),r>a?(n.addRange(d),n.extend(i.node,i.offset)):(d.setEnd(i.node,i.offset),n.addRange(d))}}}var i=e("./ExecutionEnvironment"),c=e("./getNodeForCharacterOffset"),u=e("./getTextContentAccessor"),d=i.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:d?r:a,setOffsets:d?s:l};t.exports=p},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./getNodeForCharacterOffset":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getNodeForCharacterOffset.js","./getTextContentAccessor":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js":[function(e,t,n){"use strict";var o=e("./DOMPropertyOperations"),r=e("./ReactComponentBrowserEnvironment"),a=e("./ReactDOMComponent"),s=e("./Object.assign"),l=e("./escapeTextContentForBrowser"),i=function(e){};s(i.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){this._rootNodeID=e;var r=l(this._stringText);return t.renderToStaticMarkup?r:"<span "+o.createMarkupForID(e)+">"+r+"</span>"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;n!==this._stringText&&(this._stringText=n,a.BackendIDOperations.updateTextContentByID(this._rootNodeID,n))}},unmountComponent:function(){r.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=i},{"./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextarea.js":[function(e,t,n){(function(n){"use strict";function o(){this.isMounted()&&this.forceUpdate()}var r=e("./AutoFocusMixin"),a=e("./DOMPropertyOperations"),s=e("./LinkedValueUtils"),l=e("./ReactBrowserComponentMixin"),i=e("./ReactClass"),c=e("./ReactElement"),u=e("./ReactUpdates"),d=e("./Object.assign"),p=e("./invariant"),b=e("./warning"),m=c.createFactory("textarea"),h=i.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[r,s.Mixin,l],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&("production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?b(!1,"Use the `defaultValue` or `value` props instead of setting children on <textarea>."):null),"production"!==n.env.NODE_ENV?p(null==e,"If you supply `defaultValue` on a <textarea>, do not pass children."):p(null==e),Array.isArray(t)&&("production"!==n.env.NODE_ENV?p(t.length<=1,"<textarea> can only have at most one child."):p(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var o=s.getValue(this);return{initialValue:""+(null!=o?o:e)}},render:function(){var e=d({},this.props);return"production"!==n.env.NODE_ENV?p(null==e.dangerouslySetInnerHTML,"`dangerouslySetInnerHTML` does not make sense on <textarea>."):p(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,m(e,this.state.initialValue)},componentDidUpdate:function(e,t,n){var o=s.getValue(this);if(null!=o){var r=this.getDOMNode();a.setValueForProperty(r,"value",""+o)}},_handleChange:function(e){var t,n=s.getOnChange(this);return n&&(t=n.call(this,e)),u.asap(o,this),t}});t.exports=h}).call(this,e("_process"))},{"./AutoFocusMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js":[function(e,t,n){"use strict";function o(){this.reinitializeTransaction()}var r=e("./ReactUpdates"),a=e("./Transaction"),s=e("./Object.assign"),l=e("./emptyFunction"),i={initialize:l,close:function(){p.isBatchingUpdates=!1}},c={initialize:l,close:r.flushBatchedUpdates.bind(r)},u=[c,i];s(o.prototype,a.Mixin,{getTransactionWrappers:function(){return u}});var d=new o,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,o,r){var a=p.isBatchingUpdates;p.isBatchingUpdates=!0,a?e(t,n,o,r):d.perform(e,null,t,n,o,r)}};t.exports=p},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js","./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js":[function(e,t,n){(function(n){"use strict";function o(e){return m.createClass({tagName:e.toUpperCase(),render:function(){return new j(e,null,null,null,null,this.props)}})}function r(){if(P.EventEmitter.injectReactEventListener(D),P.EventPluginHub.injectEventPluginOrder(i),P.EventPluginHub.injectInstanceHandle(M),P.EventPluginHub.injectMount(T),P.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:k,EnterLeaveEventPlugin:c,ChangeEventPlugin:s,MobileSafariClickEventPlugin:p,SelectEventPlugin:S,BeforeInputEventPlugin:a}),P.NativeComponent.injectGenericComponentClass(v),P.NativeComponent.injectTextComponentClass(U),P.NativeComponent.injectAutoWrapper(o),P.Class.injectMixin(b),P.NativeComponent.injectComponentClasses({button:y,form:g,iframe:N,img:_,input:C,option:R,select:O,textarea:w,html:L("html"),head:L("head"),body:L("body")}),P.DOMProperty.injectDOMPropertyConfig(d),P.DOMProperty.injectDOMPropertyConfig(A),P.EmptyComponent.injectEmptyComponent("noscript"),P.Updates.injectReconcileTransaction(x),P.Updates.injectBatchingStrategy(f),P.RootIndex.injectCreateReactRootIndex(u.canUseDOM?l.createReactRootIndex:I.createReactRootIndex),P.Component.injectEnvironment(h),P.DOMComponent.injectIDOperations(E),"production"!==n.env.NODE_ENV){var t=u.canUseDOM&&window.location.href||"";if(/[?&]react_perf\b/.test(t)){var r=e("./ReactDefaultPerf");r.start()}}}var a=e("./BeforeInputEventPlugin"),s=e("./ChangeEventPlugin"),l=e("./ClientReactRootIndex"),i=e("./DefaultEventPluginOrder"),c=e("./EnterLeaveEventPlugin"),u=e("./ExecutionEnvironment"),d=e("./HTMLDOMPropertyConfig"),p=e("./MobileSafariClickEventPlugin"),b=e("./ReactBrowserComponentMixin"),m=e("./ReactClass"),h=e("./ReactComponentBrowserEnvironment"),f=e("./ReactDefaultBatchingStrategy"),v=e("./ReactDOMComponent"),y=e("./ReactDOMButton"),g=e("./ReactDOMForm"),_=e("./ReactDOMImg"),E=e("./ReactDOMIDOperations"),N=e("./ReactDOMIframe"),C=e("./ReactDOMInput"),R=e("./ReactDOMOption"),O=e("./ReactDOMSelect"),w=e("./ReactDOMTextarea"),U=e("./ReactDOMTextComponent"),j=e("./ReactElement"),D=e("./ReactEventListener"),P=e("./ReactInjection"),M=e("./ReactInstanceHandles"),T=e("./ReactMount"),x=e("./ReactReconcileTransaction"),S=e("./SelectEventPlugin"),I=e("./ServerReactRootIndex"),k=e("./SimpleEventPlugin"),A=e("./SVGDOMPropertyConfig"),L=e("./createFullPageComponent");t.exports={inject:r}}).call(this,e("_process"))},{"./BeforeInputEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/BeforeInputEventPlugin.js","./ChangeEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ChangeEventPlugin.js","./ClientReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ClientReactRootIndex.js","./DefaultEventPluginOrder":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DefaultEventPluginOrder.js","./EnterLeaveEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EnterLeaveEventPlugin.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./HTMLDOMPropertyConfig":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/HTMLDOMPropertyConfig.js","./MobileSafariClickEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/MobileSafariClickEventPlugin.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js", "./ReactDOMButton":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMButton.js","./ReactDOMComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./ReactDOMForm":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMForm.js","./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactDOMIframe":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIframe.js","./ReactDOMImg":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMImg.js","./ReactDOMInput":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMInput.js","./ReactDOMOption":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMOption.js","./ReactDOMSelect":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js","./ReactDOMTextComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDOMTextarea":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextarea.js","./ReactDefaultBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactDefaultPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerf.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactEventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventListener.js","./ReactInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInjection.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactReconcileTransaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconcileTransaction.js","./SVGDOMPropertyConfig":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SVGDOMPropertyConfig.js","./SelectEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SelectEventPlugin.js","./ServerReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ServerReactRootIndex.js","./SimpleEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SimpleEventPlugin.js","./createFullPageComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/createFullPageComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerf.js":[function(e,t,n){"use strict";function o(e){return Math.floor(100*e)/100}function r(e,t,n){e[t]=(e[t]||0)+n}var a=e("./DOMProperty"),s=e("./ReactDefaultPerfAnalysis"),l=e("./ReactMount"),i=e("./ReactPerf"),c=e("./performanceNow"),u={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){u._injected||i.injection.injectMeasure(u.measure),u._allMeasurements.length=0,i.enableMeasure=!0},stop:function(){i.enableMeasure=!1},getLastMeasurements:function(){return u._allMeasurements},printExclusive:function(e){e=e||u._allMeasurements;var t=s.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":o(e.inclusive),"Exclusive mount time (ms)":o(e.exclusive),"Exclusive render time (ms)":o(e.render),"Mount time per instance (ms)":o(e.exclusive/e.count),"Render time per instance (ms)":o(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||u._allMeasurements;var t=s.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":o(e.time),Instances:e.count}})),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},getMeasurementsSummaryMap:function(e){var t=s.getInclusiveSummary(e,!0);return t.map(function(e){return{"Owner > component":e.componentName,"Wasted time (ms)":e.time,Instances:e.count}})},printWasted:function(e){e=e||u._allMeasurements,console.table(u.getMeasurementsSummaryMap(e)),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||u._allMeasurements;var t=s.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[a.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,n,o){var r=u._allMeasurements[u._allMeasurements.length-1].writes;r[e]=r[e]||[],r[e].push({type:t,time:n,args:o})},measure:function(e,t,n){return function(){for(var o=[],a=0,s=arguments.length;s>a;a++)o.push(arguments[a]);var i,d,p;if("_renderNewRootComponent"===t||"flushBatchedUpdates"===t)return u._allMeasurements.push({exclusive:{},inclusive:{},render:{},counts:{},writes:{},displayNames:{},totalTime:0}),p=c(),d=n.apply(this,o),u._allMeasurements[u._allMeasurements.length-1].totalTime=c()-p,d;if("_mountImageIntoNode"===t||"ReactDOMIDOperations"===e){if(p=c(),d=n.apply(this,o),i=c()-p,"_mountImageIntoNode"===t){var b=l.getID(o[1]);u._recordWrite(b,t,i,o[0])}else"dangerouslyProcessChildrenUpdates"===t?o[0].forEach(function(e){var t={};null!==e.fromIndex&&(t.fromIndex=e.fromIndex),null!==e.toIndex&&(t.toIndex=e.toIndex),null!==e.textContent&&(t.textContent=e.textContent),null!==e.markupIndex&&(t.markup=o[1][e.markupIndex]),u._recordWrite(e.parentID,e.type,i,t)}):u._recordWrite(o[0],t,i,Array.prototype.slice.call(o,1));return d}if("ReactCompositeComponent"!==e||"mountComponent"!==t&&"updateComponent"!==t&&"_renderValidatedComponent"!==t)return n.apply(this,o);if("string"==typeof this._currentElement.type)return n.apply(this,o);var m="mountComponent"===t?o[0]:this._rootNodeID,h="_renderValidatedComponent"===t,f="mountComponent"===t,v=u._mountStack,y=u._allMeasurements[u._allMeasurements.length-1];if(h?r(y.counts,m,1):f&&v.push(0),p=c(),d=n.apply(this,o),i=c()-p,h)r(y.render,m,i);else if(f){var g=v.pop();v[v.length-1]+=i,r(y.exclusive,m,i-g),r(y.inclusive,m,i)}else r(y.inclusive,m,i);return y.displayNames[m]={current:this.getName(),owner:this._currentElement._owner?this._currentElement._owner.getName():"<root>"},d}}};t.exports=u},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ReactDefaultPerfAnalysis":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerfAnalysis.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./performanceNow":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/performanceNow.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerfAnalysis.js":[function(e,t,n){function o(e){for(var t=0,n=0;n<e.length;n++){var o=e[n];t+=o.totalTime}return t}function r(e){for(var t=[],n=0;n<e.length;n++){var o,r=e[n];for(o in r.writes)r.writes[o].forEach(function(e){t.push({id:o,type:u[e.type]||e.type,args:e.args})})}return t}function a(e){for(var t,n={},o=0;o<e.length;o++){var r=e[o],a=i({},r.exclusive,r.inclusive);for(var s in a)t=r.displayNames[s].current,n[t]=n[t]||{componentName:t,inclusive:0,exclusive:0,render:0,count:0},r.render[s]&&(n[t].render+=r.render[s]),r.exclusive[s]&&(n[t].exclusive+=r.exclusive[s]),r.inclusive[s]&&(n[t].inclusive+=r.inclusive[s]),r.counts[s]&&(n[t].count+=r.counts[s])}var l=[];for(t in n)n[t].exclusive>=c&&l.push(n[t]);return l.sort(function(e,t){return t.exclusive-e.exclusive}),l}function s(e,t){for(var n,o={},r=0;r<e.length;r++){var a,s=e[r],u=i({},s.exclusive,s.inclusive);t&&(a=l(s));for(var d in u)if(!t||a[d]){var p=s.displayNames[d];n=p.owner+" > "+p.current,o[n]=o[n]||{componentName:n,time:0,count:0},s.inclusive[d]&&(o[n].time+=s.inclusive[d]),s.counts[d]&&(o[n].count+=s.counts[d])}}var b=[];for(n in o)o[n].time>=c&&b.push(o[n]);return b.sort(function(e,t){return t.time-e.time}),b}function l(e){var t={},n=Object.keys(e.writes),o=i({},e.exclusive,e.inclusive);for(var r in o){for(var a=!1,s=0;s<n.length;s++)if(0===n[s].indexOf(r)){a=!0;break}!a&&e.counts[r]>0&&(t[r]=!0)}return t}var i=e("./Object.assign"),c=1.2,u={_mountImageIntoNode:"set innerHTML",INSERT_MARKUP:"set innerHTML",MOVE_EXISTING:"move",REMOVE_NODE:"remove",TEXT_CONTENT:"set textContent",updatePropertyByID:"update attribute",deletePropertyByID:"delete attribute",updateStylesByID:"update styles",updateInnerHTMLByID:"set innerHTML",dangerouslyReplaceNodeWithMarkupByID:"replace"},d={getExclusiveSummary:a,getInclusiveSummary:s,getDOMSummary:r,getTotalTime:o};t.exports=d},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js":[function(e,t,n){(function(n){"use strict";function o(e,t){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[t]:null},set:function(e){"production"!==n.env.NODE_ENV?i(!1,"Don't set the %s property of the React element. Instead, specify the correct value when initially creating the element.",t):null,this._store[t]=e}})}function r(e){try{var t={props:!0};for(var n in t)o(e,n);u=!0}catch(r){}}var a=e("./ReactContext"),s=e("./ReactCurrentOwner"),l=e("./Object.assign"),i=e("./warning"),c={key:!0,ref:!0},u=!1,d=function(e,t,o,r,a,s){if(this.type=e,this.key=t,this.ref=o,this._owner=r,this._context=a,"production"!==n.env.NODE_ENV){this._store={props:s,originalProps:l({},s)};try{Object.defineProperty(this._store,"validated",{configurable:!1,enumerable:!1,writable:!0})}catch(i){}if(this._store.validated=!1,u)return void Object.freeze(this)}this.props=s};d.prototype={_isReactElement:!0},"production"!==n.env.NODE_ENV&&r(d.prototype),d.createElement=function(e,t,n){var o,r={},l=null,i=null;if(null!=t){i=void 0===t.ref?null:t.ref,l=void 0===t.key?null:""+t.key;for(o in t)t.hasOwnProperty(o)&&!c.hasOwnProperty(o)&&(r[o]=t[o])}var u=arguments.length-2;if(1===u)r.children=n;else if(u>1){for(var p=Array(u),b=0;u>b;b++)p[b]=arguments[b+2];r.children=p}if(e&&e.defaultProps){var m=e.defaultProps;for(o in m)"undefined"==typeof r[o]&&(r[o]=m[o])}return new d(e,l,i,s.current,a.current,r)},d.createFactory=function(e){var t=d.createElement.bind(null,e);return t.type=e,t},d.cloneAndReplaceProps=function(e,t){var o=new d(e.type,e.key,e.ref,e._owner,e._context,t);return"production"!==n.env.NODE_ENV&&(o._store.validated=e._store.validated),o},d.cloneElement=function(e,t,n){var o,r=l({},e.props),a=e.key,i=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(i=t.ref,u=s.current),void 0!==t.key&&(a=""+t.key);for(o in t)t.hasOwnProperty(o)&&!c.hasOwnProperty(o)&&(r[o]=t[o])}var p=arguments.length-2;if(1===p)r.children=n;else if(p>1){for(var b=Array(p),m=0;p>m;m++)b[m]=arguments[m+2];r.children=b}return new d(e.type,a,i,u,e._context,r)},d.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=d}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactContext":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js":[function(e,t,n){(function(n){"use strict";function o(){if(g.current){var e=g.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function r(e){var t=e&&e.getPublicInstance();if(t){var n=t.constructor;if(n)return n.displayName||n.name||void 0}}function a(){var e=g.current;return e&&r(e)||void 0}function s(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,i('Each child in an array or iterator should have a unique "key" prop.',e,t))}function l(e,t,n){w.test(e)&&i("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function i(e,t,o){var s=a(),l="string"==typeof o?o:o.displayName||o.name,i=s||l,c=R[e]||(R[e]={});if(!c.hasOwnProperty(i)){c[i]=!0;var u=s?" Check the render method of "+s+".":l?" Check the React.render call using <"+l+">.":"",d="";if(t&&t._owner&&t._owner!==g.current){var p=r(t._owner);d=" It was passed a child from "+p+"."}"production"!==n.env.NODE_ENV?C(!1,e+"%s%s See https://fb.me/react-warning-keys for more information.",u,d):null}}function c(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++){var o=e[n];h.isValidElement(o)&&s(o,t)}else if(h.isValidElement(e))e._store.validated=!0;else if(e){var r=E(e);if(r){if(r!==e.entries)for(var a,i=r.call(e);!(a=i.next()).done;)h.isValidElement(a.value)&&s(a.value,t)}else if("object"==typeof e){var c=f.extractIfFragment(e);for(var u in c)c.hasOwnProperty(u)&&l(u,c[u],t)}}}function u(e,t,r,a){for(var s in t)if(t.hasOwnProperty(s)){var l;try{"production"!==n.env.NODE_ENV?N("function"==typeof t[s],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e||"React class",y[a],s):N("function"==typeof t[s]),l=t[s](r,s,e,a)}catch(i){l=i}if(l instanceof Error&&!(l.message in O)){O[l.message]=!0;var c=o(this);"production"!==n.env.NODE_ENV?C(!1,"Failed propType: %s%s",l.message,c):null}}}function d(e,t){var o=t.type,r="string"==typeof o?o:o.displayName,a=t._owner?t._owner.getPublicInstance().constructor.displayName:null,s=e+"|"+r+"|"+a;if(!U.hasOwnProperty(s)){U[s]=!0;var l="";r&&(l=" <"+r+" />");var i="";a&&(i=" The element was created by "+a+"."),"production"!==n.env.NODE_ENV?C(!1,"Don't set .props.%s of the React component%s. Instead, specify the correct value when initially creating the element or use React.cloneElement to make a new element with updated props.%s",e,l,i):null}}function p(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function b(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var o in n)n.hasOwnProperty(o)&&(t.hasOwnProperty(o)&&p(t[o],n[o])||(d(o,e),t[o]=n[o]))}}function m(e){if(null!=e.type){var t=_.getComponentClassForElement(e),o=t.displayName||t.name;t.propTypes&&u(o,t.propTypes,e.props,v.prop),"function"==typeof t.getDefaultProps&&("production"!==n.env.NODE_ENV?C(t.getDefaultProps.isReactClassApproved,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."):null)}}var h=e("./ReactElement"),f=e("./ReactFragment"),v=e("./ReactPropTypeLocations"),y=e("./ReactPropTypeLocationNames"),g=e("./ReactCurrentOwner"),_=e("./ReactNativeComponent"),E=e("./getIteratorFn"),N=e("./invariant"),C=e("./warning"),R={},O={},w=/^\d+$/,U={},j={checkAndWarnForMutatedProps:b,createElement:function(e,t,o){"production"!==n.env.NODE_ENV?C(null!=e,"React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components)."):null;var r=h.createElement.apply(this,arguments);if(null==r)return r;for(var a=2;a<arguments.length;a++)c(arguments[a],e);return m(r),r},createFactory:function(e){var t=j.createElement.bind(null,e);if(t.type=e,"production"!==n.env.NODE_ENV)try{Object.defineProperty(t,"type",{enumerable:!1,get:function(){return"production"!==n.env.NODE_ENV?C(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."):null,Object.defineProperty(this,"type",{value:e}),e}})}catch(o){}return t},cloneElement:function(e,t,n){for(var o=h.cloneElement.apply(this,arguments),r=2;r<arguments.length;r++)c(arguments[r],o.type);return m(o),o}};t.exports=j}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactFragment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js":[function(e,t,n){(function(n){"use strict";function o(e){u[e]=!0}function r(e){delete u[e]}function a(e){return!!u[e]}var s,l=e("./ReactElement"),i=e("./ReactInstanceMap"),c=e("./invariant"),u={},d={injectEmptyComponent:function(e){s=l.createFactory(e)}},p=function(){};p.prototype.componentDidMount=function(){var e=i.get(this);e&&o(e._rootNodeID)},p.prototype.componentWillUnmount=function(){var e=i.get(this);e&&r(e._rootNodeID)},p.prototype.render=function(){return"production"!==n.env.NODE_ENV?c(s,"Trying to return null from a render, but no null placeholder component was injected."):c(s),s()};var b=l.createElement(p),m={emptyElement:b,injection:d,isNullComponentID:a};t.exports=m}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js":[function(e,t,n){"use strict";var o={guard:function(e,t){return e}};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventEmitterMixin.js":[function(e,t,n){"use strict";function o(e){r.enqueueEvents(e),r.processEventQueue()}var r=e("./EventPluginHub"),a={handleTopLevel:function(e,t,n,a){var s=r.extractEvents(e,t,n,a);o(s)}};t.exports=a},{"./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventListener.js":[function(e,t,n){"use strict";function o(e){var t=d.getID(e),n=u.getReactRootIDFromNodeID(t),o=d.findReactContainerForID(n),r=d.getFirstReactDOM(o);return r}function r(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function a(e){for(var t=d.getFirstReactDOM(m(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=o(n);for(var r=0,a=e.ancestors.length;a>r;r++){t=e.ancestors[r];var s=d.getID(t)||"";f._handleTopLevel(e.topLevelType,t,s,e.nativeEvent)}}function s(e){var t=h(window);e(t)}var l=e("./EventListener"),i=e("./ExecutionEnvironment"),c=e("./PooledClass"),u=e("./ReactInstanceHandles"),d=e("./ReactMount"),p=e("./ReactUpdates"),b=e("./Object.assign"),m=e("./getEventTarget"),h=e("./getUnboundedScrollPosition");b(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),c.addPoolingTo(r,c.twoArgumentPooler);var f={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:i.canUseDOM?window:null,setHandleTopLevel:function(e){f._handleTopLevel=e},setEnabled:function(e){f._enabled=!!e},isEnabled:function(){return f._enabled},trapBubbledEvent:function(e,t,n){var o=n;return o?l.listen(o,t,f.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var o=n;return o?l.capture(o,t,f.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=s.bind(null,e);l.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(f._enabled){var n=r.getPooled(e,t);try{p.batchedUpdates(a,n)}finally{r.release(n)}}}};t.exports=f},{"./EventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventListener.js","./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js","./getUnboundedScrollPosition":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getUnboundedScrollPosition.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactFragment.js":[function(e,t,n){(function(n){"use strict";var o=e("./ReactElement"),r=e("./warning");if("production"!==n.env.NODE_ENV){var a="_reactFragment",s="_reactDidWarn",l=!1;try{var i=function(){return 1};Object.defineProperty({},a,{enumerable:!1,value:!0}),Object.defineProperty({},"key",{enumerable:!0,get:i}),l=!0}catch(c){}var u=function(e,t){Object.defineProperty(e,t,{enumerable:!0,get:function(){return"production"!==n.env.NODE_ENV?r(this[s],"A ReactFragment is an opaque type. Accessing any of its properties is deprecated. Pass it to one of the React.Children helpers."):null,this[s]=!0,this[a][t]},set:function(e){"production"!==n.env.NODE_ENV?r(this[s],"A ReactFragment is an immutable opaque type. Mutating its properties is deprecated."):null,this[s]=!0,this[a][t]=e}})},d={},p=function(e){var t="";for(var n in e)t+=n+":"+typeof e[n]+",";var o=!!d[t];return d[t]=!0,o}}var b={create:function(e){if("production"!==n.env.NODE_ENV){if("object"!=typeof e||!e||Array.isArray(e))return"production"!==n.env.NODE_ENV?r(!1,"React.addons.createFragment only accepts a single object.",e):null,e;if(o.isValidElement(e))return"production"!==n.env.NODE_ENV?r(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."):null,e;if(l){var t={};Object.defineProperty(t,a,{enumerable:!1,value:e}),Object.defineProperty(t,s,{writable:!0,enumerable:!1,value:!1});for(var i in e)u(t,i);return Object.preventExtensions(t),t}}return e},extract:function(e){return"production"!==n.env.NODE_ENV&&l?e[a]?e[a]:("production"!==n.env.NODE_ENV?r(p(e),"Any use of a keyed object should be wrapped in React.addons.createFragment(object) before being passed as a child."):null,e):e},extractIfFragment:function(e){if("production"!==n.env.NODE_ENV&&l){if(e[a])return e[a];for(var t in e)if(e.hasOwnProperty(t)&&o.isValidElement(e[t]))return b.extract(e)}return e}};t.exports=b}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInjection.js":[function(e,t,n){"use strict";var o=e("./DOMProperty"),r=e("./EventPluginHub"),a=e("./ReactComponentEnvironment"),s=e("./ReactClass"),l=e("./ReactEmptyComponent"),i=e("./ReactBrowserEventEmitter"),c=e("./ReactNativeComponent"),u=e("./ReactDOMComponent"),d=e("./ReactPerf"),p=e("./ReactRootIndex"),b=e("./ReactUpdates"),m={Component:a.injection,Class:s.injection,DOMComponent:u.injection,DOMProperty:o.injection,EmptyComponent:l.injection,EventPluginHub:r.injection,EventEmitter:i.injection,NativeComponent:c.injection,Perf:d.injection,RootIndex:p.injection,Updates:b.injection};t.exports=m},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactDOMComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js":[function(e,t,n){"use strict";function o(e){return a(document.documentElement,e)}var r=e("./ReactDOMSelection"),a=e("./containsNode"),s=e("./focusNode"),l=e("./getActiveElement"),i={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=l();return{focusedElem:e,selectionRange:i.hasSelectionCapabilities(e)?i.getSelection(e):null}},restoreSelection:function(e){var t=l(),n=e.focusedElem,r=e.selectionRange;t!==n&&o(n)&&(i.hasSelectionCapabilities(n)&&i.setSelection(n,r),s(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",o-n),a.select()}else r.setOffsets(e,t)}};t.exports=i},{"./ReactDOMSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelection.js","./containsNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/containsNode.js","./focusNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/focusNode.js","./getActiveElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getActiveElement.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js":[function(e,t,n){(function(n){"use strict";function o(e){return b+e.toString(36)}function r(e,t){return e.charAt(t)===b||t===e.length}function a(e){return""===e||e.charAt(0)===b&&e.charAt(e.length-1)!==b}function s(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function l(e){return e?e.substr(0,e.lastIndexOf(b)):""}function i(e,t){if("production"!==n.env.NODE_ENV?p(a(e)&&a(t),"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,t):p(a(e)&&a(t)),"production"!==n.env.NODE_ENV?p(s(e,t),"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,t):p(s(e,t)),e===t)return e;var o,l=e.length+m;for(o=l;o<t.length&&!r(t,o);o++);return t.substr(0,o)}function c(e,t){var o=Math.min(e.length,t.length);if(0===o)return"";for(var s=0,l=0;o>=l;l++)if(r(e,l)&&r(t,l))s=l;else if(e.charAt(l)!==t.charAt(l))break;var i=e.substr(0,s);return"production"!==n.env.NODE_ENV?p(a(i),"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,t,i):p(a(i)),i}function u(e,t,o,r,a,c){e=e||"",t=t||"","production"!==n.env.NODE_ENV?p(e!==t,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e):p(e!==t);var u=s(t,e);"production"!==n.env.NODE_ENV?p(u||s(e,t),"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,t):p(u||s(e,t));for(var d=0,b=u?l:i,m=e;;m=b(m,t)){var f;if(a&&m===e||c&&m===t||(f=o(m,u,r)),f===!1||m===t)break;"production"!==n.env.NODE_ENV?p(d++<h,"traverseParentPath(%s, %s, ...): Detected an infinite loop while traversing the React DOM ID tree. This may be due to malformed IDs: %s",e,t):p(d++<h)}}var d=e("./ReactRootIndex"),p=e("./invariant"),b=".",m=b.length,h=100,f={createReactRootID:function(){return o(d.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===b&&e.length>1){var t=e.indexOf(b,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,o,r){var a=c(e,t);a!==e&&u(e,a,n,o,!1,!0),a!==t&&u(a,t,n,r,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(u("",e,t,n,!0,!1),u(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){u("",e,t,n,!0,!1)},_getFirstCommonAncestorID:c,_getNextDescendantID:i,isAncestorIDOf:s,SEPARATOR:b};t.exports=f}).call(this,e("_process"))},{"./ReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js":[function(e,t,n){"use strict";var o={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js":[function(e,t,n){"use strict";var o={currentlyMountingInstance:null,currentlyUnmountingInstance:null};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js":[function(e,t,n){"use strict";var o=e("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=o(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var n=t.getAttribute(r.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var a=o(e);return a===n}};t.exports=r},{"./adler32":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/adler32.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js":[function(e,t,n){(function(n){"use strict";function o(e,t){for(var n=Math.min(e.length,t.length),o=0;n>o;o++)if(e.charAt(o)!==t.charAt(o))return o;return e.length===t.length?-1:n}function r(e){var t=M(e);return t&&G.getID(t)}function a(e){var t=s(e);if(t)if(V.hasOwnProperty(t)){var o=V[t];o!==e&&("production"!==n.env.NODE_ENV?x(!u(o,t),"ReactMount: Two valid but unequal nodes with the same `%s`: %s",L,t):x(!u(o,t)),V[t]=e)}else V[t]=e;return t}function s(e){return e&&e.getAttribute&&e.getAttribute(L)||""}function l(e,t){var n=s(e);n!==t&&delete V[n],e.setAttribute(L,t),V[t]=e}function i(e){return V.hasOwnProperty(e)&&u(V[e],e)||(V[e]=G.findReactNodeByID(e)),V[e]}function c(e){var t=C.get(e)._rootNodeID;return E.isNullComponentID(t)?null:(V.hasOwnProperty(t)&&u(V[t],t)||(V[t]=G.findReactNodeByID(t)),V[t])}function u(e,t){if(e){"production"!==n.env.NODE_ENV?x(s(e)===t,"ReactMount: Unexpected modification of `%s`",L):x(s(e)===t); var o=G.findReactContainerForID(t);if(o&&P(o,e))return!0}return!1}function d(e){delete V[e]}function p(e){var t=V[e];return t&&u(t,e)?void(z=t):!1}function b(e){z=null,N.traverseAncestors(e,p);var t=z;return z=null,t}function m(e,t,n,o,r){var a=w.mountComponent(e,t,o,D);e._isTopLevel=!0,G._mountImageIntoNode(a,n,r)}function h(e,t,n,o){var r=j.ReactReconcileTransaction.getPooled();r.perform(m,null,e,t,n,r,o),j.ReactReconcileTransaction.release(r)}var f=e("./DOMProperty"),v=e("./ReactBrowserEventEmitter"),y=e("./ReactCurrentOwner"),g=e("./ReactElement"),_=e("./ReactElementValidator"),E=e("./ReactEmptyComponent"),N=e("./ReactInstanceHandles"),C=e("./ReactInstanceMap"),R=e("./ReactMarkupChecksum"),O=e("./ReactPerf"),w=e("./ReactReconciler"),U=e("./ReactUpdateQueue"),j=e("./ReactUpdates"),D=e("./emptyObject"),P=e("./containsNode"),M=e("./getReactRootElementInContainer"),T=e("./instantiateReactComponent"),x=e("./invariant"),S=e("./setInnerHTML"),I=e("./shouldUpdateReactComponent"),k=e("./warning"),A=N.SEPARATOR,L=f.ID_ATTRIBUTE_NAME,V={},F=1,B=9,H={},W={};if("production"!==n.env.NODE_ENV)var K={};var q=[],z=null,G={_instancesByReactRootID:H,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,o,a){return"production"!==n.env.NODE_ENV&&_.checkAndWarnForMutatedProps(t),G.scrollMonitor(o,function(){U.enqueueElementInternal(e,t),a&&U.enqueueCallbackInternal(e,a)}),"production"!==n.env.NODE_ENV&&(K[r(o)]=M(o)),e},_registerComponent:function(e,t){"production"!==n.env.NODE_ENV?x(t&&(t.nodeType===F||t.nodeType===B),"_registerComponent(...): Target container is not a DOM element."):x(t&&(t.nodeType===F||t.nodeType===B)),v.ensureScrollValueMonitoring();var o=G.registerContainer(t);return H[o]=e,o},_renderNewRootComponent:function(e,t,o){"production"!==n.env.NODE_ENV?k(null==y.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null;var r=T(e,null),a=G._registerComponent(r,t);return j.batchedUpdates(h,r,a,t,o),"production"!==n.env.NODE_ENV&&(K[a]=M(t)),r},render:function(e,t,o){"production"!==n.env.NODE_ENV?x(g.isValidElement(e),"React.render(): Invalid component element.%s","string"==typeof e?" Instead of passing an element string, make sure to instantiate it by passing it to React.createElement.":"function"==typeof e?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":null!=e&&void 0!==e.props?" This may be caused by unintentionally loading two independent copies of React.":""):x(g.isValidElement(e));var a=H[r(t)];if(a){var s=a._currentElement;if(I(s,e))return G._updateRootComponent(a,e,t,o).getPublicInstance();G.unmountComponentAtNode(t)}var l=M(t),i=l&&G.isRenderedByReact(l);if("production"!==n.env.NODE_ENV&&(!i||l.nextSibling))for(var c=l;c;){if(G.isRenderedByReact(c)){"production"!==n.env.NODE_ENV?k(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):null;break}c=c.nextSibling}var u=i&&!a,d=G._renderNewRootComponent(e,t,u).getPublicInstance();return o&&o.call(d),d},constructAndRenderComponent:function(e,t,n){var o=g.createElement(e,t);return G.render(o,n)},constructAndRenderComponentByID:function(e,t,o){var r=document.getElementById(o);return"production"!==n.env.NODE_ENV?x(r,'Tried to get element with id of "%s" but it is not present on the page.',o):x(r),G.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=r(e);return t&&(t=N.getReactRootIDFromNodeID(t)),t||(t=N.createReactRootID()),W[t]=e,t},unmountComponentAtNode:function(e){"production"!==n.env.NODE_ENV?k(null==y.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null,"production"!==n.env.NODE_ENV?x(e&&(e.nodeType===F||e.nodeType===B),"unmountComponentAtNode(...): Target container is not a DOM element."):x(e&&(e.nodeType===F||e.nodeType===B));var t=r(e),o=H[t];return o?(G.unmountComponentFromNode(o,e),delete H[t],delete W[t],"production"!==n.env.NODE_ENV&&delete K[t],!0):!1},unmountComponentFromNode:function(e,t){for(w.unmountComponent(e),t.nodeType===B&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=N.getReactRootIDFromNodeID(e),o=W[t];if("production"!==n.env.NODE_ENV){var r=K[t];if(r&&r.parentNode!==o){"production"!==n.env.NODE_ENV?x(s(r)===t,"ReactMount: Root element ID differed from reactRootID."):x(s(r)===t);var a=o.firstChild;a&&t===s(a)?K[t]=a:"production"!==n.env.NODE_ENV?k(!1,"ReactMount: Root element has been removed from its original container. New container:",r.parentNode):null}}return o},findReactNodeByID:function(e){var t=G.findReactContainerForID(e);return G.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=G.getID(e);return t?t.charAt(0)===A:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(G.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var o=q,r=0,a=b(t)||e;for(o[0]=a.firstChild,o.length=1;r<o.length;){for(var s,l=o[r++];l;){var i=G.getID(l);i?t===i?s=l:N.isAncestorIDOf(i,t)&&(o.length=r=0,o.push(l.firstChild)):o.push(l.firstChild),l=l.nextSibling}if(s)return o.length=0,s}o.length=0,"production"!==n.env.NODE_ENV?x(!1,"findComponentRoot(..., %s): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",t,G.getID(e)):x(!1)},_mountImageIntoNode:function(e,t,r){if("production"!==n.env.NODE_ENV?x(t&&(t.nodeType===F||t.nodeType===B),"mountComponentIntoNode(...): Target container is not valid."):x(t&&(t.nodeType===F||t.nodeType===B)),r){var a=M(t);if(R.canReuseMarkup(e,a))return;var s=a.getAttribute(R.CHECKSUM_ATTR_NAME);a.removeAttribute(R.CHECKSUM_ATTR_NAME);var l=a.outerHTML;a.setAttribute(R.CHECKSUM_ATTR_NAME,s);var i=o(e,l),c=" (client) "+e.substring(i-20,i+20)+"\n (server) "+l.substring(i-20,i+20);"production"!==n.env.NODE_ENV?x(t.nodeType!==B,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",c):x(t.nodeType!==B),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?k(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",c):null)}"production"!==n.env.NODE_ENV?x(t.nodeType!==B,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See React.renderToString() for server rendering."):x(t.nodeType!==B),S(t,e)},getReactRootID:r,getID:a,setID:l,getNode:i,getNodeFromInstance:c,purgeID:d};O.measureMethods(G,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),t.exports=G}).call(this,e("_process"))},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactMarkupChecksum":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./containsNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/containsNode.js","./emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./getReactRootElementInContainer":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getReactRootElementInContainer.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChild.js":[function(e,t,n){"use strict";function o(e,t,n){m.push({parentID:e,parentNode:null,type:u.INSERT_MARKUP,markupIndex:h.push(t)-1,textContent:null,fromIndex:null,toIndex:n})}function r(e,t,n){m.push({parentID:e,parentNode:null,type:u.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:t,toIndex:n})}function a(e,t){m.push({parentID:e,parentNode:null,type:u.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:t,toIndex:null})}function s(e,t){m.push({parentID:e,parentNode:null,type:u.TEXT_CONTENT,markupIndex:null,textContent:t,fromIndex:null,toIndex:null})}function l(){m.length&&(c.processChildrenUpdates(m,h),i())}function i(){m.length=0,h.length=0}var c=e("./ReactComponentEnvironment"),u=e("./ReactMultiChildUpdateTypes"),d=e("./ReactReconciler"),p=e("./ReactChildReconciler"),b=0,m=[],h=[],f={Mixin:{mountChildren:function(e,t,n){var o=p.instantiateChildren(e,t,n);this._renderedChildren=o;var r=[],a=0;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],i=this._rootNodeID+s,c=d.mountComponent(l,i,t,n);l._mountIndex=a,r.push(c),a++}return r},updateTextContent:function(e){b++;var t=!0;try{var n=this._renderedChildren;p.unmountChildren(n);for(var o in n)n.hasOwnProperty(o)&&this._unmountChildByName(n[o],o);this.setTextContent(e),t=!1}finally{b--,b||(t?i():l())}},updateChildren:function(e,t,n){b++;var o=!0;try{this._updateChildren(e,t,n),o=!1}finally{b--,b||(o?i():l())}},_updateChildren:function(e,t,n){var o=this._renderedChildren,r=p.updateChildren(o,e,t,n);if(this._renderedChildren=r,r||o){var a,s=0,l=0;for(a in r)if(r.hasOwnProperty(a)){var i=o&&o[a],c=r[a];i===c?(this.moveChild(i,l,s),s=Math.max(i._mountIndex,s),i._mountIndex=l):(i&&(s=Math.max(i._mountIndex,s),this._unmountChildByName(i,a)),this._mountChildByNameAtIndex(c,a,l,t,n)),l++}for(a in o)!o.hasOwnProperty(a)||r&&r.hasOwnProperty(a)||this._unmountChildByName(o[a],a)}},unmountChildren:function(){var e=this._renderedChildren;p.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&r(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){o(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){a(this._rootNodeID,e._mountIndex)},setTextContent:function(e){s(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,o,r){var a=this._rootNodeID+t,s=d.mountComponent(e,a,o,r);e._mountIndex=n,this.createChild(e,s)},_unmountChildByName:function(e,t){this.removeChild(e),e._mountIndex=null}}};t.exports=f},{"./ReactChildReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildReconciler.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactMultiChildUpdateTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js":[function(e,t,n){"use strict";var o=e("./keyMirror"),r=o({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});t.exports=r},{"./keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js":[function(e,t,n){(function(n){"use strict";function o(e){if("function"==typeof e.type)return e.type;var t=e.type,n=d[t];return null==n&&(d[t]=n=c(t)),n}function r(e){return"production"!==n.env.NODE_ENV?i(u,"There is no registered component for the tag %s",e.type):i(u),new u(e.type,e.props)}function a(e){return new p(e)}function s(e){return e instanceof p}var l=e("./Object.assign"),i=e("./invariant"),c=null,u=null,d={},p=null,b={injectGenericComponentClass:function(e){u=e},injectTextComponentClass:function(e){p=e},injectComponentClasses:function(e){l(d,e)},injectAutoWrapper:function(e){c=e}},m={getComponentClassForElement:o,createInternalComponent:r,createInstanceForText:a,isTextComponent:s,injection:b};t.exports=m}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactOwner.js":[function(e,t,n){(function(n){"use strict";var o=e("./invariant"),r={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,a){"production"!==n.env.NODE_ENV?o(r.isValidOwner(a),"addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref."):o(r.isValidOwner(a)),a.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,a){"production"!==n.env.NODE_ENV?o(r.isValidOwner(a),"removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This usually means that you're trying to remove a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref."):o(r.isValidOwner(a)),a.getPublicInstance().refs[t]===e.getPublicInstance()&&a.detachRef(t)}};t.exports=r}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js":[function(e,t,n){(function(e){"use strict";function n(e,t,n){return n}var o={enableMeasure:!1,storedMeasure:n,measureMethods:function(t,n,r){if("production"!==e.env.NODE_ENV)for(var a in r)r.hasOwnProperty(a)&&(t[a]=o.measure(n,r[a],t[a]))},measure:function(t,n,r){if("production"!==e.env.NODE_ENV){var a=null,s=function(){return o.enableMeasure?(a||(a=o.storedMeasure(t,n,r)),a.apply(this,arguments)):r.apply(this,arguments)};return s.displayName=t+"_"+n,s}return r},injection:{injectMeasure:function(e){o.storedMeasure=e}}};t.exports=o}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js":[function(e,t,n){(function(e){"use strict";var n={};"production"!==e.env.NODE_ENV&&(n={prop:"prop",context:"context",childContext:"child context"}),t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js":[function(e,t,n){"use strict";var o=e("./keyMirror"),r=o({prop:null,context:null,childContext:null});t.exports=r},{"./keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js":[function(e,t,n){"use strict";function o(e){function t(t,n,o,r,a){if(r=r||E,null==n[o]){var s=g[a];return t?new Error("Required "+s+" `"+o+"` was not specified in "+("`"+r+"`.")):null}return e(n,o,r,a)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function r(e){function t(t,n,o,r){var a=t[n],s=h(a);if(s!==e){var l=g[r],i=f(a);return new Error("Invalid "+l+" `"+n+"` of type `"+i+"` "+("supplied to `"+o+"`, expected `"+e+"`."))}return null}return o(t)}function a(){return o(_.thatReturns(null))}function s(e){function t(t,n,o,r){var a=t[n];if(!Array.isArray(a)){var s=g[r],l=h(a);return new Error("Invalid "+s+" `"+n+"` of type "+("`"+l+"` supplied to `"+o+"`, expected an array."))}for(var i=0;i<a.length;i++){var c=e(a,i,o,r);if(c instanceof Error)return c}return null}return o(t)}function l(){function e(e,t,n,o){if(!v.isValidElement(e[t])){var r=g[o];return new Error("Invalid "+r+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactElement."))}return null}return o(e)}function i(e){function t(t,n,o,r){if(!(t[n]instanceof e)){var a=g[r],s=e.name||E;return new Error("Invalid "+a+" `"+n+"` supplied to "+("`"+o+"`, expected instance of `"+s+"`."))}return null}return o(t)}function c(e){function t(t,n,o,r){for(var a=t[n],s=0;s<e.length;s++)if(a===e[s])return null;var l=g[r],i=JSON.stringify(e);return new Error("Invalid "+l+" `"+n+"` of value `"+a+"` "+("supplied to `"+o+"`, expected one of "+i+"."))}return o(t)}function u(e){function t(t,n,o,r){var a=t[n],s=h(a);if("object"!==s){var l=g[r];return new Error("Invalid "+l+" `"+n+"` of type "+("`"+s+"` supplied to `"+o+"`, expected an object."))}for(var i in a)if(a.hasOwnProperty(i)){var c=e(a,i,o,r);if(c instanceof Error)return c}return null}return o(t)}function d(e){function t(t,n,o,r){for(var a=0;a<e.length;a++){var s=e[a];if(null==s(t,n,o,r))return null}var l=g[r];return new Error("Invalid "+l+" `"+n+"` supplied to "+("`"+o+"`."))}return o(t)}function p(){function e(e,t,n,o){if(!m(e[t])){var r=g[o];return new Error("Invalid "+r+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return null}return o(e)}function b(e){function t(t,n,o,r){var a=t[n],s=h(a);if("object"!==s){var l=g[r];return new Error("Invalid "+l+" `"+n+"` of type `"+s+"` "+("supplied to `"+o+"`, expected `object`."))}for(var i in e){var c=e[i];if(c){var u=c(a,i,o,r);if(u)return u}}return null}return o(t)}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||v.isValidElement(e))return!0;e=y.extractIfFragment(e);for(var t in e)if(!m(e[t]))return!1;return!0;default:return!1}}function h(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function f(e){var t=h(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}var v=e("./ReactElement"),y=e("./ReactFragment"),g=e("./ReactPropTypeLocationNames"),_=e("./emptyFunction"),E="<<anonymous>>",N=l(),C=p(),R={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:a(),arrayOf:s,element:N,instanceOf:i,node:C,objectOf:u,oneOf:c,oneOfType:d,shape:b};t.exports=R},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactFragment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPutListenerQueue.js":[function(e,t,n){"use strict";function o(){this.listenersToPut=[]}var r=e("./PooledClass"),a=e("./ReactBrowserEventEmitter"),s=e("./Object.assign");s(o.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e<this.listenersToPut.length;e++){var t=this.listenersToPut[e];a.putListener(t.rootNodeID,t.propKey,t.propValue)}},reset:function(){this.listenersToPut.length=0},destructor:function(){this.reset()}}),r.addPoolingTo(o),t.exports=o},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconcileTransaction.js":[function(e,t,n){"use strict";function o(){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=r.getPooled(null),this.putListenerQueue=i.getPooled()}var r=e("./CallbackQueue"),a=e("./PooledClass"),s=e("./ReactBrowserEventEmitter"),l=e("./ReactInputSelection"),i=e("./ReactPutListenerQueue"),c=e("./Transaction"),u=e("./Object.assign"),d={initialize:l.getSelectionInformation,close:l.restoreSelection},p={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},b={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},m={initialize:function(){this.putListenerQueue.reset()},close:function(){this.putListenerQueue.putListeners()}},h=[m,d,p,b],f={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){r.release(this.reactMountReady),this.reactMountReady=null,i.release(this.putListenerQueue),this.putListenerQueue=null}};u(o.prototype,c.Mixin,f),a.addPoolingTo(o),t.exports=o},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactInputSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js","./ReactPutListenerQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js":[function(e,t,n){(function(n){"use strict";function o(){r.attachRefs(this,this._currentElement)}var r=e("./ReactRef"),a=e("./ReactElementValidator"),s={mountComponent:function(e,t,r,s){var l=e.mountComponent(t,r,s);return"production"!==n.env.NODE_ENV&&a.checkAndWarnForMutatedProps(e._currentElement),r.getReactMountReady().enqueue(o,e),l},unmountComponent:function(e){r.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,s,l){var i=e._currentElement;if(t!==i||null==t._owner){"production"!==n.env.NODE_ENV&&a.checkAndWarnForMutatedProps(t);var c=r.shouldUpdateRefs(i,t);c&&r.detachRefs(e,i),e.receiveComponent(t,s,l),c&&s.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};t.exports=s}).call(this,e("_process"))},{"./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactRef":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRef.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRef.js":[function(e,t,n){"use strict";function o(e,t,n){"function"==typeof e?e(t.getPublicInstance()):a.addComponentAsRefTo(t,e,n)}function r(e,t,n){"function"==typeof e?e(null):a.removeComponentAsRefFrom(t,e,n)}var a=e("./ReactOwner"),s={};s.attachRefs=function(e,t){var n=t.ref;null!=n&&o(n,e,t._owner)},s.shouldUpdateRefs=function(e,t){return t._owner!==e._owner||t.ref!==e.ref},s.detachRefs=function(e,t){var n=t.ref;null!=n&&r(n,e,t._owner)},t.exports=s},{"./ReactOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactOwner.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js":[function(e,t,n){"use strict";var o={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:o};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRendering.js":[function(e,t,n){(function(n){"use strict";function o(e){"production"!==n.env.NODE_ENV?d(a.isValidElement(e),"renderToString(): You must pass a valid ReactElement."):d(a.isValidElement(e));var t;try{var o=s.createReactRootID();return t=i.getPooled(!1),t.perform(function(){var n=u(e,null),r=n.mountComponent(o,t,c);return l.addChecksumToMarkup(r)},null)}finally{i.release(t)}}function r(e){"production"!==n.env.NODE_ENV?d(a.isValidElement(e),"renderToStaticMarkup(): You must pass a valid ReactElement."):d(a.isValidElement(e));var t;try{var o=s.createReactRootID();return t=i.getPooled(!0),t.perform(function(){var n=u(e,null);return n.mountComponent(o,t,c)},null)}finally{i.release(t)}}var a=e("./ReactElement"),s=e("./ReactInstanceHandles"),l=e("./ReactMarkupChecksum"),i=e("./ReactServerRenderingTransaction"),c=e("./emptyObject"),u=e("./instantiateReactComponent"),d=e("./invariant");t.exports={renderToString:o,renderToStaticMarkup:r}}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMarkupChecksum":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js","./ReactServerRenderingTransaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRenderingTransaction.js","./emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRenderingTransaction.js":[function(e,t,n){"use strict";function o(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=a.getPooled(null),this.putListenerQueue=s.getPooled()}var r=e("./PooledClass"),a=e("./CallbackQueue"),s=e("./ReactPutListenerQueue"),l=e("./Transaction"),i=e("./Object.assign"),c=e("./emptyFunction"),u={initialize:function(){this.reactMountReady.reset()},close:c},d={initialize:function(){this.putListenerQueue.reset()},close:c},p=[d,u],b={getTransactionWrappers:function(){return p},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){a.release(this.reactMountReady),this.reactMountReady=null,s.release(this.putListenerQueue),this.putListenerQueue=null}};i(o.prototype,l.Mixin,b),r.addPoolingTo(o),t.exports=o},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactPutListenerQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js","./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js":[function(e,t,n){(function(n){"use strict";function o(e){e!==a.currentlyMountingInstance&&c.enqueueUpdate(e)}function r(e,t){"production"!==n.env.NODE_ENV?d(null==s.current,"%s(...): Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.",t):d(null==s.current);var o=i.get(e);return o?o===a.currentlyUnmountingInstance?null:o:("production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?p(!t,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op.",t,t):null),null)}var a=e("./ReactLifeCycle"),s=e("./ReactCurrentOwner"),l=e("./ReactElement"),i=e("./ReactInstanceMap"),c=e("./ReactUpdates"),u=e("./Object.assign"),d=e("./invariant"),p=e("./warning"),b={enqueueCallback:function(e,t){"production"!==n.env.NODE_ENV?d("function"==typeof t,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):d("function"==typeof t);var s=r(e);return s&&s!==a.currentlyMountingInstance?(s._pendingCallbacks?s._pendingCallbacks.push(t):s._pendingCallbacks=[t],void o(s)):null},enqueueCallbackInternal:function(e,t){"production"!==n.env.NODE_ENV?d("function"==typeof t,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):d("function"==typeof t),e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],o(e)},enqueueForceUpdate:function(e){var t=r(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,o(t))},enqueueReplaceState:function(e,t){var n=r(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,o(n))},enqueueSetState:function(e,t){var n=r(e,"setState");if(n){var a=n._pendingStateQueue||(n._pendingStateQueue=[]);a.push(t),o(n)}},enqueueSetProps:function(e,t){var a=r(e,"setProps");if(a){"production"!==n.env.NODE_ENV?d(a._isTopLevel,"setProps(...): You called `setProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):d(a._isTopLevel); var s=a._pendingElement||a._currentElement,i=u({},s.props,t);a._pendingElement=l.cloneAndReplaceProps(s,i),o(a)}},enqueueReplaceProps:function(e,t){var a=r(e,"replaceProps");if(a){"production"!==n.env.NODE_ENV?d(a._isTopLevel,"replaceProps(...): You called `replaceProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):d(a._isTopLevel);var s=a._pendingElement||a._currentElement;a._pendingElement=l.cloneAndReplaceProps(s,t),o(a)}},enqueueElementInternal:function(e,t){e._pendingElement=t,o(e)}};t.exports=b}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactLifeCycle":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js":[function(e,t,n){(function(n){"use strict";function o(){"production"!==n.env.NODE_ENV?v(j.ReactReconcileTransaction&&N,"ReactUpdates: must inject a reconcile transaction class and batching strategy"):v(j.ReactReconcileTransaction&&N)}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=u.getPooled(),this.reconcileTransaction=j.ReactReconcileTransaction.getPooled()}function a(e,t,n,r,a){o(),N.batchedUpdates(e,t,n,r,a)}function s(e,t){return e._mountOrder-t._mountOrder}function l(e){var t=e.dirtyComponentsLength;"production"!==n.env.NODE_ENV?v(t===g.length,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",t,g.length):v(t===g.length),g.sort(s);for(var o=0;t>o;o++){var r=g[o],a=r._pendingCallbacks;if(r._pendingCallbacks=null,m.performUpdateIfNecessary(r,e.reconcileTransaction),a)for(var l=0;l<a.length;l++)e.callbackQueue.enqueue(a[l],r.getPublicInstance())}}function i(e){return o(),"production"!==n.env.NODE_ENV?y(null==p.current,"enqueueUpdate(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null,N.isBatchingUpdates?void g.push(e):void N.batchedUpdates(i,e)}function c(e,t){"production"!==n.env.NODE_ENV?v(N.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."):v(N.isBatchingUpdates),_.enqueue(e,t),E=!0}var u=e("./CallbackQueue"),d=e("./PooledClass"),p=e("./ReactCurrentOwner"),b=e("./ReactPerf"),m=e("./ReactReconciler"),h=e("./Transaction"),f=e("./Object.assign"),v=e("./invariant"),y=e("./warning"),g=[],_=u.getPooled(),E=!1,N=null,C={initialize:function(){this.dirtyComponentsLength=g.length},close:function(){this.dirtyComponentsLength!==g.length?(g.splice(0,this.dirtyComponentsLength),w()):g.length=0}},R={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},O=[C,R];f(r.prototype,h.Mixin,{getTransactionWrappers:function(){return O},destructor:function(){this.dirtyComponentsLength=null,u.release(this.callbackQueue),this.callbackQueue=null,j.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return h.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),d.addPoolingTo(r);var w=function(){for(;g.length||E;){if(g.length){var e=r.getPooled();e.perform(l,null,e),r.release(e)}if(E){E=!1;var t=_;_=u.getPooled(),t.notifyAll(),u.release(t)}}};w=b.measure("ReactUpdates","flushBatchedUpdates",w);var U={injectReconcileTransaction:function(e){"production"!==n.env.NODE_ENV?v(e,"ReactUpdates: must provide a reconcile transaction class"):v(e),j.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){"production"!==n.env.NODE_ENV?v(e,"ReactUpdates: must provide a batching strategy"):v(e),"production"!==n.env.NODE_ENV?v("function"==typeof e.batchedUpdates,"ReactUpdates: must provide a batchedUpdates() function"):v("function"==typeof e.batchedUpdates),"production"!==n.env.NODE_ENV?v("boolean"==typeof e.isBatchingUpdates,"ReactUpdates: must provide an isBatchingUpdates boolean attribute"):v("boolean"==typeof e.isBatchingUpdates),N=e}},j={ReactReconcileTransaction:null,batchedUpdates:a,enqueueUpdate:i,flushBatchedUpdates:w,injection:U,asap:c};t.exports=j}).call(this,e("_process"))},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SVGDOMPropertyConfig.js":[function(e,t,n){"use strict";var o=e("./DOMProperty"),r=o.injection.MUST_USE_ATTRIBUTE,a={Properties:{clipPath:r,cx:r,cy:r,d:r,dx:r,dy:r,fill:r,fillOpacity:r,fontFamily:r,fontSize:r,fx:r,fy:r,gradientTransform:r,gradientUnits:r,markerEnd:r,markerMid:r,markerStart:r,offset:r,opacity:r,patternContentUnits:r,patternUnits:r,points:r,preserveAspectRatio:r,r:r,rx:r,ry:r,spreadMethod:r,stopColor:r,stopOpacity:r,stroke:r,strokeDasharray:r,strokeLinecap:r,strokeOpacity:r,strokeWidth:r,textAnchor:r,transform:r,version:r,viewBox:r,x1:r,x2:r,x:r,y1:r,y2:r,y:r},DOMAttributeNames:{clipPath:"clip-path",fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox"}};t.exports=a},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SelectEventPlugin.js":[function(e,t,n){"use strict";function o(e){if("selectionStart"in e&&l.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function r(e){if(y||null==h||h!==c())return null;var t=o(h);if(!v||!p(v,t)){v=t;var n=i.getPooled(m.select,f,e);return n.type="select",n.target=h,s.accumulateTwoPhaseDispatches(n),n}}var a=e("./EventConstants"),s=e("./EventPropagators"),l=e("./ReactInputSelection"),i=e("./SyntheticEvent"),c=e("./getActiveElement"),u=e("./isTextInputElement"),d=e("./keyOf"),p=e("./shallowEqual"),b=a.topLevelTypes,m={select:{phasedRegistrationNames:{bubbled:d({onSelect:null}),captured:d({onSelectCapture:null})},dependencies:[b.topBlur,b.topContextMenu,b.topFocus,b.topKeyDown,b.topMouseDown,b.topMouseUp,b.topSelectionChange]}},h=null,f=null,v=null,y=!1,g={eventTypes:m,extractEvents:function(e,t,n,o){switch(e){case b.topFocus:(u(t)||"true"===t.contentEditable)&&(h=t,f=n,v=null);break;case b.topBlur:h=null,f=null,v=null;break;case b.topMouseDown:y=!0;break;case b.topContextMenu:case b.topMouseUp:return y=!1,r(o);case b.topSelectionChange:case b.topKeyDown:case b.topKeyUp:return r(o)}}};t.exports=g},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactInputSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./getActiveElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getActiveElement.js","./isTextInputElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js","./shallowEqual":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shallowEqual.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ServerReactRootIndex.js":[function(e,t,n){"use strict";var o=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*o)}};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SimpleEventPlugin.js":[function(e,t,n){(function(n){"use strict";var o=e("./EventConstants"),r=e("./EventPluginUtils"),a=e("./EventPropagators"),s=e("./SyntheticClipboardEvent"),l=e("./SyntheticEvent"),i=e("./SyntheticFocusEvent"),c=e("./SyntheticKeyboardEvent"),u=e("./SyntheticMouseEvent"),d=e("./SyntheticDragEvent"),p=e("./SyntheticTouchEvent"),b=e("./SyntheticUIEvent"),m=e("./SyntheticWheelEvent"),h=e("./getEventCharCode"),f=e("./invariant"),v=e("./keyOf"),y=e("./warning"),g=o.topLevelTypes,_={blur:{phasedRegistrationNames:{bubbled:v({onBlur:!0}),captured:v({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:v({onClick:!0}),captured:v({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:v({onContextMenu:!0}),captured:v({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:v({onCopy:!0}),captured:v({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:v({onCut:!0}),captured:v({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:v({onDoubleClick:!0}),captured:v({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:v({onDrag:!0}),captured:v({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:v({onDragEnd:!0}),captured:v({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:v({onDragEnter:!0}),captured:v({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:v({onDragExit:!0}),captured:v({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:v({onDragLeave:!0}),captured:v({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:v({onDragOver:!0}),captured:v({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:v({onDragStart:!0}),captured:v({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:v({onDrop:!0}),captured:v({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:v({onFocus:!0}),captured:v({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:v({onInput:!0}),captured:v({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:v({onKeyDown:!0}),captured:v({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:v({onKeyPress:!0}),captured:v({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:v({onKeyUp:!0}),captured:v({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:v({onLoad:!0}),captured:v({onLoadCapture:!0})}},error:{phasedRegistrationNames:{bubbled:v({onError:!0}),captured:v({onErrorCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:v({onMouseDown:!0}),captured:v({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:v({onMouseMove:!0}),captured:v({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:v({onMouseOut:!0}),captured:v({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:v({onMouseOver:!0}),captured:v({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:v({onMouseUp:!0}),captured:v({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:v({onPaste:!0}),captured:v({onPasteCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:v({onReset:!0}),captured:v({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:v({onScroll:!0}),captured:v({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:v({onSubmit:!0}),captured:v({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:v({onTouchCancel:!0}),captured:v({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:v({onTouchEnd:!0}),captured:v({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:v({onTouchMove:!0}),captured:v({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:v({onTouchStart:!0}),captured:v({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:v({onWheel:!0}),captured:v({onWheelCapture:!0})}}},E={topBlur:_.blur,topClick:_.click,topContextMenu:_.contextMenu,topCopy:_.copy,topCut:_.cut,topDoubleClick:_.doubleClick,topDrag:_.drag,topDragEnd:_.dragEnd,topDragEnter:_.dragEnter,topDragExit:_.dragExit,topDragLeave:_.dragLeave,topDragOver:_.dragOver,topDragStart:_.dragStart,topDrop:_.drop,topError:_.error,topFocus:_.focus,topInput:_.input,topKeyDown:_.keyDown,topKeyPress:_.keyPress,topKeyUp:_.keyUp,topLoad:_.load,topMouseDown:_.mouseDown,topMouseMove:_.mouseMove,topMouseOut:_.mouseOut,topMouseOver:_.mouseOver,topMouseUp:_.mouseUp,topPaste:_.paste,topReset:_.reset,topScroll:_.scroll,topSubmit:_.submit,topTouchCancel:_.touchCancel,topTouchEnd:_.touchEnd,topTouchMove:_.touchMove,topTouchStart:_.touchStart,topWheel:_.wheel};for(var N in E)E[N].dependencies=[N];var C={eventTypes:_,executeDispatch:function(e,t,o){var a=r.executeDispatch(e,t,o);"production"!==n.env.NODE_ENV?y("boolean"!=typeof a,"Returning `false` from an event handler is deprecated and will be ignored in a future release. Instead, manually call e.stopPropagation() or e.preventDefault(), as appropriate."):null,a===!1&&(e.stopPropagation(),e.preventDefault())},extractEvents:function(e,t,o,r){var v=E[e];if(!v)return null;var y;switch(e){case g.topInput:case g.topLoad:case g.topError:case g.topReset:case g.topSubmit:y=l;break;case g.topKeyPress:if(0===h(r))return null;case g.topKeyDown:case g.topKeyUp:y=c;break;case g.topBlur:case g.topFocus:y=i;break;case g.topClick:if(2===r.button)return null;case g.topContextMenu:case g.topDoubleClick:case g.topMouseDown:case g.topMouseMove:case g.topMouseOut:case g.topMouseOver:case g.topMouseUp:y=u;break;case g.topDrag:case g.topDragEnd:case g.topDragEnter:case g.topDragExit:case g.topDragLeave:case g.topDragOver:case g.topDragStart:case g.topDrop:y=d;break;case g.topTouchCancel:case g.topTouchEnd:case g.topTouchMove:case g.topTouchStart:y=p;break;case g.topScroll:y=b;break;case g.topWheel:y=m;break;case g.topCopy:case g.topCut:case g.topPaste:y=s}"production"!==n.env.NODE_ENV?f(y,"SimpleEventPlugin: Unhandled event type, `%s`.",e):f(y);var _=y.getPooled(v,o,r);return a.accumulateTwoPhaseDispatches(_),_}};t.exports=C}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./SyntheticClipboardEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticClipboardEvent.js","./SyntheticDragEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticDragEvent.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./SyntheticFocusEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticFocusEvent.js","./SyntheticKeyboardEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticKeyboardEvent.js","./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js","./SyntheticTouchEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticTouchEvent.js","./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./SyntheticWheelEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticWheelEvent.js","./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticClipboardEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),a={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};r.augmentClass(o,a),t.exports=o},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticCompositionEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),a={data:null};r.augmentClass(o,a),t.exports=o},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticDragEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticMouseEvent"),a={dataTransfer:null};r.augmentClass(o,a),t.exports=o},{"./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js":[function(e,t,n){"use strict";function o(e,t,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var r in o)if(o.hasOwnProperty(r)){var a=o[r];a?this[r]=a(n):this[r]=n[r]}var l=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;l?this.isDefaultPrevented=s.thatReturnsTrue:this.isDefaultPrevented=s.thatReturnsFalse,this.isPropagationStopped=s.thatReturnsFalse}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("./emptyFunction"),l=e("./getEventTarget"),i={type:null,target:l,currentTarget:s.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};a(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=s.thatReturnsTrue},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=s.thatReturnsTrue},persist:function(){this.isPersistent=s.thatReturnsTrue},isPersistent:s.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),o.Interface=i,o.augmentClass=function(e,t){var n=this,o=Object.create(n.prototype);a(o,e.prototype),e.prototype=o,e.prototype.constructor=e,e.Interface=a({},n.Interface,t),e.augmentClass=n.augmentClass,r.addPoolingTo(e,r.threeArgumentPooler)},r.addPoolingTo(o,r.threeArgumentPooler),t.exports=o},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticFocusEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),a={relatedTarget:null};r.augmentClass(o,a),t.exports=o},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticInputEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),a={data:null};r.augmentClass(o,a),t.exports=o},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticKeyboardEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),a=e("./getEventCharCode"),s=e("./getEventKey"),l=e("./getEventModifierState"),i={key:s,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:l,charCode:function(e){return"keypress"===e.type?a(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?a(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};r.augmentClass(o,i),t.exports=o},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js","./getEventKey":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventKey.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),a=e("./ViewportMetrics"),s=e("./getEventModifierState"),l={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:s,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+a.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+a.currentScrollTop}};r.augmentClass(o,l),t.exports=o},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./ViewportMetrics":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticTouchEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),a=e("./getEventModifierState"),s={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:a};r.augmentClass(o,s),t.exports=o},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),a=e("./getEventTarget"),s={view:function(e){if(e.view)return e.view;var t=a(e);if(null!=t&&t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};r.augmentClass(o,s),t.exports=o},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticWheelEvent.js":[function(e,t,n){"use strict";function o(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticMouseEvent"),a={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};r.augmentClass(o,a),t.exports=o},{"./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js":[function(e,t,n){(function(n){"use strict";var o=e("./invariant"),r={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,r,a,s,l,i,c){"production"!==n.env.NODE_ENV?o(!this.isInTransaction(),"Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction."):o(!this.isInTransaction());var u,d;try{this._isInTransaction=!0,u=!0,this.initializeAll(0),d=e.call(t,r,a,s,l,i,c),u=!1}finally{try{if(u)try{this.closeAll(0)}catch(p){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return d},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var o=t[n];try{this.wrapperInitData[n]=a.OBSERVED_ERROR,this.wrapperInitData[n]=o.initialize?o.initialize.call(this):null}finally{if(this.wrapperInitData[n]===a.OBSERVED_ERROR)try{this.initializeAll(n+1)}catch(r){}}}},closeAll:function(e){"production"!==n.env.NODE_ENV?o(this.isInTransaction(),"Transaction.closeAll(): Cannot close transaction when none are open."):o(this.isInTransaction());for(var t=this.transactionWrappers,r=e;r<t.length;r++){var s,l=t[r],i=this.wrapperInitData[r];try{s=!0,i!==a.OBSERVED_ERROR&&l.close&&l.close.call(this,i),s=!1}finally{if(s)try{this.closeAll(r+1)}catch(c){}}}this.wrapperInitData.length=0}},a={Mixin:r,OBSERVED_ERROR:{}};t.exports=a}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js":[function(e,t,n){"use strict";var o={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){o.currentScrollLeft=e.x,o.currentScrollTop=e.y}};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js":[function(e,t,n){(function(n){"use strict";function o(e,t){if("production"!==n.env.NODE_ENV?r(null!=t,"accumulateInto(...): Accumulated items must not be null or undefined."):r(null!=t),null==e)return t;var o=Array.isArray(e),a=Array.isArray(t);return o&&a?(e.push.apply(e,t),e):o?(e.push(t),e):a?[e].concat(t):[e,t]}var r=e("./invariant");t.exports=o}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/adler32.js":[function(e,t,n){"use strict";function o(e){for(var t=1,n=0,o=0;o<e.length;o++)t=(t+e.charCodeAt(o))%r,n=(n+t)%r;return t|n<<16}var r=65521;t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/camelize.js":[function(e,t,n){function o(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/camelizeStyleName.js":[function(e,t,n){"use strict";function o(e){return r(e.replace(a,"ms-"))}var r=e("./camelize"),a=/^-ms-/;t.exports=o},{"./camelize":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/camelize.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/containsNode.js":[function(e,t,n){function o(e,t){return e&&t?e===t?!0:r(e)?!1:r(t)?o(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var r=e("./isTextNode");t.exports=o},{"./isTextNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/createArrayFromMixed.js":[function(e,t,n){function o(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function r(e){return o(e)?Array.isArray(e)?e.slice():a(e):[e]}var a=e("./toArray");t.exports=r},{"./toArray":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/toArray.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/createFullPageComponent.js":[function(e,t,n){(function(n){"use strict";function o(e){var t=a.createFactory(e),o=r.createClass({tagName:e.toUpperCase(),displayName:"ReactFullPageComponent"+e,componentWillUnmount:function(){"production"!==n.env.NODE_ENV?s(!1,"%s tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this.constructor.displayName):s(!1)},render:function(){return t(this.props)}});return o}var r=e("./ReactClass"),a=e("./ReactElement"),s=e("./invariant");t.exports=o}).call(this,e("_process"))},{"./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/createNodesFromMarkup.js":[function(e,t,n){(function(n){function o(e){var t=e.match(u);return t&&t[1].toLowerCase()}function r(e,t){var r=c;"production"!==n.env.NODE_ENV?i(!!c,"createNodesFromMarkup dummy not initialized"):i(!!c);var a=o(e),u=a&&l(a);if(u){r.innerHTML=u[1]+e+u[2];for(var d=u[0];d--;)r=r.lastChild}else r.innerHTML=e;var p=r.getElementsByTagName("script");p.length&&("production"!==n.env.NODE_ENV?i(t,"createNodesFromMarkup(...): Unexpected <script> element rendered."):i(t),s(p).forEach(t));for(var b=s(r.childNodes);r.lastChild;)r.removeChild(r.lastChild); return b}var a=e("./ExecutionEnvironment"),s=e("./createArrayFromMixed"),l=e("./getMarkupWrap"),i=e("./invariant"),c=a.canUseDOM?document.createElement("div"):null,u=/^\s*<(\w+)/;t.exports=r}).call(this,e("_process"))},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./createArrayFromMixed":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/createArrayFromMixed.js","./getMarkupWrap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getMarkupWrap.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/dangerousStyleValue.js":[function(e,t,n){"use strict";function o(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var o=isNaN(t);return o||0===t||a.hasOwnProperty(e)&&a[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var r=e("./CSSProperty"),a=r.isUnitlessNumber;t.exports=o},{"./CSSProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSProperty.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js":[function(e,t,n){function o(e){return function(){return e}}function r(){}r.thatReturns=o,r.thatReturnsFalse=o(!1),r.thatReturnsTrue=o(!0),r.thatReturnsNull=o(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyObject.js":[function(e,t,n){(function(e){"use strict";var n={};"production"!==e.env.NODE_ENV&&Object.freeze(n),t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js":[function(e,t,n){"use strict";function o(e){return a[e]}function r(e){return(""+e).replace(s,o)}var a={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},s=/[&><"']/g;t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js":[function(e,t,n){(function(n){"use strict";function o(e){if("production"!==n.env.NODE_ENV){var t=r.current;null!==t&&("production"!==n.env.NODE_ENV?c(t._warnedAboutRefsInRender,"%s is accessing getDOMNode or findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):null,t._warnedAboutRefsInRender=!0)}return null==e?null:i(e)?e:a.has(e)?s.getNodeFromInstance(e):("production"!==n.env.NODE_ENV?l(null==e.render||"function"!=typeof e.render,"Component (with keys: %s) contains `render` method but is not mounted in the DOM",Object.keys(e)):l(null==e.render||"function"!=typeof e.render),void("production"!==n.env.NODE_ENV?l(!1,"Element appears to be neither ReactComponent nor DOMNode (keys: %s)",Object.keys(e)):l(!1)))}var r=e("./ReactCurrentOwner"),a=e("./ReactInstanceMap"),s=e("./ReactMount"),l=e("./invariant"),i=e("./isNode"),c=e("./warning");t.exports=o}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./isNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isNode.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/flattenChildren.js":[function(e,t,n){(function(n){"use strict";function o(e,t,o){var r=e,a=!r.hasOwnProperty(o);"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?s(a,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",o):null),a&&null!=t&&(r[o]=t)}function r(e){if(null==e)return e;var t={};return a(e,o,t),t}var a=e("./traverseAllChildren"),s=e("./warning");t.exports=r}).call(this,e("_process"))},{"./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/focusNode.js":[function(e,t,n){"use strict";function o(e){try{e.focus()}catch(t){}}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js":[function(e,t,n){"use strict";var o=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getActiveElement.js":[function(e,t,n){function o(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js":[function(e,t,n){"use strict";function o(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventKey.js":[function(e,t,n){"use strict";function o(e){if(e.key){var t=a[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?s[e.keyCode]||"Unidentified":""}var r=e("./getEventCharCode"),a={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=o},{"./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js":[function(e,t,n){"use strict";function o(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var o=a[e];return o?!!n[o]:!1}function r(e){return o}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js":[function(e,t,n){"use strict";function o(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js":[function(e,t,n){"use strict";function o(e){var t=e&&(r&&e[r]||e[a]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getMarkupWrap.js":[function(e,t,n){(function(n){function o(e){return"production"!==n.env.NODE_ENV?a(!!s,"Markup wrapping node not initialized"):a(!!s),p.hasOwnProperty(e)||(e="*"),l.hasOwnProperty(e)||("*"===e?s.innerHTML="<link />":s.innerHTML="<"+e+"></"+e+">",l[e]=!s.firstChild),l[e]?p[e]:null}var r=e("./ExecutionEnvironment"),a=e("./invariant"),s=r.canUseDOM?document.createElement("div"):null,l={circle:!0,clipPath:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},i=[1,'<select multiple="true">',"</select>"],c=[1,"<table>","</table>"],u=[3,"<table><tbody><tr>","</tr></tbody></table>"],d=[1,"<svg>","</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:i,option:i,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:u,th:u,circle:d,clipPath:d,defs:d,ellipse:d,g:d,line:d,linearGradient:d,path:d,polygon:d,polyline:d,radialGradient:d,rect:d,stop:d,text:d};t.exports=o}).call(this,e("_process"))},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getNodeForCharacterOffset.js":[function(e,t,n){"use strict";function o(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function a(e,t){for(var n=o(e),a=0,s=0;n;){if(3===n.nodeType){if(s=a+n.textContent.length,t>=a&&s>=t)return{node:n,offset:t-a};a=s}n=o(r(n))}}t.exports=a},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getReactRootElementInContainer.js":[function(e,t,n){"use strict";function o(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js":[function(e,t,n){"use strict";function o(){return!a&&r.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var r=e("./ExecutionEnvironment"),a=null;t.exports=o},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getUnboundedScrollPosition.js":[function(e,t,n){"use strict";function o(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/hyphenate.js":[function(e,t,n){function o(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/hyphenateStyleName.js":[function(e,t,n){"use strict";function o(e){return r(e).replace(a,"-ms-")}var r=e("./hyphenate"),a=/^ms-/;t.exports=o},{"./hyphenate":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/hyphenate.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js":[function(e,t,n){(function(n){"use strict";function o(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function r(e,t){var r;if(null!==e&&e!==!1||(e=s.emptyElement),"object"==typeof e){var a=e;"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?u(a&&("function"==typeof a.type||"string"==typeof a.type),"Only functions or strings can be mounted as React components."):null),r=t===a.type&&"string"==typeof a.type?l.createInternalComponent(a):o(a.type)?new a.type(a):new d}else"string"==typeof e||"number"==typeof e?r=l.createInstanceForText(e):"production"!==n.env.NODE_ENV?c(!1,"Encountered invalid React node of type %s",typeof e):c(!1);return"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?u("function"==typeof r.construct&&"function"==typeof r.mountComponent&&"function"==typeof r.receiveComponent&&"function"==typeof r.unmountComponent,"Only React Components can be mounted."):null),r.construct(e),r._mountIndex=0,r._mountImage=null,"production"!==n.env.NODE_ENV&&(r._isOwnerNecessary=!1,r._warnedAboutRefsInRender=!1),"production"!==n.env.NODE_ENV&&Object.preventExtensions&&Object.preventExtensions(r),r}var a=e("./ReactCompositeComponent"),s=e("./ReactEmptyComponent"),l=e("./ReactNativeComponent"),i=e("./Object.assign"),c=e("./invariant"),u=e("./warning"),d=function(){};i(d.prototype,a.Mixin,{_instantiateReactComponent:r}),t.exports=r}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCompositeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCompositeComponent.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js":[function(e,t,n){(function(e){"use strict";var n=function(t,n,o,r,a,s,l,i){if("production"!==e.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!t){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[o,r,a,s,l,i],d=0;c=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return u[d++]}))}throw c.framesToPop=1,c}};t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js":[function(e,t,n){"use strict";function o(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,o=n in document;if(!o){var s=document.createElement("div");s.setAttribute(n,"return;"),o="function"==typeof s[n]}return!o&&r&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}var r,a=e("./ExecutionEnvironment");a.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=o},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isNode.js":[function(e,t,n){function o(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js":[function(e,t,n){"use strict";function o(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextNode.js":[function(e,t,n){function o(e){return r(e)&&3==e.nodeType}var r=e("./isNode");t.exports=o},{"./isNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyMirror.js":[function(e,t,n){(function(n){"use strict";var o=e("./invariant"),r=function(e){var t,r={};"production"!==n.env.NODE_ENV?o(e instanceof Object&&!Array.isArray(e),"keyMirror(...): Argument must be an object."):o(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/keyOf.js":[function(e,t,n){var o=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/mapObject.js":[function(e,t,n){"use strict";function o(e,t,n){if(!e)return null;var o={};for(var a in e)r.call(e,a)&&(o[a]=t.call(n,e[a],a,e));return o}var r=Object.prototype.hasOwnProperty;t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/memoizeStringOnly.js":[function(e,t,n){"use strict";function o(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/onlyChild.js":[function(e,t,n){(function(n){"use strict";function o(e){return"production"!==n.env.NODE_ENV?a(r.isValidElement(e),"onlyChild must be passed a children with exactly one child."):a(r.isValidElement(e)),e}var r=e("./ReactElement"),a=e("./invariant");t.exports=o}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/performance.js":[function(e,t,n){"use strict";var o,r=e("./ExecutionEnvironment");r.canUseDOM&&(o=window.performance||window.msPerformance||window.webkitPerformance),t.exports=o||{}},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/performanceNow.js":[function(e,t,n){var o=e("./performance");o&&o.now||(o=Date);var r=o.now.bind(o);t.exports=r},{"./performance":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/performance.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/quoteAttributeValueForBrowser.js":[function(e,t,n){"use strict";function o(e){return'"'+r(e)+'"'}var r=e("./escapeTextContentForBrowser");t.exports=o},{"./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js":[function(e,t,n){"use strict";var o=e("./ExecutionEnvironment"),r=/^[ \r\n\t\f]/,a=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,s=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(s=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),o.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(s=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&a.test(t)){e.innerHTML="\ufeff"+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=s},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setTextContent.js":[function(e,t,n){"use strict";var o=e("./ExecutionEnvironment"),r=e("./escapeTextContentForBrowser"),a=e("./setInnerHTML"),s=function(e,t){e.textContent=t};o.canUseDOM&&("textContent"in document.documentElement||(s=function(e,t){a(e,r(t))})),t.exports=s},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shallowEqual.js":[function(e,t,n){"use strict";function o(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=o},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js":[function(e,t,n){(function(n){"use strict";function o(e,t){if(null!=e&&null!=t){var o=typeof e,a=typeof t;if("string"===o||"number"===o)return"string"===a||"number"===a;if("object"===a&&e.type===t.type&&e.key===t.key){var s=e._owner===t._owner,l=null,i=null,c=null;return"production"!==n.env.NODE_ENV&&(s||(null!=e._owner&&null!=e._owner.getPublicInstance()&&null!=e._owner.getPublicInstance().constructor&&(l=e._owner.getPublicInstance().constructor.displayName),null!=t._owner&&null!=t._owner.getPublicInstance()&&null!=t._owner.getPublicInstance().constructor&&(i=t._owner.getPublicInstance().constructor.displayName),null!=t.type&&null!=t.type.displayName&&(c=t.type.displayName),null!=t.type&&"string"==typeof t.type&&(c=t.type),"string"==typeof t.type&&"input"!==t.type&&"textarea"!==t.type||(null!=e._owner&&e._owner._isOwnerNecessary===!1||null!=t._owner&&t._owner._isOwnerNecessary===!1)&&(null!=e._owner&&(e._owner._isOwnerNecessary=!0),null!=t._owner&&(t._owner._isOwnerNecessary=!0),"production"!==n.env.NODE_ENV?r(!1,"<%s /> is being rendered by both %s and %s using the same key (%s) in the same place. Currently, this means that they don't preserve state. This behavior should be very rare so we're considering deprecating it. Please contact the React team and explain your use case so that we can take that into consideration.",c||"Unknown Component",l||"[Unknown]",i||"[Unknown]",e.key):null))),s}}return!1}var r=e("./warning");t.exports=o}).call(this,e("_process"))},{"./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/toArray.js":[function(e,t,n){(function(n){function o(e){var t=e.length;if("production"!==n.env.NODE_ENV?r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e),"toArray: Array-like object expected"):r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),"production"!==n.env.NODE_ENV?r("number"==typeof t,"toArray: Object needs a length property"):r("number"==typeof t),"production"!==n.env.NODE_ENV?r(0===t||t-1 in e,"toArray: Object should have keys for indices"):r(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(o){}for(var a=Array(t),s=0;t>s;s++)a[s]=e[s];return a}var r=e("./invariant");t.exports=o}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js":[function(e,t,n){(function(n){"use strict";function o(e){return v[e]}function r(e,t){return e&&null!=e.key?s(e.key):t.toString(36)}function a(e){return(""+e).replace(y,o)}function s(e){return"$"+a(e)}function l(e,t,o,a,i){var d=typeof e;if("undefined"!==d&&"boolean"!==d||(e=null),null===e||"string"===d||"number"===d||c.isValidElement(e))return a(i,e,""===t?h+r(e,0):t,o),1;var v,y,_,E=0;if(Array.isArray(e))for(var N=0;N<e.length;N++)v=e[N],y=(""!==t?t+f:h)+r(v,N),_=o+E,E+=l(v,y,_,a,i);else{var C=p(e);if(C){var R,O=C.call(e);if(C!==e.entries)for(var w=0;!(R=O.next()).done;)v=R.value,y=(""!==t?t+f:h)+r(v,w++),_=o+E,E+=l(v,y,_,a,i);else for("production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?m(g,"Using Maps as children is not yet fully supported. It is an experimental feature that might be removed. Convert it to a sequence / iterable of keyed ReactElements instead."):null,g=!0);!(R=O.next()).done;){var U=R.value;U&&(v=U[1],y=(""!==t?t+f:h)+s(U[0])+f+r(v,0),_=o+E,E+=l(v,y,_,a,i))}}else if("object"===d){"production"!==n.env.NODE_ENV?b(1!==e.nodeType,"traverseAllChildren(...): Encountered an invalid child; DOM elements are not valid children of React components."):b(1!==e.nodeType);var j=u.extract(e);for(var D in j)j.hasOwnProperty(D)&&(v=j[D],y=(""!==t?t+f:h)+s(D)+f+r(v,0),_=o+E,E+=l(v,y,_,a,i))}}return E}function i(e,t,n){return null==e?0:l(e,"",0,t,n)}var c=e("./ReactElement"),u=e("./ReactFragment"),d=e("./ReactInstanceHandles"),p=e("./getIteratorFn"),b=e("./invariant"),m=e("./warning"),h=d.SEPARATOR,f=":",v={"=":"=0",".":"=1",":":"=2"},y=/[=.:]/g,g=!1;t.exports=i}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactFragment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/warning.js":[function(e,t,n){(function(n){"use strict";var o=e("./emptyFunction"),r=o;"production"!==n.env.NODE_ENV&&(r=function(e,t){for(var n=[],o=2,r=arguments.length;r>o;o++)n.push(arguments[o]);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(0!==t.indexOf("Failed Composite propType: ")&&!e){var a=0,s="Warning: "+t.replace(/%s/g,function(){return n[a++]});console.warn(s);try{throw new Error(s)}catch(l){}}}),t.exports=r}).call(this,e("_process"))},{"./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/emptyFunction.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js":[function(e,t,n){t.exports=e("./lib/React")},{"./lib/React":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/React.js"}],"/Users/allen/Node/react-bootstrap-table/src/BootstrapTable.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function y(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:y(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("classnames")),u=o(e("./Const")),d=o(e("./TableHeader")),p=o(e("./TableBody")),b=o(e("./pagination/PaginationList")),m=o(e("./toolbar/ToolBar")),h=o(e("./TableFilter")),f=e("./store/TableDataStore").TableDataStore,v=function(e){function t(e){var n=this;l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._attachCellEditFunc(),this.sortTable=!1,this.order=u.SORT_DESC,this.sortField=null;var o=null;if(this.props.children.forEach(function(e){if(e.props.dataSort&&(this.sortTable=!0),e.props.isKey){if(null!=o)throw"Error. Multiple key column be detected in TableHeaderColumn.";o=e.props.dataField}},this),null==o)throw"Error. No any key column defined in TableHeaderColumn. Use 'isKey={true}' to specify an unique column after version 0.5.4.";Array.isArray(this.props.data)?this.store=new f(this.props.data):(this.store=new f(this.props.data.getData()),this.props.data.clear(),this.props.data.on("change",function(e){n.store.setData(e),n.setState({data:n.getTableData()})}.bind(this))),this.store.setProps(this.props.pagination,o),this.state={data:this.getTableData()}}return s(t,e),r(t,{getTableData:{value:function(){var e=[];return e=this.props.pagination?this.store.page(1,u.SIZE_PER_PAGE).get():this.store.get()}},componentDidMount:{value:function(){this._adjustHeaderWidth(),window.addEventListener("resize",this._adjustHeaderWidth.bind(this))}},componentWillUnmount:{value:function(){window.removeEventListener("resize",this._adjustHeaderWidth.bind(this))}},componentDidUpdate:{value:function(){this._adjustHeaderWidth(),this._attachCellEditFunc(),this.props.options.afterTableComplete&&this.props.options.afterTableComplete()}},_attachCellEditFunc:{value:function(){this.props.cellEdit&&(this.props.cellEdit.__onCompleteEdit__=this.handleEditCell.bind(this),this.props.cellEdit.mode!==u.CELL_EDIT_NONE&&(this.props.selectRow.clickToSelect=!1))}},render:{value:function(){var e=c("react-bs-table"),t={height:this.props.height},n=this.props.children.map(function(e,t){return{name:e.props.dataField,align:e.props.dataAlign,sort:e.props.dataSort,format:e.props.dataFormat,editable:e.props.editable,hidden:e.props.hidden,className:e.props.className,width:e.props.width,index:t}},this),o=this.renderPagination(),r=this.renderToolBar(),a=this.renderTableFilter(n);return i.createElement("div",{className:"react-bs-container"},r,i.createElement("div",{ref:"table",style:t,className:e},i.createElement(d,{rowSelectType:this.props.selectRow.mode,sortName:this.props.options.sortName,sortOrder:this.props.options.sortOrder,onSort:this.handleSort.bind(this),onSelectAllRow:this.handleSelectAllRow.bind(this)},this.props.children),i.createElement(p,{ref:"body",data:this.state.data,columns:n,striped:this.props.striped,hover:this.props.hover,keyField:this.store.getKeyField(),condensed:this.props.condensed,selectRow:this.props.selectRow,cellEdit:this.props.cellEdit}),a),o)}},handleSort:{value:function(e,t){var n=this.store.sort(e,t).get();this.setState({data:n})}},handlePaginationData:{value:function(e,t){var n=this.store.page(e,t).get();this.setState({data:n})}},handleSelectAllRow:{value:function(e){var t=e.currentTarget.checked;if(t){var n=this.store.getAllRowkey();this.props.selectRow.__onSelectAll__(n)}else this.props.selectRow.__onSelectAll__([])}},handleEditCell:{value:function(e,t,n){var o=void 0;this.props.children.forEach(function(e,t){return t==n?(o=e.props.dataField,!1):void 0});var r=this.store.edit(e,t,o).get();this.setState({data:r}),this.props.cellEdit.afterSaveCell&&this.props.cellEdit.afterSaveCell(this.state.data[t],o,e)}},handleAddRow:{value:function(e){var t=void 0;try{this.store.add(e)}catch(n){return n}if(this.props.pagination){var o=this.refs.pagination.getSizePerPage(),r=Math.ceil(this.store.getDataNum()/o);t=this.store.page(r,o).get(),this.setState({data:t}),this.refs.pagination.changePage(r)}else t=this.store.get(),this.setState({data:t})}},handleDropRow:{value:function(){var e=void 0;if(this.store.remove(this.refs.body.getSelectedRowKeys()),this.props.pagination){var t=this.refs.pagination.getSizePerPage(),n=Math.ceil(this.store.getDataNum()/t),o=this.refs.pagination.getCurrentPage();o>n&&(o=n),e=this.store.page(o,t).get(), this.setState({data:e}),this.refs.pagination.changePage(o)}else e=this.store.get(),this.setState({data:e})}},handleFilterData:{value:function(e){this.store.filter(e);var t=void 0;if(this.props.pagination){var n=this.refs.pagination.getSizePerPage();t=this.store.page(1,n).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.setState({data:t})}},handleSearch:{value:function(e){this.store.search(e);var t=void 0;if(this.props.pagination){var n=this.refs.pagination.getSizePerPage();t=this.store.page(1,n).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.setState({data:t})}},_adjustHeaderWidth:{value:function(){this.refs.table.getDOMNode().childNodes[0].childNodes[0].style.width=this.refs.table.getDOMNode().childNodes[1].childNodes[0].offsetWidth-1+"px"}},renderPagination:{value:function(){return this.props.pagination?i.createElement("div",null,i.createElement(b,{ref:"pagination",changePage:this.handlePaginationData.bind(this),sizePerPage:u.SIZE_PER_PAGE,dataSize:this.store.getDataNum()})):null}},renderToolBar:{value:function(){var e=this.props.children.map(function(e){return{name:e.props.children,field:e.props.dataField}});return this.props.insertRow||this.props.deleteRow||this.props.search?i.createElement("div",{className:"tool-bar"},i.createElement(m,{enableInsert:this.props.insertRow,enableDelete:this.props.deleteRow,enableSearch:this.props.search,columns:e,onAddRow:this.handleAddRow.bind(this),onDropRow:this.handleDropRow.bind(this),onSearch:this.handleSearch.bind(this)})):null}},renderTableFilter:{value:function(e){return this.props.columnFilter?i.createElement(h,{columns:e,rowSelectType:this.props.selectRow.mode,onFilter:this.handleFilterData.bind(this)}):null}}}),t}(i.Component);v.propTypes={height:i.PropTypes.string,data:i.PropTypes.array,striped:i.PropTypes.bool,hover:i.PropTypes.bool,condensed:i.PropTypes.bool,pagination:i.PropTypes.bool,selectRow:i.PropTypes.shape({mode:i.PropTypes.string,bgColor:i.PropTypes.string,selected:i.PropTypes.array,onSelect:i.PropTypes.func,onSelectAll:i.PropTypes.func,clickToSelect:i.PropTypes.bool,clickToSelectAndEditCell:i.PropTypes.bool}),cellEdit:i.PropTypes.shape({mode:i.PropTypes.string,blurToSave:i.PropTypes.bool,afterSaveCell:i.PropTypes.func}),insertRow:i.PropTypes.bool,deleteRow:i.PropTypes.bool,search:i.PropTypes.bool,columnFilter:i.PropTypes.bool,options:i.PropTypes.shape({sortName:i.PropTypes.string,sortOrder:i.PropTypes.string,afterTableComplete:i.PropTypes.func})},v.defaultProps={height:"100%",striped:!1,hover:!1,condensed:!1,pagination:!1,selectRow:{mode:u.ROW_SELECT_NONE,bgColor:u.ROW_SELECT_BG_COLOR,selected:[],onSelect:void 0,onSelectAll:void 0,clickToSelect:!1,clickToSelectAndEditCell:!1},cellEdit:{mode:u.CELL_EDIT_NONE,blurToSave:!1,afterTableComplete:void 0},insertRow:!1,deleteRow:!1,search:!1,columnFilter:!1,options:{sortName:null,sortOrder:u.SORT_DESC}},t.exports=v},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./TableBody":"/Users/allen/Node/react-bootstrap-table/src/TableBody.js","./TableFilter":"/Users/allen/Node/react-bootstrap-table/src/TableFilter.js","./TableHeader":"/Users/allen/Node/react-bootstrap-table/src/TableHeader.js","./pagination/PaginationList":"/Users/allen/Node/react-bootstrap-table/src/pagination/PaginationList.js","./store/TableDataStore":"/Users/allen/Node/react-bootstrap-table/src/store/TableDataStore.js","./toolbar/ToolBar":"/Users/allen/Node/react-bootstrap-table/src/toolbar/ToolBar.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/Const.js":[function(e,t,n){"use strict";t.exports={SORT_DESC:"desc",SORT_ASC:"asc",SIZE_PER_PAGE:10,SIZE_PER_LIST:5,NEXT_PAGE:">",LAST_PAGE:">>",PRE_PAGE:"<",FIRST_PAGE:"<<",ROW_SELECT_BG_COLOR:"",ROW_SELECT_NONE:"none",ROW_SELECT_SINGLE:"radio",ROW_SELECT_MULTI:"checkbox",CELL_EDIT_NONE:"none",CELL_EDIT_CLICK:"click",CELL_EDIT_DBCLICK:"dbclick"}},{}],"/Users/allen/Node/react-bootstrap-table/src/SelectRowHeaderColumn.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),i=(o(e("classnames")),o(e("./Const")),function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{render:{value:function(){var e={width:35};return l.createElement("th",{style:e},l.createElement("div",{className:"th-inner table-header-column"},this.props.children))}}}),t}(l.Component));t.exports=i},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableBody.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function h(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:h(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("./Const")),u=o(e("./TableRow")),d=o(e("./TableColumn")),p=o(e("./TableEditColumn")),b=o(e("classnames")),m=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={currEditCell:null,selectedRowKey:this._getSelectedKeyFromProp(e)},this._attachRowSelectFunc(),this.editing=!1}return s(t,e),r(t,{componentDidUpdate:{value:function(e,t){this.props.selectRow.selected=this.state.selectedRowKey,this._attachRowSelectFunc()}},componentWillReceiveProps:{value:function(e){var t=!e.selectRow.selected;if(t=e.selectRow.selected.length!=this.state.selectedRowKey.length,!t)for(var n=0;n<e.selectRow.selected.length;n++)if(-1==this.state.selectedRowKey.indexOf(e.selectRow.selected[n])){t=!0;break}t&&this.setState({selectedRowKey:this._getSelectedKeyFromProp(e)})}},_getSelectedKeyFromProp:{value:function(e){var t=e.selectRow.selected||[];return e.selectRow.mode===c.ROW_SELECT_SINGLE&&e.selectRow.selected&&(t=e.selectRow.selected.length>0?[e.selectRow.selected[0]]:[]),t}},_attachRowSelectFunc:{value:function(){this.props.selectRow&&(this.props.selectRow.__onSelect__=this.handleSelectRow.bind(this),this.props.selectRow.__onSelectAll__=this.handleSelectAllRow.bind(this))}},render:{value:function(){var e=b("table-container"),t=b("table","table-bordered",{"table-striped":this.props.striped,"table-hover":this.props.hover,"table-condensed":this.props.condensed}),n=this._isSelectRowDefined(),o=this.renderTableHeader(n),r=this.props.data.map(function(e,t){var o=this.props.columns.map(function(n,o){var r=e[n.name];if(this.editing&&n.name!==this.props.keyField&&n.editable&&null!=this.state.currEditCell&&this.state.currEditCell.rid==t&&this.state.currEditCell.cid==o)return i.createElement(p,{completeEdit:this.handleCompleteEditCell.bind(this),key:o,blurToSave:this.props.cellEdit.blurToSave,rowIndex:t,colIndex:o},r);if("undefined"!=typeof n.format){var a=n.format(r,e);return i.isValidElement(a)||(a=i.createElement("div",{dangerouslySetInnerHTML:{__html:a}})),i.createElement(d,{dataAlign:n.align,key:o,className:n.className,cellEdit:this.props.cellEdit,onEdit:this.handleEditCell.bind(this),width:n.width},a)}return i.createElement(d,{dataAlign:n.align,key:o,className:n.className,cellEdit:this.props.cellEdit,hidden:n.hidden,onEdit:this.handleEditCell.bind(this),width:n.width},r)},this),r=-1!=this.state.selectedRowKey.indexOf(e[this.props.keyField]),a=n?this.renderSelectRowColumn(r):null;return i.createElement(u,{isSelected:r,key:t,selectRow:n?this.props.selectRow:void 0,enableCellEdit:this.props.cellEdit.mode!==c.CELL_EDIT_NONE},a,o)},this);return this.editing=!1,i.createElement("div",{className:e},i.createElement("table",{className:t},o,i.createElement("tbody",null,r)))}},renderTableHeader:{value:function(e){var t=null;if(e){var n={width:35};t=i.createElement("th",{style:n,key:-1})}var o=this.props.columns.map(function(e,t){var n={display:e.hidden?"none":null,width:e.width};return i.createElement("th",{style:n,key:t})});return i.createElement("thead",null,i.createElement("tr",null,t,o))}},handleSelectRow:{value:function(e,t){var n,o;this.props.data.forEach(function(t,r){r==e-1&&(n=t[this.props.keyField],o=t)},this);var r=this.state.selectedRowKey;this.props.selectRow.mode==c.ROW_SELECT_SINGLE&&(r=[]),t?r.push(n):r=r.filter(function(e){return n!==e}),this.setState({selectedRowKey:r}),this.props.selectRow.onSelect&&this.props.selectRow.onSelect(o,t)}},handleSelectAllRow:{value:function(e){this.setState({selectedRowKey:e}),this.props.selectRow.onSelectAll&&this.props.selectRow.onSelectAll(0!=e.length)}},handleSelectRowColumChange:{value:function(e){this.props.selectRow.clickToSelect&&this.props.selectRow.clickToSelectAndEditCell||this.props.selectRow.__onSelect__(e.currentTarget.parentElement.parentElement.rowIndex,e.currentTarget.checked)}},handleEditCell:{value:function(e,t){this.editing=!0,this._isSelectRowDefined()&&t--,e--;var n={currEditCell:{rid:e,cid:t}};if(this.props.selectRow.clickToSelectAndEditCell){var o=-1!=this.state.selectedRowKey.indexOf(this.props.data[e][this.props.keyField]);this.handleSelectRow(e+1,!o)}this.setState(n)}},handleCompleteEditCell:{value:function(e,t,n){this.setState({currEditCell:null}),null!=e&&this.props.cellEdit.__onCompleteEdit__(e,t,n)}},renderSelectRowColumn:{value:function(e){return this.props.selectRow.mode==c.ROW_SELECT_SINGLE?i.createElement(d,null,i.createElement("input",{type:"radio",name:"selection",checked:e,onChange:this.handleSelectRowColumChange.bind(this)})):i.createElement(d,null,i.createElement("input",{type:"checkbox",checked:e,onChange:this.handleSelectRowColumChange.bind(this)}))}},_isSelectRowDefined:{value:function(){return this.props.selectRow.mode==c.ROW_SELECT_SINGLE||this.props.selectRow.mode==c.ROW_SELECT_MULTI}},getSelectedRowKeys:{value:function(){return this.state.selectedRowKey}}}),t}(i.Component);m.propTypes={data:i.PropTypes.array,columns:i.PropTypes.array,striped:i.PropTypes.bool,hover:i.PropTypes.bool,condensed:i.PropTypes.bool,keyField:i.PropTypes.string},t.exports=m},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./TableColumn":"/Users/allen/Node/react-bootstrap-table/src/TableColumn.js","./TableEditColumn":"/Users/allen/Node/react-bootstrap-table/src/TableEditColumn.js","./TableRow":"/Users/allen/Node/react-bootstrap-table/src/TableRow.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableColumn.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function p(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:p(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=o(e("react")),u=o(e("./Const")),d=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e)}return s(t,e),r(t,{handleCellEdit:{value:function(e){if(this.props.cellEdit.mode==u.CELL_EDIT_DBCLICK)if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var t=window.getSelection();t.removeAllRanges()}this.props.onEdit(e.currentTarget.parentElement.rowIndex,e.currentTarget.cellIndex)}},render:{value:function(){var e={textAlign:this.props.dataAlign,display:this.props.hidden?"none":null},t={};return this.props.cellEdit&&(this.props.cellEdit.mode==u.CELL_EDIT_CLICK?t.onClick=this.handleCellEdit.bind(this):this.props.cellEdit.mode==u.CELL_EDIT_DBCLICK&&(t.onDoubleClick=this.handleCellEdit.bind(this))),c.createElement("td",i({style:e,className:this.props.className},t),this.props.children)}}}),t}(c.Component);d.propTypes={dataAlign:c.PropTypes.string,hidden:c.PropTypes.bool,className:c.PropTypes.string},d.defaultProps={dataAlign:"left",hidden:!1,className:""},t.exports=d},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableEditColumn.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),i=(o(e("./Const")),function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{handleKeyPress:{value:function(e){13==e.keyCode?this.props.completeEdit(e.currentTarget.value,this.props.rowIndex,this.props.colIndex):27==e.keyCode&&this.props.completeEdit(null,this.props.rowIndex,this.props.colIndex)}},handleBlur:{value:function(e){this.props.blurToSave&&this.props.completeEdit(e.currentTarget.value,this.props.rowIndex,this.props.colIndex)}},componentDidMount:{value:function(){var e=this.refs.inputRef.getDOMNode();e.value=this.props.children,e.focus()}},render:{value:function(){return l.createElement("td",null,l.createElement("input",{ref:"inputRef",type:"text",onKeyDown:this.handleKeyPress.bind(this),onBlur:this.handleBlur.bind(this)}))}}}),t}(l.Component));i.propTypes={completeEdit:l.PropTypes.func,rowIndex:l.PropTypes.number,colIndex:l.PropTypes.number,blurToSave:l.PropTypes.bool},t.exports=i},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableFilter.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function p(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:p(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("./Const")),u=o(e("classnames")),d=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.filterObj={}}return s(t,e),r(t,{handleKeyUp:{value:function(e){""===e.currentTarget.value.trim()?delete this.filterObj[e.currentTarget.name]:this.filterObj[e.currentTarget.name]=e.currentTarget.value,this.props.onFilter(this.filterObj)}},render:{value:function(){var e=u("table",{"table-striped":this.props.striped,"table-condensed":this.props.condensed}),t=null;if(this.props.rowSelectType==c.ROW_SELECT_SINGLE||this.props.rowSelectType==c.ROW_SELECT_MULTI){var n={width:35,paddingLeft:0,paddingRight:0};t=i.createElement("th",{style:n,key:-1},"Filter")}var o=this.props.columns.map(function(e){var t={display:e.hidden?"none":null,width:e.width};return i.createElement("th",{style:t},i.createElement("div",{className:"th-inner table-header-column"},i.createElement("input",{type:"text",placeholder:e.name,name:e.name,onKeyUp:this.handleKeyUp.bind(this)})))},this);return i.createElement("table",{className:e,style:{marginTop:5}},i.createElement("thead",null,i.createElement("tr",{style:{borderBottomStyle:"hidden"}},t,o)))}}}),t}(i.Component);d.propTypes={columns:i.PropTypes.array,rowSelectType:i.PropTypes.string,onFilter:i.PropTypes.func},t.exports=d},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableHeader.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function m(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:m(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("./Const")),u=o(e("./util")),d=o(e("classnames")),p=o(e("./SelectRowHeaderColumn")),b=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._attachClearSortCaretFunc()}return s(t,e),r(t,{clearSortCaret:{value:function(e,t){for(var n=this.refs.header.getDOMNode(),o=0;o<n.childElementCount;o++){var r=n.childNodes[o].childNodes[0];r.getElementsByClassName("order").length>0&&r.removeChild(r.getElementsByClassName("order")[0])}this.props.onSort(e,t)}},componentDidMount:{value:function(){if(null!==this.props.sortName){this.clearSortCaret(this.props.sortOrder,this.props.sortName);for(var e=this.refs.header.getDOMNode(),t=0;t<e.childElementCount;t++){var n=e.childNodes[t].childNodes[0];if(n.getAttribute("data-field")===this.props.sortName){n.appendChild(u.renderSortCaret(this.props.sortOrder));break}}}}},componentDidUpdate:{value:function(e,t){this._attachClearSortCaretFunc()}},render:{value:function(){var e=d("table-header"),t=this.renderSelectRowHeader();return i.createElement("div",{className:e},i.createElement("table",{className:"table table-hover table-bordered"},i.createElement("thead",null,i.createElement("tr",{ref:"header"},t,this.props.children))))}},renderSelectRowHeader:{value:function(){return this.props.rowSelectType==c.ROW_SELECT_SINGLE?i.createElement(p,null):this.props.rowSelectType==c.ROW_SELECT_MULTI?i.createElement(p,null,i.createElement("input",{type:"checkbox",onChange:this.props.onSelectAllRow})):null}},_attachClearSortCaretFunc:{value:function(){this.props.children.forEach(function(e){e.props.clearSortCaret=this.clearSortCaret.bind(this)},this)}}}),t}(i.Component);b.propTypes={rowSelectType:i.PropTypes.string,onSort:i.PropTypes.func,onSelectAllRow:i.PropTypes.func,sortName:i.PropTypes.string,sortOrder:i.PropTypes.string},b.defaultProps={},t.exports=b},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./SelectRowHeaderColumn":"/Users/allen/Node/react-bootstrap-table/src/SelectRowHeaderColumn.js","./util":"/Users/allen/Node/react-bootstrap-table/src/util.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableHeaderColumn.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),i=o(e("classnames")),c=o(e("./Const")),u=o(e("./util")),d=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{handleColumnClick:{value:function(e){if(this.props.dataSort){var t=this.refs.innerDiv.getDOMNode();this.order=this.order==c.SORT_DESC?c.SORT_ASC:c.SORT_DESC,this.props.clearSortCaret(this.order,this.props.dataField),t.appendChild(u.renderSortCaret(this.order))}}},componentDidMount:{value:function(){this.refs.innerDiv.getDOMNode().setAttribute("data-field",this.props.dataField)}},render:{value:function(){var e={textAlign:this.props.dataAlign,display:this.props.hidden?"none":null,width:this.props.width},t=i(this.props.dataSort?"sort-column":"");return l.createElement("th",{className:t,style:e},l.createElement("div",{ref:"innerDiv",className:"th-inner table-header-column",onClick:this.handleColumnClick.bind(this)},this.props.children))}}}),t}(l.Component);d.propTypes={dataField:l.PropTypes.string,dataAlign:l.PropTypes.string,dataSort:l.PropTypes.bool,clearSortCaret:l.PropTypes.func,dataFormat:l.PropTypes.func,isKey:l.PropTypes.bool,editable:l.PropTypes.bool,hidden:l.PropTypes.bool,className:l.PropTypes.string,width:l.PropTypes.string},d.defaultProps={dataAlign:"left",dataSort:!1,dataFormat:void 0,isKey:!1,editable:!0,clearSortCaret:void 0,hidden:!1,className:"",width:null},t.exports=d},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./util":"/Users/allen/Node/react-bootstrap-table/src/util.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableRow.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),i=(o(e("./Const")),function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{rowClick:{value:function(e){this.props.selectRow.__onSelect__(e.currentTarget.rowIndex,!this.props.isSelected)}},render:{value:function(){var e={backgroundColor:this.props.isSelected?this.props.selectRow.bgColor:null};return this.props.selectRow&&!this.props.enableCellEdit&&(this.props.selectRow.clickToSelect||this.props.selectRow.clickToSelectAndEditCell)?l.createElement("tr",{style:e,onClick:this.rowClick.bind(this)},this.props.children):l.createElement("tr",{style:e},this.props.children)}}}),t}(l.Component));i.propTypes={isSelected:l.PropTypes.bool,enableCellEdit:l.PropTypes.bool},t.exports=i},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/pagination/PageButton.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function d(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:d(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("classnames")),u=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e)}return s(t,e),r(t,{pageBtnClick:{value:function(e){e.preventDefault(),this.props.changePage(e.currentTarget.text)}},render:{value:function(){var e=this.props.active?c("active"):null;return i.createElement("li",{className:e},i.createElement("a",{href:"#",onClick:this.pageBtnClick.bind(this)},this.props.children))}}}),t}(i.Component);u.propTypes={changePage:i.PropTypes.func,active:i.PropTypes.bool},t.exports=u},{classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/pagination/PaginationList.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function p(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:p(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("./PageButton.js")),u=o(e("../Const")),d=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.sizePerList=u.SIZE_PER_LIST,this.state={currentPage:1,sizePerPage:this.props.sizePerPage}}return s(t,e),r(t,{changePage:{value:function(e){e=e==u.PRE_PAGE?this.state.currentPage-1<1?1:this.state.currentPage-1:e==u.NEXT_PAGE?this.state.currentPage+1>this.totalPages?this.totalPages:this.state.currentPage+1:e==u.LAST_PAGE?this.totalPages:e==u.FIRST_PAGE?1:parseInt(e),e!=this.state.currentPage&&(this.setState({currentPage:e}),this.props.changePage(e,this.state.sizePerPage))}},changeSizePerPage:{value:function(e){e.preventDefault();var t=parseInt(e.currentTarget.text);t!=this.state.sizePerPage&&(this.totalPages=Math.ceil(this.props.dataSize/t),this.state.currentPage>this.totalPages&&(this.state.currentPage=this.totalPages),this.setState({sizePerPage:t,currentPage:this.state.currentPage}),this.props.changePage(this.state.currentPage,t))}},render:{value:function(){this.totalPages=Math.ceil(this.props.dataSize/this.state.sizePerPage);var e=this.makePage(),t={marginTop:"0px"};return i.createElement("div",{className:"row"},i.createElement("div",{className:"col-md-1"},i.createElement("div",{className:"dropdown"},i.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"pageDropDown","data-toggle":"dropdown","aria-expanded":"true"},this.state.sizePerPage,i.createElement("span",{className:"caret"})),i.createElement("ul",{className:"dropdown-menu",role:"menu","aria-labelledby":"pageDropDown"},i.createElement("li",{role:"presentation"},i.createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"10")),i.createElement("li",{role:"presentation"},i.createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"25")),i.createElement("li",{role:"presentation"},i.createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"30")),i.createElement("li",{role:"presentation"},i.createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"50"))))),i.createElement("div",{className:"col-md-6"},i.createElement("ul",{className:"pagination",style:t},e)))}},makePage:{value:function(){var e=this.getPages();return e.map(function(e){var t=e==this.state.currentPage;return i.createElement(c,{changePage:this.changePage.bind(this),active:t,key:e},e)},this)}},getPages:{value:function(){var e=1,t=this.totalPages;e=Math.max(this.state.currentPage-Math.floor(this.sizePerList/2),1),t=e+this.sizePerList-1,t>this.totalPages&&(t=this.totalPages,e=t-this.sizePerList+1);for(var n=[u.FIRST_PAGE,u.PRE_PAGE],o=e;t>=o;o++)o>0&&n.push(o);return n.push(u.NEXT_PAGE),n.push(u.LAST_PAGE),n}},getCurrentPage:{value:function(){return this.state.currentPage}},getSizePerPage:{value:function(){return this.state.sizePerPage}}}),t}(i.Component);d.propTypes={sizePerPage:i.PropTypes.number,dataSize:i.PropTypes.number,changePage:i.PropTypes.func},d.defaultProps={sizePerPage:u.SIZE_PER_PAGE},t.exports=d},{"../Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./PageButton.js":"/Users/allen/Node/react-bootstrap-table/src/pagination/PageButton.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/store/TableDataStore.js":[function(e,t,n){"use strict";function o(e,t,n){return n=n.toLowerCase(),e.sort(function(e,o){return n==c.SORT_DESC?e[t]>o[t]?-1:e[t]<o[t]?1:0:e[t]<o[t]?-1:e[t]>o[t]?1:0}),e}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n), o&&e(t,o),t}}(),s=function d(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:d(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},l=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(e("../Const")),u=e("events").EventEmitter;n.TableDataSet=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.data=e}return l(t,e),a(t,{setData:{value:function(e){this.emit("change",e)}},clear:{value:function(){this.data=null}},getData:{value:function(){return this.data}}}),t}(u),n.TableDataStore=function(){function e(t){i(this,e),this.data=t,this.filteredData=null,this.isOnFilter=!1,this.sortObj={},this.pageObj={}}return a(e,{setProps:{value:function(e,t){this.keyField=t,this.enablePagination=e}},setData:{value:function(e){this.data=e}},getCurrentDisplayData:{value:function(){return this.isOnFilter?this.filteredData:this.data}},sort:{value:function(e,t){this.sortObj={order:e,sortField:t};var n=this.getCurrentDisplayData();return n=o(n,t,e),this}},page:{value:function(e){var t=function(t,n){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e,t){return this.pageObj.end=e*t-1,this.pageObj.start=this.pageObj.end-(t-1),this})},edit:{value:function(e,t,n){var o=this.getCurrentDisplayData(),r=void 0;return this.enablePagination?(o[this.pageObj.start+t][n]=e,r=o[this.pageObj.start+t][this.keyField]):(o[t][n]=e,r=o[t][this.keyField]),this.isOnFilter&&this.data.forEach(function(t){t[this.keyField]===r&&(t[this.keyField][n]=e)},this),this}},add:{value:function(e){if(""===e[this.keyField].trim())throw this.keyField+" can't be empty value.";var t=this.getCurrentDisplayData();t.forEach(function(t){if(t[this.keyField].toString()===e[this.keyField])throw this.keyField+" "+e[this.keyField]+" already exists"},this),t.push(e),this.isOnFilter&&this.data.push(e)}},remove:{value:function(e){var t=this.getCurrentDisplayData(),n=t.filter(function(t){return-1==e.indexOf(t[this.keyField])},this);this.isOnFilter?(this.data=this.data.filter(function(t){return-1==e.indexOf(t[this.keyField])},this),this.filteredData=n):this.data=n}},filter:{value:function(e){0==Object.keys(e).length?(this.filteredData=null,this.isOnFilter=!1):(this.filteredData=this.data.filter(function(t){var n=!0;for(var o in e)if(-1==t[o].toString().toLowerCase().indexOf(e[o].toLowerCase())){n=!1;break}return n}),this.isOnFilter=!0)}},search:{value:function(e){""===e.trim()?(this.filteredData=null,this.isOnFilter=!1):(this.filteredData=this.data.filter(function(t){var n=!1;for(var o in t)if(-1!==t[o].toString().toLowerCase().indexOf(e.toLowerCase())){n=!0;break}return n}),this.isOnFilter=!0)}},get:{value:function(){var e=this.getCurrentDisplayData();if(0==e.length)return e;if(this.enablePagination){for(var t=[],n=this.pageObj.start;n<=this.pageObj.end&&(t.push(e[n]),n+1!=e.length);n++);return t}return e}},getKeyField:{value:function(){return this.keyField}},getDataNum:{value:function(){return this.getCurrentDisplayData().length}},getAllRowkey:{value:function(){return this.data.map(function(e){return e[this.keyField]},this)}}}),e}()},{"../Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",events:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/events/events.js"}],"/Users/allen/Node/react-bootstrap-table/src/toolbar/ToolBar.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function d(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:d(r,t,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=o(e("react")),c=o(e("classnames")),u=(o(e("../Const")),function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={isInsertRowTrigger:!0}}return s(t,e),r(t,{handleSaveBtnClick:{value:function(e){var t={};this.props.columns.forEach(function(e,n){t[e.field]=this.refs[e.field+n].getDOMNode().value},this);var n=this.props.onAddRow(t);n?(this.refs.warning.getDOMNode().style.display="block",this.refs.warningText.getDOMNode().textContent=n):this.refs.warning.getDOMNode().style.display="none"}},handleDropRowBtnClick:{value:function(e){this.props.onDropRow()}},handleCloseBtn:{value:function(e){this.refs.warning.getDOMNode().style.display="none"}},handleKeyUp:{value:function(e){this.props.onSearch(e.currentTarget.value)}},render:{value:function(){var e="bs-table-modal-sm"+(new Date).getTime(),t=this.props.enableInsert?i.createElement("button",{type:"button",className:"btn btn-default","data-toggle":"modal","data-target":"."+e},"New"):null,n=this.props.enableDelete?i.createElement("button",{type:"button",className:"btn btn-default","data-toggle":"tooltip","data-placement":"right",title:"Drop selected row",onClick:this.handleDropRowBtnClick.bind(this)},"Delete"):null,o=this.props.enableSearch?i.createElement("input",{type:"text",placeholder:"Search",onKeyUp:this.handleKeyUp.bind(this)}):null,r=this.props.enableInsert?this.renderInsertRowModal(e):null,a={display:"none",marginBottom:0};return i.createElement("div",null,i.createElement("div",{className:"btn-group btn-group-sm",role:"group","aria-label":"..."},t,n),o,i.createElement("div",{ref:"warning",className:"alert alert-warning",style:a},i.createElement("button",{type:"button",className:"close","aria-label":"Close",onClick:this.handleCloseBtn.bind(this)},i.createElement("span",{"aria-hidden":"true"},"×")),i.createElement("strong",null,"Warning! "),i.createElement("font",{ref:"warningText"})),r)}},renderInsertRowModal:{value:function(e){var t=this.props.columns.map(function(e,t){return i.createElement("div",{className:"form-group",key:e.field},i.createElement("label",null,e.name),i.createElement("input",{ref:e.field+t,type:"text",className:"form-control",placeholder:e.name}))}),n=c("modal","fade",e);return i.createElement("div",{className:n,tabIndex:"-1",role:"dialog","aria-hidden":"true"},i.createElement("div",{className:"modal-dialog modal-sm"},i.createElement("div",{className:"modal-content"},i.createElement("div",{className:"modal-header"},i.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},i.createElement("span",{"aria-hidden":"true"},"×")),i.createElement("h4",{className:"modal-title"},"New Record")),i.createElement("div",{className:"modal-body"},t),i.createElement("div",{className:"modal-footer"},i.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"),i.createElement("button",{type:"button",className:"btn btn-primary","data-dismiss":"modal",onClick:this.handleSaveBtnClick.bind(this)},"Save")))))}}}),t}(i.Component));u.propTypes={onAddRow:i.PropTypes.func,onDropRow:i.PropTypes.func,enableInsert:i.PropTypes.bool,enableDelete:i.PropTypes.bool,enableSearch:i.PropTypes.bool,columns:i.PropTypes.array},u.defaultProps={enableInsert:!1,enableDelete:!1,enableSearch:!1},t.exports=u},{"../Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/util.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},r=o(e("./Const"));t.exports={renderSortCaret:function(e){var t=document.createElement("span");t.className="order",e==r.SORT_ASC&&(t.className+=" dropup");var n=document.createElement("span");return n.className="caret",n.style.margin="10px 5px",t.appendChild(n),t}}},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js"}]},{},["./src/index.js"]); //# sourceMappingURL=react-bootstrap-table.min.js.map
webpack/base.config.js
storeo/scaffolding
const WebpackNotifierPlugin = require('webpack-notifier'); module.exports = { commons: { module: { loaders: [ { test: /\.js$/, loaders: ['react-hot'], }, { test: /\.js$/, loader: 'babel', query: { cacheDirectory: '/tmp/', presets: ['stage-0', 'es2015', 'react'], plugins: ['add-module-exports', 'transform-class-properties'], }, }, { test: /(\.scss|\.css)$/, exclude: /node_modules/, loaders: ['style', 'css', 'sass'], }, ], }, resolve: { extensions: ['', '.scss', '.js', '.json', '.jade', '.png'], modulesDirectories: [ 'node_modules', ], }, }, plugins: [ new WebpackNotifierPlugin({ title: '<Project Title>', }), ], };
pnpm-cached/.pnpm-store/1/registry.npmjs.org/react-bootstrap/0.31.0/es/Navbar.js
JamieMason/npm-cache-benchmark
import _extends from 'babel-runtime/helpers/extends'; import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; // TODO: Remove this pragma once we upgrade eslint-config-airbnb. /* eslint-disable react/no-multi-comp */ import classNames from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; import elementType from 'react-prop-types/lib/elementType'; import uncontrollable from 'uncontrollable'; import Grid from './Grid'; import NavbarBrand from './NavbarBrand'; import NavbarCollapse from './NavbarCollapse'; import NavbarHeader from './NavbarHeader'; import NavbarToggle from './NavbarToggle'; import { bsClass as setBsClass, bsStyles, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils'; import { Style } from './utils/StyleConfig'; import createChainedFunction from './utils/createChainedFunction'; var propTypes = { /** * Create a fixed navbar along the top of the screen, that scrolls with the * page */ fixedTop: PropTypes.bool, /** * Create a fixed navbar along the bottom of the screen, that scrolls with * the page */ fixedBottom: PropTypes.bool, /** * Create a full-width navbar that scrolls away with the page */ staticTop: PropTypes.bool, /** * An alternative dark visual style for the Navbar */ inverse: PropTypes.bool, /** * Allow the Navbar to fluidly adjust to the page or container width, instead * of at the predefined screen breakpoints */ fluid: PropTypes.bool, /** * Set a custom element for this component. */ componentClass: elementType, /** * A callback fired when the `<Navbar>` body collapses or expands. Fired when * a `<Navbar.Toggle>` is clicked and called with the new `navExpanded` * boolean value. * * @controllable navExpanded */ onToggle: PropTypes.func, /** * A callback fired when a descendant of a child `<Nav>` is selected. Should * be used to execute complex closing or other miscellaneous actions desired * after selecting a descendant of `<Nav>`. Does nothing if no `<Nav>` or `<Nav>` * descendants exist. The callback is called with an eventKey, which is a * prop from the selected `<Nav>` descendant, and an event. * * ```js * function ( * Any eventKey, * SyntheticEvent event? * ) * ``` * * For basic closing behavior after all `<Nav>` descendant onSelect events in * mobile viewports, try using collapseOnSelect. * * Note: If you are manually closing the navbar using this `OnSelect` prop, * ensure that you are setting `expanded` to false and not *toggling* between * true and false. */ onSelect: PropTypes.func, /** * Sets `expanded` to `false` after the onSelect event of a descendant of a * child `<Nav>`. Does nothing if no `<Nav>` or `<Nav>` descendants exist. * * The onSelect callback should be used instead for more complex operations * that need to be executed after the `select` event of `<Nav>` descendants. */ collapseOnSelect: PropTypes.bool, /** * Explicitly set the visiblity of the navbar body * * @controllable onToggle */ expanded: PropTypes.bool, role: PropTypes.string }; var defaultProps = { componentClass: 'nav', fixedTop: false, fixedBottom: false, staticTop: false, inverse: false, fluid: false, collapseOnSelect: false }; var childContextTypes = { $bs_navbar: PropTypes.shape({ bsClass: PropTypes.string, expanded: PropTypes.bool, onToggle: PropTypes.func.isRequired, onSelect: PropTypes.func }) }; var Navbar = function (_React$Component) { _inherits(Navbar, _React$Component); function Navbar(props, context) { _classCallCheck(this, Navbar); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); _this.handleToggle = _this.handleToggle.bind(_this); _this.handleCollapse = _this.handleCollapse.bind(_this); return _this; } Navbar.prototype.getChildContext = function getChildContext() { var _props = this.props, bsClass = _props.bsClass, expanded = _props.expanded, onSelect = _props.onSelect, collapseOnSelect = _props.collapseOnSelect; return { $bs_navbar: { bsClass: bsClass, expanded: expanded, onToggle: this.handleToggle, onSelect: createChainedFunction(onSelect, collapseOnSelect ? this.handleCollapse : null) } }; }; Navbar.prototype.handleCollapse = function handleCollapse() { var _props2 = this.props, onToggle = _props2.onToggle, expanded = _props2.expanded; if (expanded) { onToggle(false); } }; Navbar.prototype.handleToggle = function handleToggle() { var _props3 = this.props, onToggle = _props3.onToggle, expanded = _props3.expanded; onToggle(!expanded); }; Navbar.prototype.render = function render() { var _extends2; var _props4 = this.props, Component = _props4.componentClass, fixedTop = _props4.fixedTop, fixedBottom = _props4.fixedBottom, staticTop = _props4.staticTop, inverse = _props4.inverse, fluid = _props4.fluid, className = _props4.className, children = _props4.children, props = _objectWithoutProperties(_props4, ['componentClass', 'fixedTop', 'fixedBottom', 'staticTop', 'inverse', 'fluid', 'className', 'children']); var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['expanded', 'onToggle', 'onSelect', 'collapseOnSelect']), bsProps = _splitBsPropsAndOmit[0], elementProps = _splitBsPropsAndOmit[1]; // will result in some false positives but that seems better // than false negatives. strict `undefined` check allows explicit // "nulling" of the role if the user really doesn't want one if (elementProps.role === undefined && Component !== 'nav') { elementProps.role = 'navigation'; } if (inverse) { bsProps.bsStyle = Style.INVERSE; } var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'fixed-top')] = fixedTop, _extends2[prefix(bsProps, 'fixed-bottom')] = fixedBottom, _extends2[prefix(bsProps, 'static-top')] = staticTop, _extends2)); return React.createElement( Component, _extends({}, elementProps, { className: classNames(className, classes) }), React.createElement( Grid, { fluid: fluid }, children ) ); }; return Navbar; }(React.Component); Navbar.propTypes = propTypes; Navbar.defaultProps = defaultProps; Navbar.childContextTypes = childContextTypes; setBsClass('navbar', Navbar); var UncontrollableNavbar = uncontrollable(Navbar, { expanded: 'onToggle' }); function createSimpleWrapper(tag, suffix, displayName) { var Wrapper = function Wrapper(_ref, _ref2) { var _ref2$$bs_navbar = _ref2.$bs_navbar, navbarProps = _ref2$$bs_navbar === undefined ? { bsClass: 'navbar' } : _ref2$$bs_navbar; var Component = _ref.componentClass, className = _ref.className, pullRight = _ref.pullRight, pullLeft = _ref.pullLeft, props = _objectWithoutProperties(_ref, ['componentClass', 'className', 'pullRight', 'pullLeft']); return React.createElement(Component, _extends({}, props, { className: classNames(className, prefix(navbarProps, suffix), pullRight && prefix(navbarProps, 'right'), pullLeft && prefix(navbarProps, 'left')) })); }; Wrapper.displayName = displayName; Wrapper.propTypes = { componentClass: elementType, pullRight: PropTypes.bool, pullLeft: PropTypes.bool }; Wrapper.defaultProps = { componentClass: tag, pullRight: false, pullLeft: false }; Wrapper.contextTypes = { $bs_navbar: PropTypes.shape({ bsClass: PropTypes.string }) }; return Wrapper; } UncontrollableNavbar.Brand = NavbarBrand; UncontrollableNavbar.Header = NavbarHeader; UncontrollableNavbar.Toggle = NavbarToggle; UncontrollableNavbar.Collapse = NavbarCollapse; UncontrollableNavbar.Form = createSimpleWrapper('div', 'form', 'NavbarForm'); UncontrollableNavbar.Text = createSimpleWrapper('p', 'text', 'NavbarText'); UncontrollableNavbar.Link = createSimpleWrapper('a', 'link', 'NavbarLink'); // Set bsStyles here so they can be overridden. export default bsStyles([Style.DEFAULT, Style.INVERSE], Style.DEFAULT, UncontrollableNavbar);
docs/app/Examples/collections/Breadcrumb/Variations/BreadcrumbExampleBigSize.js
mohammed88/Semantic-UI-React
import React from 'react' import { Breadcrumb } from 'semantic-ui-react' const BreadcrumbExampleBigSize = () => ( <Breadcrumb size='big'> <Breadcrumb.Section link>Home</Breadcrumb.Section> <Breadcrumb.Divider icon='right chevron' /> <Breadcrumb.Section link>Registration</Breadcrumb.Section> <Breadcrumb.Divider icon='right chevron' /> <Breadcrumb.Section active>Personal Information</Breadcrumb.Section> </Breadcrumb> ) export default BreadcrumbExampleBigSize
app/javascript/app/pages/my-climate-watch/my-cw-editor/plugins/side-toolbar-plugin/draft-js-side-toolbar-plugin/components/DefaultBlockTypeSelect/index.js
Vizzuality/climate-watch
/* eslint-disable */ import React from 'react'; import { HeadlineOneButton, HeadlineTwoButton, BlockquoteButton, CodeBlockButton, UnorderedListButton, OrderedListButton } from 'draft-js-buttons'; import BlockTypeSelect from '../BlockTypeSelect'; const DefaultBlockTypeSelect = ({ getEditorState, setEditorState, theme }) => ( <BlockTypeSelect getEditorState={getEditorState} setEditorState={setEditorState} theme={theme} structure={[ HeadlineOneButton, HeadlineTwoButton, UnorderedListButton, OrderedListButton, BlockquoteButton, CodeBlockButton ]} /> ); export default DefaultBlockTypeSelect;
modules/IndexLink.js
Nedomas/react-router
import React from 'react' import Link from './Link' const IndexLink = React.createClass({ render() { return <Link {...this.props} onlyActiveOnIndex={true} /> } }) export default IndexLink
app/containers/NotFoundPage/messages.js
s0enke/react-boilerplate
/* * NotFoundPage Messages * * This contains all the text for the NotFoundPage component. */ import { defineMessages } from 'react-intl'; export default defineMessages({ header: { id: 'boilerplate.containers.NotFoundPage.header', defaultMessage: 'Page not found.', }, homeButton: { id: 'boilerplate.containers.NotFoundPage.home', defaultMessage: 'Home', }, });
frontend/src/Organize/OrganizePreviewModalConnector.js
geogolem/Radarr
import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { clearOrganizePreview } from 'Store/Actions/organizePreviewActions'; import OrganizePreviewModal from './OrganizePreviewModal'; const mapDispatchToProps = { clearOrganizePreview }; class OrganizePreviewModalConnector extends Component { // // Listeners onModalClose = () => { this.props.clearOrganizePreview(); this.props.onModalClose(); } // // Render render() { return ( <OrganizePreviewModal {...this.props} onModalClose={this.onModalClose} /> ); } } OrganizePreviewModalConnector.propTypes = { clearOrganizePreview: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired }; export default connect(undefined, mapDispatchToProps)(OrganizePreviewModalConnector);
src/svg-icons/editor/bubble-chart.js
IsenrichO/mui-with-arrows
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorBubbleChart = (props) => ( <SvgIcon {...props}> <circle cx="7.2" cy="14.4" r="3.2"/><circle cx="14.8" cy="18" r="2"/><circle cx="15.2" cy="8.8" r="4.8"/> </SvgIcon> ); EditorBubbleChart = pure(EditorBubbleChart); EditorBubbleChart.displayName = 'EditorBubbleChart'; EditorBubbleChart.muiName = 'SvgIcon'; export default EditorBubbleChart;
Samples/Core.JavaScriptInjection/JavaScriptInjectionWeb/Scripts/jquery-1.9.1.js
HenrikGustafsson/PnP
/* NUGET: BEGIN LICENSE TEXT jQuery v1.9.1 Microsoft grants you the right to use these script files for the sole purpose of either: (i) interacting through your browser with the Microsoft website, subject to the website's terms of use; or (ii) using the files as included with a Microsoft product subject to that product's license terms. Microsoft reserves all other rights to the files not expressly granted by Microsoft, whether by implication, estoppel or otherwise. The notices and licenses below are for informational purposes only. *************************************************** * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors ******************************** * Includes Sizzle CSS Selector Engine * http://sizzlejs.com/ * Copyright 2012 jQuery Foundation and other contributors ******************************************************** Provided for Informational Purposes Only MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The 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. * NUGET: END LICENSE TEXT */ /*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<9 // For `typeof node.method` instead of `node.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) document = window.document, location = window.location, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.9.1", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( list && ( !fired || stack ) ) { if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function() { var support, all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Support tests won't run in some limited or non-browser environments all = div.getElementsByTagName("*"); a = div.getElementsByTagName("a")[ 0 ]; if ( !all || !a || !all.length ) { return {}; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; support = { // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) getSetAttribute: div.className !== "t", // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType === 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText instead) style: /top/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.5/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) checkOn: !!input.value, // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Tests for enctype support on a form (#6743) enctype: !!document.createElement("form").enctype, // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode boxModel: document.compatMode === "CSS1Compat", // Will be defined later deleteExpando: true, noCloneEvent: true, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, boxSizingReliable: true, pixelPosition: false }; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; support.boxSizing = ( div.offsetWidth === 4 ); support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })(); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { cache[ id ] = {}; // Avoids exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var i, l, thisCache, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } for ( i = 0, l = name.length; i < l; i++ ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) } else if ( jQuery.support.deleteExpando || cache != cache.window ) { delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, elem = this[0], i = 0, data = null; // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( !name.indexOf( "data-" ) ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return jQuery.access( this, function( value ) { if ( value === undefined ) { // Try to fetch any internally stored data first return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; } this.each(function() { jQuery.data( this, key, value ); }); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } hooks.cur = fn; if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val, self = jQuery(this); if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, self.val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var values = jQuery.makeArray( value ); jQuery(elem).find("option").each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, notxml, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { // In IE9+, Flash objects don't have .getAttribute (#12945) // Support: IE9+ if ( typeof elem.getAttribute !== core_strundefined ) { ret = elem.getAttribute( name ); } // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( rboolean.test( name ) ) { // Set corresponding property to false for boolean attributes // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 if ( !getSetAttribute && ruseDefault.test( name ) ) { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } else { elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { return ( elem[ name ] = value ); } } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { return elem[ name ]; } } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt( attributeNode.value, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } } } }); // Hook for boolean attributes boolHook = { get: function( elem, name ) { var // Use .prop to determine if this attribute is understood as boolean prop = jQuery.prop( elem, name ), // Fetch it accordingly attr = typeof prop === "boolean" && elem.getAttribute( name ), detail = typeof prop === "boolean" ? getSetInput && getSetAttribute ? attr != null : // oldIE fabricates an empty string for missing boolean attributes // and conflates checked/selected into attroperties ruseDefault.test( name ) ? elem[ jQuery.camelCase( "default-" + name ) ] : !!attr : // fetch an attribute node for properties not recognized as boolean elem.getAttributeNode( name ); return detail && detail.value !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; // fix oldIE value attroperty if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return jQuery.nodeName( elem, "input" ) ? // Ignore the value *property* by using defaultValue elem.defaultValue : ret && ret.specified ? ret.value : undefined; }, set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? ret.value : undefined; }, set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }); }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { get: function( elem ) { var ret = elem.getAttribute( name, 2 ); return ret == null ? undefined : ret; } }); }); // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }); } // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter if ( !jQuery.support.checkOn ) { jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { get: function( elem ) { // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); event.isTrigger = true; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { for ( ; cur != this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } } }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== document.activeElement && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === document.activeElement && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ (function( window, undefined ) { var i, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, // Local document vars setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches, contains, sortOrder, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, support = {}, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Array methods arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors operators = "([*^$|!~]?=)", attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rsibling = /[\x20\t\r\n\f]*[+~]/, rnative = /^[^{]+\{\s*\[native code/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, funescape = function( _, escaped ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint return high !== high ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Use a stripped-down slice if we can't use a native one try { slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; } catch ( e ) { slice = function( i ) { var elem, results = []; while ( (elem = this[i++]) ) { results.push( elem ); } return results; }; } /** * For feature detection * @param {Function} fn The function to test for native support */ function isNative( fn ) { return rnative.test( fn + "" ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var cache, keys = []; return (cache = function( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); }); } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return fn( div ); } catch (e) { return false; } finally { // release memory in IE div = null; } } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( !documentIsXML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); return results; } } // QSA path if ( support.qsa && !rbuggyQSA.test(selector) ) { old = true; nid = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, slice.call( newContext.querySelectorAll( newSelector ), 0 ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsXML = isXML( doc ); // Check if getElementsByTagName("*") returns only elements support.tagNameNoComments = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if attributes should be retrieved by attribute nodes support.attributes = assert(function( div ) { div.innerHTML = "<select></select>"; var type = typeof div.lastChild.getAttribute("multiple"); // IE8 returns a string for some attributes even when not present return type !== "boolean" && type !== "string"; }); // Check if getElementsByClassName can be trusted support.getByClassName = assert(function( div ) { // Opera can't find a second classname (in 9.6) div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { return false; } // Safari 3.2 caches class attributes and doesn't catch changes div.lastChild.className = "e"; return div.getElementsByClassName("e").length === 2; }); // Check if getElementById returns elements by name // Check if getElementsByName privileges form controls or returns elements by ID support.getByName = assert(function( div ) { // Inject content div.id = expando + 0; div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; docElem.insertBefore( div, docElem.firstChild ); // Test var pass = doc.getElementsByName && // buggy browsers will return fewer than the correct 2 doc.getElementsByName( expando ).length === 2 + // buggy browsers will return more than the correct 0 doc.getElementsByName( expando + 0 ).length; support.getIdNotName = !doc.getElementById( expando ); // Cleanup docElem.removeChild( div ); return pass; }); // IE6/7 return modified attributes Expr.attrHandle = assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && div.firstChild.getAttribute("href") === "#"; }) ? {} : { "href": function( elem ) { return elem.getAttribute( "href", 2 ); }, "type": function( elem ) { return elem.getAttribute("type"); } }; // ID find and filter if ( support.getIdNotName ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? [m] : undefined : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.tagNameNoComments ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Name Expr.find["NAME"] = support.getByName && function( tag, context ) { if ( typeof context.getElementsByName !== strundefined ) { return context.getElementsByName( name ); } }; // Class Expr.find["CLASS"] = support.getByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { return context.getElementsByClassName( className ); } }; // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21), // no need to also add to buggyMatches since matches checks buggyQSA // A support test would require too much code (would include document ready) rbuggyQSA = [ ":focus" ]; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explictly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // IE8 - Some boolean attributes are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Opera 10-12/IE8 - ^= $= *= and empty values // Should not select anything div.innerHTML = "<input type='hidden' i=''/>"; if ( div.querySelectorAll("[i^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { var compare; if ( a === b ) { hasDuplicate = true; return 0; } if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { if ( a === doc || contains( preferredDoc, a ) ) { return -1; } if ( b === doc || contains( preferredDoc, b ) ) { return 1; } return 0; } return compare & 4 ? -1 : 1; } return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; // Always assume the presence of duplicates if sort doesn't // pass them to our comparison function (as in Google Chrome). hasDuplicate = false; [0, 0].sort( sortOrder ); support.detectDuplicates = hasDuplicate; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); // rbuggyQSA always contains :focus, so no need for an existence check if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { var val; // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } if ( !documentIsXML ) { name = name.toLowerCase(); } if ( (val = Expr.attrHandle[ name ]) ) { return val( elem ); } if ( documentIsXML || support.attributes ) { return elem.getAttribute( name ); } return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? name : val && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; // Document sorting and removing duplicates Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], i = 1, j = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; results.sort( sortOrder ); if ( hasDuplicate ) { for ( ; (elem = results[i]); i++ ) { if ( elem === results[ i - 1 ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; function siblingCheck( a, b ) { var cur = b && a, diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } // Returns a function to use in pseudos for input types function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } // Returns a function to use in pseudos for buttons function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } // Returns a function to use in pseudos for positionals function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[4] ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeName ) { if ( nodeName === "*" ) { return function() { return true; }; } nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); return function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifider if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsXML ? elem.getAttribute("xml:lang") || elem.getAttribute("lang") : elem.lang) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push( { value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push( { value: matched, type: type, matches: match } ); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && !documentIsXML && Expr.relative[ tokens[1].type ] ) { context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, slice.call( seed, 0 ) ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, documentIsXML, results, rsibling.test( selector ) ); return results; } // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Easy API for creating new setFilters function setFilters() {} Expr.filters = setFilters.prototype = Expr.pseudos; Expr.setFilters = new setFilters(); // Initialize with the default document setDocument(); // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); var runtil = /Until$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret, self, len = this.length; if ( typeof selector !== "string" ) { self = this; return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } ret = []; for ( i = 0; i < len; i++ ) { jQuery.find( selector, this[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true) ); }, is: function( selector ) { return !!selector && ( typeof selector === "string" ? // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". rneedsContext.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { cur = this[i]; while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } cur = cur.parentNode; } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); jQuery.fn.andSelf = jQuery.fn.addBack; function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( this.length > 1 && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem ) { return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function( value ) { var isFunc = jQuery.isFunction( value ); // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( !isFunc && typeof value !== "string" ) { value = jQuery( value ).not( this ).detach(); } return this.domManip( [ value ], true, function( elem ) { var next = this.nextSibling, parent = this.parentNode; if ( parent ) { jQuery( this ).remove(); parent.insertBefore( elem, next ); } }); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, table ? self.html() : undefined ); } self.domManip( args, table, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( table && jQuery.nodeName( this[i], "table" ) ? findOrAppend( this[i], "tbody" ) : this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery.ajax({ url: node.src, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); function findOrAppend( elem, tag ) { return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { var attr = elem.getAttributeNode("type"); elem.type = ( attr && attr.specified ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { var bool = typeof state === "boolean"; return this.each(function() { if ( bool ? state : isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Exclude the following css properties to add px cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.hover = function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }; var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 ) { isSuccess = true; statusText = "nocontent"; // if not modified } else if ( status === 304 ) { isSuccess = true; statusText = "notmodified"; // If we have data, let's convert it } else { isSuccess = ajaxConvert( s, response ); statusText = isSuccess.state; success = isSuccess.data; error = isSuccess.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); } }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { var conv2, current, conv, tmp, converters = {}, i = 0, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(), prev = dataTypes[ 0 ]; // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } // Convert to each sequential dataType, tolerating list modification for ( ; (current = dataTypes[++i]); ) { // There's only work to do if current dataType is non-auto if ( current !== "*" ) { // Convert response if prev dataType is non-auto and differs from current if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split(" "); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.splice( i--, 0, current ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s["throws"] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } // Update prev for next iteration prev = current; } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var end, unit, tween = this.createTween( prop, value ), parts = rfxnum.exec( value ), target = tween.cur(), start = +target || 0, scale = 1, maxIterations = 20; if ( parts ) { end = +parts[2]; unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" && start ) { // Iteratively approximate from a nonzero starting point // Prefer the current property, because this process will be trivial if it uses the same units // Fallback to end or a simple constant start = jQuery.css( tween.elem, prop, true ) || end || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } tween.unit = unit; tween.start = start; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTweens( animation, props ) { jQuery.each( props, function( prop, value ) { var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( collection[ index ].call( animation, prop, value ) ) { // we're done with this property return; } } }); } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } createTweens( animation, props ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var value, name, index, easing, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /*jshint validthis:true */ var prop, index, length, value, dataShow, toggle, tween, hooks, oldfire, anim = this, style = elem.style, orig = {}, handled = [], hidden = elem.nodeType && isHidden( elem ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( index in props ) { value = props[ index ]; if ( rfxtypes.exec( value ) ) { delete props[ index ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } handled.push( index ); } } length = handled.length; if ( length ) { dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( index = 0 ; index < length ; index++ ) { prop = handled[ index ]; tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Remove in 2.0 - this supports IE8's panic based approach // to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); doAnimation.finish = function() { anim.stop( true ); }; // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.cur && hooks.cur.finish ) { hooks.cur.finish.call( this ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.documentElement; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || document.documentElement; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // })(); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; // Expose jQuery as an AMD module, but only for AMD loaders that // understand the issues with loading multiple versions of jQuery // in a page that all might call define(). The loader will indicate // they have special allowances for multiple jQuery versions by // specifying define.amd.jQuery = true. Register as a named module, // since jQuery can be concatenated with other files that may use define, // but not use a proper concatenation script that understands anonymous // AMD modules. A named AMD is safest and most robust way to register. // Lowercase jquery is used because AMD module names are derived from // file names, and jQuery is normally delivered in a lowercase file name. // Do this after creating the global so that if an AMD module wants to call // noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } })( window );
packages/core/admin/admin/src/components/GuidedTour/Modal/components/Stepper.js
wistityhq/strapi
import React from 'react'; import PropTypes from 'prop-types'; import { useIntl } from 'react-intl'; import { pxToRem } from '@strapi/helper-plugin'; import { Typography } from '@strapi/design-system/Typography'; import { Button } from '@strapi/design-system/Button'; import { LinkButton } from '@strapi/design-system/LinkButton'; import { Box } from '@strapi/design-system/Box'; import { Flex } from '@strapi/design-system/Flex'; import ArrowRight from '@strapi/icons/ArrowRight'; import Content from './Content'; import StepLine from '../../Stepper/StepLine'; import StepNumberWithPadding from './StepNumberWithPadding'; import { IS_DONE, IS_ACTIVE } from '../../constants'; const StepperModal = ({ title, content, cta, onCtaClick, sectionIndex, stepIndex, hasSectionAfter, }) => { const { formatMessage } = useIntl(); const hasSectionBefore = sectionIndex > 0; const hasStepsBefore = stepIndex > 0; const nextSectionIndex = sectionIndex + 1; return ( <> <Flex alignItems="stretch"> <Flex marginRight={8} justifyContent="center" minWidth={pxToRem(30)}> {hasSectionBefore && <StepLine type={IS_DONE} minHeight={pxToRem(24)} />} </Flex> <Typography variant="sigma" textColor="primary600"> {formatMessage({ id: 'app.components.GuidedTour.title', defaultMessage: '3 steps to get started', })} </Typography> </Flex> <Flex> <Flex marginRight={8} minWidth={pxToRem(30)}> <StepNumberWithPadding number={sectionIndex + 1} type={hasStepsBefore ? IS_DONE : IS_ACTIVE} /> </Flex> <Typography variant="alpha" fontWeight="bold" textColor="neutral800" as="h3" id="title"> {formatMessage(title)} </Typography> </Flex> <Flex alignItems="stretch"> <Flex marginRight={8} direction="column" justifyContent="center" minWidth={pxToRem(30)}> {hasSectionAfter && ( <> <StepLine type={IS_DONE} /> {hasStepsBefore && ( <StepNumberWithPadding number={nextSectionIndex + 1} type={IS_ACTIVE} last /> )} </> )} </Flex> <Box> <Content {...content} /> {cta && (cta.target ? ( <LinkButton endIcon={<ArrowRight />} onClick={onCtaClick} to={cta.target}> {formatMessage(cta.title)} </LinkButton> ) : ( <Button endIcon={<ArrowRight />} onClick={onCtaClick}> {formatMessage(cta.title)} </Button> ))} </Box> </Flex> {hasStepsBefore && hasSectionAfter && ( <Box paddingTop={3}> <Flex marginRight={8} justifyContent="center" width={pxToRem(30)}> <StepLine type={IS_DONE} minHeight={pxToRem(24)} /> </Flex> </Box> )} </> ); }; StepperModal.defaultProps = { currentStep: null, cta: undefined, }; StepperModal.propTypes = { sectionIndex: PropTypes.number.isRequired, stepIndex: PropTypes.number.isRequired, hasSectionAfter: PropTypes.bool.isRequired, content: PropTypes.shape({ id: PropTypes.string.isRequired, defaultMessage: PropTypes.string.isRequired, }).isRequired, cta: PropTypes.shape({ target: PropTypes.string, title: PropTypes.shape({ id: PropTypes.string.isRequired, defaultMessage: PropTypes.string.isRequired, }), }), currentStep: PropTypes.string, onCtaClick: PropTypes.func.isRequired, title: PropTypes.shape({ id: PropTypes.string.isRequired, defaultMessage: PropTypes.string.isRequired, }).isRequired, }; export default StepperModal;
ajax/libs/6to5/2.0.1/browser.js
cloudrifles/cdnjs
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.to5=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(root,mod){if(typeof exports=="object"&&typeof module=="object")return mod(exports);if(typeof define=="function"&&define.amd)return define(["exports"],mod);mod(root.acorn||(root.acorn={}))})(this,function(exports){"use strict";exports.version="0.11.1";var options,input,inputLen,sourceFile;exports.parse=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();var startPos=options.locations?[tokPos,curPosition()]:tokPos;initParserState();return parseTopLevel(options.program||startNodeAt(startPos))};var defaultOptions=exports.defaultOptions={playground:false,ecmaVersion:5,strictSemicolons:false,allowTrailingCommas:true,forbidReserved:false,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};exports.parseExpressionAt=function(inpt,pos,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState(pos);initParserState();return parseExpression()};var isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};function setOptions(opts){options={};for(var opt in defaultOptions)options[opt]=opts&&has(opts,opt)?opts[opt]:defaultOptions[opt];sourceFile=options.sourceFile||null;if(isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){tokens.push(token)}}if(isArray(options.onComment)){var comments=options.onComment;options.onComment=function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start:start,end:end};if(options.locations){comment.loc=new SourceLocation;comment.loc.start=startLoc;comment.loc.end=endLoc}if(options.ranges)comment.range=[start,end];comments.push(comment)}}if(options.strictMode){strict=true}if(options.ecmaVersion>=6){isKeyword=isEcma6Keyword}else{isKeyword=isEcma5AndLessKeyword}}var getLineInfo=exports.getLineInfo=function(input,offset){for(var line=1,cur=0;;){lineBreak.lastIndex=cur;var match=lineBreak.exec(input);if(match&&match.index<offset){++line;cur=match.index+match[0].length}else break}return{line:line,column:offset-cur}};function Token(){this.type=tokType;this.value=tokVal;this.start=tokStart;this.end=tokEnd;if(options.locations){this.loc=new SourceLocation;this.loc.end=tokEndLoc;this.startLoc=tokStartLoc;this.endLoc=tokEndLoc}if(options.ranges)this.range=[tokStart,tokEnd]}exports.Token=Token;exports.tokenize=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();skipSpace();function getToken(forceRegexp){lastEnd=tokEnd;readToken(forceRegexp);return new Token}getToken.jumpTo=function(pos,reAllowed){tokPos=pos;if(options.locations){tokCurLine=1;tokLineStart=lineBreak.lastIndex=0;var match;while((match=lineBreak.exec(input))&&match.index<pos){++tokCurLine;tokLineStart=match.index+match[0].length}}tokRegexpAllowed=reAllowed;skipSpace()};getToken.noRegexp=function(){tokRegexpAllowed=false};getToken.options=options;return getToken};var tokPos;var tokStart,tokEnd;var tokStartLoc,tokEndLoc;var tokType,tokVal;var tokRegexpAllowed;var tokCurLine,tokLineStart;var lastStart,lastEnd,lastEndLoc;var inFunction,inGenerator,inAsync,labels,strict,inXJSChild,inXJSTag,inType;var metParenL;var templates;function initParserState(){lastStart=lastEnd=tokPos;if(options.locations)lastEndLoc=new Position;inFunction=inGenerator=inAsync=strict=false;labels=[];skipSpace();readToken()}function raise(pos,message){var loc=getLineInfo(input,pos);message+=" ("+loc.line+":"+loc.column+")";var err=new SyntaxError(message);err.pos=pos;err.loc=loc;err.raisedAt=tokPos;throw err}var empty=[];var _num={type:"num"},_regexp={type:"regexp"},_string={type:"string"};var _name={type:"name"},_eof={type:"eof"};var _xjsName={type:"xjsName"},_xjsText={type:"xjsText"};var _break={keyword:"break"},_case={keyword:"case",beforeExpr:true},_catch={keyword:"catch"};var _continue={keyword:"continue"},_debugger={keyword:"debugger"},_default={keyword:"default"};var _do={keyword:"do",isLoop:true},_else={keyword:"else",beforeExpr:true};var _finally={keyword:"finally"},_for={keyword:"for",isLoop:true},_function={keyword:"function"};var _if={keyword:"if"},_return={keyword:"return",beforeExpr:true},_switch={keyword:"switch"};var _throw={keyword:"throw",beforeExpr:true},_try={keyword:"try"},_var={keyword:"var"};var _let={keyword:"let"},_const={keyword:"const"};var _while={keyword:"while",isLoop:true},_with={keyword:"with"},_new={keyword:"new",beforeExpr:true};var _this={keyword:"this"};var _class={keyword:"class"},_extends={keyword:"extends",beforeExpr:true};var _export={keyword:"export"},_import={keyword:"import"};var _yield={keyword:"yield",beforeExpr:true};var _null={keyword:"null",atomValue:null},_true={keyword:"true",atomValue:true};var _false={keyword:"false",atomValue:false};var _in={keyword:"in",binop:7,beforeExpr:true};var keywordTypes={"break":_break,"case":_case,"catch":_catch,"continue":_continue,"debugger":_debugger,"default":_default,"do":_do,"else":_else,"finally":_finally,"for":_for,"function":_function,"if":_if,"return":_return,"switch":_switch,"throw":_throw,"try":_try,"var":_var,let:_let,"const":_const,"while":_while,"with":_with,"null":_null,"true":_true,"false":_false,"new":_new,"in":_in,"instanceof":{keyword:"instanceof",binop:7,beforeExpr:true},"this":_this,"typeof":{keyword:"typeof",prefix:true,beforeExpr:true},"void":{keyword:"void",prefix:true,beforeExpr:true},"delete":{keyword:"delete",prefix:true,beforeExpr:true},"class":_class,"extends":_extends,"export":_export,"import":_import,"yield":_yield};var _bracketL={type:"[",beforeExpr:true},_bracketR={type:"]"},_braceL={type:"{",beforeExpr:true};var _braceR={type:"}"},_parenL={type:"(",beforeExpr:true},_parenR={type:")"};var _comma={type:",",beforeExpr:true},_semi={type:";",beforeExpr:true};var _colon={type:":",beforeExpr:true},_dot={type:"."},_question={type:"?",beforeExpr:true};var _arrow={type:"=>",beforeExpr:true},_bquote={type:"`"},_dollarBraceL={type:"${",beforeExpr:true};var _ltSlash={type:"</"};var _arrow={type:"=>",beforeExpr:true},_template={type:"template"},_templateContinued={type:"templateContinued"};var _ellipsis={type:"...",prefix:true,beforeExpr:true};var _paamayimNekudotayim={type:"::",beforeExpr:true};var _at={type:"@"};var _hash={type:"#"};var _slash={binop:10,beforeExpr:true},_eq={isAssign:true,beforeExpr:true};var _assign={isAssign:true,beforeExpr:true};var _incDec={postfix:true,prefix:true,isUpdate:true},_prefix={prefix:true,beforeExpr:true};var _logicalOR={binop:1,beforeExpr:true};var _logicalAND={binop:2,beforeExpr:true};var _bitwiseOR={binop:3,beforeExpr:true};var _bitwiseXOR={binop:4,beforeExpr:true};var _bitwiseAND={binop:5,beforeExpr:true};var _equality={binop:6,beforeExpr:true};var _relational={binop:7,beforeExpr:true};var _bitShift={binop:8,beforeExpr:true};var _plusMin={binop:9,prefix:true,beforeExpr:true};var _modulo={binop:10,beforeExpr:true};var _star={binop:10,beforeExpr:true};var _exponent={binop:10,beforeExpr:true};var _lt={binop:7,beforeExpr:true},_gt={binop:7,beforeExpr:true};exports.tokTypes={bracketL:_bracketL,bracketR:_bracketR,braceL:_braceL,braceR:_braceR,parenL:_parenL,parenR:_parenR,comma:_comma,semi:_semi,colon:_colon,dot:_dot,ellipsis:_ellipsis,question:_question,slash:_slash,eq:_eq,name:_name,eof:_eof,num:_num,regexp:_regexp,string:_string,arrow:_arrow,bquote:_bquote,dollarBraceL:_dollarBraceL,star:_star,assign:_assign,xjsName:_xjsName,xjsText:_xjsText,paamayimNekudotayim:_paamayimNekudotayim,exponent:_exponent,at:_at,hash:_hash,template:_template,templateContinued:_templateContinued};for(var kw in keywordTypes)exports.tokTypes["_"+kw]=keywordTypes[kw];function makePredicate(words){words=words.split(" ");var f="",cats=[];out:for(var i=0;i<words.length;++i){for(var j=0;j<cats.length;++j)if(cats[j][0].length==words[i].length){cats[j].push(words[i]);continue out}cats.push([words[i]])}function compareTo(arr){if(arr.length==1)return f+="return str === "+JSON.stringify(arr[0])+";";f+="switch(str){";for(var i=0;i<arr.length;++i)f+="case "+JSON.stringify(arr[i])+":";f+="return true}return false;"}if(cats.length>3){cats.sort(function(a,b){return b.length-a.length});f+="switch(str.length){";for(var i=0;i<cats.length;++i){var cat=cats[i];f+="case "+cat[0].length+":";compareTo(cat)}f+="}"}else{compareTo(words)}return new Function("str",f)}var isReservedWord3=makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile");var isReservedWord5=makePredicate("class enum extends super const export import");var isStrictReservedWord=makePredicate("implements interface let package private protected public static yield");var isStrictBadIdWord=makePredicate("eval arguments");var ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var isEcma5AndLessKeyword=makePredicate(ecma5AndLessKeywords);var ecma6AndLessKeywords=ecma5AndLessKeywords+" let const class extends export import yield";var isEcma6Keyword=makePredicate(ecma6AndLessKeywords);var isKeyword=isEcma5AndLessKeyword;var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var nonASCIIidentifierChars="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";var nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]");var nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");var decimalNumber=/^\d+$/;var hexNumber=/^[\da-fA-F]+$/;var newline=/[\n\r\u2028\u2029]/;function isNewLine(code){return code===10||code===13||code===8232||code==8233}var lineBreak=/\r\n|[\n\r\u2028\u2029]/g;var isIdentifierStart=exports.isIdentifierStart=function(code){if(code<65)return code===36;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code))};var isIdentifierChar=exports.isIdentifierChar=function(code){if(code<48)return code===36;if(code<58)return true;if(code<65)return false;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifier.test(String.fromCharCode(code))};function Position(line,col){this.line=line;this.column=col}Position.prototype.offset=function(n){return new Position(this.line,this.column+n)};function curPosition(){return new Position(tokCurLine,tokPos-tokLineStart)}function initTokenState(pos){if(pos){tokPos=pos;tokLineStart=Math.max(0,input.lastIndexOf("\n",pos));tokCurLine=input.slice(0,tokLineStart).split(newline).length}else{tokCurLine=1;tokPos=tokLineStart=0}tokRegexpAllowed=true;metParenL=0;inType=inXJSChild=inXJSTag=false;templates=[];if(tokPos===0&&options.allowHashBang&&input.slice(0,2)==="#!"){skipLineComment(2)}}function finishToken(type,val,shouldSkipSpace){tokEnd=tokPos;if(options.locations)tokEndLoc=curPosition();tokType=type;if(shouldSkipSpace!==false)skipSpace();tokVal=val;tokRegexpAllowed=type.beforeExpr;if(options.onToken){options.onToken(new Token)}}function skipBlockComment(){var startLoc=options.onComment&&options.locations&&curPosition();var start=tokPos,end=input.indexOf("*/",tokPos+=2);if(end===-1)raise(tokPos-2,"Unterminated comment");tokPos=end+2;if(options.locations){lineBreak.lastIndex=start;var match;while((match=lineBreak.exec(input))&&match.index<tokPos){++tokCurLine;tokLineStart=match.index+match[0].length}}if(options.onComment)options.onComment(true,input.slice(start+2,end),start,tokPos,startLoc,options.locations&&curPosition())}function skipLineComment(startSkip){var start=tokPos;var startLoc=options.onComment&&options.locations&&curPosition();var ch=input.charCodeAt(tokPos+=startSkip);while(tokPos<inputLen&&ch!==10&&ch!==13&&ch!==8232&&ch!==8233){++tokPos;ch=input.charCodeAt(tokPos)}if(options.onComment)options.onComment(false,input.slice(start+startSkip,tokPos),start,tokPos,startLoc,options.locations&&curPosition())}function skipSpace(){while(tokPos<inputLen){var ch=input.charCodeAt(tokPos);if(ch===32){++tokPos}else if(ch===13){++tokPos;var next=input.charCodeAt(tokPos);if(next===10){++tokPos}if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch===10||ch===8232||ch===8233){++tokPos;if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch>8&&ch<14){++tokPos}else if(ch===47){var next=input.charCodeAt(tokPos+1);if(next===42){skipBlockComment()}else if(next===47){skipLineComment(2)}else break}else if(ch===160){++tokPos}else if(ch>=5760&&nonASCIIwhitespace.test(String.fromCharCode(ch))){++tokPos}else{break}}}function readToken_dot(){var next=input.charCodeAt(tokPos+1);if(next>=48&&next<=57)return readNumber(true);var next2=input.charCodeAt(tokPos+2);if(options.playground&&next===63){tokPos+=2;return finishToken(_dotQuestion)}else if(options.ecmaVersion>=6&&next===46&&next2===46){tokPos+=3;return finishToken(_ellipsis)}else{++tokPos;return finishToken(_dot)}}function readToken_slash(){var next=input.charCodeAt(tokPos+1);if(tokRegexpAllowed){++tokPos;return readRegexp()}if(next===61)return finishOp(_assign,2);return finishOp(_slash,1)}function readToken_modulo(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_modulo,1)}function readToken_mult(){var type=_star;var width=1;var next=input.charCodeAt(tokPos+1);if(options.ecmaVersion>=7&&next===42){width++;next=input.charCodeAt(tokPos+2);type=_exponent}if(next===61){width++;type=_assign}return finishOp(type,width)}function readToken_pipe_amp(code){var next=input.charCodeAt(tokPos+1);if(next===code)return finishOp(code===124?_logicalOR:_logicalAND,2);if(next===61)return finishOp(_assign,2);return finishOp(code===124?_bitwiseOR:_bitwiseAND,1)}function readToken_caret(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_bitwiseXOR,1)}function readToken_plus_min(code){var next=input.charCodeAt(tokPos+1);if(next===code){if(next==45&&input.charCodeAt(tokPos+2)==62&&newline.test(input.slice(lastEnd,tokPos))){skipLineComment(3);skipSpace();return readToken()}return finishOp(_incDec,2)}if(next===61)return finishOp(_assign,2);return finishOp(_plusMin,1)}function readToken_lt_gt(code){var next=input.charCodeAt(tokPos+1);var size=1;if(!inType&&next===code){size=code===62&&input.charCodeAt(tokPos+2)===62?3:2;if(input.charCodeAt(tokPos+size)===61)return finishOp(_assign,size+1);return finishOp(_bitShift,size)}if(next==33&&code==60&&input.charCodeAt(tokPos+2)==45&&input.charCodeAt(tokPos+3)==45){skipLineComment(4);skipSpace();return readToken()}if(next===61){size=input.charCodeAt(tokPos+2)===61?3:2;return finishOp(_relational,size)}if(next===47){size=2;return finishOp(_ltSlash,size)}return code===60?finishOp(_lt,size):finishOp(_gt,size,!inXJSTag)}function readToken_eq_excl(code){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_equality,input.charCodeAt(tokPos+2)===61?3:2);if(code===61&&next===62&&options.ecmaVersion>=6){tokPos+=2;return finishToken(_arrow)}return finishOp(code===61?_eq:_prefix,1)}function getTemplateToken(code){if(tokType===_string){if(code===96){++tokPos;return finishToken(_bquote)}else if(code===36&&input.charCodeAt(tokPos+1)===123){tokPos+=2;return finishToken(_dollarBraceL)}}return readTmplString()}function getTokenFromCode(code){switch(code){case 46:return readToken_dot();case 40:++tokPos;return finishToken(_parenL);case 41:++tokPos;return finishToken(_parenR);case 59:++tokPos;return finishToken(_semi);case 44:++tokPos;return finishToken(_comma);case 91:++tokPos;return finishToken(_bracketL);case 93:++tokPos;return finishToken(_bracketR);case 123:++tokPos;if(templates.length)++templates[templates.length-1];return finishToken(_braceL);case 125:++tokPos;if(templates.length&&--templates[templates.length-1]===0)return readTemplateString(_templateContinued);else return finishToken(_braceR);case 63:++tokPos;return finishToken(_question);case 64:if(options.playground){++tokPos;return finishToken(_at)}case 35:if(options.playground){++tokPos;return finishToken(_hash)}case 58:++tokPos;if(options.ecmaVersion>=7){var next=input.charCodeAt(tokPos);if(next===58){++tokPos;return finishToken(_paamayimNekudotayim)}}return finishToken(_colon);case 96:if(options.ecmaVersion>=6){++tokPos;return readTemplateString(_template)}case 48:var next=input.charCodeAt(tokPos+1);if(next===120||next===88)return readRadixNumber(16);if(options.ecmaVersion>=6){if(next===111||next===79)return readRadixNumber(8);if(next===98||next===66)return readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(false);case 34:case 39:return inXJSTag?readXJSStringLiteral():readString(code);case 47:return readToken_slash();case 37:return readToken_modulo();case 42:return readToken_mult();case 124:case 38:return readToken_pipe_amp(code);case 94:return readToken_caret();case 43:case 45:return readToken_plus_min(code);case 60:case 62:return readToken_lt_gt(code);case 61:case 33:return readToken_eq_excl(code);case 126:return finishOp(_prefix,1)}return false}function readToken(forceRegexp){if(!forceRegexp)tokStart=tokPos;else tokPos=tokStart+1;if(options.locations)tokStartLoc=curPosition();if(forceRegexp)return readRegexp();if(tokPos>=inputLen)return finishToken(_eof);var code=input.charCodeAt(tokPos);if(inXJSChild&&tokType!==_braceL&&code!==60&&code!==123&&code!==125){return readXJSText(["<","{"])}if(isIdentifierStart(code)||code===92)return readWord();var tok=getTokenFromCode(code);if(tok===false){var ch=String.fromCharCode(code);if(ch==="\\"||nonASCIIidentifierStart.test(ch))return readWord();raise(tokPos,"Unexpected character '"+ch+"'")}return tok}function finishOp(type,size,shouldSkipSpace){var str=input.slice(tokPos,tokPos+size);tokPos+=size;finishToken(type,str,shouldSkipSpace)}var regexpUnicodeSupport=false;try{new RegExp("￿","u");regexpUnicodeSupport=true}catch(e){}function readRegexp(){var content="",escaped,inClass,start=tokPos;for(;;){if(tokPos>=inputLen)raise(start,"Unterminated regular expression");var ch=nextChar();if(newline.test(ch))raise(start,"Unterminated regular expression");if(!escaped){if(ch==="[")inClass=true;else if(ch==="]"&&inClass)inClass=false;else if(ch==="/"&&!inClass)break;escaped=ch==="\\"}else escaped=false;++tokPos}var content=input.slice(start,tokPos);++tokPos;var mods=readWord1();var tmp=content;if(mods){var validFlags=/^[gmsiy]*$/;if(options.ecmaVersion>=6)validFlags=/^[gmsiyu]*$/;if(!validFlags.test(mods))raise(start,"Invalid regular expression flag");if(mods.indexOf("u")>=0&&!regexpUnicodeSupport){tmp=tmp.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}}try{new RegExp(tmp)}catch(e){if(e instanceof SyntaxError)raise(start,"Error parsing regular expression: "+e.message);raise(e)}try{var value=new RegExp(content,mods)}catch(err){value=null}return finishToken(_regexp,{pattern:content,flags:mods,value:value})}function readInt(radix,len){var start=tokPos,total=0;for(var i=0,e=len==null?Infinity:len;i<e;++i){var code=input.charCodeAt(tokPos),val;if(code>=97)val=code-97+10;else if(code>=65)val=code-65+10;else if(code>=48&&code<=57)val=code-48;else val=Infinity;if(val>=radix)break;++tokPos;total=total*radix+val}if(tokPos===start||len!=null&&tokPos-start!==len)return null;return total}function readRadixNumber(radix){tokPos+=2;var val=readInt(radix);if(val==null)raise(tokStart+2,"Expected number in radix "+radix);if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");return finishToken(_num,val)}function readNumber(startsWithDot){var start=tokPos,isFloat=false,octal=input.charCodeAt(tokPos)===48;if(!startsWithDot&&readInt(10)===null)raise(start,"Invalid number");if(input.charCodeAt(tokPos)===46){++tokPos;readInt(10);isFloat=true}var next=input.charCodeAt(tokPos);if(next===69||next===101){next=input.charCodeAt(++tokPos);if(next===43||next===45)++tokPos;if(readInt(10)===null)raise(start,"Invalid number");isFloat=true}if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");var str=input.slice(start,tokPos),val;if(isFloat)val=parseFloat(str);else if(!octal||str.length===1)val=parseInt(str,10);else if(/[89]/.test(str)||strict)raise(start,"Invalid number");else val=parseInt(str,8);return finishToken(_num,val)}function readCodePoint(){var ch=input.charCodeAt(tokPos),code;if(ch===123){if(options.ecmaVersion<6)unexpected();++tokPos;code=readHexChar(input.indexOf("}",tokPos)-tokPos);++tokPos;if(code>1114111)unexpected()}else{code=readHexChar(4)}if(code<=65535){return String.fromCharCode(code)}var cu1=(code-65536>>10)+55296;var cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function readString(quote){++tokPos;var out="";for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated string constant");var ch=input.charCodeAt(tokPos);if(ch===quote){++tokPos;return finishToken(_string,out)}if(ch===92){out+=readEscapedChar()}else{++tokPos;if(newline.test(String.fromCharCode(ch))){raise(tokStart,"Unterminated string constant")}out+=String.fromCharCode(ch)}}}function readTemplateString(type){if(type==_templateContinued)templates.pop();var out="",start=tokPos;for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated template");var ch=input.charAt(tokPos);if(ch==="`"||ch==="$"&&input.charCodeAt(tokPos+1)===123){var raw=input.slice(start,tokPos);++tokPos;if(ch=="$"){++tokPos;templates.push(1)}return finishToken(type,{cooked:out,raw:raw})}if(ch==="\\"){out+=readEscapedChar()}else{++tokPos;if(newline.test(ch)){if(ch==="\r"&&input.charCodeAt(tokPos)===10){++tokPos;ch="\n"}if(options.locations){++tokCurLine;tokLineStart=tokPos}}out+=ch}}}function readEscapedChar(){var ch=input.charCodeAt(++tokPos);var octal=/^[0-7]+/.exec(input.slice(tokPos,tokPos+3));if(octal)octal=octal[0];while(octal&&parseInt(octal,8)>255)octal=octal.slice(0,-1);if(octal==="0")octal=null;++tokPos;if(octal){if(strict)raise(tokPos-2,"Octal literal in strict mode");tokPos+=octal.length-1;return String.fromCharCode(parseInt(octal,8))}else{switch(ch){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(readHexChar(2));case 117:return readCodePoint();case 116:return" ";case 98:return"\b";case 118:return" ";case 102:return"\f";case 48:return"\x00";case 13:if(input.charCodeAt(tokPos)===10)++tokPos;case 10:if(options.locations){tokLineStart=tokPos;++tokCurLine}return"";default:return String.fromCharCode(ch)}}}var XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function readXJSEntity(){var str="",count=0,entity;var ch=nextChar();if(ch!=="&")raise(tokPos,"Entity must start with an ampersand");var startPos=++tokPos;while(tokPos<inputLen&&count++<10){ch=nextChar();tokPos++;if(ch===";"){if(str[0]==="#"){if(str[1]==="x"){str=str.substr(2);if(hexNumber.test(str)){entity=String.fromCharCode(parseInt(str,16))}}else{str=str.substr(1);if(decimalNumber.test(str)){entity=String.fromCharCode(parseInt(str,10))}}}else{entity=XHTMLEntities[str]}break}str+=ch}if(!entity){tokPos=startPos;return"&"}return entity}function readXJSText(stopChars){var str="";while(tokPos<inputLen){var ch=nextChar();if(stopChars.indexOf(ch)!==-1){break}if(ch==="&"){str+=readXJSEntity()}else{++tokPos;if(ch==="\r"&&nextChar()==="\n"){str+=ch;++tokPos;ch="\n"}if(ch==="\n"&&options.locations){tokLineStart=tokPos;++tokCurLine}str+=ch}}return finishToken(_xjsText,str)}function readXJSStringLiteral(){var quote=input.charCodeAt(tokPos);if(quote!==34&&quote!==39){raise("String literal must starts with a quote")}++tokPos;readXJSText([String.fromCharCode(quote)]);if(quote!==input.charCodeAt(tokPos)){unexpected()}++tokPos;return finishToken(tokType,tokVal)}function readHexChar(len){var n=readInt(16,len);if(n===null)raise(tokStart,"Bad character escape sequence");return n}var containsEsc;function readWord1(){containsEsc=false;var word,first=true,start=tokPos;for(;;){var ch=input.charCodeAt(tokPos);if(isIdentifierChar(ch)||inXJSTag&&ch===45){if(containsEsc)word+=nextChar();++tokPos}else if(ch===92&&!inXJSTag){if(!containsEsc)word=input.slice(start,tokPos);containsEsc=true;if(input.charCodeAt(++tokPos)!=117)raise(tokPos,"Expecting Unicode escape sequence \\uXXXX");++tokPos;var esc=readHexChar(4);var escStr=String.fromCharCode(esc);if(!escStr)raise(tokPos-1,"Invalid Unicode escape");if(!(first?isIdentifierStart(esc):isIdentifierChar(esc)))raise(tokPos-4,"Invalid Unicode escape");word+=escStr}else{break}first=false}return containsEsc?word:input.slice(start,tokPos)}function readWord(){var word=readWord1();var type=inXJSTag?_xjsName:_name;if(!containsEsc&&isKeyword(word))type=keywordTypes[word];return finishToken(type,word)}function next(){lastStart=tokStart;lastEnd=tokEnd;lastEndLoc=tokEndLoc;readToken()}function setStrict(strct){strict=strct;tokPos=tokStart;if(options.locations){while(tokPos<tokLineStart){tokLineStart=input.lastIndexOf("\n",tokLineStart-2)+1;--tokCurLine}}skipSpace();readToken()}function Node(){this.type=null;this.start=tokStart;this.end=null}exports.Node=Node;function SourceLocation(){this.start=tokStartLoc;this.end=null;if(sourceFile!==null)this.source=sourceFile}function startNode(){var node=new Node;if(options.locations)node.loc=new SourceLocation;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[tokStart,0];return node}function storeCurrentPos(){return options.locations?[tokStart,tokStartLoc]:tokStart}function startNodeAt(pos){var node=new Node,start=pos;if(options.locations){node.loc=new SourceLocation;node.loc.start=start[1];start=pos[0]}node.start=start;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[start,0];return node}function finishNode(node,type){node.type=type;node.end=lastEnd;if(options.locations)node.loc.end=lastEndLoc;if(options.ranges)node.range[1]=lastEnd;return node}function finishNodeAt(node,type,pos){if(options.locations){node.loc.end=pos[1];pos=pos[0]}node.type=type;node.end=pos;if(options.ranges)node.range[1]=pos;return node}function isUseStrict(stmt){return options.ecmaVersion>=5&&stmt.type==="ExpressionStatement"&&stmt.expression.type==="Literal"&&stmt.expression.value==="use strict"}function eat(type){if(tokType===type){next();return true}else{return false}}function canInsertSemicolon(){return!options.strictSemicolons&&(tokType===_eof||tokType===_braceR||newline.test(input.slice(lastEnd,tokStart)))}function semicolon(){if(!eat(_semi)&&!canInsertSemicolon())unexpected()}function expect(type){eat(type)||unexpected()}function nextChar(){return input.charAt(tokPos)}function unexpected(pos){raise(pos!=null?pos:tokStart,"Unexpected token")}function has(obj,propName){return Object.prototype.hasOwnProperty.call(obj,propName)}function toAssignable(node,allowSpread,checkType){if(options.ecmaVersion>=6&&node){switch(node.type){case"Identifier":case"MemberExpression":break;case"ObjectExpression":node.type="ObjectPattern";for(var i=0;i<node.properties.length;i++){var prop=node.properties[i];if(prop.type==="Property"&&prop.kind!=="init")unexpected(prop.key.start);toAssignable(prop.value,false,checkType)}break;case"ArrayExpression":node.type="ArrayPattern";for(var i=0,lastI=node.elements.length-1;i<=lastI;i++){toAssignable(node.elements[i],i===lastI,checkType) }break;case"SpreadElement":if(allowSpread){toAssignable(node.argument,false,checkType);checkSpreadAssign(node.argument)}else{unexpected(node.start)}break;default:if(checkType)unexpected(node.start)}}return node}function checkSpreadAssign(node){if(node.type!=="Identifier"&&node.type!=="ArrayPattern")unexpected(node.start)}function checkFunctionParam(param,nameHash){switch(param.type){case"Identifier":if(isStrictReservedWord(param.name)||isStrictBadIdWord(param.name))raise(param.start,"Defining '"+param.name+"' in strict mode");if(has(nameHash,param.name))raise(param.start,"Argument name clash in strict mode");nameHash[param.name]=true;break;case"ObjectPattern":for(var i=0;i<param.properties.length;i++)checkFunctionParam(param.properties[i].value,nameHash);break;case"ArrayPattern":for(var i=0;i<param.elements.length;i++){var elem=param.elements[i];if(elem)checkFunctionParam(elem,nameHash)}break}}function checkPropClash(prop,propHash){if(options.ecmaVersion>=6)return;var key=prop.key,name;switch(key.type){case"Identifier":name=key.name;break;case"Literal":name=String(key.value);break;default:return}var kind=prop.kind||"init",other;if(has(propHash,name)){other=propHash[name];var isGetSet=kind!=="init";if((strict||isGetSet)&&other[kind]||!(isGetSet^other.init))raise(key.start,"Redefinition of property")}else{other=propHash[name]={init:false,get:false,set:false}}other[kind]=true}function checkLVal(expr,isBinding){switch(expr.type){case"Identifier":if(strict&&(isStrictBadIdWord(expr.name)||isStrictReservedWord(expr.name)))raise(expr.start,(isBinding?"Binding ":"Assigning to ")+expr.name+" in strict mode");break;case"MemberExpression":if(isBinding)raise(expr.start,"Binding to member expression");break;case"ObjectPattern":for(var i=0;i<expr.properties.length;i++){var prop=expr.properties[i];if(prop.type==="Property")prop=prop.value;checkLVal(prop,isBinding)}break;case"ArrayPattern":for(var i=0;i<expr.elements.length;i++){var elem=expr.elements[i];if(elem)checkLVal(elem,isBinding)}break;case"SpreadProperty":case"SpreadElement":case"VirtualPropertyExpression":break;default:raise(expr.start,"Assigning to rvalue")}}function parseTopLevel(node){var first=true;if(!node.body)node.body=[];while(tokType!==_eof){var stmt=parseStatement(true);node.body.push(stmt);if(first&&isUseStrict(stmt))setStrict(true);first=false}lastStart=tokStart;lastEnd=tokEnd;lastEndLoc=tokEndLoc;return finishNode(node,"Program")}var loopLabel={kind:"loop"},switchLabel={kind:"switch"};function parseStatement(topLevel){if(tokType===_slash||tokType===_assign&&tokVal=="/=")readToken(true);var starttype=tokType,node=startNode();switch(starttype){case _break:case _continue:return parseBreakContinueStatement(node,starttype.keyword);case _debugger:return parseDebuggerStatement(node);case _do:return parseDoStatement(node);case _for:return parseForStatement(node);case _function:return parseFunctionStatement(node);case _class:return parseClass(node,true);case _if:return parseIfStatement(node);case _return:return parseReturnStatement(node);case _switch:return parseSwitchStatement(node);case _throw:return parseThrowStatement(node);case _try:return parseTryStatement(node);case _var:case _let:case _const:return parseVarStatement(node,starttype.keyword);case _while:return parseWhileStatement(node);case _with:return parseWithStatement(node);case _braceL:return parseBlock();case _semi:return parseEmptyStatement(node);case _export:case _import:if(!topLevel&&!options.allowImportExportEverywhere)raise(tokStart,"'import' and 'export' may only appear at the top level");return starttype===_import?parseImport(node):parseExport(node);default:var maybeName=tokVal,expr=parseExpression();if(starttype===_name){if(expr.type==="FunctionExpression"&&expr.async){expr.type="FunctionDeclaration";return expr}else if(expr.type==="Identifier"){if(eat(_colon)){return parseLabeledStatement(node,maybeName,expr)}if(options.ecmaVersion>=7&&expr.name==="private"&&tokType===_name){return parsePrivate(node)}else if(expr.name==="declare"){if(tokType===_class||tokType===_name||tokType===_function||tokType===_var){return parseDeclare(node)}}else if(tokType===_name){if(expr.name==="interface"){return parseInterface(node)}else if(expr.name==="type"){return parseTypeAlias(node)}}}}return parseExpressionStatement(node,expr)}}function parseBreakContinueStatement(node,keyword){var isBreak=keyword=="break";next();if(eat(_semi)||canInsertSemicolon())node.label=null;else if(tokType!==_name)unexpected();else{node.label=parseIdent();semicolon()}for(var i=0;i<labels.length;++i){var lab=labels[i];if(node.label==null||lab.name===node.label.name){if(lab.kind!=null&&(isBreak||lab.kind==="loop"))break;if(node.label&&isBreak)break}}if(i===labels.length)raise(node.start,"Unsyntactic "+keyword);return finishNode(node,isBreak?"BreakStatement":"ContinueStatement")}function parseDebuggerStatement(node){next();semicolon();return finishNode(node,"DebuggerStatement")}function parseDoStatement(node){next();labels.push(loopLabel);node.body=parseStatement();labels.pop();expect(_while);node.test=parseParenExpression();if(options.ecmaVersion>=6)eat(_semi);else semicolon();return finishNode(node,"DoWhileStatement")}function parseForStatement(node){next();labels.push(loopLabel);expect(_parenL);if(tokType===_semi)return parseFor(node,null);if(tokType===_var||tokType===_let){var init=startNode(),varKind=tokType.keyword,isLet=tokType===_let;next();parseVar(init,true,varKind);finishNode(init,"VariableDeclaration");if((tokType===_in||options.ecmaVersion>=6&&tokType===_name&&tokVal==="of")&&init.declarations.length===1&&!(isLet&&init.declarations[0].init))return parseForIn(node,init);return parseFor(node,init)}var init=parseExpression(false,true);if(tokType===_in||options.ecmaVersion>=6&&tokType===_name&&tokVal==="of"){checkLVal(init);return parseForIn(node,init)}return parseFor(node,init)}function parseFunctionStatement(node){next();return parseFunction(node,true,false)}function parseIfStatement(node){next();node.test=parseParenExpression();node.consequent=parseStatement();node.alternate=eat(_else)?parseStatement():null;return finishNode(node,"IfStatement")}function parseReturnStatement(node){if(!inFunction&&!options.allowReturnOutsideFunction)raise(tokStart,"'return' outside of function");next();if(eat(_semi)||canInsertSemicolon())node.argument=null;else{node.argument=parseExpression();semicolon()}return finishNode(node,"ReturnStatement")}function parseSwitchStatement(node){next();node.discriminant=parseParenExpression();node.cases=[];expect(_braceL);labels.push(switchLabel);for(var cur,sawDefault;tokType!=_braceR;){if(tokType===_case||tokType===_default){var isCase=tokType===_case;if(cur)finishNode(cur,"SwitchCase");node.cases.push(cur=startNode());cur.consequent=[];next();if(isCase)cur.test=parseExpression();else{if(sawDefault)raise(lastStart,"Multiple default clauses");sawDefault=true;cur.test=null}expect(_colon)}else{if(!cur)unexpected();cur.consequent.push(parseStatement())}}if(cur)finishNode(cur,"SwitchCase");next();labels.pop();return finishNode(node,"SwitchStatement")}function parseThrowStatement(node){next();if(newline.test(input.slice(lastEnd,tokStart)))raise(lastEnd,"Illegal newline after throw");node.argument=parseExpression();semicolon();return finishNode(node,"ThrowStatement")}function parseTryStatement(node){next();node.block=parseBlock();node.handler=null;if(tokType===_catch){var clause=startNode();next();expect(_parenL);clause.param=parseIdent();if(strict&&isStrictBadIdWord(clause.param.name))raise(clause.param.start,"Binding "+clause.param.name+" in strict mode");expect(_parenR);clause.guard=null;clause.body=parseBlock();node.handler=finishNode(clause,"CatchClause")}node.guardedHandlers=empty;node.finalizer=eat(_finally)?parseBlock():null;if(!node.handler&&!node.finalizer)raise(node.start,"Missing catch or finally clause");return finishNode(node,"TryStatement")}function parseVarStatement(node,kind){next();parseVar(node,false,kind);semicolon();return finishNode(node,"VariableDeclaration")}function parseWhileStatement(node){next();node.test=parseParenExpression();labels.push(loopLabel);node.body=parseStatement();labels.pop();return finishNode(node,"WhileStatement")}function parseWithStatement(node){if(strict)raise(tokStart,"'with' in strict mode");next();node.object=parseParenExpression();node.body=parseStatement();return finishNode(node,"WithStatement")}function parseEmptyStatement(node){next();return finishNode(node,"EmptyStatement")}function parseLabeledStatement(node,maybeName,expr){for(var i=0;i<labels.length;++i)if(labels[i].name===maybeName)raise(expr.start,"Label '"+maybeName+"' is already declared");var kind=tokType.isLoop?"loop":tokType===_switch?"switch":null;labels.push({name:maybeName,kind:kind});node.body=parseStatement();labels.pop();node.label=expr;return finishNode(node,"LabeledStatement")}function parseExpressionStatement(node,expr){node.expression=expr;semicolon();return finishNode(node,"ExpressionStatement")}function parseParenExpression(){expect(_parenL);var val=parseExpression();expect(_parenR);return val}function parseBlock(allowStrict){var node=startNode(),first=true,oldStrict;node.body=[];expect(_braceL);while(!eat(_braceR)){var stmt=parseStatement();node.body.push(stmt);if(first&&allowStrict&&isUseStrict(stmt)){oldStrict=strict;setStrict(strict=true)}first=false}if(oldStrict===false)setStrict(false);return finishNode(node,"BlockStatement")}function parseFor(node,init){node.init=init;expect(_semi);node.test=tokType===_semi?null:parseExpression();expect(_semi);node.update=tokType===_parenR?null:parseExpression();expect(_parenR);node.body=parseStatement();labels.pop();return finishNode(node,"ForStatement")}function parseForIn(node,init){var type=tokType===_in?"ForInStatement":"ForOfStatement";next();node.left=init;node.right=parseExpression();expect(_parenR);node.body=parseStatement();labels.pop();return finishNode(node,type)}function parseVar(node,noIn,kind){node.declarations=[];node.kind=kind;for(;;){var decl=startNode();decl.id=options.ecmaVersion>=6?toAssignable(parseExprAtom()):parseIdent();checkLVal(decl.id,true);if(tokType===_colon){decl.id.typeAnnotation=parseTypeAnnotation();finishNode(decl.id,decl.id.type)}decl.init=eat(_eq)?parseExpression(true,noIn):kind===_const.keyword?unexpected():null;node.declarations.push(finishNode(decl,"VariableDeclarator"));if(!eat(_comma))break}return node}function parseExpression(noComma,noIn){var start=storeCurrentPos();var expr=parseMaybeAssign(noIn);if(!noComma&&tokType===_comma){var node=startNodeAt(start);node.expressions=[expr];while(eat(_comma))node.expressions.push(parseMaybeAssign(noIn));return finishNode(node,"SequenceExpression")}return expr}function parseMaybeAssign(noIn,noLess){var start=storeCurrentPos();var left=parseMaybeConditional(noIn,noLess);if(tokType.isAssign){var node=startNodeAt(start);node.operator=tokVal;node.left=tokType===_eq?toAssignable(left):left;checkLVal(left);next();node.right=parseMaybeAssign(noIn);return finishNode(node,"AssignmentExpression")}return left}function parseMaybeConditional(noIn,noLess){var start=storeCurrentPos();var expr=parseExprOps(noIn,noLess);if(eat(_question)){var node=startNodeAt(start);if(eat(_eq)){var left=node.left=toAssignable(expr);if(left.type!=="MemberExpression")raise(left.start,"You can only use member expressions in memoization assignment");node.right=parseMaybeAssign(noIn);node.operator="?=";return finishNode(node,"AssignmentExpression")}node.test=expr;node.consequent=parseExpression(true);expect(_colon);node.alternate=parseExpression(true,noIn);return finishNode(node,"ConditionalExpression")}return expr}function parseExprOps(noIn,noLess){var start=storeCurrentPos();return parseExprOp(parseMaybeUnary(),start,-1,noIn,noLess)}function parseExprOp(left,leftStart,minPrec,noIn,noLess){var prec=tokType.binop;if(prec!=null&&(!noIn||tokType!==_in)&&(!noLess||tokType!==_lt)){if(prec>minPrec){var node=startNodeAt(leftStart);node.left=left;node.operator=tokVal;var op=tokType;next();var start=storeCurrentPos();node.right=parseExprOp(parseMaybeUnary(),start,prec,noIn);finishNode(node,op===_logicalOR||op===_logicalAND?"LogicalExpression":"BinaryExpression");return parseExprOp(node,leftStart,minPrec,noIn)}}return left}function parseMaybeUnary(){if(tokType.prefix){var node=startNode(),update=tokType.isUpdate,nodeType;if(tokType===_ellipsis){nodeType="SpreadElement"}else{nodeType=update?"UpdateExpression":"UnaryExpression";node.operator=tokVal;node.prefix=true}tokRegexpAllowed=true;next();node.argument=parseMaybeUnary();if(update)checkLVal(node.argument);else if(strict&&node.operator==="delete"&&node.argument.type==="Identifier")raise(node.start,"Deleting local variable in strict mode");return finishNode(node,nodeType)}var start=storeCurrentPos();var expr=parseExprSubscripts();while(tokType.postfix&&!canInsertSemicolon()){var node=startNodeAt(start);node.operator=tokVal;node.prefix=false;node.argument=expr;checkLVal(expr);next();expr=finishNode(node,"UpdateExpression")}return expr}function parseExprSubscripts(){var start=storeCurrentPos();return parseSubscripts(parseExprAtom(),start)}function parseSubscripts(base,start,noCalls){if(options.playground&&eat(_hash)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);if(eat(_parenL)){node.arguments=parseExprList(_parenR,false)}else{node.arguments=[]}return parseSubscripts(finishNode(node,"BindMemberExpression"),start,noCalls)}else if(eat(_paamayimNekudotayim)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);return parseSubscripts(finishNode(node,"VirtualPropertyExpression"),start,noCalls)}else if(eat(_dot)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);node.computed=false;return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(eat(_bracketL)){var node=startNodeAt(start);node.object=base;node.property=parseExpression();node.computed=true;expect(_bracketR);return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(!noCalls&&eat(_parenL)){var node=startNodeAt(start);node.callee=base;node.arguments=parseExprList(_parenR,false);return parseSubscripts(finishNode(node,"CallExpression"),start,noCalls)}else if(tokType===_template){var node=startNodeAt(start);node.tag=base;node.quasi=parseTemplate();return parseSubscripts(finishNode(node,"TaggedTemplateExpression"),start,noCalls)}return base}function parseExprAtom(){switch(tokType){case _this:var node=startNode();next();return finishNode(node,"ThisExpression");case _at:var node=startNode();next();node.object={type:"ThisExpression"};node.property=parseExprSubscripts();node.computed=false;return finishNode(node,"MemberExpression");case _yield:if(inGenerator)return parseYield();case _name:var start=storeCurrentPos();var node=startNode();var id=parseIdent(tokType!==_name);if(options.ecmaVersion>=7){if(id.name==="async"){if(tokType===_parenL){next();var oldParenL=++metParenL;if(tokType!==_parenR){val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}else{exprList=[]}expect(_parenR);if(metParenL===oldParenL&&eat(_arrow)){return parseArrowExpression(node,exprList,true)}else{node.callee=id;node.arguments=exprList;return parseSubscripts(finishNode(node,"CallExpression"),start)}}else if(tokType===_name){id=parseIdent();if(eat(_arrow)){return parseArrowExpression(node,[id],true)}return id}if(tokType===_function){next();return parseFunction(node,false,true)}}else if(id.name==="await"){if(inAsync)return parseAwait(node)}}if(eat(_arrow)){return parseArrowExpression(node,[id])}return id;case _regexp:var node=startNode();node.regex={pattern:tokVal.pattern,flags:tokVal.flags};node.value=tokVal.value;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _num:case _string:case _xjsText:var node=startNode();node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _null:case _true:case _false:var node=startNode();node.value=tokType.atomValue;node.raw=tokType.keyword;next();return finishNode(node,"Literal");case _parenL:var start=storeCurrentPos();var val,exprList;next();if(options.ecmaVersion>=7&&tokType===_for){val=parseComprehension(startNodeAt(start),true)}else{var oldParenL=++metParenL;if(tokType!==_parenR){val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}else{exprList=[]}expect(_parenR);if(metParenL===oldParenL&&eat(_arrow)){val=parseArrowExpression(startNodeAt(start),exprList)}else{if(!val)unexpected(lastStart);if(options.ecmaVersion>=6){for(var i=0;i<exprList.length;i++){if(exprList[i].type==="SpreadElement")unexpected()}}if(options.preserveParens){var par=startNodeAt(start);par.expression=val;val=finishNode(par,"ParenthesizedExpression")}}}return val;case _bracketL:var node=startNode();next();if(options.ecmaVersion>=7&&tokType===_for){return parseComprehension(node,false)}node.elements=parseExprList(_bracketR,true,true);return finishNode(node,"ArrayExpression");case _braceL:return parseObj();case _function:var node=startNode();next();return parseFunction(node,false,false);case _class:return parseClass(startNode(),false);case _new:return parseNew();case _template:return parseTemplate();case _lt:return parseXJSElement();case _hash:return parseBindFunctionExpression();default:unexpected()}}function parseBindFunctionExpression(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL)){node.arguments=parseExprList(_parenR,false)}else{node.arguments=[]}return finishNode(node,"BindFunctionExpression")}function parseNew(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL))node.arguments=parseExprList(_parenR,false);else node.arguments=empty;return finishNode(node,"NewExpression")}function parseTemplateElement(){var elem=startNodeAt(options.locations?[tokStart+1,tokStartLoc.offset(1)]:tokStart+1);elem.value=tokVal;elem.tail=input.charCodeAt(tokEnd-1)!==123;next();var endOff=elem.tail?1:2;return finishNodeAt(elem,"TemplateElement",options.locations?[lastEnd-endOff,lastEndLoc.offset(-endOff)]:lastEnd-endOff)}function parseTemplate(){var node=startNode();node.expressions=[];var curElt=parseTemplateElement();node.quasis=[curElt];while(!curElt.tail){node.expressions.push(parseExpression());if(tokType!==_templateContinued)unexpected();node.quasis.push(curElt=parseTemplateElement())}return finishNode(node,"TemplateLiteral")}function parseObj(){var node=startNode(),first=true,propHash={};node.properties=[];next();while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var prop=startNode(),isGenerator=false,isAsync=false;if(options.ecmaVersion>=7&&tokType===_ellipsis){prop=parseMaybeUnary();prop.type="SpreadProperty";node.properties.push(prop);continue}if(options.ecmaVersion>=6){prop.method=false;prop.shorthand=false;isGenerator=eat(_star)}if(options.ecmaVersion>=7&&tokType===_name&&tokVal==="async"){var asyncId=parseIdent();if(tokType===_colon||tokType===_parenL){prop.key=asyncId}else{isAsync=true;parsePropertyName(prop)}}else{parsePropertyName(prop)}var typeParameters;if(tokType===_lt){typeParameters=parseTypeParameterDeclaration();if(tokType!==_parenL)unexpected()}if(eat(_colon)){prop.value=parseExpression(true);prop.kind="init"}else if(options.ecmaVersion>=6&&tokType===_parenL){prop.kind="init";prop.method=true;prop.value=parseMethod(isGenerator,isAsync)}else if(options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set"||options.playground&&prop.key.name==="memo")){if(isGenerator||isAsync)unexpected();prop.kind=prop.key.name;parsePropertyName(prop);prop.value=parseMethod(false,false)}else if(options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"){prop.kind="init";prop.value=prop.key;prop.shorthand=true}else unexpected();prop.value.typeParameters=typeParameters;checkPropClash(prop,propHash);node.properties.push(finishNode(prop,"Property"))}return finishNode(node,"ObjectExpression")}function parsePropertyName(prop){if(options.ecmaVersion>=6){if(eat(_bracketL)){prop.computed=true;prop.key=parseExpression();expect(_bracketR);return}else{prop.computed=false}}prop.key=tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function initFunction(node,isAsync){node.id=null;node.params=[];if(options.ecmaVersion>=6){node.defaults=[];node.rest=null;node.generator=false}if(options.ecmaVersion>=7){node.async=isAsync}}function parseFunction(node,isStatement,isAsync,allowExpressionBody){initFunction(node,isAsync);if(options.ecmaVersion>=6){node.generator=eat(_star)}if(isStatement||tokType===_name){node.id=parseIdent()}if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}parseFunctionParams(node);parseFunctionBody(node,allowExpressionBody);return finishNode(node,isStatement?"FunctionDeclaration":"FunctionExpression")}function parseMethod(isGenerator,isAsync){var node=startNode();initFunction(node,isAsync);parseFunctionParams(node);var allowExpressionBody;if(options.ecmaVersion>=6){node.generator=isGenerator;allowExpressionBody=true}else{allowExpressionBody=false}parseFunctionBody(node,allowExpressionBody);return finishNode(node,"FunctionExpression")}function parseArrowExpression(node,params,isAsync){initFunction(node,isAsync);var defaults=node.defaults,hasDefaults=false;for(var i=0,lastI=params.length-1;i<=lastI;i++){var param=params[i];if(param.type==="AssignmentExpression"&&param.operator==="="){hasDefaults=true;params[i]=param.left;defaults.push(param.right)}else{toAssignable(param,i===lastI,true);defaults.push(null);if(param.type==="SpreadElement"){params.length--;node.rest=param.argument;break}}}node.params=params;if(!hasDefaults)node.defaults=[];parseFunctionBody(node,true);return finishNode(node,"ArrowFunctionExpression")}function parseFunctionParams(node){var defaults=[],hasDefaults=false;expect(_parenL);for(;;){if(eat(_parenR)){break}else if(options.ecmaVersion>=6&&eat(_ellipsis)){node.rest=toAssignable(parseExprAtom(),false,true);checkSpreadAssign(node.rest);parseFunctionParam(node.rest);expect(_parenR);defaults.push(null);break}else{var param=options.ecmaVersion>=6?toAssignable(parseExprAtom(),false,true):parseIdent();parseFunctionParam(param);node.params.push(param);if(options.ecmaVersion>=6){if(eat(_eq)){hasDefaults=true;defaults.push(parseExpression(true))}else{defaults.push(null)}}if(!eat(_comma)){expect(_parenR);break}}}if(hasDefaults)node.defaults=defaults;if(tokType===_colon){node.returnType=parseTypeAnnotation()}}function parseFunctionParam(param){if(tokType===_colon){param.typeAnnotation=parseTypeAnnotation()}else if(eat(_question)){param.optional=true}finishNode(param,param.type)}function parseFunctionBody(node,allowExpression){var isExpression=allowExpression&&tokType!==_braceL;var oldInAsync=inAsync;inAsync=node.async;if(isExpression){node.body=parseExpression(true);node.expression=true}else{var oldInFunc=inFunction,oldInGen=inGenerator,oldLabels=labels;inFunction=true;inGenerator=node.generator;labels=[];node.body=parseBlock(true);node.expression=false;inFunction=oldInFunc;inGenerator=oldInGen;labels=oldLabels}inAsync=oldInAsync;if(strict||!isExpression&&node.body.body.length&&isUseStrict(node.body.body[0])){var nameHash={};if(node.id)checkFunctionParam(node.id,{});for(var i=0;i<node.params.length;i++)checkFunctionParam(node.params[i],nameHash);if(node.rest)checkFunctionParam(node.rest,nameHash)}}function parsePrivate(node){node.declarations=[];do{node.declarations.push(parseIdent())}while(eat(_comma));semicolon();return finishNode(node,"PrivateDeclaration")}function parseClass(node,isStatement){next();node.id=tokType===_name?parseIdent():isStatement?unexpected():null;if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}node.superClass=eat(_extends)?parseMaybeAssign(false,true):null;if(node.superClass&&tokType===_lt){node.superTypeParameters=parseTypeParameterInstantiation()}if(tokType===_name&&tokVal==="implements"){next();node.implements=parseClassImplements()}var classBody=startNode();classBody.body=[];expect(_braceL);while(!eat(_braceR)){var method=startNode();if(options.ecmaVersion>=7&&tokType===_name&&tokVal==="private"){next();classBody.body.push(parsePrivate(method));continue}if(tokType===_name&&tokVal==="static"){next();method["static"]=true}else{method["static"]=false}var isAsync=false;var isGenerator=eat(_star);if(options.ecmaVersion>=7&&!isGenerator&&tokType===_name&&tokVal==="async"){var asyncId=parseIdent();if(tokType===_colon||tokType===_parenL){method.key=asyncId}else{isAsync=true;parsePropertyName(method)}}else{parsePropertyName(method)}if(tokType!==_parenL&&!method.computed&&method.key.type==="Identifier"&&(method.key.name==="get"||method.key.name==="set"||options.playground&&method.key.name==="memo")){if(isGenerator||isAsync)unexpected();method.kind=method.key.name;parsePropertyName(method)}else{method.kind=""}if(tokType===_colon){if(isGenerator||isAsync)unexpected();method.typeAnnotation=parseTypeAnnotation();semicolon();classBody.body.push(finishNode(method,"ClassProperty"))}else{var typeParameters;if(tokType===_lt){typeParameters=parseTypeParameterDeclaration()}method.value=parseMethod(isGenerator,isAsync);method.value.typeParameters=typeParameters;classBody.body.push(finishNode(method,"MethodDefinition"));eat(_semi)}}node.body=finishNode(classBody,"ClassBody");return finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")}function parseClassImplements(){var implemented=[];do{var node=startNode();node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterInstantiation()}else{node.typeParameters=null}implemented.push(finishNode(node,"ClassImplements"))}while(eat(_comma));return implemented}function parseExprList(close,allowTrailingComma,allowEmpty){var elts=[],first=true;while(!eat(close)){if(!first){expect(_comma);if(allowTrailingComma&&options.allowTrailingCommas&&eat(close))break}else first=false;if(allowEmpty&&tokType===_comma)elts.push(null);else elts.push(parseExpression(true))}return elts}function parseIdent(liberal){var node=startNode();if(liberal&&options.forbidReserved=="everywhere")liberal=false;if(tokType===_name){if(!liberal&&(options.forbidReserved&&(options.ecmaVersion===3?isReservedWord3:isReservedWord5)(tokVal)||strict&&isStrictReservedWord(tokVal))&&input.slice(tokStart,tokEnd).indexOf("\\")==-1)raise(tokStart,"The keyword '"+tokVal+"' is reserved");node.name=tokVal}else if(liberal&&tokType.keyword){node.name=tokType.keyword}else{unexpected()}tokRegexpAllowed=false;next();return finishNode(node,"Identifier")}function parseExport(node){next();if(tokType===_var||tokType===_const||tokType===_let||tokType===_function||tokType===_class||tokType===_name&&tokVal==="async"){node.declaration=parseStatement();node["default"]=false;node.specifiers=null;node.source=null}else if(eat(_default)){var declar=node.declaration=parseExpression(true);if(declar.id){if(declar.type==="FunctionExpression"){declar.type="FunctionDeclaration"}else if(declar.type==="ClassExpression"){declar.type="ClassDeclaration"}}node["default"]=true;node.specifiers=null;node.source=null;semicolon()}else{var isBatch=tokType===_star;node.declaration=null;node["default"]=false;node.specifiers=parseExportSpecifiers();if(tokType===_name&&tokVal==="from"){next();node.source=tokType===_string?parseExprAtom():unexpected()}else{if(isBatch)unexpected();node.source=null}semicolon()}return finishNode(node,"ExportDeclaration")}function parseExportSpecifiers(){var nodes=[],first=true;if(tokType===_star){var node=startNode();next();nodes.push(finishNode(node,"ExportBatchSpecifier"))}else{expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(tokType===_default);if(tokType===_name&&tokVal==="as"){next();node.name=parseIdent(true)}else{node.name=null}nodes.push(finishNode(node,"ExportSpecifier"))}}return nodes}function parseImport(node){next();if(tokType===_string){node.specifiers=[];node.source=parseExprAtom()}else{node.specifiers=parseImportSpecifiers();if(tokType!==_name||tokVal!=="from")unexpected();next();node.source=tokType===_string?parseExprAtom():unexpected()}semicolon();return finishNode(node,"ImportDeclaration")}function parseImportSpecifiers(){var nodes=[],first=true;if(tokType===_name){var node=startNode();node.id=startNode();node.name=parseIdent();checkLVal(node.name,true);node.id.name="default";finishNode(node.id,"Identifier");nodes.push(finishNode(node,"ImportSpecifier"));if(!eat(_comma))return nodes}if(tokType===_star){var node=startNode();next();if(tokType!==_name||tokVal!=="as")unexpected();next();node.name=parseIdent();checkLVal(node.name,true);nodes.push(finishNode(node,"ImportBatchSpecifier"));return nodes}expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(true);if(tokType===_name&&tokVal==="as"){next();node.name=parseIdent()}else{node.name=null}checkLVal(node.name||node.id,true);node["default"]=false;nodes.push(finishNode(node,"ImportSpecifier"))}return nodes}function parseYield(){var node=startNode();next();if(eat(_semi)||canInsertSemicolon()){node.delegate=false;node.argument=null}else{node.delegate=eat(_star);node.argument=parseExpression(true)}return finishNode(node,"YieldExpression")}function parseAwait(node){if(eat(_semi)||canInsertSemicolon()){unexpected()}node.delegate=eat(_star);node.argument=parseExpression(true);return finishNode(node,"AwaitExpression")}function parseComprehension(node,isGenerator){node.blocks=[];while(tokType===_for){var block=startNode();next();expect(_parenL);block.left=toAssignable(parseExprAtom());checkLVal(block.left,true);if(tokType!==_name||tokVal!=="of")unexpected();next();block.of=true;block.right=parseExpression();expect(_parenR);node.blocks.push(finishNode(block,"ComprehensionBlock"))}node.filter=eat(_if)?parseParenExpression():null;node.body=parseExpression();expect(isGenerator?_parenR:_bracketR);node.generator=isGenerator;return finishNode(node,"ComprehensionExpression")}function getQualifiedXJSName(object){if(object.type==="XJSIdentifier"){return object.name}if(object.type==="XJSNamespacedName"){return object.namespace.name+":"+object.name.name}if(object.type==="XJSMemberExpression"){return getQualifiedXJSName(object.object)+"."+getQualifiedXJSName(object.property)}}function parseXJSIdentifier(){var node=startNode();if(tokType===_xjsName){node.name=tokVal}else if(tokType.keyword){node.name=tokType.keyword}else{unexpected()}tokRegexpAllowed=false;next();return finishNode(node,"XJSIdentifier")}function parseXJSNamespacedName(){var node=startNode();node.namespace=parseXJSIdentifier();expect(_colon);node.name=parseXJSIdentifier();return finishNode(node,"XJSNamespacedName")}function parseXJSMemberExpression(){var start=storeCurrentPos();var node=parseXJSIdentifier();while(eat(_dot)){var newNode=startNodeAt(start);newNode.object=node;newNode.property=parseXJSIdentifier();node=finishNode(newNode,"XJSMemberExpression")}return node}function parseXJSElementName(){switch(nextChar()){case":":return parseXJSNamespacedName();case".":return parseXJSMemberExpression();default:return parseXJSIdentifier()}}function parseXJSAttributeName(){if(nextChar()===":"){return parseXJSNamespacedName()}return parseXJSIdentifier()}function parseXJSAttributeValue(){switch(tokType){case _braceL:var node=parseXJSExpressionContainer();if(node.expression.type==="XJSEmptyExpression"){raise(node.start,"XJS attributes must only be assigned a non-empty "+"expression")}return node;case _lt:return parseXJSElement();case _xjsText:return parseExprAtom();default:raise(tokStart,"XJS value should be either an expression or a quoted XJS text")}}function parseXJSEmptyExpression(){if(tokType!==_braceR){unexpected() }var tmp;tmp=tokStart;tokStart=lastEnd;lastEnd=tmp;tmp=tokStartLoc;tokStartLoc=lastEndLoc;lastEndLoc=tmp;return finishNode(startNode(),"XJSEmptyExpression")}function parseXJSExpressionContainer(){var node=startNode();var origInXJSTag=inXJSTag,origInXJSChild=inXJSChild;inXJSTag=false;inXJSChild=false;next();node.expression=tokType===_braceR?parseXJSEmptyExpression():parseExpression();inXJSTag=origInXJSTag;inXJSChild=origInXJSChild;if(inXJSChild){tokPos=tokEnd}expect(_braceR);return finishNode(node,"XJSExpressionContainer")}function parseXJSAttribute(){if(tokType===_braceL){var tokStart1=tokStart,tokStartLoc1=tokStartLoc;var origInXJSTag=inXJSTag;inXJSTag=false;next();if(tokType!==_ellipsis)unexpected();var node=parseMaybeUnary();inXJSTag=origInXJSTag;expect(_braceR);node.type="XJSSpreadAttribute";node.start=tokStart1;node.end=lastEnd;if(options.locations){node.loc.start=tokStartLoc1;node.loc.end=lastEndLoc}if(options.ranges){node.range=[tokStart1,lastEnd]}return node}var node=startNode();node.name=parseXJSAttributeName();if(tokType===_eq){next();node.value=parseXJSAttributeValue()}else{node.value=null}return finishNode(node,"XJSAttribute")}function parseXJSChild(){switch(tokType){case _braceL:return parseXJSExpressionContainer();case _xjsText:return parseExprAtom();default:return parseXJSElement()}}function parseXJSOpeningElement(){var node=startNode(),attributes=node.attributes=[];var origInXJSChild=inXJSChild;var origInXJSTag=inXJSTag;inXJSChild=false;inXJSTag=true;next();node.name=parseXJSElementName();while(tokType!==_eof&&tokType!==_slash&&tokType!==_gt){attributes.push(parseXJSAttribute())}inXJSTag=false;if(node.selfClosing=!!eat(_slash)){inXJSTag=origInXJSTag;inXJSChild=origInXJSChild}else{inXJSChild=true}expect(_gt);return finishNode(node,"XJSOpeningElement")}function parseXJSClosingElement(){var node=startNode();var origInXJSChild=inXJSChild;var origInXJSTag=inXJSTag;inXJSChild=false;inXJSTag=true;tokRegexpAllowed=false;expect(_ltSlash);node.name=parseXJSElementName();skipSpace();inXJSChild=origInXJSChild;inXJSTag=origInXJSTag;tokRegexpAllowed=false;if(inXJSChild){tokPos=tokEnd}expect(_gt);return finishNode(node,"XJSClosingElement")}function parseXJSElement(){var node=startNode();var children=[];var origInXJSChild=inXJSChild;var openingElement=parseXJSOpeningElement();var closingElement=null;if(!openingElement.selfClosing){while(tokType!==_eof&&tokType!==_ltSlash){inXJSChild=true;children.push(parseXJSChild())}inXJSChild=origInXJSChild;closingElement=parseXJSClosingElement();if(getQualifiedXJSName(closingElement.name)!==getQualifiedXJSName(openingElement.name)){raise(closingElement.start,"Expected corresponding XJS closing tag for '"+getQualifiedXJSName(openingElement.name)+"'")}}if(!origInXJSChild&&tokType===_lt){raise(tokStart,"Adjacent XJS elements must be wrapped in an enclosing tag")}node.openingElement=openingElement;node.closingElement=closingElement;node.children=children;return finishNode(node,"XJSElement")}function parseDeclareClass(node){next();parseInterfaceish(node,true);return finishNode(node,"DeclareClass")}function parseDeclareFunction(node){next();var id=node.id=parseIdent();var typeNode=startNode();var typeContainer=startNode();if(tokType===_lt){typeNode.typeParameters=parseTypeParameterDeclaration()}else{typeNode.typeParameters=null}expect(_parenL);var tmp=parseFunctionTypeParams();typeNode.params=tmp.params;typeNode.rest=tmp.rest;expect(_parenR);expect(_colon);typeNode.returnType=parseType();typeContainer.typeAnnotation=finishNode(typeNode,"FunctionTypeAnnotation");id.typeAnnotation=finishNode(typeContainer,"TypeAnnotation");finishNode(id,id.type);semicolon();return finishNode(node,"DeclareFunction")}function parseDeclare(node){if(tokType===_class){return parseDeclareClass(node)}else if(tokType===_function){return parseDeclareFunction(node)}else if(tokType===_var){return parseDeclareVariable(node)}else if(tokType===_name&&tokVal==="module"){return parseDeclareModule(node)}else{unexpected()}}function parseDeclareVariable(node){next();node.id=parseTypeAnnotatableIdentifier();semicolon();return finishNode(node,"DeclareVariable")}function parseDeclareModule(node){next();if(tokType===_string){node.id=parseExprAtom()}else{node.id=parseIdent()}var bodyNode=node.body=startNode();var body=bodyNode.body=[];expect(_braceL);while(tokType!==_braceR){var node2=startNode();next();body.push(parseDeclare(node2))}expect(_braceR);finishNode(bodyNode,"BlockStatement");return finishNode(node,"DeclareModule")}function parseInterfaceish(node,allowStatic){node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}else{node.typeParameters=null}node.extends=[];if(eat(_extends)){do{node.extends.push(parseInterfaceExtends())}while(eat(_comma))}node.body=parseObjectType(allowStatic)}function parseInterfaceExtends(){var node=startNode();node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterInstantiation()}else{node.typeParameters=null}return finishNode(node,"InterfaceExtends")}function parseInterface(node){parseInterfaceish(node,false);return finishNode(node,"InterfaceDeclaration")}function parseTypeAlias(node){node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}else{node.typeParameters=null}expect(_eq);node.right=parseType();semicolon();return finishNode(node,"TypeAlias")}function parseTypeParameterDeclaration(){var node=startNode();node.params=[];expect(_lt);while(tokType!==_gt){node.params.push(parseIdent());if(tokType!==_gt){expect(_comma)}}expect(_gt);return finishNode(node,"TypeParameterDeclaration")}function parseTypeParameterInstantiation(){var node=startNode(),oldInType=inType;node.params=[];inType=true;expect(_lt);while(tokType!==_gt){node.params.push(parseType());if(tokType!==_gt){expect(_comma)}}expect(_gt);inType=oldInType;return finishNode(node,"TypeParameterInstantiation")}function parseObjectPropertyKey(){return tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function parseObjectTypeIndexer(node,isStatic){node.static=isStatic;expect(_bracketL);node.id=parseObjectPropertyKey();expect(_colon);node.key=parseType();expect(_bracketR);expect(_colon);node.value=parseType();return finishNode(node,"ObjectTypeIndexer")}function parseObjectTypeMethodish(node){node.params=[];node.rest=null;node.typeParameters=null;if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}expect(_parenL);while(tokType===_name){node.params.push(parseFunctionTypeParam());if(tokType!==_parenR){expect(_comma)}}if(eat(_ellipsis)){node.rest=parseFunctionTypeParam()}expect(_parenR);expect(_colon);node.returnType=parseType();return finishNode(node,"FunctionTypeAnnotation")}function parseObjectTypeMethod(start,isStatic,key){var node=startNodeAt(start);node.value=parseObjectTypeMethodish(startNodeAt(start));node.static=isStatic;node.key=key;node.optional=false;return finishNode(node,"ObjectTypeProperty")}function parseObjectTypeCallProperty(node,isStatic){var valueNode=startNode();node.static=isStatic;node.value=parseObjectTypeMethodish(valueNode);return finishNode(node,"ObjectTypeCallProperty")}function parseObjectType(allowStatic){var nodeStart=startNode();var node;var optional=false;var property;var propertyKey;var propertyTypeAnnotation;var token;var isStatic;nodeStart.callProperties=[];nodeStart.properties=[];nodeStart.indexers=[];expect(_braceL);while(tokType!==_braceR){var start=storeCurrentPos();node=startNode();if(allowStatic&&tokType===_name&&tokVal==="static"){next();isStatic=true}if(tokType===_bracketL){nodeStart.indexers.push(parseObjectTypeIndexer(node,isStatic))}else if(tokType===_parenL||tokType===_lt){nodeStart.callProperties.push(parseObjectTypeCallProperty(node,allowStatic))}else{if(isStatic&&tokType===_colon){propertyKey=parseIdent()}else{propertyKey=parseObjectPropertyKey()}if(tokType===_lt||tokType===_parenL){nodeStart.properties.push(parseObjectTypeMethod(start,isStatic,propertyKey))}else{if(eat(_question)){optional=true}expect(_colon);node.key=propertyKey;node.value=parseType();node.optional=optional;node.static=isStatic;nodeStart.properties.push(finishNode(node,"ObjectTypeProperty"))}}if(!eat(_semi)&&tokType!==_braceR){unexpected()}}expect(_braceR);return finishNode(nodeStart,"ObjectTypeAnnotation")}function parseGenericType(start,id){var node=startNodeAt(start);node.typeParameters=null;node.id=id;while(eat(_dot)){var node2=startNodeAt(start);node2.qualification=node.id;node2.id=parseIdent();node.id=finishNode(node2,"QualifiedTypeIdentifier")}if(tokType===_lt){node.typeParameters=parseTypeParameterInstantiation()}return finishNode(node,"GenericTypeAnnotation")}function parseVoidType(){var node=startNode();expect(keywordTypes["void"]);return finishNode(node,"VoidTypeAnnotation")}function parseTypeofType(){var node=startNode();expect(keywordTypes["typeof"]);node.argument=parsePrimaryType();return finishNode(node,"TypeofTypeAnnotation")}function parseTupleType(){var node=startNode();node.types=[];expect(_bracketL);while(tokPos<inputLen&&tokType!==_bracketR){node.types.push(parseType());if(tokType===_bracketR)break;expect(_comma)}expect(_bracketR);return finishNode(node,"TupleTypeAnnotation")}function parseFunctionTypeParam(){var optional=false;var node=startNode();node.name=parseIdent();if(eat(_question)){optional=true}expect(_colon);node.optional=optional;node.typeAnnotation=parseType();return finishNode(node,"FunctionTypeParam")}function parseFunctionTypeParams(){var ret={params:[],rest:null};while(tokType===_name){ret.params.push(parseFunctionTypeParam());if(tokType!==_parenR){expect(_comma)}}if(eat(_ellipsis)){ret.rest=parseFunctionTypeParam()}return ret}function identToTypeAnnotation(start,node,id){switch(id.name){case"any":return finishNode(node,"AnyTypeAnnotation");case"bool":case"boolean":return finishNode(node,"BooleanTypeAnnotation");case"number":return finishNode(node,"NumberTypeAnnotation");case"string":return finishNode(node,"StringTypeAnnotation");default:return parseGenericType(start,id)}}function parsePrimaryType(){var typeIdentifier=null;var params=null;var returnType=null;var start=storeCurrentPos();var node=startNode();var rest=null;var tmp;var typeParameters;var token;var type;var isGroupedType=false;switch(tokType){case _name:return identToTypeAnnotation(start,node,parseIdent());case _braceL:return parseObjectType();case _bracketL:return parseTupleType();case _lt:node.typeParameters=parseTypeParameterDeclaration();expect(_parenL);tmp=parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;expect(_parenR);expect(_arrow);node.returnType=parseType();return finishNode(node,"FunctionTypeAnnotation");case _parenL:next();var tmpId;if(tokType!==_parenR&&tokType!==_ellipsis){if(tokType===_name){}else{isGroupedType=true}}if(isGroupedType){if(tmpId&&_parenR){type=tmpId}else{type=parseType();expect(_parenR)}if(eat(_arrow)){raise(node,"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType")}return type}tmp=parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;expect(_parenR);expect(_arrow);node.returnType=parseType();node.typeParameters=null;return finishNode(node,"FunctionTypeAnnotation");case _string:node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"StringLiteralTypeAnnotation");default:if(tokType.keyword){switch(tokType.keyword){case"void":return parseVoidType();case"typeof":return parseTypeofType()}}}unexpected()}function parsePostfixType(){var node=startNode();var type=node.elementType=parsePrimaryType();if(tokType===_bracketL){expect(_bracketL);expect(_bracketR);return finishNode(node,"ArrayTypeAnnotation")}return type}function parsePrefixType(){var node=startNode();if(eat(_question)){node.typeAnnotation=parsePrefixType();return finishNode(node,"NullableTypeAnnotation")}return parsePostfixType()}function parseIntersectionType(){var node=startNode();var type=parsePrefixType();node.types=[type];while(eat(_bitwiseAND)){node.types.push(parsePrefixType())}return node.types.length===1?type:finishNode(node,"IntersectionTypeAnnotation")}function parseUnionType(){var node=startNode();var type=parseIntersectionType();node.types=[type];while(eat(_bitwiseOR)){node.types.push(parseIntersectionType())}return node.types.length===1?type:finishNode(node,"UnionTypeAnnotation")}function parseType(){var oldInType=inType;inType=true;var type=parseUnionType();inType=oldInType;return type}function parseTypeAnnotation(){var node=startNode();expect(_colon);node.typeAnnotation=parseType();return finishNode(node,"TypeAnnotation")}function parseTypeAnnotatableIdentifier(requireTypeAnnotation,canBeOptionalParam){var node=startNode();var ident=parseIdent();var isOptionalParam=false;if(canBeOptionalParam&&eat(_question)){expect(_question);isOptionalParam=true}if(requireTypeAnnotation||tokType===_colon){ident.typeAnnotation=parseTypeAnnotation();finishNode(ident,ident.type)}if(isOptionalParam){ident.optional=true;finishNode(ident,ident.type)}return ident}})},{}],2:[function(require,module,exports){(function(global){var transform=module.exports=require("./transformation/transform");transform.transform=transform;transform.run=function(code,opts){opts=opts||{};opts.sourceMap="inline";return new Function(transform(code,opts).code)()};transform.load=function(url,callback,opts,hold){opts=opts||{};opts.filename=opts.filename||url;var xhr=global.ActiveXObject?new global.ActiveXObject("Microsoft.XMLHTTP"):new global.XMLHttpRequest;xhr.open("GET",url,true);if("overrideMimeType"in xhr)xhr.overrideMimeType("text/plain");xhr.onreadystatechange=function(){if(xhr.readyState!==4)return;var status=xhr.status;if(status===0||status===200){var param=[xhr.responseText,opts];if(!hold)transform.run.apply(transform,param);if(callback)callback(param)}else{throw new Error("Could not load "+url)}};xhr.send(null)};var runScripts=function(){var scripts=[];var types=["text/ecmascript-6","text/6to5"];var index=0;var exec=function(){var param=scripts[index];if(param instanceof Array){transform.run.apply(transform,param);index++;exec()}};var run=function(script,i){var opts={};if(script.src){transform.load(script.src,function(param){scripts[i]=param;exec()},opts,true)}else{opts.filename="embedded";scripts[i]=[script.innerHTML,opts]}};var _scripts=global.document.getElementsByTagName("script");for(var i in _scripts){var _script=_scripts[i];if(types.indexOf(_script.type)>=0)scripts.push(_script)}for(i in scripts){run(scripts[i],i)}exec()};if(global.addEventListener){global.addEventListener("DOMContentLoaded",runScripts,false)}else if(global.attachEvent){global.attachEvent("onload",runScripts)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./transformation/transform":31}],3:[function(require,module,exports){module.exports=File;var SHEBANG_REGEX=/^\#\!.*/;var transform=require("./transformation/transform");var generate=require("./generation/generator");var Scope=require("./traverse/scope");var util=require("./util");var t=require("./types");var _=require("lodash");function File(opts){this.opts=File.normaliseOptions(opts);this.uids={};this.ast={}}File.declarations=["inherits","prototype-properties","apply-constructor","tagged-template-literal","interop-require","to-array","object-without-properties","has-own","slice"];File.normaliseOptions=function(opts){opts=_.cloneDeep(opts||{});_.defaults(opts,{experimental:false,playground:false,whitespace:true,blacklist:[],whitelist:[],sourceMap:false,comments:true,filename:"unknown",modules:"common",runtime:false,code:true,ast:true});opts.filename=opts.filename.replace(/\\/g,"/");opts.blacklist=util.arrayify(opts.blacklist);opts.whitelist=util.arrayify(opts.whitelist);_.defaults(opts,{moduleRoot:opts.sourceRoot});_.defaults(opts,{sourceRoot:opts.moduleRoot});_.defaults(opts,{filenameRelative:opts.filename});_.defaults(opts,{sourceFileName:opts.filenameRelative,sourceMapName:opts.filenameRelative});if(opts.runtime===true){opts.runtime="to5Runtime"}if(opts.playground){opts.experimental=true}transform._ensureTransformerNames("blacklist",opts.blacklist);transform._ensureTransformerNames("whitelist",opts.whitelist);return opts};File.prototype.toArray=function(node){if(t.isArrayExpression(node)){return node}else if(t.isIdentifier(node)&&node.name==="arguments"){return t.callExpression(t.memberExpression(this.addDeclaration("slice"),t.identifier("call")),[node])}else{return t.callExpression(this.addDeclaration("to-array"),[node])}};File.prototype.getModuleFormatter=function(type){var ModuleFormatter=_.isFunction(type)?type:transform.moduleFormatters[type];if(!ModuleFormatter){var loc=util.resolve(type);if(loc)ModuleFormatter=require(loc)}if(!ModuleFormatter){throw new ReferenceError("Unknown module formatter type "+JSON.stringify(type))}return new ModuleFormatter(this)};File.prototype.parseShebang=function(code){var shebangMatch=code.match(SHEBANG_REGEX);if(shebangMatch){this.shebang=shebangMatch[0];code=code.replace(SHEBANG_REGEX,"")}return code};File.prototype.addDeclaration=function(name){if(!_.contains(File.declarations,name)){throw new ReferenceError("unknown declaration "+name)}var program=this.ast.program;var declar=program._declarations&&program._declarations[name];if(declar)return declar.id;var ref;var runtimeNamespace=this.opts.runtime;if(runtimeNamespace){name=t.identifier(t.toIdentifier(name));return t.memberExpression(t.identifier(runtimeNamespace),name)}else{ref=util.template(name)}var uid=this.generateUidIdentifier(name);this.scope.push({key:name,id:uid,init:ref});return uid};File.prototype.errorWithNode=function(node,msg,Error){Error=Error||SyntaxError;var loc=node.loc.start;var err=new Error("Line "+loc.line+": "+msg);err.loc=loc;return err};File.prototype.addCode=function(code){code=(code||"")+"";this.code=code;return this.parseShebang(code)};File.prototype.parse=function(code){var self=this;code=this.addCode(code);return util.parse(this.opts,code,function(tree){self.transform(tree);return self.generate()})};File.prototype.transform=function(ast){this.ast=ast;this.scope=new Scope(ast.program);this.moduleFormatter=this.getModuleFormatter(this.opts.modules);var self=this;_.each(transform.transformers,function(transformer){transformer.transform(self)})};File.prototype.generate=function(){var opts=this.opts;var ast=this.ast;var result={code:"",map:null,ast:null};if(opts.ast)result.ast=ast;if(!opts.code)return result;var _result=generate(ast,opts,this.code);result.code=_result.code;result.map=_result.map;if(this.shebang){result.code=this.shebang+"\n"+result.code}if(opts.sourceMap==="inline"){result.code+="\n"+util.sourceMapToComment(result.map)}return result};File.prototype.generateUid=function(name,scope){name=t.toIdentifier(name);scope=scope||this.scope;var uid;do{uid=this._generateUid(name)}while(scope.has(uid));return uid};File.prototype.generateUidIdentifier=function(name,scope){return t.identifier(this.generateUid(name,scope))};File.prototype._generateUid=function(name){var uids=this.uids;var i=uids[name]||1;var id=name;if(i>1)id+=i;uids[name]=i+1;return"_"+id}},{"./generation/generator":5,"./transformation/transform":31,"./traverse/scope":69,"./types":72,"./util":74,lodash:121}],4:[function(require,module,exports){module.exports=Buffer;var util=require("../util");var _=require("lodash");function Buffer(position,format){this.position=position;this._indent=format.indent.base;this.format=format;this.buf=""}Buffer.prototype.get=function(){return util.trimRight(this.buf)};Buffer.prototype.getIndent=function(){if(this.format.compact){return""}else{return util.repeat(this._indent,this.format.indent.style)}};Buffer.prototype.indentSize=function(){return this.getIndent().length};Buffer.prototype.indent=function(){this._indent++};Buffer.prototype.dedent=function(){this._indent--};Buffer.prototype.semicolon=function(){this.push(";")};Buffer.prototype.ensureSemicolon=function(){if(!this.isLast(";"))this.semicolon()};Buffer.prototype.rightBrace=function(){this.newline(true);this.push("}")};Buffer.prototype.keyword=function(name){this.push(name);this.push(" ")};Buffer.prototype.space=function(){if(this.buf&&!this.isLast([" ","\n"])){this.push(" ")}};Buffer.prototype.removeLast=function(cha){if(!this.isLast(cha))return;this.buf=this.buf.slice(0,-1);this.position.unshift(cha)};Buffer.prototype.newline=function(i,removeLast){if(this.format.compact)return;if(_.isBoolean(i)){removeLast=i;i=null}if(_.isNumber(i)){if(this.endsWith("{\n"))i--;if(this.endsWith(util.repeat(i,"\n")))return;var self=this;_.times(i,function(){self.newline(null,removeLast)});return}if(removeLast&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this.buf=this.buf.replace(/\n +$/,"\n");this._push("\n")};Buffer.prototype.push=function(str,noIndent){if(this._indent&&!noIndent&&str!=="\n"){var indent=this.getIndent();str=str.replace(/\n/g,"\n"+indent);if(this.isLast("\n"))str=indent+str}this._push(str)};Buffer.prototype._push=function(str){this.position.push(str);this.buf+=str};Buffer.prototype.endsWith=function(str){return this.buf.slice(-str.length)===str};Buffer.prototype.isLast=function(cha,trimRight){var buf=this.buf;if(trimRight)buf=util.trimRight(buf);var chars=[].concat(cha);return _.contains(chars,_.last(buf))}},{"../util":74,lodash:121}],5:[function(require,module,exports){module.exports=function(ast,opts,code){var gen=new CodeGenerator(ast,opts,code);return gen.generate()};module.exports.CodeGenerator=CodeGenerator;var Whitespace=require("./whitespace");var SourceMap=require("./source-map");var Position=require("./position");var Buffer=require("./buffer");var util=require("../util");var n=require("./node");var t=require("../types");var _=require("lodash");function CodeGenerator(ast,opts,code){opts=opts||{};this.comments=ast.comments||[];this.tokens=ast.tokens||[];this.format=CodeGenerator.normaliseOptions(opts);this.ast=ast;this.whitespace=new Whitespace(this.tokens,this.comments);this.position=new Position;this.map=new SourceMap(this.position,opts,code);this.buffer=new Buffer(this.position,this.format)}_.each(Buffer.prototype,function(fn,key){CodeGenerator.prototype[key]=function(){return fn.apply(this.buffer,arguments)}});CodeGenerator.normaliseOptions=function(opts){return _.merge({parentheses:true,comments:opts.comments==null||opts.comments,compact:false,indent:{adjustMultilineComment:true,style:" ",base:0}},opts.format||{})};CodeGenerator.generators={templateLiterals:require("./generators/template-literals"),comprehensions:require("./generators/comprehensions"),expressions:require("./generators/expressions"),statements:require("./generators/statements"),playground:require("./generators/playground"),classes:require("./generators/classes"),methods:require("./generators/methods"),modules:require("./generators/modules"),types:require("./generators/types"),flow:require("./generators/flow"),base:require("./generators/base"),jsx:require("./generators/jsx")};_.each(CodeGenerator.generators,function(generator){_.extend(CodeGenerator.prototype,generator)});CodeGenerator.prototype.generate=function(){var ast=this.ast;this.print(ast);var comments=[];_.each(ast.comments,function(comment){if(!comment._displayed)comments.push(comment)});this._printComments(comments);return{map:this.map.get(),code:this.buffer.get()}};CodeGenerator.prototype.buildPrint=function(parent){var self=this;var print=function(node,opts){return self.print(node,parent,opts)};print.sequence=function(nodes,opts){opts=opts||{};opts.statement=true;return self.printJoin(print,nodes,opts)};print.join=function(nodes,opts){return self.printJoin(print,nodes,opts)};print.block=function(node){return self.printBlock(print,node)};print.indentOnComments=function(node){return self.printAndIndentOnComments(print,node)};return print};CodeGenerator.prototype.print=function(node,parent,opts){if(!node)return"";var self=this;opts=opts||{};var newline=function(leading){if(!opts.statement&&!n.isUserWhitespacable(node,parent)){return}var lines=0;if(node.start!=null){if(leading){lines=self.whitespace.getNewlinesBefore(node)}else{lines=self.whitespace.getNewlinesAfter(node)}}else{if(!leading)lines++;var needs=n.needsWhitespaceAfter;if(leading)needs=n.needsWhitespaceBefore;lines+=needs(node,parent);if(!self.buffer.get())lines=0}self.newline(lines)};if(this[node.type]){this.printLeadingComments(node,parent);newline(true);if(opts.before)opts.before();this.map.mark(node,"start");var needsParens=n.needsParens(node,parent);if(needsParens)this.push("(");this[node.type](node,this.buildPrint(node),parent);if(needsParens)this.push(")");this.map.mark(node,"end");if(opts.after)opts.after();newline(false);this.printTrailingComments(node,parent)}else{throw new ReferenceError("unknown node "+node.type)}};CodeGenerator.prototype.printJoin=function(print,nodes,opts){if(!nodes||!nodes.length)return;opts=opts||{};var self=this;var len=nodes.length;if(opts.indent)self.indent();_.each(nodes,function(node,i){print(node,{statement:opts.statement,after:function(){if(opts.iterator){opts.iterator(node,i)}if(opts.separator&&i<len-1){self.push(opts.separator)}}})});if(opts.indent)self.dedent()};CodeGenerator.prototype.printAndIndentOnComments=function(print,node){var indent=!!node.leadingComments;if(indent)this.indent();print(node);if(indent)this.dedent()};CodeGenerator.prototype.printBlock=function(print,node){if(t.isEmptyStatement(node)){this.semicolon()}else{this.push(" ");print(node)}};CodeGenerator.prototype.generateComment=function(comment){var val=comment.value;if(comment.type==="Line"){val="//"+val}else{val="/*"+val+"*/"}return val};CodeGenerator.prototype.printTrailingComments=function(node,parent){this._printComments(this.getComments("trailingComments",node,parent))};CodeGenerator.prototype.printLeadingComments=function(node,parent){this._printComments(this.getComments("leadingComments",node,parent))};CodeGenerator.prototype.getComments=function(key,node,parent){if(t.isExpressionStatement(parent)){return[]}var comments=[];var nodes=[node];var self=this;if(t.isExpressionStatement(node)){nodes.push(node.argument)}_.each(nodes,function(node){comments=comments.concat(self._getComments(key,node))});return comments};CodeGenerator.prototype._getComments=function(key,node){return node&&node[key]||[]};CodeGenerator.prototype._printComments=function(comments){if(this.format.compact)return;if(!this.format.comments)return;if(!comments||!comments.length)return;var self=this;_.each(comments,function(comment){_.each(self.ast.comments,function(origComment){if(origComment.start===comment.start){origComment._displayed=true;return false}});self.newline(self.whitespace.getNewlinesBefore(comment));var column=self.position.column;var val=self.generateComment(comment);if(column&&!self.isLast(["\n"," ","[","{"])){self._push(" ");column++}if(comment.type==="Block"&&self.format.indent.adjustMultilineComment){var offset=comment.loc.start.column;if(offset){var newlineRegex=new RegExp("\\n\\s{1,"+offset+"}","g");val=val.replace(newlineRegex,"\n")}var indent=Math.max(self.indentSize(),column);val=val.replace(/\n/g,"\n"+util.repeat(indent))}if(column===0){val=self.getIndent()+val}self._push(val);self.newline(self.whitespace.getNewlinesAfter(comment))})}},{"../types":72,"../util":74,"./buffer":4,"./generators/base":6,"./generators/classes":7,"./generators/comprehensions":8,"./generators/expressions":9,"./generators/flow":10,"./generators/jsx":11,"./generators/methods":12,"./generators/modules":13,"./generators/playground":14,"./generators/statements":15,"./generators/template-literals":16,"./generators/types":17,"./node":18,"./position":21,"./source-map":22,"./whitespace":23,lodash:121}],6:[function(require,module,exports){exports.File=function(node,print){print(node.program)};exports.Program=function(node,print){print.sequence(node.body)};exports.BlockStatement=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();print.sequence(node.body,{indent:true});this.removeLast("\n");this.rightBrace()}}},{}],7:[function(require,module,exports){exports.ClassExpression=exports.ClassDeclaration=function(node,print){this.push("class");if(node.id){this.space();print(node.id)}if(node.superClass){this.push(" extends ");print(node.superClass)}this.space();print(node.body)};exports.ClassBody=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();this.indent();print.sequence(node.body);this.dedent();this.rightBrace()}};exports.MethodDefinition=function(node,print){if(node.static){this.push("static ")}this._method(node,print)}},{}],8:[function(require,module,exports){exports.ComprehensionBlock=function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" of ");print(node.right);this.push(")")};exports.ComprehensionExpression=function(node,print){this.push(node.generator?"(":"[");print.join(node.blocks,{separator:" "});this.space();if(node.filter){this.keyword("if");this.push("(");print(node.filter);this.push(")");this.space()}print(node.body);this.push(node.generator?")":"]")}},{}],9:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.UnaryExpression=function(node,print){var hasSpace=/[a-z]$/.test(node.operator);var arg=node.argument;if(t.isUpdateExpression(arg)||t.isUnaryExpression(arg)){hasSpace=true}if(t.isUnaryExpression(arg)&&arg.operator==="!"){hasSpace=false}this.push(node.operator);if(hasSpace)this.space();print(node.argument)};exports.UpdateExpression=function(node,print){if(node.prefix){this.push(node.operator);print(node.argument)}else{print(node.argument);this.push(node.operator)}};exports.ConditionalExpression=function(node,print){print(node.test);this.push(" ? ");print(node.consequent);this.push(" : ");print(node.alternate)};exports.NewExpression=function(node,print){this.push("new ");print(node.callee);if(node.arguments.length||this.format.parentheses){this.push("(");print.join(node.arguments,{separator:", "});this.push(")")}};exports.SequenceExpression=function(node,print){print.join(node.expressions,{separator:", "})};exports.ThisExpression=function(){this.push("this")};exports.CallExpression=function(node,print){print(node.callee);this.push("(");print.join(node.arguments,{separator:", "});this.push(")")};var buildYieldAwait=function(keyword){return function(node,print){this.push(keyword);if(node.delegate)this.push("*");if(node.argument){this.space();print(node.argument)}}};exports.YieldExpression=buildYieldAwait("yield");exports.AwaitExpression=buildYieldAwait("await");exports.EmptyStatement=function(){this.semicolon()};exports.ExpressionStatement=function(node,print){print(node.expression);this.semicolon()};exports.BinaryExpression=exports.LogicalExpression=exports.AssignmentExpression=function(node,print){print(node.left);this.push(" "+node.operator+" ");print(node.right)};var SCIENTIFIC_NOTATION=/e/i;exports.MemberExpression=function(node,print){var obj=node.object;print(obj);if(node.computed){this.push("[");print(node.property);this.push("]")}else{if(t.isLiteral(obj)&&util.isInteger(obj.value)&&!SCIENTIFIC_NOTATION.test(obj.value.toString())){this.push(".")}this.push(".");print(node.property)}}},{"../../types":72,"../../util":74}],10:[function(require,module,exports){exports.ClassProperty=function(){throw new Error("not implemented")}},{}],11:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.XJSAttribute=function(node,print){print(node.name);if(node.value){this.push("=");print(node.value)}};exports.XJSIdentifier=function(node){this.push(node.name)};exports.XJSNamespacedName=function(node,print){print(node.namespace);this.push(":");print(node.name)};exports.XJSMemberExpression=function(node,print){print(node.object); this.push(".");print(node.property)};exports.XJSSpreadAttribute=function(node,print){this.push("{...");print(node.argument);this.push("}")};exports.XJSExpressionContainer=function(node,print){this.push("{");print(node.expression);this.push("}")};exports.XJSElement=function(node,print){var self=this;var open=node.openingElement;print(open);if(open.selfClosing)return;this.indent();_.each(node.children,function(child){if(t.isLiteral(child)){self.push(child.value)}else{print(child)}});this.dedent();print(node.closingElement)};exports.XJSOpeningElement=function(node,print){this.push("<");print(node.name);if(node.attributes.length>0){this.space();print.join(node.attributes,{separator:" "})}this.push(node.selfClosing?" />":">")};exports.XJSClosingElement=function(node,print){this.push("</");print(node.name);this.push(">")};exports.XJSEmptyExpression=function(){}},{"../../types":72,lodash:121}],12:[function(require,module,exports){var t=require("../../types");exports._params=function(node,print){var self=this;this.push("(");print.join(node.params,{separator:", ",iterator:function(param,i){var def=node.defaults&&node.defaults[i];if(def){self.push(" = ");print(def)}}});if(node.rest){if(node.params.length){this.push(", ")}this.push("...");print(node.rest)}this.push(")")};exports._method=function(node,print){var value=node.value;var kind=node.kind;var key=node.key;if(!kind||kind==="init"){if(value.generator){this.push("*")}}else{this.push(kind+" ")}if(value.async)this.push("async ");if(node.computed){this.push("[");print(key);this.push("]")}else{print(key)}this._params(value,print);this.space();print(value.body)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,print){if(node.async)this.push("async ");this.push("function");if(node.generator)this.push("*");this.space();if(node.id)print(node.id);this._params(node,print);this.space();print(node.body)};exports.ArrowFunctionExpression=function(node,print){if(node.async)this.push("async ");if(node.params.length===1&&!node.defaults.length&&!node.rest&&t.isIdentifier(node.params[0])){print(node.params[0])}else{this._params(node,print)}this.push(" => ");print(node.body)}},{"../../types":72}],13:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.ImportSpecifier=function(node,print){if(node.id&&node.id.name==="default"){print(node.name)}else{return exports.ExportSpecifier.apply(this,arguments)}};exports.ExportSpecifier=function(node,print){print(node.id);if(node.name){this.push(" as ");print(node.name)}};exports.ExportBatchSpecifier=function(){this.push("*")};exports.ExportDeclaration=function(node,print){this.push("export ");var specifiers=node.specifiers;if(node.default){this.push("default ")}if(node.declaration){print(node.declaration);if(t.isStatement(node.declaration))return}else{if(specifiers.length===1&&t.isExportBatchSpecifier(specifiers[0])){print(specifiers[0])}else{this.push("{");if(specifiers.length){this.space();print.join(specifiers,{separator:", "});this.space()}this.push("}")}if(node.source){this.push(" from ");print(node.source)}}this.ensureSemicolon()};exports.ImportDeclaration=function(node,print){var self=this;this.push("import ");var specfiers=node.specifiers;if(specfiers&&specfiers.length){var foundImportSpecifier=false;_.each(node.specifiers,function(spec,i){if(+i>0){self.push(", ")}var isDefault=spec.id&&spec.id.name==="default";if(!isDefault&&spec.type!=="ImportBatchSpecifier"&&!foundImportSpecifier){foundImportSpecifier=true;self.push("{ ")}print(spec)});if(foundImportSpecifier){this.push(" }")}this.push(" from ")}print(node.source);this.semicolon()};exports.ImportBatchSpecifier=function(node,print){this.push("* as ");print(node.name)}},{"../../types":72,lodash:121}],14:[function(require,module,exports){var _=require("lodash");_.each(["BindMemberExpression","BindFunctionExpression"],function(type){exports[type]=function(){throw new ReferenceError("Trying to render non-standard playground node "+JSON.stringify(type))}})},{lodash:121}],15:[function(require,module,exports){var t=require("../../types");exports.WithStatement=function(node,print){this.keyword("with");this.push("(");print(node.object);this.push(")");print.block(node.body)};exports.IfStatement=function(node,print){this.keyword("if");this.push("(");print(node.test);this.push(") ");print.indentOnComments(node.consequent);if(node.alternate){if(this.isLast("}"))this.space();this.keyword("else");print.indentOnComments(node.alternate)}};exports.ForStatement=function(node,print){this.keyword("for");this.push("(");print(node.init);this.push(";");if(node.test){this.space();print(node.test)}this.push(";");if(node.update){this.space();print(node.update)}this.push(")");print.block(node.body)};exports.WhileStatement=function(node,print){this.keyword("while");this.push("(");print(node.test);this.push(")");print.block(node.body)};var buildForXStatement=function(op){return function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" "+op+" ");print(node.right);this.push(")");print.block(node.body)}};exports.ForInStatement=buildForXStatement("in");exports.ForOfStatement=buildForXStatement("of");exports.DoWhileStatement=function(node,print){this.keyword("do");print(node.body);this.space();this.keyword("while");this.push("(");print(node.test);this.push(");")};var buildLabelStatement=function(prefix,key){return function(node,print){this.push(prefix);var label=node[key||"label"];if(label){this.space();print(label)}this.semicolon()}};exports.ContinueStatement=buildLabelStatement("continue");exports.ReturnStatement=buildLabelStatement("return","argument");exports.BreakStatement=buildLabelStatement("break");exports.LabeledStatement=function(node,print){print(node.label);this.push(": ");print(node.body)};exports.TryStatement=function(node,print){this.keyword("try");print(node.block);this.space();print(node.handler);if(node.finalizer){this.space();this.push("finally ");print(node.finalizer)}};exports.CatchClause=function(node,print){this.keyword("catch");this.push("(");print(node.param);this.push(") ");print(node.body)};exports.ThrowStatement=function(node,print){this.push("throw ");print(node.argument);this.semicolon()};exports.SwitchStatement=function(node,print){this.keyword("switch");this.push("(");print(node.discriminant);this.push(") {");print.sequence(node.cases,{indent:true});this.push("}")};exports.SwitchCase=function(node,print){if(node.test){this.push("case ");print(node.test);this.push(":")}else{this.push("default:")}this.space();print.sequence(node.consequent,{indent:true})};exports.DebuggerStatement=function(){this.push("debugger;")};exports.VariableDeclaration=function(node,print,parent){this.push(node.kind+" ");print.join(node.declarations,{separator:", "});if(!t.isFor(parent)){this.semicolon()}};exports.PrivateDeclaration=function(node,print){this.push("private ");print.join(node.declarations,{separator:", "});this.semicolon()};exports.VariableDeclarator=function(node,print){if(node.init){print(node.id);this.push(" = ");print(node.init)}else{print(node.id)}}},{"../../types":72}],16:[function(require,module,exports){var _=require("lodash");exports.TaggedTemplateExpression=function(node,print){print(node.tag);print(node.quasi)};exports.TemplateElement=function(node){this._push(node.value.raw)};exports.TemplateLiteral=function(node,print){this.push("`");var quasis=node.quasis;var self=this;var len=quasis.length;_.each(quasis,function(quasi,i){print(quasi);if(i+1<len){self.push("${ ");print(node.expressions[i]);self.push(" }")}});this._push("`")}},{lodash:121}],17:[function(require,module,exports){var _=require("lodash");exports.Identifier=function(node){this.push(node.name)};exports.SpreadElement=exports.SpreadProperty=function(node,print){this.push("...");print(node.argument)};exports.VirtualPropertyExpression=function(node,print){print(node.object);this.push("::");print(node.property)};exports.ObjectExpression=exports.ObjectPattern=function(node,print){var props=node.properties;if(props.length){this.push("{");this.space();print.join(props,{separator:", ",indent:true});this.space();this.push("}")}else{this.push("{}")}};exports.Property=function(node,print){if(node.method||node.kind==="get"||node.kind==="set"){this._method(node,print)}else{if(node.computed){this.push("[");print(node.key);this.push("]")}else{print(node.key);if(node.shorthand)return}this.push(": ");print(node.value)}};exports.ArrayExpression=exports.ArrayPattern=function(node,print){var elems=node.elements;var self=this;var len=elems.length;this.push("[");_.each(elems,function(elem,i){if(!elem){self.push(",")}else{if(i>0)self.push(" ");print(elem);if(i<len-1)self.push(",")}});this.push("]")};exports.Literal=function(node){var val=node.value;var type=typeof val;if(type==="string"){val=JSON.stringify(val);val=val.replace(/[\u000A\u000D\u2028\u2029]/g,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)});this.push(val)}else if(type==="boolean"||type==="number"){this.push(JSON.stringify(val))}else if(node.regex){this.push("/"+node.regex.pattern+"/"+node.regex.flags)}else if(val===null){this.push("null")}}},{lodash:121}],18:[function(require,module,exports){module.exports=Node;var whitespace=require("./whitespace");var parens=require("./parentheses");var t=require("../../types");var _=require("lodash");var find=function(obj,node,parent){var result;_.each(obj,function(fn,type){if(t["is"+type](node)){result=fn(node,parent);if(result!=null)return false}});return result};function Node(node,parent){this.parent=parent;this.node=node}Node.prototype.isUserWhitespacable=function(){return t.isUserWhitespacable(this.node)};Node.prototype.needsWhitespace=function(type){var parent=this.parent;var node=this.node;if(!node)return 0;if(t.isExpressionStatement(node)){node=node.expression}var lines=find(whitespace[type].nodes,node,parent);if(lines)return lines;_.each(find(whitespace[type].list,node,parent),function(expr){lines=Node.needsWhitespace(expr,node,type);if(lines)return false});return lines||0};Node.prototype.needsWhitespaceBefore=function(){return this.needsWhitespace("before")};Node.prototype.needsWhitespaceAfter=function(){return this.needsWhitespace("after")};Node.prototype.needsParens=function(){var parent=this.parent;var node=this.node;if(!parent)return false;if(t.isNewExpression(parent)&&parent.callee===node){return t.isCallExpression(node)||_.some(node,function(val){return t.isCallExpression(val)})}return find(parens,node,parent)};_.each(Node.prototype,function(fn,key){Node[key]=function(node,parent){var n=new Node(node,parent);var args=_.toArray(arguments).slice(2);return n[key].apply(n,args)}})},{"../../types":72,"./parentheses":19,"./whitespace":20,lodash:121}],19:[function(require,module,exports){var t=require("../../types");var _=require("lodash");var PRECEDENCE={};_.each([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]],function(tier,i){_.each(tier,function(op){PRECEDENCE[op]=i})});exports.Binary=function(node,parent){if(t.isCallExpression(parent)&&parent.callee===node){return true}if(t.isUnaryLike(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isBinary(parent)){var parentOp=parent.operator;var parentPos=PRECEDENCE[parentOp];var nodeOp=node.operator;var nodePos=PRECEDENCE[nodeOp];if(parentPos>nodePos){return true}if(parentPos===nodePos&&parent.right===node){return true}}};exports.BinaryExpression=function(node,parent){if(node.operator==="in"){if(t.isVariableDeclarator(parent)){return true}if(t.isFor(parent)){return true}}};exports.SequenceExpression=function(node,parent){if(t.isForStatement(parent)){return false}if(t.isExpressionStatement(parent)&&parent.expression===node){return false}return true};exports.YieldExpression=function(node,parent){return t.isBinary(parent)||t.isUnaryLike(parent)||t.isCallExpression(parent)||t.isMemberExpression(parent)||t.isNewExpression(parent)||t.isConditionalExpression(parent)||t.isYieldExpression(parent)};exports.ClassExpression=function(node,parent){return t.isExpressionStatement(parent)};exports.UnaryLike=function(node,parent){return t.isMemberExpression(parent)&&parent.object===node};exports.FunctionExpression=function(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}};exports.AssignmentExpression=exports.ConditionalExpression=function(node,parent){if(t.isUnaryLike(parent)){return true}if(t.isBinary(parent)){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}if(t.isConditionalExpression(parent)&&parent.test===node){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}},{"../../types":72,lodash:121}],20:[function(require,module,exports){var _=require("lodash");var t=require("../../types");exports.before={nodes:{Property:function(node,parent){if(parent.properties[0]===node){return 1}},SpreadProperty:function(node,parent){return exports.before.nodes.Property(node,parent)},SwitchCase:function(node,parent){if(parent.cases[0]===node){return 1}},CallExpression:function(node){if(t.isFunction(node.callee)){return 1}}}};exports.after={nodes:{AssignmentExpression:function(node){if(t.isFunction(node.right)){return 1}}},list:{VariableDeclaration:function(node){return _.map(node.declarations,"init")},ArrayExpression:function(node){return node.elements},ObjectExpression:function(node){return node.properties}}};_.each({Function:1,Class:1,For:1,SwitchStatement:1,IfStatement:{before:1},CallExpression:{after:1},Literal:{after:1}},function(amounts,type){if(_.isNumber(amounts))amounts={after:amounts,before:amounts};_.each(amounts,function(amount,key){exports[key].nodes[type]=function(){return amount}})})},{"../../types":72,lodash:121}],21:[function(require,module,exports){module.exports=Position;var _=require("lodash");function Position(){this.line=1;this.column=0}Position.prototype.push=function(str){var self=this;_.each(str,function(cha){if(cha==="\n"){self.line++;self.column=0}else{self.column++}})};Position.prototype.unshift=function(str){var self=this;_.each(str,function(cha){if(cha==="\n"){self.line--}else{self.column--}})}},{lodash:121}],22:[function(require,module,exports){module.exports=SourceMap;var sourceMap=require("source-map");var t=require("../types");function SourceMap(position,opts,code){this.position=position;this.opts=opts;if(opts.sourceMap){this.map=new sourceMap.SourceMapGenerator({file:opts.sourceMapName,sourceRoot:opts.sourceRoot});this.map.setSourceContent(opts.sourceFileName,code)}else{this.map=null}}SourceMap.prototype.get=function(){var map=this.map;if(map){return map.toJSON()}else{return map}};SourceMap.prototype.mark=function(node,type){var loc=node.loc;if(!loc)return;var map=this.map;if(!map)return;if(t.isProgram(node)||t.isFile(node))return;var position=this.position;var generated={line:position.line,column:position.column};var original=loc[type];if(generated.line===original.line&&generated.column===original.column)return;map.addMapping({source:this.opts.sourceFileName,generated:generated,original:original})}},{"../types":72,"source-map":163}],23:[function(require,module,exports){module.exports=Whitespace;var _=require("lodash");function Whitespace(tokens,comments){this.tokens=_.sortBy(tokens.concat(comments),"start");this.used=[]}Whitespace.prototype.getNewlinesBefore=function(node){var startToken;var endToken;var tokens=this.tokens;_.each(tokens,function(token,i){if(node.start===token.start){startToken=tokens[i-1];endToken=token;return false}});return this.getNewlinesBetween(startToken,endToken)};Whitespace.prototype.getNewlinesAfter=function(node){var startToken;var endToken;var tokens=this.tokens;_.each(tokens,function(token,i){if(node.end===token.end){startToken=token;endToken=tokens[i+1];return false}});if(endToken.type.type==="eof"){return 1}else{return this.getNewlinesBetween(startToken,endToken)}};Whitespace.prototype.getNewlinesBetween=function(startToken,endToken){var start=startToken?startToken.loc.end.line:1;var end=endToken.loc.start.line;var lines=0;for(var line=start;line<end;line++){if(!_.contains(this.used,line)){this.used.push(line);lines++}}return lines}},{lodash:121}],24:[function(require,module,exports){var t=require("./types");var _=require("lodash");var estraverse=require("estraverse");_.extend(estraverse.VisitorKeys,t.VISITOR_KEYS);var types=require("ast-types");var def=types.Type.def;var or=types.Type.or;def("ImportBatchSpecifier").bases("Specifier").build("name").field("name",def("Identifier"));def("VirtualPropertyExpression").bases("Expression").build("object","property").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression")));def("PrivateDeclaration").bases("Declaration").build("declarations").field("declarations",[def("Identifier")]);def("BindMemberExpression").bases("Expression").build("object","property","arguments").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("arguments",[def("Expression")]);def("BindFunctionExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);types.finalize()},{"./types":72,"ast-types":88,estraverse:115,lodash:121}],25:[function(require,module,exports){module.exports=DefaultFormatter;var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");function DefaultFormatter(file){this.file=file;this.localExports=this.getLocalExports();this.remapAssignments()}DefaultFormatter.prototype.getLocalExports=function(){var localExports={};traverse(this.file.ast,{enter:function(node){var declar=node&&node.declaration;if(t.isExportDeclaration(node)&&declar&&t.isStatement(declar)){_.extend(localExports,t.getIds(declar,true))}}});return localExports};DefaultFormatter.prototype.remapExportAssignment=function(node){return t.assignmentExpression("=",node.left,t.assignmentExpression(node.operator,t.memberExpression(t.identifier("exports"),node.left),node.right))};DefaultFormatter.prototype.remapAssignments=function(){var localExports=this.localExports;var self=this;var isLocalReference=function(node,scope){var name=node.name;return t.isIdentifier(node)&&localExports[name]&&localExports[name]===scope.get(name,true)};traverse(this.file.ast,{enter:function(node,parent,scope){if(t.isUpdateExpression(node)&&isLocalReference(node.argument,scope)){this.stop();var assign=t.assignmentExpression(node.operator[0]+"=",node.argument,t.literal(1));var remapped=self.remapExportAssignment(assign);if(t.isExpressionStatement(parent)||node.prefix){return remapped}var nodes=[];nodes.push(remapped);var operator;if(node.operator==="--"){operator="+"}else{operator="-"}nodes.push(t.binaryExpression(operator,node.argument,t.literal(1)));return t.sequenceExpression(nodes)}if(t.isAssignmentExpression(node)&&isLocalReference(node.left,scope)){this.stop();return self.remapExportAssignment(node)}}})};DefaultFormatter.prototype.getModuleName=function(){var opts=this.file.opts;var filenameRelative=opts.filenameRelative;var moduleName="";if(opts.moduleRoot){moduleName=opts.moduleRoot+"/"}if(!opts.filenameRelative){return moduleName+opts.filename.replace(/^\//,"")}if(opts.sourceRoot){var sourceRootRegEx=new RegExp("^"+opts.sourceRoot+"/?");filenameRelative=filenameRelative.replace(sourceRootRegEx,"")}filenameRelative=filenameRelative.replace(/\.(.*?)$/,"");moduleName+=filenameRelative;return moduleName};DefaultFormatter.prototype._pushStatement=function(ref,nodes){if(t.isClass(ref)||t.isFunction(ref)){if(ref.id){nodes.push(t.toStatement(ref));ref=ref.id}}return ref};DefaultFormatter.prototype._hoistExport=function(declar,assign){if(t.isFunctionDeclaration(declar)){assign._blockHoist=true}return assign};DefaultFormatter.prototype._exportSpecifier=function(getRef,specifier,node,nodes){var inherits=false;if(node.specifiers.length===1)inherits=node;if(node.source){if(t.isExportBatchSpecifier(specifier)){nodes.push(this._exportsWildcard(getRef()))}else{nodes.push(this._exportsAssign(t.getSpecifierName(specifier),t.memberExpression(getRef(),specifier.id)))}}else{nodes.push(this._exportsAssign(t.getSpecifierName(specifier),specifier.id))}};DefaultFormatter.prototype._exportsWildcard=function(objectIdentifier){return util.template("exports-wildcard",{OBJECT:objectIdentifier},true)};DefaultFormatter.prototype._exportsAssign=function(id,init){return util.template("exports-assign",{VALUE:init,KEY:id},true)};DefaultFormatter.prototype.exportDeclaration=function(node,nodes){var declar=node.declaration;if(node.default){nodes.push(this._exportsAssign(t.identifier("default"),this._pushStatement(declar,nodes)))}else{var assign;if(t.isVariableDeclaration(declar)){for(var i in declar.declarations){var decl=declar.declarations[i];decl.init=this._exportsAssign(decl.id,decl.init).expression;var newDeclar=t.variableDeclaration(declar.kind,[decl]);if(i==="0")t.inherits(newDeclar,declar);nodes.push(newDeclar)}}else{assign=this._exportsAssign(declar.id,declar.id);nodes.push(t.toStatement(declar));nodes.push(assign);this._hoistExport(declar,assign)}}}},{"../../traverse":68,"../../types":72,"../../util":74,lodash:121}],26:[function(require,module,exports){module.exports=AMDFormatter;var DefaultFormatter=require("./_default");var util=require("../../util");var t=require("../../types");var _=require("lodash");function AMDFormatter(){DefaultFormatter.apply(this,arguments);this.ids={}}util.inherits(AMDFormatter,DefaultFormatter);AMDFormatter.prototype.buildDependencyLiterals=function(){var names=[];for(var name in this.ids){names.push(t.literal(name))}return names};AMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[t.literal("exports")].concat(this.buildDependencyLiterals());names=t.arrayExpression(names);var params=_.values(this.ids);params.unshift(t.identifier("exports"));var container=t.functionExpression(null,params,t.blockStatement(body));var defineArgs=[names,container];var moduleName=this.getModuleName();if(moduleName)defineArgs.unshift(t.literal(moduleName));var call=t.callExpression(t.identifier("define"),defineArgs);program.body=[t.expressionStatement(call)]};AMDFormatter.prototype.getModuleName=function(){if(this.file.opts.amdModuleIds){return DefaultFormatter.prototype.getModuleName.apply(this,arguments)}else{return null}};AMDFormatter.prototype._push=function(node){var id=node.source.value;var ids=this.ids;if(ids[id]){return ids[id]}else{return this.ids[id]=this.file.generateUidIdentifier(id)}};AMDFormatter.prototype.importDeclaration=function(node){this._push(node)};AMDFormatter.prototype.importSpecifier=function(specifier,node,nodes){var key=t.getSpecifierName(specifier);var ref=this._push(node);if(t.isImportBatchSpecifier(specifier)){}else if(t.isSpecifierDefault(specifier)){ref=t.callExpression(this.file.addDeclaration("interop-require"),[ref])}else{ref=t.memberExpression(ref,specifier.id,false)}nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,ref)]))};AMDFormatter.prototype.exportSpecifier=function(specifier,node,nodes){var self=this;return this._exportSpecifier(function(){return self._push(node)},specifier,node,nodes)}},{"../../types":72,"../../util":74,"./_default":25,lodash:121}],27:[function(require,module,exports){module.exports=CommonJSFormatter;var DefaultFormatter=require("./_default");var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");function CommonJSFormatter(file){DefaultFormatter.apply(this,arguments);var hasNonDefaultExports=false;traverse(file.ast,{enter:function(node){if(t.isExportDeclaration(node)&&!node.default)hasNonDefaultExports=true}});this.hasNonDefaultExports=hasNonDefaultExports}util.inherits(CommonJSFormatter,DefaultFormatter);CommonJSFormatter.prototype.importSpecifier=function(specifier,node,nodes){var variableName=t.getSpecifierName(specifier);if(t.isSpecifierDefault(specifier)){nodes.push(t.variableDeclaration("var",[t.variableDeclarator(variableName,t.callExpression(this.file.addDeclaration("interop-require"),[util.template("require",{MODULE_NAME:node.source})]))]))}else{var templateName="require-assign";if(specifier.type!=="ImportBatchSpecifier")templateName+="-key";nodes.push(util.template(templateName,{VARIABLE_NAME:variableName,MODULE_NAME:node.source,KEY:specifier.id}))}};CommonJSFormatter.prototype.importDeclaration=function(node,nodes){nodes.push(util.template("require",{MODULE_NAME:node.source},true))};CommonJSFormatter.prototype.exportDeclaration=function(node,nodes){if(node.default){var declar=node.declaration;var templateName="exports-default-module";if(this.hasNonDefaultExports)templateName="exports-default-module-override";var assign=util.template(templateName,{VALUE:this._pushStatement(declar,nodes)},true);nodes.push(this._hoistExport(declar,assign))}else{DefaultFormatter.prototype.exportDeclaration.apply(this,arguments)}};CommonJSFormatter.prototype.exportSpecifier=function(specifier,node,nodes){this._exportSpecifier(function(){return t.callExpression(t.identifier("require"),[node.source])},specifier,node,nodes)}},{"../../traverse":68,"../../types":72,"../../util":74,"./_default":25}],28:[function(require,module,exports){module.exports=IgnoreFormatter;var t=require("../../types");function IgnoreFormatter(){}IgnoreFormatter.prototype.exportDeclaration=function(node,nodes){var declar=t.toStatement(node.declaration,true);if(declar)nodes.push(t.inherits(declar,node))};IgnoreFormatter.prototype.importDeclaration=IgnoreFormatter.prototype.importSpecifier=IgnoreFormatter.prototype.exportSpecifier=function(){}},{"../../types":72}],29:[function(require,module,exports){module.exports=SystemFormatter;var DefaultFormatter=require("./_default");var AMDFormatter=require("./amd");var util=require("../../util");var t=require("../../types");var _=require("lodash");function SystemFormatter(file){this.exportIdentifier=file.generateUidIdentifier("export");AMDFormatter.apply(this,arguments);this.moduleNameLiteral=t.literal(this.getModuleName())}util.inherits(SystemFormatter,AMDFormatter);SystemFormatter.prototype.getModuleName=DefaultFormatter.prototype.getModuleName;SystemFormatter.prototype._exportsWildcard=function(objectIdentifier){var leftIdentifier=t.identifier("i");var valIdentifier=t.memberExpression(objectIdentifier,leftIdentifier,true);var left=t.variableDeclaration("var",[t.variableDeclarator(leftIdentifier)]);var right=objectIdentifier;var block=t.blockStatement([this.buildExportCall(leftIdentifier,valIdentifier)]);return t.forInStatement(left,right,block)};SystemFormatter.prototype._exportsAssign=function(id,init){return this.buildExportCall(t.literal(id.name),init,true)};SystemFormatter.prototype.remapExportAssignment=function(node){return this.buildExportCall(t.literal(node.left.name),node)};SystemFormatter.prototype.buildExportCall=function(id,init,isStatement){var call=t.callExpression(this.exportIdentifier,[id,init]);if(isStatement){return t.expressionStatement(call)}else{return call}};SystemFormatter.prototype.buildRunnerSetters=function(){return t.arrayExpression(_.map(this.ids,function(uid){var moduleIdentifier=t.identifier("m");return t.functionExpression(null,[moduleIdentifier],t.blockStatement([t.assignmentExpression("=",uid,moduleIdentifier)]))}))};SystemFormatter.prototype.transform=function(ast){var program=ast.program;var runner=util.template("system",{MODULE_NAME:this.moduleNameLiteral,MODULE_DEPENDENCIES:t.arrayExpression(this.buildDependencyLiterals()),EXPORT_IDENTIFIER:this.exportIdentifier,SETTERS:this.buildRunnerSetters(),EXECUTE:t.functionExpression(null,[],t.blockStatement(program.body))},true);if(!_.isEmpty(this.ids)){var handlerBody=runner.expression.arguments[2].body.body;handlerBody.unshift(t.variableDeclaration("var",_.map(this.ids,function(uid){return t.variableDeclarator(uid)})))}program.body=[runner]}},{"../../types":72,"../../util":74,"./_default":25,"./amd":26,lodash:121}],30:[function(require,module,exports){module.exports=UMDFormatter;var AMDFormatter=require("./amd");var util=require("../../util");var t=require("../../types");var _=require("lodash");function UMDFormatter(){AMDFormatter.apply(this,arguments)}util.inherits(UMDFormatter,AMDFormatter);UMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[];for(var name in this.ids){names.push(t.literal(name))}var ids=_.values(this.ids);var args=[t.identifier("exports")].concat(ids);var factory=t.functionExpression(null,args,t.blockStatement(body));var defineArgs=[t.arrayExpression([t.literal("exports")].concat(names))];var moduleName=this.getModuleName();if(moduleName)defineArgs.unshift(t.literal(moduleName));var runner=util.template("umd-runner-body",{AMD_ARGUMENTS:defineArgs,COMMON_ARGUMENTS:names.map(function(name){return t.callExpression(t.identifier("require"),[name])})});var call=t.callExpression(runner,[factory]);program.body=[t.expressionStatement(call)]}},{"../../types":72,"../../util":74,"./amd":26,lodash:121}],31:[function(require,module,exports){module.exports=transform;var Transformer=require("./transformer");var File=require("../file");var util=require("../util");var _=require("lodash");function transform(code,opts){var file=new File(opts);return file.parse(code)}transform.fromAst=function(ast,code,opts){ast=util.normaliseAst(ast);var file=new File(opts);file.addCode(code);file.transform(ast);return file.generate()};transform._ensureTransformerNames=function(type,keys){for(var i in keys){var key=keys[i];if(!_.has(transform.transformers,key)){throw new ReferenceError("unknown transformer "+key+" specified in "+type)}}};transform.transformers={};transform.moduleFormatters={common:require("./modules/common"),system:require("./modules/system"),ignore:require("./modules/ignore"),amd:require("./modules/amd"),umd:require("./modules/umd")};_.each({specBlockHoistFunctions:require("./transformers/spec-block-hoist-functions"),specNoForInOfAssignment:require("./transformers/spec-no-for-in-of-assignment"),specNoDuplicateProperties:require("./transformers/spec-no-duplicate-properties"),methodBinding:require("./transformers/playground-method-binding"),memoizationOperator:require("./transformers/playground-memoization-operator"),objectGetterMemoization:require("./transformers/playground-object-getter-memoization"),react:require("./transformers/react"),modules:require("./transformers/es6-modules"),propertyNameShorthand:require("./transformers/es6-property-name-shorthand"),arrayComprehension:require("./transformers/es7-array-comprehension"),generatorComprehension:require("./transformers/es7-generator-comprehension"),arrowFunctions:require("./transformers/es6-arrow-functions"),classes:require("./transformers/es6-classes"),computedPropertyNames:require("./transformers/es6-computed-property-names"),objectSpread:require("./transformers/es7-object-spread"),exponentiationOperator:require("./transformers/es7-exponentiation-operator"),spread:require("./transformers/es6-spread"),templateLiterals:require("./transformers/es6-template-literals"),propertyMethodAssignment:require("./transformers/es5-property-method-assignment"),destructuring:require("./transformers/es6-destructuring"),defaultParameters:require("./transformers/es6-default-parameters"),forOf:require("./transformers/es6-for-of"),unicodeRegex:require("./transformers/es6-unicode-regex"),abstractReferences:require("./transformers/es7-abstract-references"),constants:require("./transformers/es6-constants"),letScoping:require("./transformers/es6-let-scoping"),_blockHoist:require("./transformers/_block-hoist"),generators:require("./transformers/es6-generators"),restParameters:require("./transformers/es6-rest-parameters"),_declarations:require("./transformers/_declarations"),_aliasFunctions:require("./transformers/_alias-functions"),useStrict:require("./transformers/use-strict"),_moduleFormatter:require("./transformers/_module-formatter"),specPropertyLiterals:require("./transformers/spec-property-literals"),specMemberExpressionLiterals:require("./transformers/spec-member-expression-literals")},function(transformer,key){transform.transformers[key]=new Transformer(key,transformer) })},{"../file":3,"../util":74,"./modules/amd":26,"./modules/common":27,"./modules/ignore":28,"./modules/system":29,"./modules/umd":30,"./transformer":32,"./transformers/_alias-functions":33,"./transformers/_block-hoist":34,"./transformers/_declarations":35,"./transformers/_module-formatter":36,"./transformers/es5-property-method-assignment":37,"./transformers/es6-arrow-functions":38,"./transformers/es6-classes":39,"./transformers/es6-computed-property-names":40,"./transformers/es6-constants":41,"./transformers/es6-default-parameters":42,"./transformers/es6-destructuring":43,"./transformers/es6-for-of":44,"./transformers/es6-generators":45,"./transformers/es6-let-scoping":46,"./transformers/es6-modules":47,"./transformers/es6-property-name-shorthand":48,"./transformers/es6-rest-parameters":49,"./transformers/es6-spread":50,"./transformers/es6-template-literals":51,"./transformers/es6-unicode-regex":52,"./transformers/es7-abstract-references":53,"./transformers/es7-array-comprehension":54,"./transformers/es7-exponentiation-operator":55,"./transformers/es7-generator-comprehension":56,"./transformers/es7-object-spread":57,"./transformers/playground-memoization-operator":58,"./transformers/playground-method-binding":59,"./transformers/playground-object-getter-memoization":60,"./transformers/react":61,"./transformers/spec-block-hoist-functions":62,"./transformers/spec-member-expression-literals":63,"./transformers/spec-no-duplicate-properties":64,"./transformers/spec-no-for-in-of-assignment":65,"./transformers/spec-property-literals":66,"./transformers/use-strict":67,lodash:121}],32:[function(require,module,exports){module.exports=Transformer;var traverse=require("../traverse");var t=require("../types");var _=require("lodash");function Transformer(key,transformer,opts){this.transformer=Transformer.normalise(transformer);this.opts=opts||{};this.key=key}Transformer.normalise=function(transformer){if(_.isFunction(transformer)){transformer={ast:transformer}}_.each(transformer,function(fns,type){if(type[0]==="_")return;if(_.isFunction(fns))fns={enter:fns};transformer[type]=fns;var aliases=t.FLIPPED_ALIAS_KEYS[type];if(aliases){_.each(aliases,function(alias){transformer[alias]=fns})}});return transformer};Transformer.prototype.astRun=function(file,key){var transformer=this.transformer;var ast=file.ast;if(transformer.ast&&transformer.ast[key]){transformer.ast[key](ast,file)}};Transformer.prototype.transform=function(file){if(!this.canRun(file))return;var transformer=this.transformer;var ast=file.ast;this.astRun(file,"enter");var build=function(exit){return function(node,parent,scope){var fns=transformer[node.type];if(!fns)return;var fn=fns.enter;if(exit)fn=fns.exit;if(!fn)return;return fn(node,parent,file,scope)}};traverse(ast,{enter:build(),exit:build(true)});this.astRun(file,"exit")};Transformer.prototype.canRun=function(file){var opts=file.opts;var key=this.key;var blacklist=opts.blacklist;if(blacklist.length&&_.contains(blacklist,key))return false;if(key[0]!=="_"){var whitelist=opts.whitelist;if(whitelist.length&&!_.contains(whitelist,key))return false}return true}},{"../traverse":68,"../types":72,lodash:121}],33:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");var go=function(getBody,node,file,scope){var argumentsId;var thisId;var getArgumentsId=function(){return argumentsId=argumentsId||file.generateUidIdentifier("arguments",scope)};var getThisId=function(){return thisId=thisId||file.generateUidIdentifier("this",scope)};traverse(node,{enter:function(node){if(!node._aliasFunction){if(t.isFunction(node)){return false}else{return}}traverse(node,{enter:function(node,parent){if(t.isFunction(node)&&!node._aliasFunction){return false}if(node._ignoreAliasFunctions)return false;var getId;if(t.isIdentifier(node)&&node.name==="arguments"){getId=getArgumentsId}else if(t.isThisExpression(node)){getId=getThisId}else{return}if(t.isReferenced(node,parent))return getId()}});return false}});var body;var pushDeclaration=function(id,init){body=body||getBody();body.unshift(t.variableDeclaration("var",[t.variableDeclarator(id,init)]))};if(argumentsId){pushDeclaration(argumentsId,t.identifier("arguments"))}if(thisId){pushDeclaration(thisId,t.identifier("this"))}};exports.Program=function(node,parent,file,scope){go(function(){return node.body},node,file,scope)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,parent,file,scope){go(function(){t.ensureBlock(node);return node.body.body},node,file,scope)}},{"../../traverse":68,"../../types":72}],34:[function(require,module,exports){exports.BlockStatement=exports.Program={exit:function(node){var unshift=[];node.body=node.body.filter(function(bodyNode){if(bodyNode._blockHoist){unshift.push(bodyNode);return false}else{return true}});node.body=unshift.concat(node.body)}}},{}],35:[function(require,module,exports){var t=require("../../types");exports.BlockStatement=exports.Program=function(node){var kinds={};var kind;for(var i in node._declarations){var declar=node._declarations[i];kind=declar.kind||"var";var declarNode=t.variableDeclarator(declar.id,declar.init);if(!declar.init){kinds[kind]=kinds[kind]||[];kinds[kind].push(declarNode)}else{node.body.unshift(t.variableDeclaration(kind,[declarNode]))}}for(kind in kinds){node.body.unshift(t.variableDeclaration(kind,kinds[kind]))}}},{"../../types":72}],36:[function(require,module,exports){var transform=require("../transform");exports.ast={exit:function(ast,file){if(!transform.transformers.modules.canRun(file))return;if(file.moduleFormatter.transform){file.moduleFormatter.transform(ast)}}}},{"../transform":31}],37:[function(require,module,exports){var util=require("../../util");exports.Property=function(node){if(node.method)node.method=false};exports.ObjectExpression=function(node,parent,file){var mutatorMap={};var hasAny=false;node.properties=node.properties.filter(function(prop){if(prop.kind==="get"||prop.kind==="set"){hasAny=true;util.pushMutatorMap(mutatorMap,prop.key,prop.kind,prop.value);return false}else{return true}});if(!hasAny)return;var objId=util.getUid(parent,file);return util.template("object-define-properties-closure",{KEY:objId,OBJECT:node,CONTENT:util.template("object-define-properties",{OBJECT:objId,PROPS:util.buildDefineProperties(mutatorMap)})})}},{"../../util":74}],38:[function(require,module,exports){var t=require("../../types");exports.ArrowFunctionExpression=function(node){t.ensureBlock(node);node._aliasFunction="arrow";node.expression=false;node.type="FunctionExpression";return node}},{"../../types":72}],39:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");exports.ClassDeclaration=function(node,parent,file,scope){var closure=true;if(t.isProgram(parent)||t.isBlockStatement(parent)){closure=false}var factory=new Class(node,file,scope,closure);var newNode=factory.run();if(factory.closure){if(closure){scope.push({kind:"var",key:node.id.key,id:node.id});return t.assignmentExpression("=",node.id,newNode)}else{return t.variableDeclaration("let",[t.variableDeclarator(node.id,newNode)])}}else{return newNode}};exports.ClassExpression=function(node,parent,file,scope){return new Class(node,file,scope,true).run()};function Class(node,file,scope,closure){this.closure=closure;this.scope=scope;this.node=node;this.file=file;this.hasInstanceMutators=false;this.hasStaticMutators=false;this.instanceMutatorMap={};this.staticMutatorMap={};this.hasConstructor=false;this.className=node.id||file.generateUidIdentifier("class",scope);this.superName=node.superClass}Class.prototype.run=function(){var superName=this.superName;var className=this.className;var file=this.file;var body=this.body=[];var constructor=t.functionExpression(null,[],t.blockStatement([]));if(this.node.id)constructor.id=className;this.constructor=constructor;body.push(t.variableDeclaration("let",[t.variableDeclarator(className,constructor)]));if(superName&&t.isDynamic(superName)){var superRefName="super";if(className)superRefName=className.name+"Super";var superRef=file.generateUidIdentifier(superRefName,this.scope);body.unshift(t.variableDeclaration("var",[t.variableDeclarator(superRef,superName)]));superName=superRef}this.superName=superName;if(superName){body.push(t.expressionStatement(t.callExpression(file.addDeclaration("inherits"),[className,superName])))}this.buildBody();t.inheritsComments(body[0],this.node);if(this.closure){if(body.length===1){return constructor}else{body.push(t.returnStatement(className));return t.callExpression(t.functionExpression(null,[],t.blockStatement(body)),[])}}else{return body}};Class.prototype.buildBody=function(){var constructor=this.constructor;var className=this.className;var superName=this.superName;var classBody=this.node.body.body;var body=this.body;var self=this;for(var i in classBody){var node=classBody[i];if(t.isMethodDefinition(node)){self.replaceInstanceSuperReferences(node);if(node.key.name==="constructor"){self.pushConstructor(node)}else{self.pushMethod(node)}}else if(t.isPrivateDeclaration(node)){self.closure=true;body.unshift(node)}}if(!this.hasConstructor&&superName){constructor.body.body.push(util.template("class-super-constructor-call",{SUPER_NAME:superName},true))}var instanceProps;var staticProps;if(this.hasInstanceMutators){var protoId=util.template("prototype-identifier",{CLASS_NAME:className});instanceProps=util.buildDefineProperties(this.instanceMutatorMap,protoId)}if(this.hasStaticMutators){staticProps=util.buildDefineProperties(this.staticMutatorMap,className)}if(instanceProps||staticProps){staticProps=staticProps||t.literal(null);var args=[className,staticProps];if(instanceProps)args.push(instanceProps);body.push(t.expressionStatement(t.callExpression(this.file.addDeclaration("prototype-properties"),args)))}};Class.prototype.pushMethod=function(node){var methodName=node.key;var kind=node.kind;if(kind===""){var className=this.className;if(!node.static)className=t.memberExpression(className,t.identifier("prototype"));methodName=t.memberExpression(className,methodName,node.computed);var expr=t.expressionStatement(t.assignmentExpression("=",methodName,node.value));t.inheritsComments(expr,node);this.body.push(expr)}else{var mutatorMap=this.instanceMutatorMap;if(node.static){this.hasStaticMutators=true;mutatorMap=this.staticMutatorMap}else{this.hasInstanceMutators=true}util.pushMutatorMap(mutatorMap,methodName,kind,node)}};Class.prototype.superIdentifier=function(methodNode,id,parent){var methodName=methodNode.key;var superName=this.superName||t.identifier("Function");if(parent.property===id){return}else if(t.isCallExpression(parent,{callee:id})){parent.arguments.unshift(t.thisExpression());if(methodName.name==="constructor"){return t.memberExpression(superName,t.identifier("call"))}else{id=superName;if(!methodNode.static){id=t.memberExpression(id,t.identifier("prototype"))}id=t.memberExpression(id,methodName,methodNode.computed);return t.memberExpression(id,t.identifier("call"))}}else if(t.isMemberExpression(parent)&&!methodNode.static){return t.memberExpression(superName,t.identifier("prototype"))}else{return superName}};Class.prototype.replaceInstanceSuperReferences=function(methodNode){var method=methodNode.value;var self=this;traverse(method,{enter:function(node,parent){if(t.isIdentifier(node,{name:"super"})){return self.superIdentifier(methodNode,node,parent)}else if(t.isCallExpression(node)){var callee=node.callee;if(!t.isMemberExpression(callee))return;if(callee.object.name!=="super")return;callee.property=t.memberExpression(callee.property,t.identifier("call"));node.arguments.unshift(t.thisExpression())}}})};Class.prototype.pushConstructor=function(method){if(method.kind!==""){throw this.file.errorWithNode(method,"illegal kind for constructor method")}var construct=this.constructor;var fn=method.value;this.hasConstructor=true;t.inherits(construct,fn);t.inheritsComments(construct,method);construct.defaults=fn.defaults;construct.params=fn.params;construct.body=fn.body;construct.rest=fn.rest}},{"../../traverse":68,"../../types":72,"../../util":74}],40:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.ObjectExpression=function(node,parent,file){var hasComputed=false;var computed=[];node.properties=node.properties.filter(function(prop){if(prop.computed){hasComputed=true;computed.unshift(prop);return false}else{return true}});if(!hasComputed)return;var objId=util.getUid(parent,file);var container=util.template("function-return-obj",{KEY:objId,OBJECT:node});var containerCallee=container.callee;var containerBody=containerCallee.body.body;containerCallee._aliasFunction=true;for(var i in computed){var prop=computed[i];containerBody.unshift(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(objId,prop.key,true),prop.value)))}return container}},{"../../types":72,"../../util":74}],41:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");var _=require("lodash");exports.Program=exports.BlockStatement=exports.ForInStatement=exports.ForOfStatement=exports.ForStatement=function(node,parent,file){var hasConstants=false;var constants={};var check=function(parent,names,scope){for(var name in names){var nameNode=names[name];if(!_.has(constants,name))continue;if(parent&&t.isBlockStatement(parent)&&parent!==constants[name])continue;if(scope){var defined=scope.get(name);if(defined&&defined===nameNode)continue}throw file.errorWithNode(nameNode,name+" is read-only")}};var getIds=function(node){return t.getIds(node,true,["MemberExpression"])};_.each(node.body,function(child,parent){if(t.isExportDeclaration(child)){child=child.declaration}if(t.isVariableDeclaration(child,{kind:"const"})){for(var i in child.declarations){var declar=child.declarations[i];var ids=getIds(declar);for(var name in ids){var nameNode=ids[name];var names={};names[name]=nameNode;check(parent,names);constants[name]=parent;hasConstants=true}declar._ignoreConstant=true}child._ignoreConstant=true;child.kind="let"}});if(!hasConstants)return;traverse(node,{enter:function(child,parent,scope){if(child._ignoreConstant)return;if(t.isVariableDeclaration(child))return;if(t.isVariableDeclarator(child)||t.isDeclaration(child)||t.isAssignmentExpression(child)){check(parent,getIds(child),scope)}}})}},{"../../traverse":68,"../../types":72,lodash:121}],42:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");exports.Function=function(node,parent,file,scope){if(!node.defaults||!node.defaults.length)return;t.ensureBlock(node);var ids=node.params.map(function(param){return t.getIds(param)});var iife=false;var i;var def;for(i in node.defaults){def=node.defaults[i];if(!def)continue;var param=node.params[i];_.each(ids.slice(i),function(ids){var check=function(node,parent){if(!t.isIdentifier(node)||!t.isReferenced(node,parent))return;if(ids.indexOf(node.name)>=0){throw file.errorWithNode(node,"Temporal dead zone - accessing a variable before it's initialized")}if(scope.has(node.name)){iife=true}};check(def,node);traverse(def,{enter:check})});var has=scope.get(param.name);if(has&&node.params.indexOf(has)<0){iife=true}}var body=[];for(i in node.defaults){def=node.defaults[i];if(!def)continue;body.push(util.template("if-undefined-set-to",{VARIABLE:node.params[i],DEFAULT:def},true))}if(iife){var container=t.functionExpression(null,[],node.body,node.generator);container._aliasFunction=true;body.push(t.returnStatement(t.callExpression(container,[])));node.body=t.blockStatement(body)}else{node.body.body=body.concat(node.body.body)}node.defaults=[]}},{"../../traverse":68,"../../types":72,"../../util":74,lodash:121}],43:[function(require,module,exports){var t=require("../../types");var buildVariableAssign=function(opts,id,init){var op=opts.operator;if(t.isMemberExpression(id))op="=";if(op){return t.expressionStatement(t.assignmentExpression("=",id,init))}else{return t.variableDeclaration(opts.kind,[t.variableDeclarator(id,init)])}};var push=function(opts,nodes,elem,parentId){if(t.isObjectPattern(elem)){pushObjectPattern(opts,nodes,elem,parentId)}else if(t.isArrayPattern(elem)){pushArrayPattern(opts,nodes,elem,parentId)}else{nodes.push(buildVariableAssign(opts,elem,parentId))}};var pushObjectPattern=function(opts,nodes,pattern,parentId){for(var i in pattern.properties){var prop=pattern.properties[i];if(t.isSpreadProperty(prop)){var keys=[];for(var i2 in pattern.properties){var prop2=pattern.properties[i2];if(i2>=i)break;if(t.isSpreadProperty(prop2))continue;var key=prop2.key;if(t.isIdentifier(key)){key=t.literal(prop2.key.name)}keys.push(key)}keys=t.arrayExpression(keys);var value=t.callExpression(opts.file.addDeclaration("object-without-properties"),[parentId,keys]);nodes.push(buildVariableAssign(opts,prop.argument,value))}else{var pattern2=prop.value;var patternId2=t.memberExpression(parentId,prop.key,prop.computed);if(t.isPattern(pattern2)){push(opts,nodes,pattern2,patternId2)}else{nodes.push(buildVariableAssign(opts,pattern2,patternId2))}}}};var pushArrayPattern=function(opts,nodes,pattern,parentId){var _parentId=opts.file.generateUidIdentifier("ref",opts.scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(_parentId,opts.file.toArray(parentId))]));parentId=_parentId;for(var i in pattern.elements){var elem=pattern.elements[i];if(!elem)continue;i=+i;var newPatternId;if(t.isSpreadElement(elem)){newPatternId=opts.file.toArray(parentId);if(i>0){newPatternId=t.callExpression(t.memberExpression(newPatternId,t.identifier("slice")),[t.literal(i)])}elem=elem.argument}else{newPatternId=t.memberExpression(parentId,t.literal(i),true)}push(opts,nodes,elem,newPatternId)}};var pushPattern=function(opts){var nodes=opts.nodes;var pattern=opts.pattern;var parentId=opts.id;var file=opts.file;var scope=opts.scope;if(!t.isMemberExpression(parentId)&&!t.isIdentifier(parentId)){var key=file.generateUidIdentifier("ref",scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,parentId)]));parentId=key}push(opts,nodes,pattern,parentId)};exports.ForInStatement=exports.ForOfStatement=function(node,parent,file,scope){var declar=node.left;if(!t.isVariableDeclaration(declar))return;var pattern=declar.declarations[0].id;if(!t.isPattern(pattern))return;var key=file.generateUidIdentifier("ref",scope);node.left=t.variableDeclaration(declar.kind,[t.variableDeclarator(key,null)]);var nodes=[];push({kind:declar.kind,file:file,scope:scope},nodes,pattern,key);t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.Function=function(node,parent,file,scope){var nodes=[];var hasDestructuring=false;node.params=node.params.map(function(pattern){if(!t.isPattern(pattern))return pattern;hasDestructuring=true;var parentId=file.generateUidIdentifier("ref",scope);pushPattern({kind:"var",nodes:nodes,pattern:pattern,id:parentId,file:file,scope:scope});return parentId});if(!hasDestructuring)return;t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.ExpressionStatement=function(node,parent,file,scope){var expr=node.expression;if(expr.type!=="AssignmentExpression")return;if(!t.isPattern(expr.left))return;var nodes=[];var ref=file.generateUidIdentifier("ref",scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(ref,expr.right)]));push({operator:expr.operator,file:file,scope:scope},nodes,expr.left,ref);return nodes};exports.AssignmentExpression=function(node,parent,file,scope){if(parent.type==="ExpressionStatement")return;if(!t.isPattern(node.left))return;var tempName=file.generateUid("temp",scope);var ref=t.identifier(tempName);scope.push({key:tempName,id:ref});var nodes=[];nodes.push(t.assignmentExpression("=",ref,node.right));push({operator:node.operator,file:file,scope:scope},nodes,node.left,ref);nodes.push(ref);return t.toSequenceExpression(nodes,scope)};exports.VariableDeclaration=function(node,parent,file,scope){if(t.isForInStatement(parent)||t.isForOfStatement(parent))return;var nodes=[];var i;var declar;var hasPattern=false;for(i in node.declarations){declar=node.declarations[i];if(t.isPattern(declar.id)){hasPattern=true;break}}if(!hasPattern)return;for(i in node.declarations){declar=node.declarations[i];var patternId=declar.init;var pattern=declar.id;var opts={kind:node.kind,nodes:nodes,pattern:pattern,id:patternId,file:file,scope:scope};if(t.isPattern(pattern)&&patternId){pushPattern(opts)}else{nodes.push(buildVariableAssign(opts,declar.id,declar.init))}}if(!t.isProgram(parent)&&!t.isBlockStatement(parent)){for(i in nodes){node=nodes[i];declar=declar||t.variableDeclaration(node.kind,[]);if(!t.isVariableDeclaration(node)&&declar.kind!==node.kind){throw file.errorWithNode(node,"Cannot use this node within the current parent")}declar.declarations=declar.declarations.concat(node.declarations)}return declar}return nodes}},{"../../types":72}],44:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.ForOfStatement=function(node,parent,file,scope){var left=node.left;var declar;var stepKey=file.generateUidIdentifier("step",scope);var stepValue=t.memberExpression(stepKey,t.identifier("value"));if(t.isIdentifier(left)){declar=t.expressionStatement(t.assignmentExpression("=",left,stepValue))}else if(t.isVariableDeclaration(left)){declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,stepValue)])}else{throw file.errorWithNode(left,"Unknown node type "+left.type+" in ForOfStatement")}var node2=util.template("for-of",{ITERATOR_KEY:file.generateUidIdentifier("iterator",scope),STEP_KEY:stepKey,OBJECT:node.right});t.ensureBlock(node);var block=node2.body;block.body.push(declar);block.body=block.body.concat(node.body.body);return node2}},{"../../types":72,"../../util":74}],45:[function(require,module,exports){module.exports=require("regenerator").transform},{regenerator:129}],46:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");var isLet=function(node,parent){if(!t.isVariableDeclaration(node))return false;if(node._let)return true;if(node.kind!=="let")return false;if(!t.isFor(parent)||t.isFor(parent)&&parent.left!==node){_.each(node.declarations,function(declar){declar.init=declar.init||t.identifier("undefined")})}node._let=true;node.kind="var";return true};var isVar=function(node,parent){return t.isVariableDeclaration(node,{kind:"var"})&&!isLet(node,parent)};var standardiseLets=function(declars){for(var i in declars){delete declars[i]._let}};exports.VariableDeclaration=function(node,parent){isLet(node,parent)};exports.Loop=function(node,parent,file,scope){var init=node.left||node.init;if(isLet(init,node)){t.ensureBlock(node);node.body._letDeclars=[init]}if(t.isLabeledStatement(parent)){node.label=parent.label}var letScoping=new LetScoping(node,node.body,parent,file,scope);letScoping.run();if(node.label&&!t.isLabeledStatement(parent)){return t.labeledStatement(node.label,node)}};exports.BlockStatement=function(block,parent,file,scope){if(!t.isLoop(parent)){var letScoping=new LetScoping(false,block,parent,file,scope);letScoping.run()}};function LetScoping(loopParent,block,parent,file,scope){this.loopParent=loopParent;this.parent=parent;this.scope=scope;this.block=block;this.file=file;this.letReferences={};this.body=[]}LetScoping.prototype.run=function(){var block=this.block;if(block._letDone)return;block._letDone=true;this.info=this.getInfo();this.remap();if(t.isFunction(this.parent))return this.noClosure();if(!this.info.keys.length)return this.noClosure();var referencesInClosure=this.getLetReferences();if(!referencesInClosure)return this.noClosure();this.has=this.checkLoop();this.hoistVarDeclarations();standardiseLets(this.info.declarators);var letReferences=_.values(this.letReferences);var fn=t.functionExpression(null,letReferences,t.blockStatement(block.body));fn._aliasFunction=true;block.body=this.body;var params=this.getParams(letReferences);var call=t.callExpression(fn,params);var ret=this.file.generateUidIdentifier("ret",this.scope);var hasYield=traverse.hasType(fn.body,"YieldExpression",t.FUNCTION_TYPES);if(hasYield){fn.generator=true;call=t.yieldExpression(call,true)}this.build(ret,call)};LetScoping.prototype.noClosure=function(){standardiseLets(this.info.declarators)};LetScoping.prototype.remap=function(){var replacements=this.info.duplicates;var block=this.block;if(!this.info.hasDuplicates)return;var replace=function(node,parent,scope){if(!t.isIdentifier(node))return;if(!t.isReferenced(node,parent))return;if(scope&&scope.hasOwn(node.name))return;node.name=replacements[node.name]||node.name};var traverseReplace=function(node,parent){replace(node,parent);traverse(node,{enter:replace})};var loopParent=this.loopParent;if(loopParent){traverseReplace(loopParent.right,loopParent);traverseReplace(loopParent.test,loopParent);traverseReplace(loopParent.update,loopParent)}traverse(block,{enter:replace})};LetScoping.prototype.getInfo=function(){var block=this.block;var scope=this.scope;var file=this.file;var opts={outsideKeys:[],declarators:block._letDeclars||[],duplicates:{},hasDuplicates:false,keys:[]};var duplicates=function(id,key){var has=scope.parentGet(key);if(has&&has!==id){opts.duplicates[key]=id.name=file.generateUid(key,scope);opts.hasDuplicates=true}};var i;var declar;for(i in opts.declarators){declar=opts.declarators[i];opts.declarators.push(declar);var keys=t.getIds(declar,true);_.each(keys,duplicates);keys=Object.keys(keys);opts.outsideKeys=opts.outsideKeys.concat(keys);opts.keys=opts.keys.concat(keys)}for(i in block.body){declar=block.body[i];if(!isLet(declar,block))continue;_.each(t.getIds(declar,true),function(id,key){duplicates(id,key);opts.keys.push(key)})}return opts};LetScoping.prototype.checkLoop=function(){var has={hasContinue:false,hasReturn:false,hasBreak:false};traverse(this.block,{enter:function(node,parent){var replace;if(t.isFunction(node)||t.isLoop(node)){return false}if(node&&!node.label){if(t.isBreakStatement(node)){if(t.isSwitchCase(parent))return;has.hasBreak=true;replace=t.returnStatement(t.literal("break"))}else if(t.isContinueStatement(node)){has.hasContinue=true;replace=t.returnStatement(t.literal("continue"))}}if(t.isReturnStatement(node)){has.hasReturn=true;replace=t.returnStatement(t.objectExpression([t.property("init",t.identifier("v"),node.argument||t.identifier("undefined"))]))}if(replace)return t.inherits(replace,node)}});return has};LetScoping.prototype.hoistVarDeclarations=function(){var self=this;traverse(this.block,{enter:function(node,parent){if(t.isForStatement(node)){if(isVar(node.init,node)){node.init=t.sequenceExpression(self.pushDeclar(node.init))}}else if(t.isFor(node)){if(isVar(node.left,node)){node.left=node.left.declarations[0].id}}else if(isVar(node,parent)){return self.pushDeclar(node).map(t.expressionStatement)}else if(t.isFunction(node)){return false}}})};LetScoping.prototype.getParams=function(params){var info=this.info;params=_.cloneDeep(params);_.each(params,function(param){param.name=info.duplicates[param.name]||param.name});return params};LetScoping.prototype.getLetReferences=function(){var closurify=false;var self=this;traverse(this.block,{enter:function(node,parent,scope){if(t.isFunction(node)){traverse(node,{enter:function(node,parent){if(!t.isIdentifier(node))return;if(!t.isReferenced(node,parent))return;if(scope.hasOwn(node.name))return;closurify=true;if(!_.contains(self.info.outsideKeys,node.name))return;self.letReferences[node.name]=node}});return false}else if(t.isLoop(node)){return false}}});return closurify};LetScoping.prototype.pushDeclar=function(node){this.body.push(t.variableDeclaration(node.kind,node.declarations.map(function(declar){return t.variableDeclarator(declar.id)})));var replace=[];for(var i in node.declarations){var declar=node.declarations[i];if(!declar.init)continue;var expr=t.assignmentExpression("=",declar.id,declar.init);replace.push(t.inherits(expr,declar))}return replace};LetScoping.prototype.build=function(ret,call){var has=this.has;if(has.hasReturn||has.hasBreak||has.hasContinue){this.buildHas(ret,call)}else{this.body.push(t.expressionStatement(call))}};LetScoping.prototype.buildHas=function(ret,call){var body=this.body;body.push(t.variableDeclaration("var",[t.variableDeclarator(ret,call)]));var loopParent=this.loopParent;var retCheck;var has=this.has;var cases=[];if(has.hasReturn){retCheck=util.template("let-scoping-return",{RETURN:ret})}if(has.hasBreak||has.hasContinue){var label=loopParent.label=loopParent.label||this.file.generateUidIdentifier("loop",this.scope);if(has.hasBreak){cases.push(t.switchCase(t.literal("break"),[t.breakStatement(label)]))}if(has.hasContinue){cases.push(t.switchCase(t.literal("continue"),[t.continueStatement(label)]))}if(has.hasReturn){cases.push(t.switchCase(null,[retCheck]))}if(cases.length===1){var single=cases[0];body.push(t.ifStatement(t.binaryExpression("===",ret,single.test),single.consequent[0]))}else{body.push(t.switchStatement(ret,cases))}}else{if(has.hasReturn)body.push(retCheck)}}},{"../../traverse":68,"../../types":72,"../../util":74,lodash:121}],47:[function(require,module,exports){var t=require("../../types");var inheritsComments=function(node,nodes){if(nodes.length){t.inheritsComments(nodes[0],node)}};exports.ImportDeclaration=function(node,parent,file){var nodes=[];if(node.specifiers.length){if(!file.moduleFormatter.importSpecifier)return;for(var i in node.specifiers){file.moduleFormatter.importSpecifier(node.specifiers[i],node,nodes,parent)}}else{if(!file.moduleFormatter.importDeclaration)return;file.moduleFormatter.importDeclaration(node,nodes,parent)}inheritsComments(node,nodes);return nodes};exports.ExportDeclaration=function(node,parent,file){var nodes=[];if(node.declaration){if(t.isVariableDeclaration(node.declaration)){var declar=node.declaration.declarations[0];declar.init=declar.init||t.identifier("undefined")}if(!file.moduleFormatter.exportDeclaration)return;file.moduleFormatter.exportDeclaration(node,nodes,parent)}else{if(!file.moduleFormatter.exportSpecifier)return;for(var i in node.specifiers){file.moduleFormatter.exportSpecifier(node.specifiers[i],node,nodes,parent)}}inheritsComments(node,nodes);return nodes}},{"../../types":72}],48:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.Property=function(node){if(!node.shorthand)return;node.shorthand=false;node.key=t.removeComments(_.clone(node.key))}},{"../../types":72,lodash:121}],49:[function(require,module,exports){var t=require("../../types");exports.Function=function(node,parent,file){if(!node.rest)return;var rest=node.rest;delete node.rest;t.ensureBlock(node);var call=file.toArray(t.identifier("arguments"));if(node.params.length){call.arguments.push(t.literal(node.params.length))}call._ignoreAliasFunctions=true;node.body.body.unshift(t.variableDeclaration("var",[t.variableDeclarator(rest,call)]))}},{"../../types":72}],50:[function(require,module,exports){var t=require("../../types");var getSpreadLiteral=function(spread,file){return file.toArray(spread.argument)};var hasSpread=function(nodes){for(var i in nodes){if(t.isSpreadElement(nodes[i])){return true}}return false};var build=function(props,file){var nodes=[];var _props=[];var push=function(){if(!_props.length)return;nodes.push(t.arrayExpression(_props));_props=[]};for(var i in props){var prop=props[i];if(t.isSpreadElement(prop)){push();nodes.push(getSpreadLiteral(prop,file))}else{_props.push(prop)}}push();return nodes};exports.ArrayExpression=function(node,parent,file){var elements=node.elements;if(!hasSpread(elements))return;var nodes=build(elements,file);var first=nodes.shift();if(!t.isArrayExpression(first)){nodes.unshift(first);first=t.arrayExpression([])}return t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)};exports.CallExpression=function(node,parent,file,scope){var args=node.arguments; if(!hasSpread(args))return;var contextLiteral=t.literal(null);node.arguments=[];var nodes;if(args.length===1&&args[0].argument.name==="arguments"){nodes=[args[0].argument]}else{nodes=build(args,file)}var first=nodes.shift();if(nodes.length){node.arguments.push(t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes))}else{node.arguments.push(first)}var callee=node.callee;var temp;if(t.isMemberExpression(callee)){contextLiteral=callee.object;if(t.isDynamic(contextLiteral)){temp=contextLiteral=scope.generateTemp(file);callee.object=t.assignmentExpression("=",temp,callee.object)}if(callee.computed){callee.object=t.memberExpression(callee.object,callee.property,true);callee.property=t.identifier("apply");callee.computed=false}else{callee.property=t.memberExpression(callee.property,t.identifier("apply"))}}else{node.callee=t.memberExpression(node.callee,t.identifier("apply"))}node.arguments.unshift(contextLiteral)};exports.NewExpression=function(node,parent,file){var args=node.arguments;if(!hasSpread(args))return;var nodes=build(args,file);var first=nodes.shift();if(nodes.length){args=t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)}else{args=first}return t.callExpression(file.addDeclaration("apply-constructor"),[node.callee,args])}},{"../../types":72}],51:[function(require,module,exports){var t=require("../../types");var buildBinaryExpression=function(left,right){return t.binaryExpression("+",left,right)};exports.TaggedTemplateExpression=function(node,parent,file){var args=[];var quasi=node.quasi;var strings=[];var raw=[];for(var i in quasi.quasis){var elem=quasi.quasis[i];strings.push(t.literal(elem.value.cooked));raw.push(t.literal(elem.value.raw))}args.push(t.callExpression(file.addDeclaration("tagged-template-literal"),[t.arrayExpression(strings),t.arrayExpression(raw)]));args=args.concat(quasi.expressions);return t.callExpression(node.tag,args)};exports.TemplateLiteral=function(node){var nodes=[];var i;for(i in node.quasis){var elem=node.quasis[i];nodes.push(t.literal(elem.value.cooked));var expr=node.expressions.shift();if(expr)nodes.push(expr)}if(nodes.length>1){var last=nodes[nodes.length-1];if(t.isLiteral(last,{value:""}))nodes.pop();var root=buildBinaryExpression(nodes.shift(),nodes.shift());for(i in nodes){root=buildBinaryExpression(root,nodes[i])}return root}else{return nodes[0]}}},{"../../types":72}],52:[function(require,module,exports){var rewritePattern=require("regexpu/rewrite-pattern");var _=require("lodash");exports.Literal=function(node){var regex=node.regex;if(!regex)return;var flags=regex.flags.split("");if(regex.flags.indexOf("u")<0)return;_.pull(flags,"u");regex.pattern=rewritePattern(regex.pattern,regex.flags);regex.flags=flags.join("")}},{lodash:121,"regexpu/rewrite-pattern":162}],53:[function(require,module,exports){var util=require("../../util");var t=require("../../types");var container=function(parent,call,ret){if(t.isExpressionStatement(parent)){return call}else{var exprs=[];if(t.isSequenceExpression(call)){exprs=call.expressions}else{exprs.push(call)}exprs.push(ret);return t.sequenceExpression(exprs)}};exports.AssignmentExpression=function(node,parent,file,scope){var left=node.left;if(!t.isVirtualPropertyExpression(left))return;var value=node.right;var temp;if(!t.isExpressionStatement(parent)){if(t.isDynamic(value)){temp=value=scope.generateTemp(file)}}if(node.operator!=="="){value=t.binaryExpression(node.operator[0],util.template("abstract-expression-get",{PROPERTY:node.property,OBJECT:node.object}),value)}var call=util.template("abstract-expression-set",{PROPERTY:left.property,OBJECT:left.object,VALUE:value});if(temp){call=t.sequenceExpression([t.assignmentExpression("=",temp,node.right),call])}return container(parent,call,value)};exports.UnaryExpression=function(node,parent){var arg=node.argument;if(!t.isVirtualPropertyExpression(arg))return;if(node.operator!=="delete")return;var call=util.template("abstract-expression-delete",{PROPERTY:arg.property,OBJECT:arg.object});return container(parent,call,t.literal(true))};exports.CallExpression=function(node,parent,file,scope){var callee=node.callee;if(!t.isVirtualPropertyExpression(callee))return;var temp;if(t.isDynamic(callee.object)){temp=scope.generateTemp(file)}var call=util.template("abstract-expression-call",{PROPERTY:callee.property,OBJECT:temp||callee.object});call.arguments=call.arguments.concat(node.arguments);if(temp){return t.sequenceExpression([t.assignmentExpression("=",temp,callee.object),call])}else{return call}};exports.VirtualPropertyExpression=function(node){return util.template("abstract-expression-get",{PROPERTY:node.property,OBJECT:node.object})};exports.PrivateDeclaration=function(node){return t.variableDeclaration("const",node.declarations.map(function(id){return t.variableDeclarator(id,t.newExpression(t.identifier("WeakMap"),[]))}))}},{"../../types":72,"../../util":74}],54:[function(require,module,exports){var util=require("../../util");var t=require("../../types");var single=function(node,file){var block=node.blocks[0];var templateName="array-expression-comprehension-map";if(node.filter)templateName="array-expression-comprehension-filter";var result=util.template(templateName,{STATEMENT:node.body,FILTER:node.filter,ARRAY:file.toArray(block.right),KEY:block.left});var aliasPossibles=[result.callee.object,result];for(var i in aliasPossibles){var call=aliasPossibles[i];if(t.isCallExpression(call)){call.arguments[0]._aliasFunction=true}}return result};var multiple=function(node,file){var uid=file.generateUidIdentifier("arr");var container=util.template("array-comprehension-container",{KEY:uid});container.callee.expression._aliasFunction=true;var block=container.callee.body;var body=block.body;var returnStatement=body.pop();body.push(exports._build(node,function(){return util.template("array-push",{STATEMENT:node.body,KEY:uid},true)}));body.push(returnStatement);return container};exports._build=function(node,buildBody){var self=node.blocks.shift();if(!self)return;var child=exports._build(node,buildBody);if(!child){child=buildBody();if(node.filter){child=t.ifStatement(node.filter,t.blockStatement([child]))}}return t.forOfStatement(t.variableDeclaration("var",[t.variableDeclarator(self.left)]),self.right,t.blockStatement([child]))};exports.ComprehensionExpression=function(node,parent,file){if(node.generator)return;if(node.blocks.length===1){return single(node,file)}else{return multiple(node,file)}}},{"../../types":72,"../../util":74}],55:[function(require,module,exports){var t=require("../../types");var pow=t.memberExpression(t.identifier("Math"),t.identifier("pow"));exports.AssignmentExpression=function(node){if(node.operator!=="**=")return;node.operator="=";node.right=t.callExpression(pow,[node.left,node.right])};exports.BinaryExpression=function(node){if(node.operator!=="**")return;return t.callExpression(pow,[node.left,node.right])}},{"../../types":72}],56:[function(require,module,exports){var arrayComprehension=require("./es7-array-comprehension");var t=require("../../types");exports.ComprehensionExpression=function(node){if(!node.generator)return;var body=[];var container=t.functionExpression(null,[],t.blockStatement(body),true);container._aliasFunction=true;body.push(arrayComprehension._build(node,function(){return t.expressionStatement(t.yieldExpression(node.body))}));return t.callExpression(container,[])}},{"../../types":72,"./es7-array-comprehension":54}],57:[function(require,module,exports){var t=require("../../types");exports.ObjectExpression=function(node){var hasSpread=false;var i;var prop;for(i in node.properties){prop=node.properties[i];if(t.isSpreadProperty(prop)){hasSpread=true;break}}if(!hasSpread)return;var args=[];var props=[];var push=function(){if(!props.length)return;args.push(t.objectExpression(props));props=[]};for(i in node.properties){prop=node.properties[i];if(t.isSpreadProperty(prop)){push();args.push(prop.argument)}else{props.push(prop)}}push();if(!t.isObjectExpression(args[0])){args.unshift(t.objectExpression([]))}return t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("assign")),args)}},{"../../types":72}],58:[function(require,module,exports){var t=require("../../types");var isMemo=function(node){var is=t.isAssignmentExpression(node)&&node.operator==="?=";if(is)t.assertMemberExpression(node.left);return is};var getPropRef=function(nodes,prop,file,scope){if(t.isIdentifier(prop)){return t.literal(prop.name)}else{var temp=file.generateUidIdentifier("propKey",scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(temp,prop)]));return temp}};var getObjRef=function(nodes,obj,file,scope){if(t.isDynamic(obj)){var temp=file.generateUidIdentifier("obj",scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(temp,obj)]));return temp}else{return obj}};var buildHasOwn=function(obj,prop,file){return t.unaryExpression("!",t.callExpression(t.memberExpression(file.addDeclaration("has-own"),t.identifier("call")),[obj,prop]),true)};var buildAbsoluteRef=function(left,obj,prop){var computed=left.computed||t.isLiteral(prop);return t.memberExpression(obj,prop,computed)};var buildAssignment=function(expr,obj,prop){return t.assignmentExpression("=",buildAbsoluteRef(expr.left,obj,prop),expr.right)};exports.ExpressionStatement=function(node,parent,file,scope){var expr=node.expression;if(!isMemo(expr))return;var nodes=[];var left=expr.left;var obj=getObjRef(nodes,left.object,file,scope);var prop=getPropRef(nodes,left.property,file,scope);nodes.push(t.ifStatement(buildHasOwn(obj,prop,file),t.expressionStatement(buildAssignment(expr,obj,prop))));return nodes};exports.AssignmentExpression=function(node,parent,file,scope){if(t.isExpressionStatement(parent))return;if(!isMemo(node))return;var nodes=[];var left=node.left;var obj=getObjRef(nodes,left.object,file,scope);var prop=getPropRef(nodes,left.property,file,scope);nodes.push(t.logicalExpression("&&",buildHasOwn(obj,prop,file),buildAssignment(node,obj,prop)));nodes.push(buildAbsoluteRef(left,obj,prop));return t.toSequenceExpression(nodes,scope)}},{"../../types":72}],59:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.BindMemberExpression=function(node,parent,file,scope){var object=node.object;var prop=node.property;var temp;if(t.isDynamic(object)){temp=object=scope.generateTemp(file)}var call=t.callExpression(t.memberExpression(t.memberExpression(object,prop),t.identifier("bind")),[object].concat(node.arguments));if(temp){return t.sequenceExpression([t.assignmentExpression("=",temp,node.object),call])}else{return call}};exports.BindFunctionExpression=function(node,parent,file,scope){var buildCall=function(args){var param=file.generateUidIdentifier("val",scope);return t.functionExpression(null,[param],t.blockStatement([t.returnStatement(t.callExpression(t.memberExpression(param,node.callee),args))]))};if(_.find(node.arguments,t.isDynamic)){var temp=scope.generateTemp(file,"args");return t.sequenceExpression([t.assignmentExpression("=",temp,t.arrayExpression(node.arguments)),buildCall(node.arguments.map(function(node,i){return t.memberExpression(temp,t.literal(i),true)}))])}else{return buildCall(node.arguments)}}},{"../../types":72,lodash:121}],60:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");exports.Property=exports.MethodDefinition=function(node,parent,file,scope){if(node.kind!=="memo")return;node.kind="get";var value=node.value;t.ensureBlock(value);var body=value.body.body;var key=node.key;if(t.isIdentifier(key)&&!node.computed){key="_"+key.name}else{key=file.generateUid("memo",scope)}var memoId=t.memberExpression(t.thisExpression(),t.identifier(key));var doneId=t.memberExpression(t.thisExpression(),t.identifier(key+"Done"));traverse(value,{enter:function(node){if(t.isFunction(node))return;if(t.isReturnStatement(node)&&node.argument){node.argument=t.assignmentExpression("=",memoId,node.argument)}}});body.unshift(t.expressionStatement(t.assignmentExpression("=",doneId,t.literal(true))));body.unshift(t.ifStatement(doneId,t.returnStatement(memoId)))}},{"../../traverse":68,"../../types":72}],61:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");exports.XJSIdentifier=function(node){if(esutils.keyword.isIdentifierName(node.name)){node.type="Identifier"}else{return t.literal(node.name)}};exports.XJSNamespacedName=function(node,parent,file){throw file.errorWithNode(node,"Namespace tags are not supported. ReactJSX is not XML.")};exports.XJSMemberExpression={exit:function(node){node.computed=t.isLiteral(node.property);node.type="MemberExpression"}};exports.XJSExpressionContainer=function(node){return node.expression};exports.XJSAttribute={exit:function(node){var value=node.value||t.literal(true);return t.property("init",node.name,value)}};exports.XJSOpeningElement={exit:function(node){var tagExpr=node.name;var args=[];var tagName;if(t.isIdentifier(tagExpr)){tagName=tagExpr.name}else if(t.isLiteral(tagExpr)){tagName=tagExpr.value}if(tagName&&(/[a-z]/.exec(tagName[0])||tagName.indexOf("-")>=0)){args.push(t.literal(tagName))}else{args.push(tagExpr)}var props=node.attributes;if(props.length){var _props=[];var objs=[];var pushProps=function(){if(!_props.length)return;objs.push(t.objectExpression(_props));_props=[]};while(props.length){var prop=props.shift();if(t.isXJSSpreadAttribute(prop)){pushProps();objs.push(prop.argument)}else{_props.push(prop)}}pushProps();if(objs.length===1){props=objs[0]}else{if(!t.isObjectExpression(objs[0])){objs.unshift(t.objectExpression([]))}props=t.callExpression(t.memberExpression(t.identifier("React"),t.identifier("__spread")),objs)}}else{props=t.literal(null)}args.push(props);tagExpr=t.memberExpression(t.identifier("React"),t.identifier("createElement"));return t.callExpression(tagExpr,args)}};exports.XJSElement={exit:function(node){var callExpr=node.openingElement;var i;for(i in node.children){var child=node.children[i];if(t.isLiteral(child)){var lines=child.value.split(/\r\n|\n|\r/);for(i in lines){var line=lines[i];var isFirstLine=i==="0";var isLastLine=+i===lines.length-1;var trimmedLine=line.replace(/\t/g," ");if(!isFirstLine){trimmedLine=trimmedLine.replace(/^[ ]+/,"")}if(!isLastLine){trimmedLine=trimmedLine.replace(/[ ]+$/,"")}if(trimmedLine){callExpr.arguments.push(t.literal(trimmedLine))}}continue}else if(t.isXJSEmptyExpression(child)){continue}callExpr.arguments.push(child)}return t.inherits(callExpr,node)}};var addDisplayName=function(id,call){if(!call||!t.isCallExpression(call))return;var callee=call.callee;if(!t.isMemberExpression(callee))return;var obj=callee.object;if(!t.isIdentifier(obj,{name:"React"}))return;var prop=callee.property;if(!t.isIdentifier(prop,{name:"createClass"}))return;var args=call.arguments;if(args.length!==1)return;var first=args[0];if(!t.isObjectExpression(first))return;var props=first.properties;var safe=true;for(var i in props){prop=props[i];if(t.isIdentifier(prop.key,{name:"displayName"})){safe=false;break}}if(safe){props.unshift(t.property("init",t.identifier("displayName"),t.literal(id)))}};exports.AssignmentExpression=exports.Property=exports.VariableDeclarator=function(node){var left,right;if(t.isAssignmentExpression(node)){left=node.left;right=node.right}else if(t.isProperty(node)){left=node.key;right=node.value}else if(t.isVariableDeclarator(node)){left=node.id;right=node.init}if(t.isMemberExpression(left)){left=left.property}if(t.isIdentifier(left)){addDisplayName(left.name,right)}}},{"../../types":72,esutils:119}],62:[function(require,module,exports){var t=require("../../types");exports.BlockStatement=function(node,parent){if(t.isFunction(parent))return;node.body=node.body.map(function(node){if(t.isFunction(node)){node.type="FunctionExpression";var declar=t.variableDeclaration("let",[t.variableDeclarator(node.id,node)]);declar._blockHoist=true;return declar}else{return node}})}},{"../../types":72}],63:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");exports.MemberExpression=function(node){var prop=node.property;if(node.computed&&t.isLiteral(prop)&&t.isValidIdentifier(prop.value)){node.property=t.identifier(prop.value);node.computed=false}else if(!node.computed&&t.isIdentifier(prop)&&esutils.keyword.isKeywordES6(prop.name,true)){node.property=t.literal(prop.name);node.computed=true}}},{"../../types":72,esutils:119}],64:[function(require,module,exports){var t=require("../../types");exports.ObjectExpression=function(node,parent,file){var keys=[];for(var i in node.properties){var prop=node.properties[i];if(prop.computed||prop.kind!=="init")continue;var key=prop.key;if(t.isIdentifier(key)){key=key.name}else if(t.isLiteral(key)){key=key.value}else{continue}if(keys.indexOf(key)>=0){throw file.errorWithNode(prop.key,"Duplicate property key")}else{keys.push(key)}}}},{"../../types":72}],65:[function(require,module,exports){var t=require("../../types");exports.ForInStatement=exports.ForOfStatement=function(node,parent,file){var left=node.left;if(t.isVariableDeclaration(left)){var declar=left.declarations[0];if(declar.init)throw file.errorWithNode(declar,"No assignments allowed in for-in/of head")}}},{"../../types":72}],66:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");exports.Property=function(node){var key=node.key;if(t.isLiteral(key)&&t.isValidIdentifier(key.value)){node.key=t.identifier(key.value);node.computed=false}else if(!node.computed&&t.isIdentifier(key)&&esutils.keyword.isKeywordES6(key.name,true)){node.key=t.literal(key.name)}}},{"../../types":72,esutils:119}],67:[function(require,module,exports){var t=require("../../types");module.exports=function(ast){var body=ast.program.body;var first=body[0];var noStrict=!first||!t.isExpressionStatement(first)||!t.isLiteral(first.expression)||first.expression.value!=="use strict";if(noStrict){body.unshift(t.expressionStatement(t.literal("use strict")))}}},{"../../types":72}],68:[function(require,module,exports){module.exports=traverse;var Scope=require("./scope");var t=require("../types");var _=require("lodash");function traverse(parent,opts,scope){if(!parent)return;if(_.isArray(parent)){_.each(parent,function(node){traverse(node,opts,scope)});return}var keys=t.VISITOR_KEYS[parent.type];if(!keys)return;opts=opts||{};for(var i in keys){var key=keys[i];var nodes=parent[key];if(!nodes)continue;var updated=false;var handle=function(obj,key){var node=obj[key];if(!node)return;if(opts.blacklist&&opts.blacklist.indexOf(node.type)>-1)return;var maybeReplace=function(result){if(result===false)return;if(result!=null){updated=true;node=obj[key]=result;if(_.isArray(result)&&_.contains(t.STATEMENT_OR_BLOCK_KEYS,key)&&!t.isBlockStatement(obj)){t.ensureBlock(obj,key)}}};var stop=false;var context={stop:function(){stop=true}};var ourScope=scope;if(t.isScope(node))ourScope=new Scope(node,scope);if(opts.enter){var result=opts.enter.call(context,node,parent,ourScope);maybeReplace(result);if(stop||result===false)return}traverse(node,opts,ourScope);if(opts.exit){maybeReplace(opts.exit.call(context,node,parent,ourScope))}};if(_.isArray(nodes)){for(i in nodes){handle(nodes,i)}if(updated)parent[key]=_.flatten(parent[key])}else{handle(parent,key)}}}traverse.removeProperties=function(tree){var clear=function(node){delete node._declarations;delete node.extendedRange;delete node._scopeInfo;delete node.tokens;delete node.range;delete node.start;delete node.end;delete node.loc;delete node.raw;clearComments(node.trailingComments);clearComments(node.leadingComments)};var clearComments=function(comments){_.each(comments,clear)};clear(tree);traverse(tree,{enter:clear});return tree};traverse.hasType=function(tree,type,blacklistTypes){blacklistTypes=[].concat(blacklistTypes||[]);var has=false;if(_.contains(blacklistTypes,tree.type))return false;if(tree.type===type)return true;traverse(tree,{blacklist:blacklistTypes,enter:function(node){if(node.type===type){has=true;return false}}});return has}},{"../types":72,"./scope":69,lodash:121}],69:[function(require,module,exports){module.exports=Scope;var traverse=require("./index");var t=require("../types");var _=require("lodash");var FOR_KEYS=["left","init"];function Scope(block,parent){this.parent=parent;this.block=block;var info=this.getInfo();this.references=info.references;this.declarations=info.declarations}var vars=require("jshint/src/vars");Scope.defaultDeclarations=_.flatten([vars.newEcmaIdentifiers,vars.node,vars.ecmaIdentifiers,vars.reservedVars].map(_.keys));Scope.add=function(node,references){if(!node)return;_.defaults(references,t.getIds(node,true))};Scope.prototype.generateTemp=function(file,name){var id=file.generateUidIdentifier(name||"temp",this);this.push({key:id.name,id:id});return id};Scope.prototype.getInfo=function(){var block=this.block;if(block._scopeInfo)return block._scopeInfo;var info=block._scopeInfo={};var references=info.references={};var declarations=info.declarations={};var add=function(node,reference){Scope.add(node,references);if(!reference)Scope.add(node,declarations)};if(t.isFor(block)){_.each(FOR_KEYS,function(key){var node=block[key];if(t.isLet(node))add(node)});block=block.body}if(t.isBlockStatement(block)||t.isProgram(block)){_.each(block.body,function(node){if(t.isLet(node))add(node)})}if(t.isCatchClause(block)){add(block.param)}if(t.isProgram(block)||t.isFunction(block)){traverse(block,{enter:function(node,parent,scope){if(t.isFor(node)){_.each(FOR_KEYS,function(key){var declar=node[key];if(t.isVar(declar))add(declar)})}if(t.isFunction(node))return false;if(block.id&&node===block.id)return;if(t.isIdentifier(node)&&t.isReferenced(node,parent)&&!scope.has(node.name)){add(node,true)}if(t.isDeclaration(node)&&!t.isLet(node)){add(node)}}},this)}if(t.isFunction(block)){add(block.rest);_.each(block.params,function(param){add(param)})}return info};Scope.prototype.push=function(opts){var block=this.block;if(t.isFor(block)||t.isCatchClause(block)||t.isFunction(block)){t.ensureBlock(block);block=block.body}if(t.isBlockStatement(block)||t.isProgram(block)){block._declarations=block._declarations||{};block._declarations[opts.key]={kind:opts.kind,id:opts.id,init:opts.init}}else{throw new TypeError("cannot add a declaration here in node type "+block.type)}};Scope.prototype.add=function(node){Scope.add(node,this.references)};Scope.prototype.get=function(id,decl){return id&&(this.getOwn(id,decl)||this.parentGet(id,decl))};Scope.prototype.getOwn=function(id,decl){var refs=this.references;if(decl)refs=this.declarations;return _.has(refs,id)&&refs[id]};Scope.prototype.parentGet=function(id,decl){return this.parent&&this.parent.get(id,decl)};Scope.prototype.has=function(id,decl){return id&&(this.hasOwn(id,decl)||this.parentHas(id,decl))||_.contains(Scope.defaultDeclarations,id)};Scope.prototype.hasOwn=function(id,decl){return!!this.getOwn(id,decl)};Scope.prototype.parentHas=function(id,decl){return this.parent&&this.parent.has(id,decl)}},{"../types":72,"./index":68,"jshint/src/vars":120,lodash:121}],70:[function(require,module,exports){module.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement","Loop","While"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement","Loop","While"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ExportDeclaration:["Statement","Declaration"],ImportDeclaration:["Statement","Declaration"],ArrowFunctionExpression:["Scope","Function"],FunctionDeclaration:["Statement","Declaration","Scope","Function"],FunctionExpression:["Scope","Function"],BlockStatement:["Statement","Scope"],Program:["Scope"],CatchClause:["Scope"],LogicalExpression:["Binary"],BinaryExpression:["Binary"],UnaryExpression:["UnaryLike"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Statement","Declaration","Class"],ClassExpression:["Class"],ForOfStatement:["Statement","For","Scope","Loop"],ForInStatement:["Statement","For","Scope","Loop"],ForStatement:["Statement","For","Scope","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],Property:["UserWhitespacable"],XJSElement:["UserWhitespacable"]}},{}],71:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["operator","left","right"],BinaryExpression:["operator","left","right"],BlockStatement:["body"],CallExpression:["callee","arguments"],ConditionalExpression:["test","consequent","alternate"],ExpressionStatement:["expression"],File:["program","comments","tokens"],FunctionExpression:["id","params","body","generator"],Identifier:["name"],IfStatement:["test","consequent","alternate"],Literal:["value"],LogicalExpression:["operator","left","right"],MemberExpression:["object","property","computed"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],Program:["body"],Property:["kind","key","value","computed"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ThrowExpression:["argument"],UnaryExpression:["operator","argument","prefix"],VariableDeclaration:["kind","declarations"],VariableDeclarator:["id","init"],WithStatement:["object","body"],YieldExpression:["argument","delegate"]}},{}],72:[function(require,module,exports){var esutils=require("esutils");var _=require("lodash");var t=exports;var addAssert=function(type,is){t["assert"+type]=function(node,opts){opts=opts||{};if(!is(node,opts)){throw new Error("Expected type "+JSON.stringify(type)+" with option "+JSON.stringify(opts))}}};t.STATEMENT_OR_BLOCK_KEYS=["consequent","body"];t.VISITOR_KEYS=require("./visitor-keys");_.each(t.VISITOR_KEYS,function(keys,type){var is=t["is"+type]=function(node,opts){return node&&node.type===type&&t.shallowEqual(node,opts)};addAssert(type,is)});t.BUILDER_KEYS=_.defaults(require("./builder-keys"),t.VISITOR_KEYS);_.each(t.BUILDER_KEYS,function(keys,type){t[type[0].toLowerCase()+type.slice(1)]=function(){var args=arguments;var node={type:type};_.each(keys,function(key,i){node[key]=args[i]});return node}});t.ALIAS_KEYS=require("./alias-keys");t.FLIPPED_ALIAS_KEYS={};_.each(t.ALIAS_KEYS,function(aliases,type){_.each(aliases,function(alias){var types=t.FLIPPED_ALIAS_KEYS[alias]=t.FLIPPED_ALIAS_KEYS[alias]||[];types.push(type)})});_.each(t.FLIPPED_ALIAS_KEYS,function(types,type){t[type.toUpperCase()+"_TYPES"]=types;var is=t["is"+type]=function(node,opts){return node&&types.indexOf(node.type)>=0&&t.shallowEqual(node,opts)};addAssert(type,is)});t.isExpression=function(node){return!t.isStatement(node)};addAssert("Expression",t.isExpression);t.toSequenceExpression=function(nodes,scope){var exprs=[];_.each(nodes,function(node){if(t.isExpression(node)){exprs.push(node)}if(t.isExpressionStatement(node)){exprs.push(node.expression)}else if(t.isVariableDeclaration(node)){_.each(node.declarations,function(declar){scope.push({kind:node.kind,key:declar.id.name,id:declar.id});exprs.push(t.assignmentExpression("=",declar.id,declar.init))})}});return t.sequenceExpression(exprs)};t.shallowEqual=function(actual,expected){var same=true;if(expected){_.each(expected,function(val,key){if(actual[key]!==val){return same=false}})}return same};t.isDynamic=function(node){if(t.isExpressionStatement(node)){return t.isDynamic(node.expression)}else if(t.isIdentifier(node)||t.isLiteral(node)||t.isThisExpression(node)){return false}else if(t.isMemberExpression(node)){return t.isDynamic(node.object)||t.isDynamic(node.property)}else{return true}};t.isReferenced=function(node,parent){if(t.isProperty(parent)&&parent.key===node&&!parent.computed)return false;if(t.isVariableDeclarator(parent)&&parent.id===node)return false;var isMemberExpression=t.isMemberExpression(parent);var isComputedProperty=isMemberExpression&&parent.property===node&&parent.computed;var isObject=isMemberExpression&&parent.object===node;if(!isMemberExpression||isComputedProperty||isObject)return true;return false};t.toIdentifier=function(name){if(t.isIdentifier(name))return name.name;name=name.replace(/[^a-zA-Z0-9]/g,"-");name=name.replace(/^[-0-9]+/,"");name=name.replace(/[-_\s]+(.)?/g,function(match,c){return c?c.toUpperCase():""});return name||"_"};t.isValidIdentifier=function(name){return _.isString(name)&&esutils.keyword.isIdentifierName(name)&&!esutils.keyword.isKeywordES6(name,true)};t.ensureBlock=function(node,key){key=key||"body";node[key]=t.toBlock(node[key],node)};t.toStatement=function(node,ignore){if(t.isStatement(node)){return node}var mustHaveId=false;var newType;if(t.isClass(node)){mustHaveId=true;newType="ClassDeclaration"}else if(t.isFunction(node)){mustHaveId=true;newType="FunctionDeclaration"}if(mustHaveId&&!node.id){newType=false}if(!newType){if(ignore){return false}else{throw new Error("cannot turn "+node.type+" to a statement")}}node.type=newType;return node};t.toBlock=function(node,parent){if(t.isBlockStatement(node)){return node}if(!_.isArray(node)){if(!t.isStatement(node)){if(t.isFunction(parent)){node=t.returnStatement(node)}else{node=t.expressionStatement(node)}}node=[node]}return t.blockStatement(node)};t.getIds=function(node,map,ignoreTypes){ignoreTypes=ignoreTypes||[];var search=[].concat(node);var ids={};while(search.length){var id=search.shift();if(!id)continue;if(_.contains(ignoreTypes,id.type))continue;var nodeKey=t.getIds.nodes[id.type];var arrKeys=t.getIds.arrays[id.type];if(t.isIdentifier(id)){ids[id.name]=id}else if(nodeKey){if(id[nodeKey])search.push(id[nodeKey])}else if(arrKeys){for(var i in arrKeys){var key=arrKeys[i];search=search.concat(id[key]||[])}}}if(!map)ids=_.keys(ids);return ids};t.getIds.nodes={AssignmentExpression:"left",ImportSpecifier:"name",ExportSpecifier:"name",VariableDeclarator:"id",FunctionDeclaration:"id",ClassDeclaration:"id",MemeberExpression:"object",SpreadElement:"argument",Property:"value"};t.getIds.arrays={ExportDeclaration:["specifiers","declaration"],ImportDeclaration:["specifiers"],VariableDeclaration:["declarations"],ArrayPattern:["elements"],ObjectPattern:["properties"]};t.isLet=function(node){return t.isVariableDeclaration(node)&&(node.kind!=="var"||node._let)};t.isVar=function(node){return t.isVariableDeclaration(node,{kind:"var"})&&!node._let};t.removeComments=function(child){delete child.leadingComments;delete child.trailingComments;return child};t.inheritsComments=function(child,parent){child.leadingComments=_.compact([].concat(child.leadingComments,parent.leadingComments));child.trailingComments=_.compact([].concat(child.trailingComments,parent.trailingComments));return child};t.inherits=function(child,parent){child.loc=parent.loc;child.end=parent.end;child.range=parent.range;child.start=parent.start;t.inheritsComments(child,parent);return child};t.getSpecifierName=function(specifier){return specifier.name||specifier.id};t.isSpecifierDefault=function(specifier){return t.isIdentifier(specifier.id)&&specifier.id.name==="default"}},{"./alias-keys":70,"./builder-keys":71,"./visitor-keys":73,esutils:119,lodash:121}],73:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AssignmentExpression:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BindFunctionExpression:["callee","arguments"],BindMemberExpression:["object","property","arguments"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ClassProperty:["key"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportBatchSpecifier:["id"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateDeclaration:["declarations"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],VirtualPropertyExpression:["object","property"],WhileStatement:["test","body"],WithStatement:["object","body"],XJSAttribute:["name","value"],XJSClosingElement:["name"],XJSElement:["openingElement","closingElement","children"],XJSEmptyExpression:[],XJSExpressionContainer:["expression"],XJSIdentifier:[],XJSMemberExpression:["object","property"],XJSNamespacedName:["namespace","name"],XJSOpeningElement:["name","attributes"],XJSSpreadAttribute:["argument"],YieldExpression:["argument"]} },{}],74:[function(require,module,exports){(function(Buffer,__dirname){require("./patch");var estraverse=require("estraverse");var traverse=require("./traverse");var acorn=require("acorn-6to5");var path=require("path");var util=require("util");var fs=require("fs");var t=require("./types");var _=require("lodash");exports.inherits=util.inherits;exports.canCompile=function(filename,altExts){var exts=altExts||[".js",".jsx",".es6"];var ext=path.extname(filename);return _.contains(exts,ext)};exports.isInteger=function(i){return _.isNumber(i)&&i%1===0};exports.resolve=function(loc){try{return require.resolve(loc)}catch(err){return null}};exports.trimRight=function(str){return str.replace(/[\n\s]+$/g,"")};exports.list=function(val){return val?val.split(","):[]};exports.regexify=function(val){if(!val)return new RegExp(/.^/);if(_.isArray(val))val=val.join("|");if(_.isString(val))return new RegExp(val);if(_.isRegExp(val))return val;throw new TypeError("illegal type for regexify")};exports.arrayify=function(val){if(!val)return[];if(_.isString(val))return exports.list(val);if(_.isArray(val))return val;throw new TypeError("illegal type for arrayify")};exports.getUid=function(parent,file){var node;if(t.isAssignmentExpression(parent)){node=parent.left}else if(t.isVariableDeclarator(parent)){node=parent.id}var id="ref";if(t.isIdentifier(node))id=node.name;return file.generateUidIdentifier(id)};exports.isAbsolute=function(loc){if(!loc)return false;if(loc[0]==="/")return true;if(loc[1]===":"&&loc[2]==="\\")return true;return false};exports.sourceMapToComment=function(map){var json=JSON.stringify(map);var base64=new Buffer(json).toString("base64");return"//# sourceMappingURL=data:application/json;base64,"+base64};exports.pushMutatorMap=function(mutatorMap,key,kind,method){var alias;if(t.isIdentifier(key)){alias=key.name;if(method.computed)alias="computed:"+alias}else if(t.isLiteral(key)){alias=String(key.value)}else{alias=JSON.stringify(traverse.removeProperties(_.cloneDeep(key)))}var map;if(_.has(mutatorMap,alias)){map=mutatorMap[alias]}else{map={}}mutatorMap[alias]=map;map._key=key;if(method.computed){map._computed=true}map[kind]=method};exports.buildDefineProperties=function(mutatorMap){var objExpr=t.objectExpression([]);_.each(mutatorMap,function(map){var mapNode=t.objectExpression([]);var propNode=t.property("init",map._key,mapNode,map._computed);map.enumerable=t.literal(true);_.each(map,function(node,key){if(key[0]==="_")return;node=_.clone(node);var inheritNode=node;if(t.isMethodDefinition(node))node=node.value;var prop=t.property("init",t.identifier(key),node);t.inheritsComments(prop,inheritNode);t.removeComments(inheritNode);mapNode.properties.push(prop)});objExpr.properties.push(propNode)});return objExpr};exports.template=function(name,nodes,keepExpression){var template=exports.templates[name];if(!template)throw new ReferenceError("unknown template "+name);if(nodes===true){keepExpression=true;nodes=null}template=_.cloneDeep(template);if(!_.isEmpty(nodes)){traverse(template,{enter:function(node){if(t.isIdentifier(node)&&_.has(nodes,node.name)){return nodes[node.name]}}})}var node=template.body[0];if(!keepExpression&&t.isExpressionStatement(node)){node=node.expression}return node};exports.codeFrame=function(lines,lineNumber,colNumber){colNumber=Math.max(colNumber,0);lines=lines.split("\n");var start=Math.max(lineNumber-3,0);var end=Math.min(lines.length,lineNumber+3);var width=(end+"").length;if(!lineNumber&&!colNumber){start=0;end=lines.length}return"\n"+lines.slice(start,end).map(function(line,i){var curr=i+start+1;var gutter=curr===lineNumber?"> ":" ";var sep=curr+exports.repeat(width+1);gutter+=sep+"| ";var str=gutter+line;if(colNumber&&curr===lineNumber){str+="\n";str+=exports.repeat(gutter.length-2);str+="|"+exports.repeat(colNumber)+"^"}return str}).join("\n")};exports.repeat=function(width,cha){cha=cha||" ";return new Array(width+1).join(cha)};exports.normaliseAst=function(ast,comments,tokens){if(ast&&ast.type==="Program"){return t.file(ast,comments||[],tokens||[])}else{throw new Error("Not a valid ast?")}};exports.parse=function(opts,code,callback){try{var comments=[];var tokens=[];var ast=acorn.parse(code,{allowImportExportEverywhere:true,allowReturnOutsideFunction:true,ecmaVersion:opts.experimental?7:6,playground:opts.playground,strictMode:true,onComment:comments,locations:true,onToken:tokens,ranges:true});estraverse.attachComments(ast,comments,tokens);ast=exports.normaliseAst(ast,comments,tokens);if(callback){return callback(ast)}else{return ast}}catch(err){if(!err._6to5){err._6to5=true;var message=opts.filename+": "+err.message;var loc=err.loc;if(loc){var frame=exports.codeFrame(code,loc.line,loc.column);message+=frame}if(err.stack)err.stack=err.stack.replace(err.message,message);err.message=message}throw err}};exports.parseTemplate=function(loc,code){var ast=exports.parse({filename:loc},code).program;return traverse.removeProperties(ast)};var loadTemplates=function(){var templates={};var templatesLoc=__dirname+"/templates";if(!fs.existsSync(templatesLoc)){throw new Error("no templates directory - this is most likely the "+"result of a broken `npm publish`. Please report to "+"https://githut.com/6to5/6to5/issues")}_.each(fs.readdirSync(templatesLoc),function(name){if(name[0]===".")return;var key=path.basename(name,path.extname(name));var loc=templatesLoc+"/"+name;var code=fs.readFileSync(loc,"utf8");templates[key]=exports.parseTemplate(loc,code)});return templates};try{exports.templates=require("../../templates.json")}catch(err){if(err.code!=="MODULE_NOT_FOUND")throw err;exports.templates=loadTemplates()}}).call(this,require("buffer").Buffer,"/lib/6to5")},{"../../templates.json":173,"./patch":24,"./traverse":68,"./types":72,"acorn-6to5":1,buffer:91,estraverse:115,fs:89,lodash:121,path:98,util:114}],75:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var def=Type.def;var or=Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isNumber=builtin.number;var isBoolean=builtin.boolean;var isRegExp=builtin.RegExp;var shared=require("../lib/shared");var defaults=shared.defaults;var geq=shared.geq;def("Printable").field("loc",or(def("SourceLocation"),null),defaults["null"],true);def("Node").bases("Printable").field("type",isString);def("SourceLocation").build("start","end","source").field("start",def("Position")).field("end",def("Position")).field("source",or(isString,null),defaults["null"]);def("Position").build("line","column").field("line",geq(1)).field("column",geq(0));def("Program").bases("Node").build("body").field("body",[def("Statement")]).field("comments",or([or(def("Block"),def("Line"))],null),defaults["null"],true);def("Function").bases("Node").field("id",or(def("Identifier"),null),defaults["null"]).field("params",[def("Pattern")]).field("body",or(def("BlockStatement"),def("Expression")));def("Statement").bases("Node");def("EmptyStatement").bases("Statement").build();def("BlockStatement").bases("Statement").build("body").field("body",[def("Statement")]);def("ExpressionStatement").bases("Statement").build("expression").field("expression",def("Expression"));def("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Statement")).field("alternate",or(def("Statement"),null),defaults["null"]);def("LabeledStatement").bases("Statement").build("label","body").field("label",def("Identifier")).field("body",def("Statement"));def("BreakStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("ContinueStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("WithStatement").bases("Statement").build("object","body").field("object",def("Expression")).field("body",def("Statement"));def("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",def("Expression")).field("cases",[def("SwitchCase")]).field("lexical",isBoolean,defaults["false"]);def("ReturnStatement").bases("Statement").build("argument").field("argument",or(def("Expression"),null));def("ThrowStatement").bases("Statement").build("argument").field("argument",def("Expression"));def("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",def("BlockStatement")).field("handler",or(def("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[def("CatchClause")],function(){return this.handler?[this.handler]:[]},true).field("guardedHandlers",[def("CatchClause")],defaults.emptyArray).field("finalizer",or(def("BlockStatement"),null),defaults["null"]);def("CatchClause").bases("Node").build("param","guard","body").field("param",def("Pattern")).field("guard",or(def("Expression"),null),defaults["null"]).field("body",def("BlockStatement"));def("WhileStatement").bases("Statement").build("test","body").field("test",def("Expression")).field("body",def("Statement"));def("DoWhileStatement").bases("Statement").build("body","test").field("body",def("Statement")).field("test",def("Expression"));def("ForStatement").bases("Statement").build("init","test","update","body").field("init",or(def("VariableDeclaration"),def("Expression"),null)).field("test",or(def("Expression"),null)).field("update",or(def("Expression"),null)).field("body",def("Statement"));def("ForInStatement").bases("Statement").build("left","right","body","each").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement")).field("each",isBoolean);def("DebuggerStatement").bases("Statement").build();def("Declaration").bases("Statement");def("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",def("Identifier"));def("FunctionExpression").bases("Function","Expression").build("id","params","body");def("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",or("var","let","const")).field("declarations",[or(def("VariableDeclarator"),def("Identifier"))]);def("VariableDeclarator").bases("Node").build("id","init").field("id",def("Pattern")).field("init",or(def("Expression"),null));def("Expression").bases("Node","Pattern");def("ThisExpression").bases("Expression").build();def("ArrayExpression").bases("Expression").build("elements").field("elements",[or(def("Expression"),null)]);def("ObjectExpression").bases("Expression").build("properties").field("properties",[def("Property")]);def("Property").bases("Node").build("kind","key","value").field("kind",or("init","get","set")).field("key",or(def("Literal"),def("Identifier"))).field("value",def("Expression"));def("SequenceExpression").bases("Expression").build("expressions").field("expressions",[def("Expression")]);var UnaryOperator=or("-","+","!","~","typeof","void","delete");def("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",UnaryOperator).field("argument",def("Expression")).field("prefix",isBoolean,defaults["true"]);var BinaryOperator=or("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");def("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",BinaryOperator).field("left",def("Expression")).field("right",def("Expression"));var AssignmentOperator=or("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");def("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",AssignmentOperator).field("left",def("Pattern")).field("right",def("Expression"));var UpdateOperator=or("++","--");def("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",UpdateOperator).field("argument",def("Expression")).field("prefix",isBoolean);var LogicalOperator=or("||","&&");def("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",LogicalOperator).field("left",def("Expression")).field("right",def("Expression"));def("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Expression")).field("alternate",def("Expression"));def("NewExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("CallExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("MemberExpression").bases("Expression").build("object","property","computed").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("Pattern").bases("Node");def("ObjectPattern").bases("Pattern").build("properties").field("properties",[def("PropertyPattern")]);def("PropertyPattern").bases("Pattern").build("key","pattern").field("key",or(def("Literal"),def("Identifier"))).field("pattern",def("Pattern"));def("ArrayPattern").bases("Pattern").build("elements").field("elements",[or(def("Pattern"),null)]);def("SwitchCase").bases("Node").build("test","consequent").field("test",or(def("Expression"),null)).field("consequent",[def("Statement")]);def("Identifier").bases("Node","Expression","Pattern").build("name").field("name",isString);def("Literal").bases("Node","Expression").build("value").field("value",or(isString,isBoolean,null,isNumber,isRegExp));def("Block").bases("Printable").build("loc","value").field("value",isString);def("Line").bases("Printable").build("loc","value").field("value",isString)},{"../lib/shared":86,"../lib/types":87}],76:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;def("XMLDefaultDeclaration").bases("Declaration").field("namespace",def("Expression"));def("XMLAnyName").bases("Expression");def("XMLQualifiedIdentifier").bases("Expression").field("left",or(def("Identifier"),def("XMLAnyName"))).field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLAttributeSelector").bases("Expression").field("attribute",def("Expression"));def("XMLFilterExpression").bases("Expression").field("left",def("Expression")).field("right",def("Expression"));def("XMLElement").bases("XML","Expression").field("contents",[def("XML")]);def("XMLList").bases("XML","Expression").field("contents",[def("XML")]);def("XML").bases("Node");def("XMLEscape").bases("XML").field("expression",def("Expression"));def("XMLText").bases("XML").field("text",isString);def("XMLStartTag").bases("XML").field("contents",[def("XML")]);def("XMLEndTag").bases("XML").field("contents",[def("XML")]);def("XMLPointTag").bases("XML").field("contents",[def("XML")]);def("XMLName").bases("XML").field("contents",or(isString,[def("XML")]));def("XMLAttribute").bases("XML").field("value",isString);def("XMLCdata").bases("XML").field("contents",isString);def("XMLComment").bases("XML").field("contents",isString);def("XMLProcessingInstruction").bases("XML").field("target",isString).field("contents",or(isString,null))},{"../lib/types":87,"./core":75}],77:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var isObject=builtin.object;var isString=builtin.string;var defaults=require("../lib/shared").defaults;def("Function").field("generator",isBoolean,defaults["false"]).field("expression",isBoolean,defaults["false"]).field("defaults",[or(def("Expression"),null)],defaults.emptyArray).field("rest",or(def("Identifier"),null),defaults["null"]);def("FunctionDeclaration").build("id","params","body","generator","expression");def("FunctionExpression").build("id","params","body","generator","expression");def("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,defaults["null"]).field("generator",false);def("YieldExpression").bases("Expression").build("argument","delegate").field("argument",or(def("Expression"),null)).field("delegate",isBoolean,defaults["false"]);def("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionBlock").bases("Node").build("left","right","each").field("left",def("Pattern")).field("right",def("Expression")).field("each",isBoolean);def("ModuleSpecifier").bases("Literal").build("value").field("value",isString);def("Property").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("method",isBoolean,defaults["false"]).field("shorthand",isBoolean,defaults["false"]).field("computed",isBoolean,defaults["false"]);def("PropertyPattern").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",or("init","get","set","")).field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("value",def("Function")).field("computed",isBoolean,defaults["false"]);def("SpreadElement").bases("Node").build("argument").field("argument",def("Expression"));def("ArrayExpression").field("elements",[or(def("Expression"),def("SpreadElement"),null)]);def("NewExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("CallExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("SpreadElementPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));var ClassBodyElement=or(def("MethodDefinition"),def("VariableDeclarator"),def("ClassPropertyDefinition"),def("ClassProperty"));def("ClassProperty").bases("Declaration").build("key").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",ClassBodyElement);def("ClassBody").bases("Declaration").build("body").field("body",[ClassBodyElement]);def("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",def("Identifier")).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]);def("ClassExpression").bases("Expression").build("id","body","superClass").field("id",or(def("Identifier"),null),defaults["null"]).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]).field("implements",[def("ClassImplements")],defaults.emptyArray);def("ClassImplements").bases("Node").build("id").field("id",def("Identifier")).field("superClass",or(def("Expression"),null),defaults["null"]);def("Specifier").bases("Node");def("NamedSpecifier").bases("Specifier").field("id",def("Identifier")).field("name",or(def("Identifier"),null),defaults["null"]);def("ExportSpecifier").bases("NamedSpecifier").build("id","name");def("ExportBatchSpecifier").bases("Specifier").build();def("ImportSpecifier").bases("NamedSpecifier").build("id","name");def("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",isBoolean).field("declaration",or(def("Declaration"),def("Expression"),null)).field("specifiers",[or(def("ExportSpecifier"),def("ExportBatchSpecifier"))],defaults.emptyArray).field("source",or(def("ModuleSpecifier"),null),defaults["null"]);def("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[or(def("ImportSpecifier"),def("ImportNamespaceSpecifier"),def("ImportDefaultSpecifier"))],defaults.emptyArray).field("source",def("ModuleSpecifier"));def("TaggedTemplateExpression").bases("Expression").field("tag",def("Expression")).field("quasi",def("TemplateLiteral"));def("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[def("TemplateElement")]).field("expressions",[def("Expression")]);def("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:isString,raw:isString}).field("tail",isBoolean)},{"../lib/shared":86,"../lib/types":87,"./core":75}],78:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("Function").field("async",isBoolean,defaults["false"]);def("SpreadProperty").bases("Node").build("argument").field("argument",def("Expression"));def("ObjectExpression").field("properties",[or(def("Property"),def("SpreadProperty"))]);def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));def("ObjectPattern").field("properties",[or(def("PropertyPattern"),def("SpreadPropertyPattern"))]);def("AwaitExpression").bases("Expression").build("argument","all").field("argument",or(def("Expression"),null)).field("all",isBoolean,defaults["false"])},{"../lib/shared":86,"../lib/types":87,"./core":75}],79:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("XJSAttribute").bases("Node").build("name","value").field("name",or(def("XJSIdentifier"),def("XJSNamespacedName"))).field("value",or(def("Literal"),def("XJSExpressionContainer"),null),defaults["null"]);def("XJSIdentifier").bases("Node").build("name").field("name",isString);def("XJSNamespacedName").bases("Node").build("namespace","name").field("namespace",def("XJSIdentifier")).field("name",def("XJSIdentifier"));def("XJSMemberExpression").bases("MemberExpression").build("object","property").field("object",or(def("XJSIdentifier"),def("XJSMemberExpression"))).field("property",def("XJSIdentifier")).field("computed",isBoolean,defaults.false);var XJSElementName=or(def("XJSIdentifier"),def("XJSNamespacedName"),def("XJSMemberExpression"));def("XJSSpreadAttribute").bases("Node").build("argument").field("argument",def("Expression"));var XJSAttributes=[or(def("XJSAttribute"),def("XJSSpreadAttribute"))];def("XJSExpressionContainer").bases("Expression").build("expression").field("expression",def("Expression"));def("XJSElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",def("XJSOpeningElement")).field("closingElement",or(def("XJSClosingElement"),null),defaults["null"]).field("children",[or(def("XJSElement"),def("XJSExpressionContainer"),def("XJSText"),def("Literal"))],defaults.emptyArray).field("name",XJSElementName,function(){return this.openingElement.name}).field("selfClosing",isBoolean,function(){return this.openingElement.selfClosing}).field("attributes",XJSAttributes,function(){return this.openingElement.attributes});def("XJSOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",XJSElementName).field("attributes",XJSAttributes,defaults.emptyArray).field("selfClosing",isBoolean,defaults["false"]);def("XJSClosingElement").bases("Node").build("name").field("name",XJSElementName);def("XJSText").bases("Literal").build("value").field("value",isString);def("XJSEmptyExpression").bases("Expression").build();def("Type").bases("Node");def("AnyTypeAnnotation").bases("Type");def("VoidTypeAnnotation").bases("Type");def("NumberTypeAnnotation").bases("Type");def("StringTypeAnnotation").bases("Type");def("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",isString).field("raw",isString);def("BooleanTypeAnnotation").bases("Type");def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",def("Type"));def("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",def("Type"));def("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[def("FunctionTypeParam")]).field("returnType",def("Type")).field("rest",or(def("FunctionTypeParam"),null)).field("typeParameters",or(def("TypeParameterDeclaration"),null));def("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",def("Identifier")).field("typeAnnotation",def("Type")).field("optional",isBoolean);def("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[def("ObjectTypeProperty")]).field("indexers",[def("ObjectTypeIndexer")],defaults.emptyArray).field("callProperties",[def("ObjectTypeCallProperty")],defaults.emptyArray);def("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",or(def("Literal"),def("Identifier"))).field("value",def("Type")).field("optional",isBoolean);def("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",def("Identifier")).field("key",def("Type")).field("value",def("Type"));def("ObjectTypeCallProperty").bases("Node").build("value").field("value",def("FunctionTypeAnnotation")).field("static",isBoolean,false);def("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("id",def("Identifier"));def("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("MemberTypeAnnotation").bases("Type").build("object","property").field("object",def("Identifier")).field("property",or(def("MemberTypeAnnotation"),def("GenericTypeAnnotation")));def("UnionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",def("Type"));def("Identifier").field("typeAnnotation",or(def("TypeAnnotation"),null),defaults["null"]);def("TypeParameterDeclaration").bases("Node").build("params").field("params",[def("Identifier")]);def("TypeParameterInstantiation").bases("Node").build("params").field("params",[def("Type")]);def("Function").field("returnType",or(def("TypeAnnotation"),null),defaults["null"]).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]);def("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",def("TypeAnnotation")).field("static",isBoolean,false);def("ClassImplements").field("typeParameters",or(def("TypeParameterInstantiation"),null),defaults["null"]);def("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]).field("body",def("ObjectTypeAnnotation")).field("extends",[def("InterfaceExtends")]);def("InterfaceExtends").bases("Node").build("id").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null)).field("right",def("Type"));def("TupleTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("DeclareVariable").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareFunction").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareClass").bases("InterfaceDeclaration").build("id");def("DeclareModule").bases("Statement").build("id","body").field("id",or(def("Identifier"),def("Literal"))).field("body",def("BlockStatement"))},{"../lib/shared":86,"../lib/types":87,"./core":75}],80:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var geq=require("../lib/shared").geq;def("ForOfStatement").bases("Statement").build("left","right","body").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement"));def("LetStatement").bases("Statement").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Statement"));def("LetExpression").bases("Expression").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Expression"));def("GraphExpression").bases("Expression").build("index","expression").field("index",geq(0)).field("expression",def("Literal"));def("GraphIndexExpression").bases("Expression").build("index").field("index",geq(0))},{"../lib/shared":86,"../lib/types":87,"./core":75}],81:[function(require,module,exports){var assert=require("assert");var types=require("../main");var getFieldNames=types.getFieldNames;var getFieldValue=types.getFieldValue;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isDate=types.builtInTypes.Date;var isRegExp=types.builtInTypes.RegExp;var hasOwn=Object.prototype.hasOwnProperty;function astNodesAreEquivalent(a,b,problemPath){if(isArray.check(problemPath)){problemPath.length=0}else{problemPath=null}return areEquivalent(a,b,problemPath)}astNodesAreEquivalent.assert=function(a,b){var problemPath=[];if(!astNodesAreEquivalent(a,b,problemPath)){if(problemPath.length===0){assert.strictEqual(a,b)}else{assert.ok(false,"Nodes differ in the following path: "+problemPath.map(subscriptForProperty).join(""))}}};function subscriptForProperty(property){if(/[_$a-z][_$a-z0-9]*/i.test(property)){return"."+property}return"["+JSON.stringify(property)+"]"}function areEquivalent(a,b,problemPath){if(a===b){return true}if(isArray.check(a)){return arraysAreEquivalent(a,b,problemPath)}if(isObject.check(a)){return objectsAreEquivalent(a,b,problemPath)}if(isDate.check(a)){return isDate.check(b)&&+a===+b}if(isRegExp.check(a)){return isRegExp.check(b)&&(a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.ignoreCase===b.ignoreCase)}return a==b}function arraysAreEquivalent(a,b,problemPath){isArray.assert(a);var aLength=a.length;if(!isArray.check(b)||b.length!==aLength){if(problemPath){problemPath.push("length")}return false}for(var i=0;i<aLength;++i){if(problemPath){problemPath.push(i)}if(i in a!==i in b){return false}if(!areEquivalent(a[i],b[i],problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),i)}}return true}function objectsAreEquivalent(a,b,problemPath){isObject.assert(a);if(!isObject.check(b)){return false}if(a.type!==b.type){if(problemPath){problemPath.push("type")}return false}var aNames=getFieldNames(a);var aNameCount=aNames.length;var bNames=getFieldNames(b);var bNameCount=bNames.length;if(aNameCount===bNameCount){for(var i=0;i<aNameCount;++i){var name=aNames[i];var aChild=getFieldValue(a,name);var bChild=getFieldValue(b,name);if(problemPath){problemPath.push(name)}if(!areEquivalent(aChild,bChild,problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),name)}}return true}if(!problemPath){return false}var seenNames=Object.create(null);for(i=0;i<aNameCount;++i){seenNames[aNames[i]]=true}for(i=0;i<bNameCount;++i){name=bNames[i];if(!hasOwn.call(seenNames,name)){problemPath.push(name);return false}delete seenNames[name]}for(name in seenNames){problemPath.push(name);break}return false}module.exports=astNodesAreEquivalent},{"../main":88,assert:90}],82:[function(require,module,exports){var assert=require("assert"); var types=require("./types");var n=types.namedTypes;var b=types.builders;var isNumber=types.builtInTypes.number;var isArray=types.builtInTypes.array;var Path=require("./path");var Scope=require("./scope");function NodePath(value,parentPath,name){assert.ok(this instanceof NodePath);Path.call(this,value,parentPath,name)}require("util").inherits(NodePath,Path);var NPp=NodePath.prototype;Object.defineProperties(NPp,{node:{get:function(){Object.defineProperty(this,"node",{configurable:true,value:this._computeNode()});return this.node}},parent:{get:function(){Object.defineProperty(this,"parent",{configurable:true,value:this._computeParent()});return this.parent}},scope:{get:function(){Object.defineProperty(this,"scope",{configurable:true,value:this._computeScope()});return this.scope}}});NPp.replace=function(){delete this.node;delete this.parent;delete this.scope;return Path.prototype.replace.apply(this,arguments)};NPp.prune=function(){var remainingNodePath=this.parent;this.replace();return cleanUpNodesAfterPrune(remainingNodePath)};NPp._computeNode=function(){var value=this.value;if(n.Node.check(value)){return value}var pp=this.parentPath;return pp&&pp.node||null};NPp._computeParent=function(){var value=this.value;var pp=this.parentPath;if(!n.Node.check(value)){while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}if(pp){pp=pp.parentPath}}while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}return pp||null};NPp._computeScope=function(){var value=this.value;var pp=this.parentPath;var scope=pp&&pp.scope;if(n.Node.check(value)&&Scope.isEstablishedBy(value)){scope=new Scope(this,scope)}return scope||null};NPp.getValueProperty=function(name){return types.getFieldValue(this.value,name)};NPp.needsParens=function(assumeExpressionContext){var pp=this.parentPath;if(!pp){return false}var node=this.value;if(!n.Expression.check(node)){return false}if(node.type==="Identifier"){return false}while(!n.Node.check(pp.value)){pp=pp.parentPath;if(!pp){return false}}var parent=pp.value;switch(node.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return parent.type==="MemberExpression"&&this.name==="object"&&parent.object===node;case"BinaryExpression":case"LogicalExpression":switch(parent.type){case"CallExpression":return this.name==="callee"&&parent.callee===node;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return true;case"MemberExpression":return this.name==="object"&&parent.object===node;case"BinaryExpression":case"LogicalExpression":var po=parent.operator;var pp=PRECEDENCE[po];var no=node.operator;var np=PRECEDENCE[no];if(pp>np){return true}if(pp===np&&this.name==="right"){assert.strictEqual(parent.right,node);return true}default:return false}case"SequenceExpression":switch(parent.type){case"ForStatement":return false;case"ExpressionStatement":return this.name!=="expression";default:return true}case"YieldExpression":switch(parent.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return true;default:return false}case"Literal":return parent.type==="MemberExpression"&&isNumber.check(node.value)&&this.name==="object"&&parent.object===node;case"AssignmentExpression":case"ConditionalExpression":switch(parent.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return true;case"CallExpression":return this.name==="callee"&&parent.callee===node;case"ConditionalExpression":return this.name==="test"&&parent.test===node;case"MemberExpression":return this.name==="object"&&parent.object===node;default:return false}default:if(parent.type==="NewExpression"&&this.name==="callee"&&parent.callee===node){return containsCallExpression(node)}}if(assumeExpressionContext!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function isBinary(node){return n.BinaryExpression.check(node)||n.LogicalExpression.check(node)}function isUnaryLike(node){return n.UnaryExpression.check(node)||n.SpreadElement&&n.SpreadElement.check(node)||n.SpreadProperty&&n.SpreadProperty.check(node)}var PRECEDENCE={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(tier,i){tier.forEach(function(op){PRECEDENCE[op]=i})});function containsCallExpression(node){if(n.CallExpression.check(node)){return true}if(isArray.check(node)){return node.some(containsCallExpression)}if(n.Node.check(node)){return types.someField(node,function(name,child){return containsCallExpression(child)})}return false}NPp.canBeFirstInStatement=function(){var node=this.node;return!n.FunctionExpression.check(node)&&!n.ObjectExpression.check(node)};NPp.firstInStatement=function(){return firstInStatement(this)};function firstInStatement(path){for(var node,parent;path.parent;path=path.parent){node=path.node;parent=path.parent.node;if(n.BlockStatement.check(parent)&&path.parent.name==="body"&&path.name===0){assert.strictEqual(parent.body[0],node);return true}if(n.ExpressionStatement.check(parent)&&path.name==="expression"){assert.strictEqual(parent.expression,node);return true}if(n.SequenceExpression.check(parent)&&path.parent.name==="expressions"&&path.name===0){assert.strictEqual(parent.expressions[0],node);continue}if(n.CallExpression.check(parent)&&path.name==="callee"){assert.strictEqual(parent.callee,node);continue}if(n.MemberExpression.check(parent)&&path.name==="object"){assert.strictEqual(parent.object,node);continue}if(n.ConditionalExpression.check(parent)&&path.name==="test"){assert.strictEqual(parent.test,node);continue}if(isBinary(parent)&&path.name==="left"){assert.strictEqual(parent.left,node);continue}if(n.UnaryExpression.check(parent)&&!parent.prefix&&path.name==="argument"){assert.strictEqual(parent.argument,node);continue}return false}return true}function cleanUpNodesAfterPrune(remainingNodePath){if(n.VariableDeclaration.check(remainingNodePath.node)){var declarations=remainingNodePath.get("declarations").value;if(!declarations||declarations.length===0){return remainingNodePath.prune()}}else if(n.ExpressionStatement.check(remainingNodePath.node)){if(!remainingNodePath.get("expression").value){return remainingNodePath.prune()}}else if(n.IfStatement.check(remainingNodePath.node)){cleanUpIfStatementAfterPrune(remainingNodePath)}return remainingNodePath}function cleanUpIfStatementAfterPrune(ifStatement){var testExpression=ifStatement.get("test").value;var alternate=ifStatement.get("alternate").value;var consequent=ifStatement.get("consequent").value;if(!consequent&&!alternate){var testExpressionStatement=b.expressionStatement(testExpression);ifStatement.replace(testExpressionStatement)}else if(!consequent&&alternate){var negatedTestExpression=b.unaryExpression("!",testExpression,true);if(n.UnaryExpression.check(testExpression)&&testExpression.operator==="!"){negatedTestExpression=testExpression.argument}ifStatement.get("test").replace(negatedTestExpression);ifStatement.get("consequent").replace(alternate);ifStatement.get("alternate").replace()}}module.exports=NodePath},{"./path":84,"./scope":85,"./types":87,assert:90,util:114}],83:[function(require,module,exports){var assert=require("assert");var types=require("./types");var NodePath=require("./node-path");var Node=types.namedTypes.Node;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isFunction=types.builtInTypes.function;var hasOwn=Object.prototype.hasOwnProperty;var undefined;function PathVisitor(){assert.ok(this instanceof PathVisitor);this._reusableContextStack=[];this._methodNameTable=computeMethodNameTable(this);this.Context=makeContextConstructor(this);this._visiting=false;this._changeReported=false}function computeMethodNameTable(visitor){var typeNames=Object.create(null);for(var methodName in visitor){if(/^visit[A-Z]/.test(methodName)){typeNames[methodName.slice("visit".length)]=true}}var supertypeTable=types.computeSupertypeLookupTable(typeNames);var methodNameTable=Object.create(null);var typeNames=Object.keys(supertypeTable);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];methodName="visit"+supertypeTable[typeName];if(isFunction.check(visitor[methodName])){methodNameTable[typeName]=methodName}}return methodNameTable}PathVisitor.fromMethodsObject=function fromMethodsObject(methods){if(methods instanceof PathVisitor){return methods}if(!isObject.check(methods)){return new PathVisitor}function Visitor(){assert.ok(this instanceof Visitor);PathVisitor.call(this)}var Vp=Visitor.prototype=Object.create(PVp);Vp.constructor=Visitor;extend(Vp,methods);extend(Visitor,PathVisitor);isFunction.assert(Visitor.fromMethodsObject);isFunction.assert(Visitor.visit);return new Visitor};function extend(target,source){for(var property in source){if(hasOwn.call(source,property)){target[property]=source[property]}}return target}PathVisitor.visit=function visit(node,methods){var visitor=PathVisitor.fromMethodsObject(methods);if(node instanceof NodePath){visitor.visit(node);return node.value}var rootPath=new NodePath({root:node});visitor.visit(rootPath.get("root"));return rootPath.value.root};var PVp=PathVisitor.prototype;var recursiveVisitWarning=["Recursively calling visitor.visit(path) resets visitor state.","Try this.visit(path) or this.traverse(path) instead."].join(" ");PVp.visit=function(path){assert.ok(!this._visiting,recursiveVisitWarning);this._visiting=true;this._changeReported=false;this.reset.apply(this,arguments);try{return this.visitWithoutReset(path)}finally{this._visiting=false}};PVp.reset=function(path){};PVp.visitWithoutReset=function(path){if(this instanceof this.Context){return this.visitor.visitWithoutReset(path)}assert.ok(path instanceof NodePath);var value=path.value;var methodName=Node.check(value)&&this._methodNameTable[value.type];if(methodName){var context=this.acquireContext(path);try{context.invokeVisitorMethod(methodName)}finally{this.releaseContext(context)}}else{visitChildren(path,this)}};function visitChildren(path,visitor){assert.ok(path instanceof NodePath);assert.ok(visitor instanceof PathVisitor);var value=path.value;if(isArray.check(value)){path.each(visitor.visitWithoutReset,visitor)}else if(!isObject.check(value)){}else{var childNames=types.getFieldNames(value);var childCount=childNames.length;var childPaths=[];for(var i=0;i<childCount;++i){var childName=childNames[i];if(!hasOwn.call(value,childName)){value[childName]=types.getFieldValue(value,childName)}childPaths.push(path.get(childName))}for(var i=0;i<childCount;++i){visitor.visitWithoutReset(childPaths[i])}}}PVp.acquireContext=function(path){if(this._reusableContextStack.length===0){return new this.Context(path)}return this._reusableContextStack.pop().reset(path)};PVp.releaseContext=function(context){assert.ok(context instanceof this.Context);this._reusableContextStack.push(context);context.currentPath=null};PVp.reportChanged=function(){this._changeReported=true};PVp.wasChangeReported=function(){return this._changeReported};function makeContextConstructor(visitor){function Context(path){assert.ok(this instanceof Context);assert.ok(this instanceof PathVisitor);assert.ok(path instanceof NodePath);Object.defineProperty(this,"visitor",{value:visitor,writable:false,enumerable:true,configurable:false});this.currentPath=path;this.needToCallTraverse=true;Object.seal(this)}assert.ok(visitor instanceof PathVisitor);var Cp=Context.prototype=Object.create(visitor);Cp.constructor=Context;extend(Cp,sharedContextProtoMethods);return Context}var sharedContextProtoMethods=Object.create(null);sharedContextProtoMethods.reset=function reset(path){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);this.currentPath=path;this.needToCallTraverse=true;return this};sharedContextProtoMethods.invokeVisitorMethod=function invokeVisitorMethod(methodName){assert.ok(this instanceof this.Context);assert.ok(this.currentPath instanceof NodePath);var result=this.visitor[methodName].call(this,this.currentPath);if(result===false){this.needToCallTraverse=false}else if(result!==undefined){this.currentPath=this.currentPath.replace(result)[0];if(this.needToCallTraverse){this.traverse(this.currentPath)}}assert.strictEqual(this.needToCallTraverse,false,"Must either call this.traverse or return false in "+methodName)};sharedContextProtoMethods.traverse=function traverse(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;visitChildren(path,PathVisitor.fromMethodsObject(newVisitor||this.visitor))};sharedContextProtoMethods.visit=function visit(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;PathVisitor.fromMethodsObject(newVisitor||this.visitor).visitWithoutReset(path)};sharedContextProtoMethods.reportChanged=function reportChanged(){this.visitor.reportChanged()};module.exports=PathVisitor},{"./node-path":82,"./types":87,assert:90}],84:[function(require,module,exports){var assert=require("assert");var Op=Object.prototype;var hasOwn=Op.hasOwnProperty;var types=require("./types");var isArray=types.builtInTypes.array;var isNumber=types.builtInTypes.number;var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;function Path(value,parentPath,name){assert.ok(this instanceof Path);if(parentPath){assert.ok(parentPath instanceof Path)}else{parentPath=null;name=null}this.value=value;this.parentPath=parentPath;this.name=name;this.__childCache=null}var Pp=Path.prototype;function getChildCache(path){return path.__childCache||(path.__childCache=Object.create(null))}function getChildPath(path,name){var cache=getChildCache(path);var actualChildValue=path.getValueProperty(name);var childPath=cache[name];if(!hasOwn.call(cache,name)||childPath.value!==actualChildValue){childPath=cache[name]=new path.constructor(actualChildValue,path,name)}return childPath}Pp.getValueProperty=function getValueProperty(name){return this.value[name]};Pp.get=function get(name){var path=this;var names=arguments;var count=names.length;for(var i=0;i<count;++i){path=getChildPath(path,names[i])}return path};Pp.each=function each(callback,context){var childPaths=[];var len=this.value.length;var i=0;for(var i=0;i<len;++i){if(hasOwn.call(this.value,i)){childPaths[i]=this.get(i)}}context=context||this;for(i=0;i<len;++i){if(hasOwn.call(childPaths,i)){callback.call(context,childPaths[i])}}};Pp.map=function map(callback,context){var result=[];this.each(function(childPath){result.push(callback.call(this,childPath))},context);return result};Pp.filter=function filter(callback,context){var result=[];this.each(function(childPath){if(callback.call(this,childPath)){result.push(childPath)}},context);return result};function emptyMoves(){}function getMoves(path,offset,start,end){isArray.assert(path.value);if(offset===0){return emptyMoves}var length=path.value.length;if(length<1){return emptyMoves}var argc=arguments.length;if(argc===2){start=0;end=length}else if(argc===3){start=Math.max(start,0);end=length}else{start=Math.max(start,0);end=Math.min(end,length)}isNumber.assert(start);isNumber.assert(end);var moves=Object.create(null);var cache=getChildCache(path);for(var i=start;i<end;++i){if(hasOwn.call(path.value,i)){var childPath=path.get(i);assert.strictEqual(childPath.name,i);var newIndex=i+offset;childPath.name=newIndex;moves[newIndex]=childPath;delete cache[i]}}delete cache.length;return function(){for(var newIndex in moves){var childPath=moves[newIndex];assert.strictEqual(childPath.name,+newIndex);cache[newIndex]=childPath;path.value[newIndex]=childPath.value}}}Pp.shift=function shift(){var move=getMoves(this,-1);var result=this.value.shift();move();return result};Pp.unshift=function unshift(node){var move=getMoves(this,arguments.length);var result=this.value.unshift.apply(this.value,arguments);move();return result};Pp.push=function push(node){isArray.assert(this.value);delete getChildCache(this).length;return this.value.push.apply(this.value,arguments)};Pp.pop=function pop(){isArray.assert(this.value);var cache=getChildCache(this);delete cache[this.value.length-1];delete cache.length;return this.value.pop()};Pp.insertAt=function insertAt(index,node){var argc=arguments.length;var move=getMoves(this,argc-1,index);if(move===emptyMoves){return this}index=Math.max(index,0);for(var i=1;i<argc;++i){this.value[index+i-1]=arguments[i]}move();return this};Pp.insertBefore=function insertBefore(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};Pp.insertAfter=function insertAfter(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name+1];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};function repairRelationshipWithParent(path){assert.ok(path instanceof Path);var pp=path.parentPath;if(!pp){return path}var parentValue=pp.value;var parentCache=getChildCache(pp);if(parentValue[path.name]===path.value){parentCache[path.name]=path}else if(isArray.check(parentValue)){var i=parentValue.indexOf(path.value);if(i>=0){parentCache[path.name=i]=path}}else{parentValue[path.name]=path.value;parentCache[path.name]=path}assert.strictEqual(parentValue[path.name],path.value);assert.strictEqual(path.parentPath.get(path.name),path);return path}Pp.replace=function replace(replacement){var results=[];var parentValue=this.parentPath.value;var parentCache=getChildCache(this.parentPath);var count=arguments.length;repairRelationshipWithParent(this);if(isArray.check(parentValue)){var originalLength=parentValue.length;var move=getMoves(this.parentPath,count-1,this.name+1);var spliceArgs=[this.name,1];for(var i=0;i<count;++i){spliceArgs.push(arguments[i])}var splicedOut=parentValue.splice.apply(parentValue,spliceArgs);assert.strictEqual(splicedOut[0],this.value);assert.strictEqual(parentValue.length,originalLength-1+count);move();if(count===0){delete this.value;delete parentCache[this.name];this.__childCache=null}else{assert.strictEqual(parentValue[this.name],replacement);if(this.value!==replacement){this.value=replacement;this.__childCache=null}for(i=0;i<count;++i){results.push(this.parentPath.get(this.name+i))}assert.strictEqual(results[0],this)}}else if(count===1){if(this.value!==replacement){this.__childCache=null}this.value=parentValue[this.name]=replacement;results.push(this)}else if(count===0){delete parentValue[this.name];delete this.value;this.__childCache=null}else{assert.ok(false,"Could not replace path")}return results};module.exports=Path},{"./types":87,assert:90}],85:[function(require,module,exports){var assert=require("assert");var types=require("./types");var Type=types.Type;var namedTypes=types.namedTypes;var Node=namedTypes.Node;var Expression=namedTypes.Expression;var isArray=types.builtInTypes.array;var hasOwn=Object.prototype.hasOwnProperty;var b=types.builders;function Scope(path,parentScope){assert.ok(this instanceof Scope);assert.ok(path instanceof require("./node-path"));ScopeType.assert(path.value);var depth;if(parentScope){assert.ok(parentScope instanceof Scope);depth=parentScope.depth+1}else{parentScope=null;depth=0}Object.defineProperties(this,{path:{value:path},node:{value:path.value},isGlobal:{value:!parentScope,enumerable:true},depth:{value:depth},parent:{value:parentScope},bindings:{value:{}}})}var scopeTypes=[namedTypes.Program,namedTypes.Function,namedTypes.CatchClause];var ScopeType=Type.or.apply(Type,scopeTypes);Scope.isEstablishedBy=function(node){return ScopeType.check(node)};var Sp=Scope.prototype;Sp.didScan=false;Sp.declares=function(name){this.scan();return hasOwn.call(this.bindings,name)};Sp.declareTemporary=function(prefix){if(prefix){assert.ok(/^[a-z$_]/i.test(prefix),prefix)}else{prefix="t$"}prefix+=this.depth.toString(36)+"$";this.scan();var index=0;while(this.declares(prefix+index)){++index}var name=prefix+index;return this.bindings[name]=types.builders.identifier(name)};Sp.injectTemporary=function(identifier,init){identifier||(identifier=this.declareTemporary());var bodyPath=this.path.get("body");if(namedTypes.BlockStatement.check(bodyPath.value)){bodyPath=bodyPath.get("body")}bodyPath.unshift(b.variableDeclaration("var",[b.variableDeclarator(identifier,init||null)]));return identifier};Sp.scan=function(force){if(force||!this.didScan){for(var name in this.bindings){delete this.bindings[name]}scanScope(this.path,this.bindings);this.didScan=true}};Sp.getBindings=function(){this.scan();return this.bindings};function scanScope(path,bindings){var node=path.value;ScopeType.assert(node);if(namedTypes.CatchClause.check(node)){addPattern(path.get("param"),bindings)}else{recursiveScanScope(path,bindings)}}function recursiveScanScope(path,bindings){var node=path.value;if(path.parent&&namedTypes.FunctionExpression.check(path.parent.node)&&path.parent.node.id){addPattern(path.parent.get("id"),bindings)}if(!node){}else if(isArray.check(node)){path.each(function(childPath){recursiveScanChild(childPath,bindings)})}else if(namedTypes.Function.check(node)){path.get("params").each(function(paramPath){addPattern(paramPath,bindings)});recursiveScanChild(path.get("body"),bindings)}else if(namedTypes.VariableDeclarator.check(node)){addPattern(path.get("id"),bindings);recursiveScanChild(path.get("init"),bindings)}else if(node.type==="ImportSpecifier"||node.type==="ImportNamespaceSpecifier"||node.type==="ImportDefaultSpecifier"){addPattern(node.name?path.get("name"):path.get("id"),bindings)}else if(Node.check(node)&&!Expression.check(node)){types.eachField(node,function(name,child){var childPath=path.get(name);assert.strictEqual(childPath.value,child);recursiveScanChild(childPath,bindings)})}}function recursiveScanChild(path,bindings){var node=path.value;if(!node||Expression.check(node)){}else if(namedTypes.FunctionDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(namedTypes.ClassDeclaration&&namedTypes.ClassDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(ScopeType.check(node)){if(namedTypes.CatchClause.check(node)){var catchParamName=node.param.name;var hadBinding=hasOwn.call(bindings,catchParamName);recursiveScanScope(path.get("body"),bindings);if(!hadBinding){delete bindings[catchParamName]}}}else{recursiveScanScope(path,bindings)}}function addPattern(patternPath,bindings){var pattern=patternPath.value;namedTypes.Pattern.assert(pattern);if(namedTypes.Identifier.check(pattern)){if(hasOwn.call(bindings,pattern.name)){bindings[pattern.name].push(patternPath)}else{bindings[pattern.name]=[patternPath]}}else if(namedTypes.SpreadElement&&namedTypes.SpreadElement.check(pattern)){addPattern(patternPath.get("argument"),bindings)}}Sp.lookup=function(name){for(var scope=this;scope;scope=scope.parent)if(scope.declares(name))break;return scope};Sp.getGlobalScope=function(){var scope=this;while(!scope.isGlobal)scope=scope.parent;return scope};module.exports=Scope},{"./node-path":82,"./types":87,assert:90}],86:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var builtin=types.builtInTypes;var isNumber=builtin.number;exports.geq=function(than){return new Type(function(value){return isNumber.check(value)&&value>=than},isNumber+" >= "+than)};exports.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return false},"true":function(){return true},undefined:function(){}};var naiveIsPrimitive=Type.or(builtin.string,builtin.number,builtin.boolean,builtin.null,builtin.undefined);exports.isPrimitive=new Type(function(value){if(value===null)return true;var type=typeof value;return!(type==="object"||type==="function")},naiveIsPrimitive.toString())},{"../lib/types":87}],87:[function(require,module,exports){var assert=require("assert");var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;var each=Ap.forEach;var Op=Object.prototype;var objToStr=Op.toString;var funObjStr=objToStr.call(function(){});var strObjStr=objToStr.call("");var hasOwn=Op.hasOwnProperty;function Type(check,name){var self=this;assert.ok(self instanceof Type,self);assert.strictEqual(objToStr.call(check),funObjStr,check+" is not a function");var nameObjStr=objToStr.call(name);assert.ok(nameObjStr===funObjStr||nameObjStr===strObjStr,name+" is neither a function nor a string");Object.defineProperties(self,{name:{value:name},check:{value:function(value,deep){var result=check.call(self,value,deep);if(!result&&deep&&objToStr.call(deep)===funObjStr)deep(self,value);return result}}})}var Tp=Type.prototype;exports.Type=Type;Tp.assert=function(value,deep){if(!this.check(value,deep)){var str=shallowStringify(value);assert.ok(false,str+" does not match type "+this);return false}return true};function shallowStringify(value){if(isObject.check(value))return"{"+Object.keys(value).map(function(key){return key+": "+value[key]}).join(", ")+"}";if(isArray.check(value))return"["+value.map(shallowStringify).join(", ")+"]";return JSON.stringify(value)}Tp.toString=function(){var name=this.name;if(isString.check(name))return name;if(isFunction.check(name))return name.call(this)+"";return name+" type"};var builtInTypes={};exports.builtInTypes=builtInTypes;function defBuiltInType(example,name){var objStr=objToStr.call(example);Object.defineProperty(builtInTypes,name,{enumerable:true,value:new Type(function(value){return objToStr.call(value)===objStr},name)});return builtInTypes[name]}var isString=defBuiltInType("","string");var isFunction=defBuiltInType(function(){},"function");var isArray=defBuiltInType([],"array");var isObject=defBuiltInType({},"object");var isRegExp=defBuiltInType(/./,"RegExp");var isDate=defBuiltInType(new Date,"Date");var isNumber=defBuiltInType(3,"number");var isBoolean=defBuiltInType(true,"boolean");var isNull=defBuiltInType(null,"null");var isUndefined=defBuiltInType(void 0,"undefined");function toType(from,name){if(from instanceof Type)return from;if(from instanceof Def)return from.type;if(isArray.check(from))return Type.fromArray(from);if(isObject.check(from))return Type.fromObject(from);if(isFunction.check(from))return new Type(from,name);return new Type(function(value){return value===from},isUndefined.check(name)?function(){return from+""}:name)}Type.or=function(){var types=[];var len=arguments.length;for(var i=0;i<len;++i)types.push(toType(arguments[i]));return new Type(function(value,deep){for(var i=0;i<len;++i)if(types[i].check(value,deep))return true;return false},function(){return types.join(" | ")})};Type.fromArray=function(arr){assert.ok(isArray.check(arr));assert.strictEqual(arr.length,1,"only one element type is permitted for typed arrays");return toType(arr[0]).arrayOf()};Tp.arrayOf=function(){var elemType=this;return new Type(function(value,deep){return isArray.check(value)&&value.every(function(elem){return elemType.check(elem,deep)})},function(){return"["+elemType+"]"})};Type.fromObject=function(obj){var fields=Object.keys(obj).map(function(name){return new Field(name,obj[name])});return new Type(function(value,deep){return isObject.check(value)&&fields.every(function(field){return field.type.check(value[field.name],deep)})},function(){return"{ "+fields.join(", ")+" }"})};function Field(name,type,defaultFn,hidden){var self=this;assert.ok(self instanceof Field);isString.assert(name);type=toType(type);var properties={name:{value:name},type:{value:type},hidden:{value:!!hidden}};if(isFunction.check(defaultFn)){properties.defaultFn={value:defaultFn}}Object.defineProperties(self,properties)}var Fp=Field.prototype;Fp.toString=function(){return JSON.stringify(this.name)+": "+this.type};Fp.getValue=function(obj){var value=obj[this.name];if(!isUndefined.check(value))return value;if(this.defaultFn)value=this.defaultFn.call(obj);return value};Type.def=function(typeName){isString.assert(typeName);return hasOwn.call(defCache,typeName)?defCache[typeName]:defCache[typeName]=new Def(typeName)};var defCache=Object.create(null);function Def(typeName){var self=this;assert.ok(self instanceof Def);Object.defineProperties(self,{typeName:{value:typeName},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new Type(function(value,deep){return self.check(value,deep)},typeName)}})}Def.fromValue=function(value){if(value&&typeof value==="object"){var type=value.type;if(typeof type==="string"&&hasOwn.call(defCache,type)){var d=defCache[type];if(d.finalized){return d}}}return null};var Dp=Def.prototype;Dp.isSupertypeOf=function(that){if(that instanceof Def){assert.strictEqual(this.finalized,true);assert.strictEqual(that.finalized,true);return hasOwn.call(that.allSupertypes,this.typeName)}else{assert.ok(false,that+" is not a Def")}};exports.getSupertypeNames=function(typeName){assert.ok(hasOwn.call(defCache,typeName));var d=defCache[typeName];assert.strictEqual(d.finalized,true);return d.supertypeList.slice(1)};exports.computeSupertypeLookupTable=function(candidates){var table={};var typeNames=Object.keys(defCache);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];var d=defCache[typeName];assert.strictEqual(d.finalized,true);for(var j=0;j<d.supertypeList.length;++j){var superTypeName=d.supertypeList[j];if(hasOwn.call(candidates,superTypeName)){table[typeName]=superTypeName;break}}}return table};Dp.checkAllFields=function(value,deep){var allFields=this.allFields;assert.strictEqual(this.finalized,true);function checkFieldByName(name){var field=allFields[name];var type=field.type;var child=field.getValue(value);return type.check(child,deep)}return isObject.check(value)&&Object.keys(allFields).every(checkFieldByName)};Dp.check=function(value,deep){assert.strictEqual(this.finalized,true,"prematurely checking unfinalized type "+this.typeName);if(!isObject.check(value))return false;var vDef=Def.fromValue(value);if(!vDef){if(this.typeName==="SourceLocation"||this.typeName==="Position"){return this.checkAllFields(value,deep)}return false}if(deep&&vDef===this)return this.checkAllFields(value,deep);if(!this.isSupertypeOf(vDef))return false;if(!deep)return true;return vDef.checkAllFields(value,deep)&&this.checkAllFields(value,false)};Dp.bases=function(){var bases=this.baseNames;assert.strictEqual(this.finalized,false);each.call(arguments,function(baseName){isString.assert(baseName);if(bases.indexOf(baseName)<0)bases.push(baseName)});return this};Object.defineProperty(Dp,"buildable",{value:false});var builders={};exports.builders=builders;var nodePrototype={};exports.defineMethod=function(name,func){var old=nodePrototype[name];if(isUndefined.check(func)){delete nodePrototype[name]}else{isFunction.assert(func);Object.defineProperty(nodePrototype,name,{enumerable:true,configurable:true,value:func})}return old};Dp.build=function(){var self=this;Object.defineProperty(self,"buildParams",{value:slice.call(arguments),writable:false,enumerable:false,configurable:true});assert.strictEqual(self.finalized,false);isString.arrayOf().assert(self.buildParams);if(self.buildable){return self}self.field("type",self.typeName,function(){return self.typeName});Object.defineProperty(self,"buildable",{value:true});Object.defineProperty(builders,getBuilderName(self.typeName),{enumerable:true,value:function(){var args=arguments;var argc=args.length;var built=Object.create(nodePrototype);assert.ok(self.finalized,"attempting to instantiate unfinalized type "+self.typeName);function add(param,i){if(hasOwn.call(built,param))return;var all=self.allFields;assert.ok(hasOwn.call(all,param),param);var field=all[param];var type=field.type;var value;if(isNumber.check(i)&&i<argc){value=args[i]}else if(field.defaultFn){value=field.defaultFn.call(built) }else{var message="no value or default function given for field "+JSON.stringify(param)+" of "+self.typeName+"("+self.buildParams.map(function(name){return all[name]}).join(", ")+")";assert.ok(false,message)}if(!type.check(value)){assert.ok(false,shallowStringify(value)+" does not match field "+field+" of type "+self.typeName)}built[param]=value}self.buildParams.forEach(function(param,i){add(param,i)});Object.keys(self.allFields).forEach(function(param){add(param)});assert.strictEqual(built.type,self.typeName);return built}});return self};function getBuilderName(typeName){return typeName.replace(/^[A-Z]+/,function(upperCasePrefix){var len=upperCasePrefix.length;switch(len){case 0:return"";case 1:return upperCasePrefix.toLowerCase();default:return upperCasePrefix.slice(0,len-1).toLowerCase()+upperCasePrefix.charAt(len-1)}})}Dp.field=function(name,type,defaultFn,hidden){assert.strictEqual(this.finalized,false);this.ownFields[name]=new Field(name,type,defaultFn,hidden);return this};var namedTypes={};exports.namedTypes=namedTypes;function getFieldNames(object){var d=Def.fromValue(object);if(d){return d.fieldNames.slice(0)}if("type"in object){assert.ok(false,"did not recognize object of type "+JSON.stringify(object.type))}return Object.keys(object)}exports.getFieldNames=getFieldNames;function getFieldValue(object,fieldName){var d=Def.fromValue(object);if(d){var field=d.allFields[fieldName];if(field){return field.getValue(object)}}return object[fieldName]}exports.getFieldValue=getFieldValue;exports.eachField=function(object,callback,context){getFieldNames(object).forEach(function(name){callback.call(this,name,getFieldValue(object,name))},context)};exports.someField=function(object,callback,context){return getFieldNames(object).some(function(name){return callback.call(this,name,getFieldValue(object,name))},context)};Object.defineProperty(Dp,"finalized",{value:false});Dp.finalize=function(){if(!this.finalized){var allFields=this.allFields;var allSupertypes=this.allSupertypes;this.baseNames.forEach(function(name){var def=defCache[name];def.finalize();extend(allFields,def.allFields);extend(allSupertypes,def.allSupertypes)});extend(allFields,this.ownFields);allSupertypes[this.typeName]=this;this.fieldNames.length=0;for(var fieldName in allFields){if(hasOwn.call(allFields,fieldName)&&!allFields[fieldName].hidden){this.fieldNames.push(fieldName)}}Object.defineProperty(namedTypes,this.typeName,{enumerable:true,value:this.type});Object.defineProperty(this,"finalized",{value:true});populateSupertypeList(this.typeName,this.supertypeList)}};function populateSupertypeList(typeName,list){list.length=0;list.push(typeName);var lastSeen=Object.create(null);for(var pos=0;pos<list.length;++pos){typeName=list[pos];var d=defCache[typeName];assert.strictEqual(d.finalized,true);if(hasOwn.call(lastSeen,typeName)){delete list[lastSeen[typeName]]}lastSeen[typeName]=pos;list.push.apply(list,d.baseNames)}for(var to=0,from=to,len=list.length;from<len;++from){if(hasOwn.call(list,from)){list[to++]=list[from]}}list.length=to}function extend(into,from){Object.keys(from).forEach(function(name){into[name]=from[name]});return into}exports.finalize=function(){Object.keys(defCache).forEach(function(name){defCache[name].finalize()})}},{assert:90}],88:[function(require,module,exports){var types=require("./lib/types");require("./def/core");require("./def/es6");require("./def/es7");require("./def/mozilla");require("./def/e4x");require("./def/fb-harmony");types.finalize();exports.Type=types.Type;exports.builtInTypes=types.builtInTypes;exports.namedTypes=types.namedTypes;exports.builders=types.builders;exports.defineMethod=types.defineMethod;exports.getFieldNames=types.getFieldNames;exports.getFieldValue=types.getFieldValue;exports.eachField=types.eachField;exports.someField=types.someField;exports.getSupertypeNames=types.getSupertypeNames;exports.astNodesAreEquivalent=require("./lib/equiv");exports.finalize=types.finalize;exports.NodePath=require("./lib/node-path");exports.PathVisitor=require("./lib/path-visitor");exports.visit=exports.PathVisitor.visit},{"./def/core":75,"./def/e4x":76,"./def/es6":77,"./def/es7":78,"./def/fb-harmony":79,"./def/mozilla":80,"./lib/equiv":81,"./lib/node-path":82,"./lib/path-visitor":83,"./lib/types":87}],89:[function(require,module,exports){},{}],90:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":114}],91:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=Buffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){if(encoding==="base64")subject=base64clean(subject);length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(this.length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string),buf,offset,length,2);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function binarySlice(buf,start,end){return asciiSlice(buf,start,end)}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;if(Buffer.TYPED_ARRAY_SUPPORT){return Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;var newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}return newBuf}};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(!target_start)target_start=0;if(end===start)return;if(target.length===0||source.length===0)return;if(end<start)throw new TypeError("sourceEnd < sourceStart");if(target_start<0||target_start>=target.length)throw new TypeError("targetStart out of bounds");if(start<0||start>=source.length)throw new TypeError("sourceStart out of bounds");if(end<0||end>source.length)throw new TypeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new TypeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new TypeError("start out of bounds");if(end<0||end>this.length)throw new TypeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){var b=str.charCodeAt(i);if(b<=127){byteArray.push(b)}else{var start=i;if(b>=55296&&b<=57343)i++;var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%");for(var j=0;j<h.length;j++){byteArray.push(parseInt(h[j],16))}}}return byteArray}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length,unitSize){if(unitSize)length-=length%unitSize;for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":92,ieee754:93,"is-array":94}],92:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS)return 62;if(code===SLASH)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],93:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits; nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],94:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],95:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],96:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],97:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],98:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:99}],99:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],100:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":101}],101:[function(require,module,exports){(function(process){module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);forEach(objectKeys(Writable.prototype),function(method){if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]});function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}}).call(this,require("_process"))},{"./_stream_readable":103,"./_stream_writable":105,_process:99,"core-util-is":106,inherits:96}],102:[function(require,module,exports){module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":104,"core-util-is":106,inherits:96}],103:[function(require,module,exports){(function(process){module.exports=Readable;var isArray=require("isarray");var Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;if(!EE.listenerCount)EE.listenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream=require("stream");var util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream);function ReadableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!options.objectMode;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}function Readable(options){if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(typeof chunk==="string"&&!state.objectMode){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=new Buffer(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null||chunk===undefined){state.reading=false;if(!state.ended)onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc};var MAX_HWM=8388608;function roundUpToNextPowerOf2(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;var ret;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){ret=null;if(state.length>0&&state.decoder){ret=fromList(n,state);state.length-=ret.length}if(state.length===0)endReadable(this);return ret}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream)}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)process.nextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){if(readable!==src)return;cleanup()}function onend(){dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);function cleanup(){dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);if(!dest._writableState||dest._writableState.needDrain)ondrain()}function onerror(er){unpipe();dest.removeListener("error",onerror);if(EE.listenerCount(dest,"error")===0)dest.emit("error",er)}if(!dest._events||!dest._events.error)dest.on("error",onerror);else if(isArray(dest._events.error))dest._events.error.unshift(onerror);else dest._events.error=[onerror,dest._events.error];function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){this.on("readable",pipeOnReadable);state.flowing=true;process.nextTick(function(){flow(src)})}return dest};function pipeOnDrain(src){return function(){var dest=this;var state=src._readableState;state.awaitDrain--;if(state.awaitDrain===0)flow(src)}}function flow(src){var state=src._readableState;var chunk;state.awaitDrain=0;function write(dest,i,list){var written=dest.write(chunk);if(false===written){state.awaitDrain++}}while(state.pipesCount&&null!==(chunk=src.read())){if(state.pipesCount===1)write(state.pipes,0,null);else forEach(state.pipes,write);src.emit("data",chunk);if(state.awaitDrain>0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"&&!this._readableState.flowing)emitDataEvents(this);if(ev==="readable"&&this.readable){var state=this._readableState;if(!state.readableListening){state.readableListening=true;state.emittedReadable=false;state.needReadable=true;if(!state.reading){this.read(0)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.resume=function(){emitDataEvents(this);this.read(0);this.emit("resume")};Readable.prototype.pause=function(){emitDataEvents(this,true);this.emit("pause")};function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing){throw new Error("Cannot switch to old mode now.")}var paused=startPaused||false;var readable=false;stream.readable=true;stream.pipe=Stream.prototype.pipe;stream.on=stream.addListener=Stream.prototype.on;stream.on("readable",function(){readable=true;var c;while(!paused&&null!==(c=stream.read()))stream.emit("data",c);if(c===null){readable=false;stream._readableState.needReadable=true}});stream.pause=function(){paused=true;this.emit("pause")};stream.resume=function(){paused=false;if(readable)process.nextTick(function(){stream.emit("readable")});else this.read(0);this.emit("resume")};stream.emit("readable")}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(typeof stream[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){var list=state.buffer;var length=state.length;var stringMode=!!state.decoder;var objectMode=!!state.objectMode;var ret;if(list.length===0)return null;if(length===0)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n);list[0]=buf.slice(n)}else if(n===list[0].length){ret=list.shift()}else{if(stringMode)ret="";else ret=new Buffer(n);var c=0;for(var i=0,l=list.length;i<l&&c<n;i++){var buf=list[0];var cpy=Math.min(n-c,buf.length);if(stringMode)ret+=buf.slice(0,cpy);else buf.copy(ret,c,0,cpy);if(cpy<buf.length)list[0]=buf.slice(cpy);else list.shift();c+=cpy}}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{_process:99,buffer:91,"core-util-is":106,events:95,inherits:96,isarray:97,stream:111,"string_decoder/":112}],104:[function(require,module,exports){module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);if(cb)cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);var ts=this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var rs=stream._readableState;var ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":101,"core-util-is":106,inherits:96}],105:[function(require,module,exports){(function(process){module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream);function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb}function WritableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.objectMode=!!options.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er);process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er);process.nextTick(function(){cb(er)});valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=function(){};if(state.ended)writeAfterEnd(this,state,cb);else if(validChunk(this,state,chunk,cb))ret=writeOrBuffer(this,state,chunk,encoding,cb);return ret};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing)state.buffer.push(new WriteReq(chunk,encoding,cb));else doWrite(stream,state,len,chunk,encoding,cb);return ret}function doWrite(stream,state,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){if(sync)process.nextTick(function(){cb(er)});else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);if(!finished&&!state.bufferProcessing&&state.buffer.length)clearBuffer(stream,state);if(sync){process.nextTick(function(){afterWrite(stream,state,finished,cb)})}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);cb();if(finished)finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true; for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c];var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,len,chunk,encoding,cb);if(state.writing){c++;break}}state.bufferProcessing=false;if(c<state.buffer.length)state.buffer=state.buffer.slice(c);else state.buffer.length=0}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(typeof chunk!=="undefined"&&chunk!==null)this.write(chunk,encoding);if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(stream,state){return state.ending&&state.length===0&&!state.finished&&!state.writing}function finishMaybe(stream,state){var need=needFinish(stream,state);if(need){state.finished=true;stream.emit("finish")}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)process.nextTick(cb);else stream.once("finish",cb)}state.ended=true}}).call(this,require("_process"))},{"./_stream_duplex":101,_process:99,buffer:91,"core-util-is":106,inherits:96,stream:111}],106:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("buffer").Buffer)},{buffer:91}],107:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":102}],108:[function(require,module,exports){var Stream=require("stream");exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=Stream;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":101,"./lib/_stream_passthrough.js":102,"./lib/_stream_readable.js":103,"./lib/_stream_transform.js":104,"./lib/_stream_writable.js":105,stream:111}],109:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":104}],110:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":105}],111:[function(require,module,exports){module.exports=Stream;var EE=require("events").EventEmitter;var inherits=require("inherits");inherits(Stream,EE);Stream.Readable=require("readable-stream/readable.js");Stream.Writable=require("readable-stream/writable.js");Stream.Duplex=require("readable-stream/duplex.js");Stream.Transform=require("readable-stream/transform.js");Stream.PassThrough=require("readable-stream/passthrough.js");Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause()}}}source.on("data",ondata);function ondrain(){if(source.readable&&source.resume){source.resume()}}dest.on("drain",ondrain);if(!dest._isStdio&&(!options||options.end!==false)){source.on("end",onend);source.on("close",onclose)}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end()}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==="function")dest.destroy()}function onerror(er){cleanup();if(EE.listenerCount(this,"error")===0){throw er}}source.on("error",onerror);dest.on("error",onerror);function cleanup(){source.removeListener("data",ondata);dest.removeListener("drain",ondrain);source.removeListener("end",onend);source.removeListener("close",onclose);source.removeListener("error",onerror);dest.removeListener("error",onerror);source.removeListener("end",cleanup);source.removeListener("close",cleanup);dest.removeListener("close",cleanup)}source.on("end",cleanup);source.on("close",cleanup);dest.on("close",cleanup);dest.emit("pipe",source);return dest}},{events:95,inherits:96,"readable-stream/duplex.js":100,"readable-stream/passthrough.js":107,"readable-stream/readable.js":108,"readable-stream/transform.js":109,"readable-stream/writable.js":110}],112:[function(require,module,exports){var Buffer=require("buffer").Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error("Unknown encoding: "+encoding)}}var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(encoding);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0};StringDecoder.prototype.write=function(buffer){var charStr="";while(this.charLength){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived<this.charLength){return""}buffer=buffer.slice(available,buffer.length);charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:91}],113:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],114:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":113,_process:99,inherits:96}],115:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.estraverse={})}})(this,function(exports){"use strict";var Syntax,isArray,VisitorOption,VisitorKeys,objectCreate,objectKeys,BREAK,SKIP,REMOVE;function ignoreJSHintError(){}isArray=Array.isArray;if(!isArray){isArray=function isArray(array){return Object.prototype.toString.call(array)==="[object Array]"}}function deepCopy(obj){var ret={},key,val;for(key in obj){if(obj.hasOwnProperty(key)){val=obj[key];if(typeof val==="object"&&val!==null){ret[key]=deepCopy(val)}else{ret[key]=val}}}return ret}function shallowCopy(obj){var ret={},key;for(key in obj){if(obj.hasOwnProperty(key)){ret[key]=obj[key]}}return ret}ignoreJSHintError(shallowCopy);function upperBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){len=diff}else{i=current+1;len-=diff+1}}return i}function lowerBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){i=current+1;len-=diff+1}else{len=diff}}return i}ignoreJSHintError(lowerBound);objectCreate=Object.create||function(){function F(){}return function(o){F.prototype=o;return new F}}();objectKeys=Object.keys||function(o){var keys=[],key;for(key in o){keys.push(key)}return keys};function extend(to,from){objectKeys(from).forEach(function(key){to[key]=from[key]});return to}Syntax={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};VisitorKeys={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};BREAK={};SKIP={};REMOVE={};VisitorOption={Break:BREAK,Skip:SKIP,Remove:REMOVE};function Reference(parent,key){this.parent=parent;this.key=key}Reference.prototype.replace=function replace(node){this.parent[this.key]=node};Reference.prototype.remove=function remove(){if(isArray(this.parent)){this.parent.splice(this.key,1);return true}else{this.replace(null);return false}};function Element(node,path,wrap,ref){this.node=node;this.path=path;this.wrap=wrap;this.ref=ref}function Controller(){}Controller.prototype.path=function path(){var i,iz,j,jz,result,element;function addToPath(result,path){if(isArray(path)){for(j=0,jz=path.length;j<jz;++j){result.push(path[j])}}else{result.push(path)}}if(!this.__current.path){return null}result=[];for(i=2,iz=this.__leavelist.length;i<iz;++i){element=this.__leavelist[i];addToPath(result,element.path)}addToPath(result,this.__current.path);return result};Controller.prototype.type=function(){var node=this.current();return node.type||this.__current.wrap};Controller.prototype.parents=function parents(){var i,iz,result;result=[];for(i=1,iz=this.__leavelist.length;i<iz;++i){result.push(this.__leavelist[i].node)}return result};Controller.prototype.current=function current(){return this.__current.node};Controller.prototype.__execute=function __execute(callback,element){var previous,result;result=undefined;previous=this.__current;this.__current=element;this.__state=null;if(callback){result=callback.call(this,element.node,this.__leavelist[this.__leavelist.length-1].node)}this.__current=previous;return result};Controller.prototype.notify=function notify(flag){this.__state=flag};Controller.prototype.skip=function(){this.notify(SKIP)};Controller.prototype["break"]=function(){this.notify(BREAK)};Controller.prototype.remove=function(){this.notify(REMOVE)};Controller.prototype.__initialize=function(root,visitor){this.visitor=visitor;this.root=root;this.__worklist=[];this.__leavelist=[];this.__current=null;this.__state=null;this.__fallback=visitor.fallback==="iteration";this.__keys=VisitorKeys;if(visitor.keys){this.__keys=extend(objectCreate(this.__keys),visitor.keys)}};function isNode(node){if(node==null){return false}return typeof node==="object"&&typeof node.type==="string"}function isProperty(nodeType,key){return(nodeType===Syntax.ObjectExpression||nodeType===Syntax.ObjectPattern)&&"properties"===key}Controller.prototype.traverse=function traverse(root,visitor){var worklist,leavelist,element,node,nodeType,ret,key,current,current2,candidates,candidate,sentinel;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;worklist.push(new Element(root,null,null,null));leavelist.push(new Element(null,null,null,null));while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();ret=this.__execute(visitor.leave,element);if(this.__state===BREAK||ret===BREAK){return}continue}if(element.node){ret=this.__execute(visitor.enter,element);if(this.__state===BREAK||ret===BREAK){return}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||ret===SKIP){continue}node=element.node;nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",null)}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,null)}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,null))}}}}};Controller.prototype.replace=function replace(root,visitor){function removeElem(element){var i,key,nextElem,parent;if(element.ref.remove()){key=element.ref.key;parent=element.ref.parent;i=worklist.length;while(i--){nextElem=worklist[i];if(nextElem.ref&&nextElem.ref.parent===parent){if(nextElem.ref.key<key){break}--nextElem.ref.key}}}}var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;outer={root:root};element=new Element(root,null,null,new Reference(outer,"root"));worklist.push(element);leavelist.push(element);while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();target=this.__execute(visitor.leave,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target)}if(this.__state===REMOVE||target===REMOVE){removeElem(element)}if(this.__state===BREAK||target===BREAK){return outer.root}continue}target=this.__execute(visitor.enter,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target);element.node=target}if(this.__state===REMOVE||target===REMOVE){removeElem(element);element.node=null}if(this.__state===BREAK||target===BREAK){return outer.root}node=element.node;if(!node){continue}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||target===SKIP){continue}nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2))}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2))}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,new Reference(node,key)))}}}return outer.root};function traverse(root,visitor){var controller=new Controller;return controller.traverse(root,visitor)}function replace(root,visitor){var controller=new Controller;return controller.replace(root,visitor)}function extendCommentRange(comment,tokens){var target;target=upperBound(tokens,function search(token){return token.range[0]>comment.range[0]});comment.extendedRange=[comment.range[0],comment.range[1]];if(target!==tokens.length){comment.extendedRange[1]=tokens[target].range[0]}target-=1;if(target>=0){comment.extendedRange[0]=tokens[target].range[1]}return comment}function attachComments(tree,providedComments,tokens){var comments=[],comment,len,i,cursor;if(!tree.range){throw new Error("attachComments needs range information")}if(!tokens.length){if(providedComments.length){for(i=0,len=providedComments.length;i<len;i+=1){comment=deepCopy(providedComments[i]);comment.extendedRange=[0,tree.range[0]];comments.push(comment)}tree.leadingComments=comments}return tree}for(i=0,len=providedComments.length;i<len;i+=1){comments.push(extendCommentRange(deepCopy(providedComments[i]),tokens))}cursor=0;traverse(tree,{enter:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(comment.extendedRange[1]>node.range[0]){break}if(comment.extendedRange[1]===node.range[0]){if(!node.leadingComments){node.leadingComments=[]}node.leadingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip }}});cursor=0;traverse(tree,{leave:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(node.range[1]<comment.extendedRange[0]){break}if(node.range[1]===comment.extendedRange[0]){if(!node.trailingComments){node.trailingComments=[]}node.trailingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});return tree}exports.version="1.8.0";exports.Syntax=Syntax;exports.traverse=traverse;exports.replace=replace;exports.attachComments=attachComments;exports.VisitorKeys=VisitorKeys;exports.VisitorOption=VisitorOption;exports.Controller=Controller})},{}],116:[function(require,module,exports){(function(){"use strict";function isExpression(node){if(node==null){return false}switch(node.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return true}return false}function isIterationStatement(node){if(node==null){return false}switch(node.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return true}return false}function isStatement(node){if(node==null){return false}switch(node.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return true}return false}function isSourceElement(node){return isStatement(node)||node!=null&&node.type==="FunctionDeclaration"}function trailingStatement(node){switch(node.type){case"IfStatement":if(node.alternate!=null){return node.alternate}return node.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return node.body}return null}function isProblematicIfStatement(node){var current;if(node.type!=="IfStatement"){return false}if(node.alternate==null){return false}current=node.consequent;do{if(current.type==="IfStatement"){if(current.alternate==null){return true}}current=trailingStatement(current)}while(current);return false}module.exports={isExpression:isExpression,isStatement:isStatement,isIterationStatement:isIterationStatement,isSourceElement:isSourceElement,isProblematicIfStatement:isProblematicIfStatement,trailingStatement:trailingStatement}})()},{}],117:[function(require,module,exports){(function(){"use strict";var Regex,NON_ASCII_WHITESPACES;Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return isDecimalDigit(ch)||97<=ch&&ch<=102||65<=ch&&ch<=70}function isOctalDigit(ch){return ch>=48&&ch<=55}NON_ASCII_WHITESPACES=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&NON_ASCII_WHITESPACES.indexOf(ch)>=0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch>=97&&ch<=122||ch>=65&&ch<=90||ch===36||ch===95||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch>=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57||ch===36||ch===95||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}module.exports={isDecimalDigit:isDecimalDigit,isHexDigit:isHexDigit,isOctalDigit:isOctalDigit,isWhiteSpace:isWhiteSpace,isLineTerminator:isLineTerminator,isIdentifierStart:isIdentifierStart,isIdentifierPart:isIdentifierPart}})()},{}],118:[function(require,module,exports){(function(){"use strict";var code=require("./code");function isStrictModeReservedWordES6(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false}}function isKeywordES5(id,strict){if(!strict&&id==="yield"){return false}return isKeywordES6(id,strict)}function isKeywordES6(id,strict){if(strict&&isStrictModeReservedWordES6(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="yield"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function isReservedWordES5(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES5(id,strict)}function isReservedWordES6(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES6(id,strict)}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isIdentifierName(id){var i,iz,ch;if(id.length===0){return false}ch=id.charCodeAt(0);if(!code.isIdentifierStart(ch)||ch===92){return false}for(i=1,iz=id.length;i<iz;++i){ch=id.charCodeAt(i);if(!code.isIdentifierPart(ch)||ch===92){return false}}return true}function isIdentifierES5(id,strict){return isIdentifierName(id)&&!isReservedWordES5(id,strict)}function isIdentifierES6(id,strict){return isIdentifierName(id)&&!isReservedWordES6(id,strict)}module.exports={isKeywordES5:isKeywordES5,isKeywordES6:isKeywordES6,isReservedWordES5:isReservedWordES5,isReservedWordES6:isReservedWordES6,isRestrictedWord:isRestrictedWord,isIdentifierName:isIdentifierName,isIdentifierES5:isIdentifierES5,isIdentifierES6:isIdentifierES6}})()},{"./code":117}],119:[function(require,module,exports){(function(){"use strict";exports.ast=require("./ast");exports.code=require("./code");exports.keyword=require("./keyword")})()},{"./ast":116,"./code":117,"./keyword":118}],120:[function(require,module,exports){"use strict";exports.reservedVars={arguments:false,NaN:false};exports.ecmaIdentifiers={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Map:false,Math:false,Number:false,Object:false,Proxy:false,Promise:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,Set:false,String:false,SyntaxError:false,TypeError:false,URIError:false,WeakMap:false,WeakSet:false};exports.newEcmaIdentifiers={Set:false,Map:false,WeakMap:false,WeakSet:false,Proxy:false,Promise:false,Reflect:false,Symbol:false,System:false};exports.browser={Audio:false,Blob:false,addEventListener:false,applicationCache:false,atob:false,blur:false,btoa:false,cancelAnimationFrame:false,CanvasGradient:false,CanvasPattern:false,CanvasRenderingContext2D:false,CSS:false,clearInterval:false,clearTimeout:false,close:false,closed:false,CustomEvent:false,DOMParser:false,defaultStatus:false,Document:false,document:false,Element:false,ElementTimeControl:false,Event:false,event:false,FileReader:false,FormData:false,focus:false,frames:false,getComputedStyle:false,HTMLElement:false,HTMLAnchorElement:false,HTMLBaseElement:false,HTMLBlockquoteElement:false,HTMLBodyElement:false,HTMLBRElement:false,HTMLButtonElement:false,HTMLCanvasElement:false,HTMLDirectoryElement:false,HTMLDivElement:false,HTMLDListElement:false,HTMLFieldSetElement:false,HTMLFontElement:false,HTMLFormElement:false,HTMLFrameElement:false,HTMLFrameSetElement:false,HTMLHeadElement:false,HTMLHeadingElement:false,HTMLHRElement:false,HTMLHtmlElement:false,HTMLIFrameElement:false,HTMLImageElement:false,HTMLInputElement:false,HTMLIsIndexElement:false,HTMLLabelElement:false,HTMLLayerElement:false,HTMLLegendElement:false,HTMLLIElement:false,HTMLLinkElement:false,HTMLMapElement:false,HTMLMenuElement:false,HTMLMetaElement:false,HTMLModElement:false,HTMLObjectElement:false,HTMLOListElement:false,HTMLOptGroupElement:false,HTMLOptionElement:false,HTMLParagraphElement:false,HTMLParamElement:false,HTMLPreElement:false,HTMLQuoteElement:false,HTMLScriptElement:false,HTMLSelectElement:false,HTMLStyleElement:false,HTMLTableCaptionElement:false,HTMLTableCellElement:false,HTMLTableColElement:false,HTMLTableElement:false,HTMLTableRowElement:false,HTMLTableSectionElement:false,HTMLTextAreaElement:false,HTMLTitleElement:false,HTMLUListElement:false,HTMLVideoElement:false,history:false,Image:false,Intl:false,length:false,localStorage:false,location:false,matchMedia:false,MessageChannel:false,MessageEvent:false,MessagePort:false,MouseEvent:false,moveBy:false,moveTo:false,MutationObserver:false,name:false,Node:false,NodeFilter:false,NodeList:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,openDatabase:false,opener:false,Option:false,parent:false,print:false,requestAnimationFrame:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,sessionStorage:false,setInterval:false,setTimeout:false,SharedWorker:false,status:false,SVGAElement:false,SVGAltGlyphDefElement:false,SVGAltGlyphElement:false,SVGAltGlyphItemElement:false,SVGAngle:false,SVGAnimateColorElement:false,SVGAnimateElement:false,SVGAnimateMotionElement:false,SVGAnimateTransformElement:false,SVGAnimatedAngle:false,SVGAnimatedBoolean:false,SVGAnimatedEnumeration:false,SVGAnimatedInteger:false,SVGAnimatedLength:false,SVGAnimatedLengthList:false,SVGAnimatedNumber:false,SVGAnimatedNumberList:false,SVGAnimatedPathData:false,SVGAnimatedPoints:false,SVGAnimatedPreserveAspectRatio:false,SVGAnimatedRect:false,SVGAnimatedString:false,SVGAnimatedTransformList:false,SVGAnimationElement:false,SVGCSSRule:false,SVGCircleElement:false,SVGClipPathElement:false,SVGColor:false,SVGColorProfileElement:false,SVGColorProfileRule:false,SVGComponentTransferFunctionElement:false,SVGCursorElement:false,SVGDefsElement:false,SVGDescElement:false,SVGDocument:false,SVGElement:false,SVGElementInstance:false,SVGElementInstanceList:false,SVGEllipseElement:false,SVGExternalResourcesRequired:false,SVGFEBlendElement:false,SVGFEColorMatrixElement:false,SVGFEComponentTransferElement:false,SVGFECompositeElement:false,SVGFEConvolveMatrixElement:false,SVGFEDiffuseLightingElement:false,SVGFEDisplacementMapElement:false,SVGFEDistantLightElement:false,SVGFEFloodElement:false,SVGFEFuncAElement:false,SVGFEFuncBElement:false,SVGFEFuncGElement:false,SVGFEFuncRElement:false,SVGFEGaussianBlurElement:false,SVGFEImageElement:false,SVGFEMergeElement:false,SVGFEMergeNodeElement:false,SVGFEMorphologyElement:false,SVGFEOffsetElement:false,SVGFEPointLightElement:false,SVGFESpecularLightingElement:false,SVGFESpotLightElement:false,SVGFETileElement:false,SVGFETurbulenceElement:false,SVGFilterElement:false,SVGFilterPrimitiveStandardAttributes:false,SVGFitToViewBox:false,SVGFontElement:false,SVGFontFaceElement:false,SVGFontFaceFormatElement:false,SVGFontFaceNameElement:false,SVGFontFaceSrcElement:false,SVGFontFaceUriElement:false,SVGForeignObjectElement:false,SVGGElement:false,SVGGlyphElement:false,SVGGlyphRefElement:false,SVGGradientElement:false,SVGHKernElement:false,SVGICCColor:false,SVGImageElement:false,SVGLangSpace:false,SVGLength:false,SVGLengthList:false,SVGLineElement:false,SVGLinearGradientElement:false,SVGLocatable:false,SVGMPathElement:false,SVGMarkerElement:false,SVGMaskElement:false,SVGMatrix:false,SVGMetadataElement:false,SVGMissingGlyphElement:false,SVGNumber:false,SVGNumberList:false,SVGPaint:false,SVGPathElement:false,SVGPathSeg:false,SVGPathSegArcAbs:false,SVGPathSegArcRel:false,SVGPathSegClosePath:false,SVGPathSegCurvetoCubicAbs:false,SVGPathSegCurvetoCubicRel:false,SVGPathSegCurvetoCubicSmoothAbs:false,SVGPathSegCurvetoCubicSmoothRel:false,SVGPathSegCurvetoQuadraticAbs:false,SVGPathSegCurvetoQuadraticRel:false,SVGPathSegCurvetoQuadraticSmoothAbs:false,SVGPathSegCurvetoQuadraticSmoothRel:false,SVGPathSegLinetoAbs:false,SVGPathSegLinetoHorizontalAbs:false,SVGPathSegLinetoHorizontalRel:false,SVGPathSegLinetoRel:false,SVGPathSegLinetoVerticalAbs:false,SVGPathSegLinetoVerticalRel:false,SVGPathSegList:false,SVGPathSegMovetoAbs:false,SVGPathSegMovetoRel:false,SVGPatternElement:false,SVGPoint:false,SVGPointList:false,SVGPolygonElement:false,SVGPolylineElement:false,SVGPreserveAspectRatio:false,SVGRadialGradientElement:false,SVGRect:false,SVGRectElement:false,SVGRenderingIntent:false,SVGSVGElement:false,SVGScriptElement:false,SVGSetElement:false,SVGStopElement:false,SVGStringList:false,SVGStylable:false,SVGStyleElement:false,SVGSwitchElement:false,SVGSymbolElement:false,SVGTRefElement:false,SVGTSpanElement:false,SVGTests:false,SVGTextContentElement:false,SVGTextElement:false,SVGTextPathElement:false,SVGTextPositioningElement:false,SVGTitleElement:false,SVGTransform:false,SVGTransformList:false,SVGTransformable:false,SVGURIReference:false,SVGUnitTypes:false,SVGUseElement:false,SVGVKernElement:false,SVGViewElement:false,SVGViewSpec:false,SVGZoomAndPan:false,TextDecoder:false,TextEncoder:false,TimeEvent:false,top:false,URL:false,WebGLActiveInfo:false,WebGLBuffer:false,WebGLContextEvent:false,WebGLFramebuffer:false,WebGLProgram:false,WebGLRenderbuffer:false,WebGLRenderingContext:false,WebGLShader:false,WebGLShaderPrecisionFormat:false,WebGLTexture:false,WebGLUniformLocation:false,WebSocket:false,window:false,Worker:false,XDomainRequest:false,XMLHttpRequest:false,XMLSerializer:false,XPathEvaluator:false,XPathException:false,XPathExpression:false,XPathNamespace:false,XPathNSResolver:false,XPathResult:false};exports.devel={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false};exports.worker={importScripts:true,postMessage:true,self:true,FileReaderSync:true};exports.nonstandard={escape:false,unescape:false};exports.couch={require:false,respond:false,getRow:false,emit:false,send:false,start:false,sum:false,log:false,exports:false,module:false,provides:false};exports.node={__filename:false,__dirname:false,GLOBAL:false,global:false,module:false,require:false,Buffer:true,console:true,exports:true,process:true,setTimeout:true,clearTimeout:true,setInterval:true,clearInterval:true,setImmediate:true,clearImmediate:true};exports.browserify={__filename:false,__dirname:false,global:false,module:false,require:false,Buffer:true,exports:true,process:true};exports.phantom={phantom:true,require:true,WebPage:true,console:true,exports:true};exports.qunit={asyncTest:false,deepEqual:false,equal:false,expect:false,module:false,notDeepEqual:false,notEqual:false,notPropEqual:false,notStrictEqual:false,ok:false,propEqual:false,QUnit:false,raises:false,start:false,stop:false,strictEqual:false,test:false,"throws":false};exports.rhino={defineClass:false,deserialize:false,gc:false,help:false,importClass:false,importPackage:false,java:false,load:false,loadClass:false,Packages:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false};exports.shelljs={target:false,echo:false,exit:false,cd:false,pwd:false,ls:false,find:false,cp:false,rm:false,mv:false,mkdir:false,test:false,cat:false,sed:false,grep:false,which:false,dirs:false,pushd:false,popd:false,env:false,exec:false,chmod:false,config:false,error:false,tempdir:false};exports.typed={ArrayBuffer:false,ArrayBufferView:false,DataView:false,Float32Array:false,Float64Array:false,Int16Array:false,Int32Array:false,Int8Array:false,Uint16Array:false,Uint32Array:false,Uint8Array:false,Uint8ClampedArray:false};exports.wsh={ActiveXObject:true,Enumerator:true,GetObject:true,ScriptEngine:true,ScriptEngineBuildVersion:true,ScriptEngineMajorVersion:true,ScriptEngineMinorVersion:true,VBArray:true,WSH:true,WScript:true,XDomainRequest:true};exports.dojo={dojo:false,dijit:false,dojox:false,define:false,require:false};exports.jquery={$:false,jQuery:false};exports.mootools={$:false,$$:false,Asset:false,Browser:false,Chain:false,Class:false,Color:false,Cookie:false,Core:false,Document:false,DomReady:false,DOMEvent:false,DOMReady:false,Drag:false,Element:false,Elements:false,Event:false,Events:false,Fx:false,Group:false,Hash:false,HtmlTable:false,IFrame:false,IframeShim:false,InputValidator:false,instanceOf:false,Keyboard:false,Locale:false,Mask:false,MooTools:false,Native:false,Options:false,OverText:false,Request:false,Scroller:false,Slick:false,Slider:false,Sortables:false,Spinner:false,Swiff:false,Tips:false,Type:false,typeOf:false,URI:false,Window:false};exports.prototypejs={$:false,$$:false,$A:false,$F:false,$H:false,$R:false,$break:false,$continue:false,$w:false,Abstract:false,Ajax:false,Class:false,Enumerable:false,Element:false,Event:false,Field:false,Form:false,Hash:false,Insertion:false,ObjectRange:false,PeriodicalExecuter:false,Position:false,Prototype:false,Selector:false,Template:false,Toggle:false,Try:false,Autocompleter:false,Builder:false,Control:false,Draggable:false,Draggables:false,Droppables:false,Effect:false,Sortable:false,SortableObserver:false,Sound:false,Scriptaculous:false};exports.yui={YUI:false,Y:false,YUI_config:false};exports.mocha={describe:false,it:false,before:false,after:false,beforeEach:false,afterEach:false,suite:false,test:false,setup:false,teardown:false};exports.jasmine={jasmine:false,describe:false,it:false,xit:false,beforeEach:false,afterEach:false,setFixtures:false,loadFixtures:false,spyOn:false,expect:false,runs:false,waitsFor:false,waits:false}},{}],121:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b }var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId) }else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],122:[function(require,module,exports){"use strict";var originalObject=Object;var originalDefProp=Object.defineProperty;var originalCreate=Object.create;function defProp(obj,name,value){if(originalDefProp)try{originalDefProp.call(originalObject,obj,name,{value:value})}catch(definePropertyIsBrokenInIE8){obj[name]=value}else{obj[name]=value}}function makeSafeToCall(fun){if(fun){defProp(fun,"call",fun.call);defProp(fun,"apply",fun.apply)}return fun}makeSafeToCall(originalDefProp);makeSafeToCall(originalCreate);var hasOwn=makeSafeToCall(Object.prototype.hasOwnProperty);var numToStr=makeSafeToCall(Number.prototype.toString);var strSlice=makeSafeToCall(String.prototype.slice);var cloner=function(){};function create(prototype){if(originalCreate){return originalCreate.call(originalObject,prototype)}cloner.prototype=prototype||null;return new cloner}var rand=Math.random;var uniqueKeys=create(null);function makeUniqueKey(){do var uniqueKey=internString(strSlice.call(numToStr.call(rand(),36),2));while(hasOwn.call(uniqueKeys,uniqueKey));return uniqueKeys[uniqueKey]=uniqueKey}function internString(str){var obj={};obj[str]=true;return Object.keys(obj)[0]}defProp(exports,"makeUniqueKey",makeUniqueKey);var originalGetOPNs=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function getOwnPropertyNames(object){for(var names=originalGetOPNs(object),src=0,dst=0,len=names.length;src<len;++src){if(!hasOwn.call(uniqueKeys,names[src])){if(src>dst){names[dst]=names[src]}++dst}}names.length=dst;return names};function defaultCreatorFn(object){return create(null)}function makeAccessor(secretCreatorFn){var brand=makeUniqueKey();var passkey=create(null);secretCreatorFn=secretCreatorFn||defaultCreatorFn;function register(object){var secret;function vault(key,forget){if(key===passkey){return forget?secret=null:secret||(secret=secretCreatorFn(object))}}defProp(object,brand,vault)}function accessor(object){if(!hasOwn.call(object,brand))register(object);return object[brand](passkey)}accessor.forget=function(object){if(hasOwn.call(object,brand))object[brand](passkey,true)};return accessor}defProp(exports,"makeAccessor",makeAccessor)},{}],123:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var isArray=types.builtInTypes.array;var b=types.builders;var n=types.namedTypes;var leap=require("./leap");var meta=require("./meta");var util=require("./util");var runtimeKeysMethod=util.runtimeProperty("keys");var hasOwn=Object.prototype.hasOwnProperty;function Emitter(contextId){assert.ok(this instanceof Emitter);n.Identifier.assert(contextId);Object.defineProperties(this,{contextId:{value:contextId},listing:{value:[]},marked:{value:[true]},finalLoc:{value:loc()},tryEntries:{value:[]}});Object.defineProperties(this,{leapManager:{value:new leap.LeapManager(this)}})}var Ep=Emitter.prototype;exports.Emitter=Emitter;function loc(){return b.literal(-1)}Ep.mark=function(loc){n.Literal.assert(loc);var index=this.listing.length;if(loc.value===-1){loc.value=index}else{assert.strictEqual(loc.value,index)}this.marked[index]=true;return loc};Ep.emit=function(node){if(n.Expression.check(node))node=b.expressionStatement(node);n.Statement.assert(node);this.listing.push(node)};Ep.emitAssign=function(lhs,rhs){this.emit(this.assign(lhs,rhs));return lhs};Ep.assign=function(lhs,rhs){return b.expressionStatement(b.assignmentExpression("=",lhs,rhs))};Ep.contextProperty=function(name,computed){return b.memberExpression(this.contextId,computed?b.literal(name):b.identifier(name),!!computed)};var volatileContextPropertyNames={prev:true,next:true,sent:true,rval:true};Ep.isVolatileContextProperty=function(expr){if(n.MemberExpression.check(expr)){if(expr.computed){return true}if(n.Identifier.check(expr.object)&&n.Identifier.check(expr.property)&&expr.object.name===this.contextId.name&&hasOwn.call(volatileContextPropertyNames,expr.property.name)){return true}}return false};Ep.stop=function(rval){if(rval){this.setReturnValue(rval)}this.jump(this.finalLoc)};Ep.setReturnValue=function(valuePath){n.Expression.assert(valuePath.value);this.emitAssign(this.contextProperty("rval"),this.explodeExpression(valuePath))};Ep.clearPendingException=function(tryLoc,assignee){n.Literal.assert(tryLoc);var catchCall=b.callExpression(this.contextProperty("catch",true),[tryLoc]);if(assignee){this.emitAssign(assignee,catchCall)}else{this.emit(catchCall)}};Ep.jump=function(toLoc){this.emitAssign(this.contextProperty("next"),toLoc);this.emit(b.breakStatement())};Ep.jumpIf=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);this.emit(b.ifStatement(test,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};Ep.jumpIfNot=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);var negatedTest;if(n.UnaryExpression.check(test)&&test.operator==="!"){negatedTest=test.argument}else{negatedTest=b.unaryExpression("!",test)}this.emit(b.ifStatement(negatedTest,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};var nextTempId=0;Ep.makeTempVar=function(){return this.contextProperty("t"+nextTempId++)};Ep.getContextFunction=function(id){return b.functionExpression(id||null,[this.contextId],b.blockStatement([this.getDispatchLoop()]),false,false)};Ep.getDispatchLoop=function(){var self=this;var cases=[];var current;var alreadyEnded=false;self.listing.forEach(function(stmt,i){if(self.marked.hasOwnProperty(i)){cases.push(b.switchCase(b.literal(i),current=[]));alreadyEnded=false}if(!alreadyEnded){current.push(stmt);if(isSwitchCaseEnder(stmt))alreadyEnded=true}});this.finalLoc.value=this.listing.length;cases.push(b.switchCase(this.finalLoc,[]),b.switchCase(b.literal("end"),[b.returnStatement(b.callExpression(this.contextProperty("stop"),[]))]));return b.whileStatement(b.literal(1),b.switchStatement(b.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),cases))};function isSwitchCaseEnder(stmt){return n.BreakStatement.check(stmt)||n.ContinueStatement.check(stmt)||n.ReturnStatement.check(stmt)||n.ThrowStatement.check(stmt)}Ep.getTryEntryList=function(){if(this.tryEntries.length===0){return null}var lastLocValue=0;return b.arrayExpression(this.tryEntries.map(function(tryEntry){var thisLocValue=tryEntry.firstLoc.value;assert.ok(thisLocValue>=lastLocValue,"try entries out of order");lastLocValue=thisLocValue;var ce=tryEntry.catchEntry;var fe=tryEntry.finallyEntry;var triple=[tryEntry.firstLoc,ce?ce.firstLoc:null];if(fe){triple[2]=fe.firstLoc}return b.arrayExpression(triple)}))};Ep.explode=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var node=path.value;var self=this;n.Node.assert(node);if(n.Statement.check(node))return self.explodeStatement(path);if(n.Expression.check(node))return self.explodeExpression(path,ignoreResult);if(n.Declaration.check(node))throw getDeclError(node);switch(node.type){case"Program":return path.get("body").map(self.explodeStatement,self);case"VariableDeclarator":throw getDeclError(node);case"Property":case"SwitchCase":case"CatchClause":throw new Error(node.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(node.type))}};function getDeclError(node){return new Error("all declarations should have been transformed into "+"assignments before the Exploder began its work: "+JSON.stringify(node))}Ep.explodeStatement=function(path,labelId){assert.ok(path instanceof types.NodePath);var stmt=path.value;var self=this;n.Statement.assert(stmt);if(labelId){n.Identifier.assert(labelId)}else{labelId=null}if(n.BlockStatement.check(stmt)){return path.get("body").each(self.explodeStatement,self)}if(!meta.containsLeap(stmt)){self.emit(stmt);return}switch(stmt.type){case"ExpressionStatement":self.explodeExpression(path.get("expression"),true);break;case"LabeledStatement":self.explodeStatement(path.get("body"),stmt.label);break;case"WhileStatement":var before=loc();var after=loc();self.mark(before);self.jumpIfNot(self.explodeExpression(path.get("test")),after);self.leapManager.withEntry(new leap.LoopEntry(after,before,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(before);self.mark(after);break;case"DoWhileStatement":var first=loc();var test=loc();var after=loc();self.mark(first);self.leapManager.withEntry(new leap.LoopEntry(after,test,labelId),function(){self.explode(path.get("body"))});self.mark(test);self.jumpIf(self.explodeExpression(path.get("test")),first);self.mark(after);break;case"ForStatement":var head=loc();var update=loc();var after=loc();if(stmt.init){self.explode(path.get("init"),true)}self.mark(head);if(stmt.test){self.jumpIfNot(self.explodeExpression(path.get("test")),after)}else{}self.leapManager.withEntry(new leap.LoopEntry(after,update,labelId),function(){self.explodeStatement(path.get("body"))});self.mark(update);if(stmt.update){self.explode(path.get("update"),true)}self.jump(head);self.mark(after);break;case"ForInStatement":n.Identifier.assert(stmt.left);var head=loc();var after=loc();var keyIterNextFn=self.makeTempVar();self.emitAssign(keyIterNextFn,b.callExpression(runtimeKeysMethod,[self.explodeExpression(path.get("right"))]));self.mark(head);var keyInfoTmpVar=self.makeTempVar();self.jumpIf(b.memberExpression(b.assignmentExpression("=",keyInfoTmpVar,b.callExpression(keyIterNextFn,[])),b.identifier("done"),false),after);self.emitAssign(stmt.left,b.memberExpression(keyInfoTmpVar,b.identifier("value"),false));self.leapManager.withEntry(new leap.LoopEntry(after,head,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(head);self.mark(after);break;case"BreakStatement":self.emitAbruptCompletion({type:"break",target:self.leapManager.getBreakLoc(stmt.label)});break;case"ContinueStatement":self.emitAbruptCompletion({type:"continue",target:self.leapManager.getContinueLoc(stmt.label)});break;case"SwitchStatement":var disc=self.emitAssign(self.makeTempVar(),self.explodeExpression(path.get("discriminant")));var after=loc();var defaultLoc=loc();var condition=defaultLoc;var caseLocs=[];var cases=stmt.cases||[];for(var i=cases.length-1;i>=0;--i){var c=cases[i];n.SwitchCase.assert(c);if(c.test){condition=b.conditionalExpression(b.binaryExpression("===",disc,c.test),caseLocs[i]=loc(),condition)}else{caseLocs[i]=defaultLoc}}self.jump(self.explodeExpression(new types.NodePath(condition,path,"discriminant")));self.leapManager.withEntry(new leap.SwitchEntry(after),function(){path.get("cases").each(function(casePath){var c=casePath.value;var i=casePath.name;self.mark(caseLocs[i]);casePath.get("consequent").each(self.explodeStatement,self)})});self.mark(after);if(defaultLoc.value===-1){self.mark(defaultLoc);assert.strictEqual(after.value,defaultLoc.value)}break;case"IfStatement":var elseLoc=stmt.alternate&&loc();var after=loc();self.jumpIfNot(self.explodeExpression(path.get("test")),elseLoc||after);self.explodeStatement(path.get("consequent"));if(elseLoc){self.jump(after);self.mark(elseLoc);self.explodeStatement(path.get("alternate"))}self.mark(after);break;case"ReturnStatement":self.emitAbruptCompletion({type:"return",value:self.explodeExpression(path.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var after=loc();var handler=stmt.handler;if(!handler&&stmt.handlers){handler=stmt.handlers[0]||null}var catchLoc=handler&&loc();var catchEntry=catchLoc&&new leap.CatchEntry(catchLoc,handler.param);var finallyLoc=stmt.finalizer&&loc();var finallyEntry=finallyLoc&&new leap.FinallyEntry(finallyLoc);var tryEntry=new leap.TryEntry(self.getUnmarkedCurrentLoc(),catchEntry,finallyEntry);self.tryEntries.push(tryEntry);self.updateContextPrevLoc(tryEntry.firstLoc);self.leapManager.withEntry(tryEntry,function(){self.explodeStatement(path.get("block"));if(catchLoc){if(finallyLoc){self.jump(finallyLoc)}else{self.jump(after)}self.updateContextPrevLoc(self.mark(catchLoc));var bodyPath=path.get("handler","body");var safeParam=self.makeTempVar();self.clearPendingException(tryEntry.firstLoc,safeParam);var catchScope=bodyPath.scope;var catchParamName=handler.param.name;n.CatchClause.assert(catchScope.node);assert.strictEqual(catchScope.lookup(catchParamName),catchScope);types.visit(bodyPath,{visitIdentifier:function(path){if(util.isReference(path,catchParamName)&&path.scope.lookup(catchParamName)===catchScope){return safeParam}this.traverse(path)},visitFunction:function(path){if(path.scope.declares(catchParamName)){return false}this.traverse(path)}});self.leapManager.withEntry(catchEntry,function(){self.explodeStatement(bodyPath)})}if(finallyLoc){self.updateContextPrevLoc(self.mark(finallyLoc));self.leapManager.withEntry(finallyEntry,function(){self.explodeStatement(path.get("finalizer"))});self.emit(b.callExpression(self.contextProperty("finish"),[finallyEntry.firstLoc]))}});self.mark(after);break;case"ThrowStatement":self.emit(b.throwStatement(self.explodeExpression(path.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(stmt.type))}};Ep.emitAbruptCompletion=function(record){if(!isValidCompletion(record)){assert.ok(false,"invalid completion record: "+JSON.stringify(record))}assert.notStrictEqual(record.type,"normal","normal completions are not abrupt");var abruptArgs=[b.literal(record.type)];if(record.type==="break"||record.type==="continue"){n.Literal.assert(record.target);abruptArgs[1]=record.target}else if(record.type==="return"||record.type==="throw"){if(record.value){n.Expression.assert(record.value);abruptArgs[1]=record.value}}this.emit(b.returnStatement(b.callExpression(this.contextProperty("abrupt"),abruptArgs)))};function isValidCompletion(record){var type=record.type;if(type==="normal"){return!hasOwn.call(record,"target")}if(type==="break"||type==="continue"){return!hasOwn.call(record,"value")&&n.Literal.check(record.target)}if(type==="return"||type==="throw"){return hasOwn.call(record,"value")&&!hasOwn.call(record,"target")}return false}Ep.getUnmarkedCurrentLoc=function(){return b.literal(this.listing.length)};Ep.updateContextPrevLoc=function(loc){if(loc){n.Literal.assert(loc);if(loc.value===-1){loc.value=this.listing.length}else{assert.strictEqual(loc.value,this.listing.length)}}else{loc=this.getUnmarkedCurrentLoc()}this.emitAssign(this.contextProperty("prev"),loc)};Ep.explodeExpression=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var expr=path.value;if(expr){n.Expression.assert(expr)}else{return expr}var self=this;var result;function finish(expr){n.Expression.assert(expr);if(ignoreResult){self.emit(expr)}else{return expr}}if(!meta.containsLeap(expr)){return finish(expr)}var hasLeapingChildren=meta.containsLeap.onlyChildren(expr);function explodeViaTempVar(tempVar,childPath,ignoreChildResult){assert.ok(childPath instanceof types.NodePath);assert.ok(!ignoreChildResult||!tempVar,"Ignoring the result of a child expression but forcing it to "+"be assigned to a temporary variable?");var result=self.explodeExpression(childPath,ignoreChildResult);if(ignoreChildResult){}else if(tempVar||hasLeapingChildren&&(self.isVolatileContextProperty(result)||meta.hasSideEffects(result))){result=self.emitAssign(tempVar||self.makeTempVar(),result)}return result}switch(expr.type){case"MemberExpression":return finish(b.memberExpression(self.explodeExpression(path.get("object")),expr.computed?explodeViaTempVar(null,path.get("property")):expr.property,expr.computed));case"CallExpression":var oldCalleePath=path.get("callee");var newCallee=self.explodeExpression(oldCalleePath);if(!n.MemberExpression.check(oldCalleePath.node)&&n.MemberExpression.check(newCallee)){newCallee=b.sequenceExpression([b.literal(0),newCallee])}return finish(b.callExpression(newCallee,path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"NewExpression":return finish(b.newExpression(explodeViaTempVar(null,path.get("callee")),path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"ObjectExpression":return finish(b.objectExpression(path.get("properties").map(function(propPath){return b.property(propPath.value.kind,propPath.value.key,explodeViaTempVar(null,propPath.get("value")))})));case"ArrayExpression":return finish(b.arrayExpression(path.get("elements").map(function(elemPath){return explodeViaTempVar(null,elemPath)})));case"SequenceExpression":var lastIndex=expr.expressions.length-1;path.get("expressions").each(function(exprPath){if(exprPath.name===lastIndex){result=self.explodeExpression(exprPath,ignoreResult)}else{self.explodeExpression(exprPath,true)}});return result;case"LogicalExpression":var after=loc();if(!ignoreResult){result=self.makeTempVar()}var left=explodeViaTempVar(result,path.get("left"));if(expr.operator==="&&"){self.jumpIfNot(left,after)}else{assert.strictEqual(expr.operator,"||");self.jumpIf(left,after)}explodeViaTempVar(result,path.get("right"),ignoreResult);self.mark(after);return result;case"ConditionalExpression":var elseLoc=loc();var after=loc();var test=self.explodeExpression(path.get("test"));self.jumpIfNot(test,elseLoc);if(!ignoreResult){result=self.makeTempVar()}explodeViaTempVar(result,path.get("consequent"),ignoreResult);self.jump(after);self.mark(elseLoc);explodeViaTempVar(result,path.get("alternate"),ignoreResult);self.mark(after);return result;case"UnaryExpression":return finish(b.unaryExpression(expr.operator,self.explodeExpression(path.get("argument")),!!expr.prefix));case"BinaryExpression":return finish(b.binaryExpression(expr.operator,explodeViaTempVar(null,path.get("left")),explodeViaTempVar(null,path.get("right"))));case"AssignmentExpression":return finish(b.assignmentExpression(expr.operator,self.explodeExpression(path.get("left")),self.explodeExpression(path.get("right"))));case"UpdateExpression":return finish(b.updateExpression(expr.operator,self.explodeExpression(path.get("argument")),expr.prefix));case"YieldExpression":var after=loc();var arg=expr.argument&&self.explodeExpression(path.get("argument"));if(arg&&expr.delegate){var result=self.makeTempVar();self.emit(b.returnStatement(b.callExpression(self.contextProperty("delegateYield"),[arg,b.literal(result.property.name),after])));self.mark(after);return result}self.emitAssign(self.contextProperty("next"),after);self.emit(b.returnStatement(arg||null));self.mark(after);return self.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(expr.type))}}},{"./leap":125,"./meta":126,"./util":127,assert:90,recast:154}],124:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.hoist=function(funPath){assert.ok(funPath instanceof types.NodePath);n.Function.assert(funPath.value);var vars={};function varDeclToExpr(vdec,includeIdentifiers){n.VariableDeclaration.assert(vdec);var exprs=[];vdec.declarations.forEach(function(dec){vars[dec.id.name]=dec.id;if(dec.init){exprs.push(b.assignmentExpression("=",dec.id,dec.init))}else if(includeIdentifiers){exprs.push(dec.id)}});if(exprs.length===0)return null;if(exprs.length===1)return exprs[0];return b.sequenceExpression(exprs)}types.visit(funPath.get("body"),{visitVariableDeclaration:function(path){var expr=varDeclToExpr(path.value,false);if(expr===null){path.replace()}else{return b.expressionStatement(expr)}return false},visitForStatement:function(path){var init=path.value.init;if(n.VariableDeclaration.check(init)){path.get("init").replace(varDeclToExpr(init,false))}this.traverse(path)},visitForInStatement:function(path){var left=path.value.left;if(n.VariableDeclaration.check(left)){path.get("left").replace(varDeclToExpr(left,true))}this.traverse(path)},visitFunctionDeclaration:function(path){var node=path.value;vars[node.id.name]=node.id;var parentNode=path.parent.node;var assignment=b.expressionStatement(b.assignmentExpression("=",node.id,b.functionExpression(node.id,node.params,node.body,node.generator,node.expression)));if(n.BlockStatement.check(path.parent.node)){path.parent.get("body").unshift(assignment);path.replace()}else{path.replace(assignment)}return false},visitFunctionExpression:function(path){return false}});var paramNames={};funPath.get("params").each(function(paramPath){var param=paramPath.value;if(n.Identifier.check(param)){paramNames[param.name]=param }else{}});var declarations=[];Object.keys(vars).forEach(function(name){if(!hasOwn.call(paramNames,name)){declarations.push(b.variableDeclarator(vars[name],null))}});if(declarations.length===0){return null}return b.variableDeclaration("var",declarations)}},{assert:90,recast:154}],125:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var n=types.namedTypes;var b=types.builders;var inherits=require("util").inherits;var hasOwn=Object.prototype.hasOwnProperty;function Entry(){assert.ok(this instanceof Entry)}function FunctionEntry(returnLoc){Entry.call(this);n.Literal.assert(returnLoc);Object.defineProperties(this,{returnLoc:{value:returnLoc}})}inherits(FunctionEntry,Entry);exports.FunctionEntry=FunctionEntry;function LoopEntry(breakLoc,continueLoc,label){Entry.call(this);n.Literal.assert(breakLoc);n.Literal.assert(continueLoc);if(label){n.Identifier.assert(label)}else{label=null}Object.defineProperties(this,{breakLoc:{value:breakLoc},continueLoc:{value:continueLoc},label:{value:label}})}inherits(LoopEntry,Entry);exports.LoopEntry=LoopEntry;function SwitchEntry(breakLoc){Entry.call(this);n.Literal.assert(breakLoc);Object.defineProperties(this,{breakLoc:{value:breakLoc}})}inherits(SwitchEntry,Entry);exports.SwitchEntry=SwitchEntry;function TryEntry(firstLoc,catchEntry,finallyEntry){Entry.call(this);n.Literal.assert(firstLoc);if(catchEntry){assert.ok(catchEntry instanceof CatchEntry)}else{catchEntry=null}if(finallyEntry){assert.ok(finallyEntry instanceof FinallyEntry)}else{finallyEntry=null}assert.ok(catchEntry||finallyEntry);Object.defineProperties(this,{firstLoc:{value:firstLoc},catchEntry:{value:catchEntry},finallyEntry:{value:finallyEntry}})}inherits(TryEntry,Entry);exports.TryEntry=TryEntry;function CatchEntry(firstLoc,paramId){Entry.call(this);n.Literal.assert(firstLoc);n.Identifier.assert(paramId);Object.defineProperties(this,{firstLoc:{value:firstLoc},paramId:{value:paramId}})}inherits(CatchEntry,Entry);exports.CatchEntry=CatchEntry;function FinallyEntry(firstLoc){Entry.call(this);n.Literal.assert(firstLoc);Object.defineProperties(this,{firstLoc:{value:firstLoc}})}inherits(FinallyEntry,Entry);exports.FinallyEntry=FinallyEntry;function LeapManager(emitter){assert.ok(this instanceof LeapManager);var Emitter=require("./emit").Emitter;assert.ok(emitter instanceof Emitter);Object.defineProperties(this,{emitter:{value:emitter},entryStack:{value:[new FunctionEntry(emitter.finalLoc)]}})}var LMp=LeapManager.prototype;exports.LeapManager=LeapManager;LMp.withEntry=function(entry,callback){assert.ok(entry instanceof Entry);this.entryStack.push(entry);try{callback.call(this.emitter)}finally{var popped=this.entryStack.pop();assert.strictEqual(popped,entry)}};LMp._findLeapLocation=function(property,label){for(var i=this.entryStack.length-1;i>=0;--i){var entry=this.entryStack[i];var loc=entry[property];if(loc){if(label){if(entry.label&&entry.label.name===label.name){return loc}}else{return loc}}}return null};LMp.getBreakLoc=function(label){return this._findLeapLocation("breakLoc",label)};LMp.getContinueLoc=function(label){return this._findLeapLocation("continueLoc",label)}},{"./emit":123,assert:90,recast:154,util:114}],126:[function(require,module,exports){var assert=require("assert");var m=require("private").makeAccessor();var types=require("recast").types;var isArray=types.builtInTypes.array;var n=types.namedTypes;var hasOwn=Object.prototype.hasOwnProperty;function makePredicate(propertyName,knownTypes){function onlyChildren(node){n.Node.assert(node);var result=false;function check(child){if(result){}else if(isArray.check(child)){child.some(check)}else if(n.Node.check(child)){assert.strictEqual(result,false);result=predicate(child)}return result}types.eachField(node,function(name,child){check(child)});return result}function predicate(node){n.Node.assert(node);var meta=m(node);if(hasOwn.call(meta,propertyName))return meta[propertyName];if(hasOwn.call(opaqueTypes,node.type))return meta[propertyName]=false;if(hasOwn.call(knownTypes,node.type))return meta[propertyName]=true;return meta[propertyName]=onlyChildren(node)}predicate.onlyChildren=onlyChildren;return predicate}var opaqueTypes={FunctionExpression:true};var sideEffectTypes={CallExpression:true,ForInStatement:true,UnaryExpression:true,BinaryExpression:true,AssignmentExpression:true,UpdateExpression:true,NewExpression:true};var leapTypes={YieldExpression:true,BreakStatement:true,ContinueStatement:true,ReturnStatement:true,ThrowStatement:true};for(var type in leapTypes){if(hasOwn.call(leapTypes,type)){sideEffectTypes[type]=leapTypes[type]}}exports.hasSideEffects=makePredicate("hasSideEffects",sideEffectTypes);exports.containsLeap=makePredicate("containsLeap",leapTypes)},{assert:90,"private":122,recast:154}],127:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.defaults=function(obj){var len=arguments.length;var extension;for(var i=1;i<len;++i){if(extension=arguments[i]){for(var key in extension){if(hasOwn.call(extension,key)&&!hasOwn.call(obj,key)){obj[key]=extension[key]}}}}return obj};exports.runtimeProperty=function(name){return b.memberExpression(b.identifier("regeneratorRuntime"),b.identifier(name),false)};exports.isReference=function(path,name){var node=path.value;if(!n.Identifier.check(node)){return false}if(name&&node.name!==name){return false}var parent=path.parent.value;switch(parent.type){case"VariableDeclarator":return path.name==="init";case"MemberExpression":return path.name==="object"||parent.computed&&path.name==="property";case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":if(path.name==="id"){return false}if(parent.params===path.parentPath&&parent.params[path.name]===node){return false}return true;case"ClassDeclaration":case"ClassExpression":return path.name!=="id";case"CatchClause":return path.name!=="param";case"Property":case"MethodDefinition":return path.name!=="key";case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"LabeledStatement":return false;default:return true}}},{assert:90,recast:154}],128:[function(require,module,exports){var assert=require("assert");var fs=require("fs");var recast=require("recast");var types=recast.types;var n=types.namedTypes;var b=types.builders;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var NodePath=types.NodePath;var hoist=require("./hoist").hoist;var Emitter=require("./emit").Emitter;var runtimeProperty=require("./util").runtimeProperty;var runtimeWrapMethod=runtimeProperty("wrap");var runtimeMarkMethod=runtimeProperty("mark");var runtimeValuesMethod=runtimeProperty("values");var runtimeAsyncMethod=runtimeProperty("async");exports.transform=function transform(node,options){options=options||{};node=recast.visit(node,visitor);if(options.includeRuntime===true||options.includeRuntime==="if used"&&visitor.wasChangeReported()){injectRuntime(n.File.check(node)?node.program:node)}options.madeChanges=visitor.wasChangeReported();return node};function injectRuntime(program){n.Program.assert(program);var runtimePath=require("..").runtime.path;var runtime=fs.readFileSync(runtimePath,"utf8");var runtimeBody=recast.parse(runtime,{sourceFileName:runtimePath}).program.body;var body=program.body;body.unshift.apply(body,runtimeBody)}var visitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){this.traverse(path);var node=path.value;if(!node.generator&&!node.async){return}this.reportChanged();node.generator=false;if(node.expression){node.expression=false;node.body=b.blockStatement([b.returnStatement(node.body)])}if(node.async){awaitVisitor.visit(path.get("body"))}var outerFnId=node.id||(node.id=path.scope.parent.declareTemporary("callee$"));var innerFnId=b.identifier(node.id.name+"$");var contextId=path.scope.declareTemporary("context$");var argsId=path.scope.declareTemporary("args$");var shouldAliasArguments=renameArguments(path,argsId);var vars=hoist(path);if(shouldAliasArguments){vars=vars||b.variableDeclaration("var",[]);vars.declarations.push(b.variableDeclarator(argsId,b.identifier("arguments")))}var emitter=new Emitter(contextId);emitter.explode(path.get("body"));var outerBody=[];if(vars&&vars.declarations.length>0){outerBody.push(vars)}var wrapArgs=[emitter.getContextFunction(innerFnId),node.async?b.literal(null):outerFnId,b.thisExpression()];var tryEntryList=emitter.getTryEntryList();if(tryEntryList){wrapArgs.push(tryEntryList)}var wrapCall=b.callExpression(node.async?runtimeAsyncMethod:runtimeWrapMethod,wrapArgs);outerBody.push(b.returnStatement(wrapCall));node.body=b.blockStatement(outerBody);if(node.async){node.async=false;return}if(n.FunctionDeclaration.check(node)){var pp=path.parent;while(pp&&!(n.BlockStatement.check(pp.value)||n.Program.check(pp.value))){pp=pp.parent}if(!pp){return}path.replace();node.type="FunctionExpression";var varDecl=b.variableDeclaration("var",[b.variableDeclarator(node.id,b.callExpression(runtimeMarkMethod,[node]))]);if(node.comments){varDecl.comments=node.comments;node.comments=null}var bodyPath=pp.get("body");var bodyLen=bodyPath.value.length;for(var i=0;i<bodyLen;++i){var firstStmtPath=bodyPath.get(i);if(!shouldNotHoistAbove(firstStmtPath)){firstStmtPath.insertBefore(varDecl);return}}bodyPath.push(varDecl)}else{n.FunctionExpression.assert(node);return b.callExpression(runtimeMarkMethod,[node])}},visitForOfStatement:function(path){this.traverse(path);var node=path.value;var tempIterId=path.scope.declareTemporary("t$");var tempIterDecl=b.variableDeclarator(tempIterId,b.callExpression(runtimeValuesMethod,[node.right]));var tempInfoId=path.scope.declareTemporary("t$");var tempInfoDecl=b.variableDeclarator(tempInfoId,null);var init=node.left;var loopId;if(n.VariableDeclaration.check(init)){loopId=init.declarations[0].id;init.declarations.push(tempIterDecl,tempInfoDecl)}else{loopId=init;init=b.variableDeclaration("var",[tempIterDecl,tempInfoDecl])}n.Identifier.assert(loopId);var loopIdAssignExprStmt=b.expressionStatement(b.assignmentExpression("=",loopId,b.memberExpression(tempInfoId,b.identifier("value"),false)));if(n.BlockStatement.check(node.body)){node.body.body.unshift(loopIdAssignExprStmt)}else{node.body=b.blockStatement([loopIdAssignExprStmt,node.body])}return b.forStatement(init,b.unaryExpression("!",b.memberExpression(b.assignmentExpression("=",tempInfoId,b.callExpression(b.memberExpression(tempIterId,b.identifier("next"),false),[])),b.identifier("done"),false)),null,node.body)}});function shouldNotHoistAbove(stmtPath){var value=stmtPath.value;n.Statement.assert(value);if(n.ExpressionStatement.check(value)&&n.Literal.check(value.expression)&&value.expression.value==="use strict"){return true}if(n.VariableDeclaration.check(value)){for(var i=0;i<value.declarations.length;++i){var decl=value.declarations[i];if(n.CallExpression.check(decl.init)&&types.astNodesAreEquivalent(decl.init.callee,runtimeMarkMethod)){return true}}}return false}function renameArguments(funcPath,argsId){assert.ok(funcPath instanceof types.NodePath);var func=funcPath.value;var didReplaceArguments=false;var hasImplicitArguments=false;recast.visit(funcPath,{visitFunction:function(path){if(path.value===func){hasImplicitArguments=!path.scope.lookup("arguments");this.traverse(path)}else{return false}},visitIdentifier:function(path){if(path.value.name==="arguments"){var isMemberProperty=n.MemberExpression.check(path.parent.node)&&path.name==="property"&&!path.parent.node.computed;if(!isMemberProperty){path.replace(argsId);didReplaceArguments=true;return false}}this.traverse(path)}});return didReplaceArguments&&hasImplicitArguments}var awaitVisitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){return false},visitAwaitExpression:function(path){return b.yieldExpression(path.value.argument,false)}})},{"..":129,"./emit":123,"./hoist":124,"./util":127,assert:90,fs:89,recast:154}],129:[function(require,module,exports){(function(__dirname){var assert=require("assert");var path=require("path");var fs=require("fs");var through=require("through");var transform=require("./lib/visit").transform;var utils=require("./lib/util");var recast=require("recast");var types=recast.types;var genOrAsyncFunExp=/\bfunction\s*\*|\basync\b/;var blockBindingExp=/\b(let|const)\s+/;function exports(file,options){var data=[];return through(write,end);function write(buf){data.push(buf)}function end(){this.queue(compile(data.join(""),options).code);this.queue(null)}}module.exports=exports;function runtime(){require("./runtime")}exports.runtime=runtime;runtime.path=path.join(__dirname,"runtime.js");function compile(source,options){options=normalizeOptions(options);if(!genOrAsyncFunExp.test(source)){return{code:(options.includeRuntime===true?fs.readFileSync(runtime.path,"utf-8")+"\n":"")+source}}var recastOptions=getRecastOptions(options);var ast=recast.parse(source,recastOptions);var path=new types.NodePath(ast);var programPath=path.get("program");if(shouldVarify(source,options)){varifyAst(programPath.node)}transform(programPath,options);return recast.print(path,recastOptions)}function normalizeOptions(options){options=utils.defaults(options||{},{includeRuntime:false,supportBlockBinding:true});if(!options.esprima){options.esprima=require("esprima-fb")}assert.ok(/harmony/.test(options.esprima.version),"Bad esprima version: "+options.esprima.version);return options}function getRecastOptions(options){var recastOptions={range:true};function copy(name){if(name in options){recastOptions[name]=options[name]}}copy("esprima");copy("sourceFileName");copy("sourceMapName");copy("inputSourceMap");copy("sourceRoot");return recastOptions}function shouldVarify(source,options){var supportBlockBinding=!!options.supportBlockBinding;if(supportBlockBinding){if(!blockBindingExp.test(source)){supportBlockBinding=false}}return supportBlockBinding}function varify(source,options){var recastOptions=getRecastOptions(normalizeOptions(options));var ast=recast.parse(source,recastOptions);varifyAst(ast.program);return recast.print(ast,recastOptions).code}function varifyAst(ast){types.namedTypes.Program.assert(ast);var defsResult=require("defs")(ast,{ast:true,disallowUnknownReferences:false,disallowDuplicated:false,disallowVars:false,loopClosures:"iife"});if(defsResult.errors){throw new Error(defsResult.errors.join("\n"))}return ast}exports.varify=varify;exports.compile=compile;exports.transform=transform}).call(this,"/node_modules/regenerator")},{"./lib/util":127,"./lib/visit":128,"./runtime":156,assert:90,defs:130,"esprima-fb":144,fs:89,path:98,recast:154,through:155}],130:[function(require,module,exports){"use strict";var assert=require("assert");var is=require("simple-is");var fmt=require("simple-fmt");var stringmap=require("stringmap");var stringset=require("stringset");var alter=require("alter");var traverse=require("ast-traverse");var breakable=require("breakable");var Scope=require("./scope");var error=require("./error");var getline=error.getline;var options=require("./options");var Stats=require("./stats");var jshint_vars=require("./jshint_globals/vars.js");function isConstLet(kind){return is.someof(kind,["const","let"])}function isVarConstLet(kind){return is.someof(kind,["var","const","let"])}function isNonFunctionBlock(node){return node.type==="BlockStatement"&&is.noneof(node.$parent.type,["FunctionDeclaration","FunctionExpression"])}function isForWithConstLet(node){return node.type==="ForStatement"&&node.init&&node.init.type==="VariableDeclaration"&&isConstLet(node.init.kind)}function isForInOfWithConstLet(node){return isForInOf(node)&&node.left.type==="VariableDeclaration"&&isConstLet(node.left.kind)}function isForInOf(node){return is.someof(node.type,["ForInStatement","ForOfStatement"])}function isFunction(node){return is.someof(node.type,["FunctionDeclaration","FunctionExpression"])}function isLoop(node){return is.someof(node.type,["ForStatement","ForInStatement","ForOfStatement","WhileStatement","DoWhileStatement"])}function isReference(node){var parent=node.$parent;return node.$refToScope||node.type==="Identifier"&&!(parent.type==="VariableDeclarator"&&parent.id===node)&&!(parent.type==="MemberExpression"&&parent.computed===false&&parent.property===node)&&!(parent.type==="Property"&&parent.key===node)&&!(parent.type==="LabeledStatement"&&parent.label===node)&&!(parent.type==="CatchClause"&&parent.param===node)&&!(isFunction(parent)&&parent.id===node)&&!(isFunction(parent)&&is.someof(node,parent.params))&&true}function isLvalue(node){return isReference(node)&&(node.$parent.type==="AssignmentExpression"&&node.$parent.left===node||node.$parent.type==="UpdateExpression"&&node.$parent.argument===node)}function createScopes(node,parent){assert(!node.$scope);node.$parent=parent;node.$scope=node.$parent?node.$parent.$scope:null;if(node.type==="Program"){node.$scope=new Scope({kind:"hoist",node:node,parent:null})}else if(isFunction(node)){node.$scope=new Scope({kind:"hoist",node:node,parent:node.$parent.$scope});if(node.id){assert(node.id.type==="Identifier");if(node.type==="FunctionDeclaration"){node.$parent.$scope.add(node.id.name,"fun",node.id,null)}else if(node.type==="FunctionExpression"){node.$scope.add(node.id.name,"fun",node.id,null)}else{assert(false)}}node.params.forEach(function(param){node.$scope.add(param.name,"param",param,null)})}else if(node.type==="VariableDeclaration"){assert(isVarConstLet(node.kind));node.declarations.forEach(function(declarator){assert(declarator.type==="VariableDeclarator");var name=declarator.id.name;if(options.disallowVars&&node.kind==="var"){error(getline(declarator),"var {0} is not allowed (use let or const)",name)}node.$scope.add(name,node.kind,declarator.id,declarator.range[1])})}else if(isForWithConstLet(node)||isForInOfWithConstLet(node)){node.$scope=new Scope({kind:"block",node:node,parent:node.$parent.$scope})}else if(isNonFunctionBlock(node)){node.$scope=new Scope({kind:"block",node:node,parent:node.$parent.$scope})}else if(node.type==="CatchClause"){var identifier=node.param;node.$scope=new Scope({kind:"catch-block",node:node,parent:node.$parent.$scope});node.$scope.add(identifier.name,"caught",identifier,null);node.$scope.closestHoistScope().markPropagates(identifier.name)}}function createTopScope(programScope,environments,globals){function inject(obj){for(var name in obj){var writeable=obj[name];var kind=writeable?"var":"const";if(topScope.hasOwn(name)){topScope.remove(name)}topScope.add(name,kind,{loc:{start:{line:-1}}},-1)}}var topScope=new Scope({kind:"hoist",node:{},parent:null});var complementary={undefined:false,Infinity:false,console:false};inject(complementary);inject(jshint_vars.reservedVars);inject(jshint_vars.ecmaIdentifiers);if(environments){environments.forEach(function(env){if(!jshint_vars[env]){error(-1,'environment "{0}" not found',env)}else{inject(jshint_vars[env])}})}if(globals){inject(globals)}programScope.parent=topScope;topScope.children.push(programScope);return topScope}function setupReferences(ast,allIdentifiers,opts){var analyze=is.own(opts,"analyze")?opts.analyze:true;function visit(node){if(!isReference(node)){return}allIdentifiers.add(node.name);var scope=node.$scope.lookup(node.name);if(analyze&&!scope&&options.disallowUnknownReferences){error(getline(node),"reference to unknown global variable {0}",node.name)}if(analyze&&scope&&is.someof(scope.getKind(node.name),["const","let"])){var allowedFromPos=scope.getFromPos(node.name);var referencedAtPos=node.range[0];assert(is.finitenumber(allowedFromPos));assert(is.finitenumber(referencedAtPos));if(referencedAtPos<allowedFromPos){if(!node.$scope.hasFunctionScopeBetween(scope)){error(getline(node),"{0} is referenced before its declaration",node.name)}}}node.$refToScope=scope}traverse(ast,{pre:visit})}function varify(ast,stats,allIdentifiers,changes){function unique(name){assert(allIdentifiers.has(name));for(var cnt=0;;cnt++){var genName=name+"$"+String(cnt);if(!allIdentifiers.has(genName)){return genName}}}function renameDeclarations(node){if(node.type==="VariableDeclaration"&&isConstLet(node.kind)){var hoistScope=node.$scope.closestHoistScope();var origScope=node.$scope;changes.push({start:node.range[0],end:node.range[0]+node.kind.length,str:"var"});node.declarations.forEach(function(declarator){assert(declarator.type==="VariableDeclarator");var name=declarator.id.name;stats.declarator(node.kind);var rename=origScope!==hoistScope&&(hoistScope.hasOwn(name)||hoistScope.doesPropagate(name));var newName=rename?unique(name):name;origScope.remove(name);hoistScope.add(newName,"var",declarator.id,declarator.range[1]);origScope.moves=origScope.moves||stringmap();origScope.moves.set(name,{name:newName,scope:hoistScope});allIdentifiers.add(newName);if(newName!==name){stats.rename(name,newName,getline(declarator));declarator.id.originalName=name;declarator.id.name=newName;changes.push({start:declarator.id.range[0],end:declarator.id.range[1],str:newName})}});node.kind="var"}}function renameReferences(node){if(!node.$refToScope){return}var move=node.$refToScope.moves&&node.$refToScope.moves.get(node.name);if(!move){return}node.$refToScope=move.scope;if(node.name!==move.name){node.originalName=node.name;node.name=move.name;if(node.alterop){var existingOp=null;for(var i=0;i<changes.length;i++){var op=changes[i];if(op.node===node){existingOp=op;break}}assert(existingOp);existingOp.str=move.name}else{changes.push({start:node.range[0],end:node.range[1],str:move.name})}}}traverse(ast,{pre:renameDeclarations});traverse(ast,{pre:renameReferences});ast.$scope.traverse({pre:function(scope){delete scope.moves}})}function detectLoopClosures(ast){traverse(ast,{pre:visit});function detectIifyBodyBlockers(body,node){return breakable(function(brk){traverse(body,{pre:function(n){if(isFunction(n)){return false}var err=true;var msg="loop-variable {0} is captured by a loop-closure that can't be transformed due to use of {1} at line {2}";if(n.type==="BreakStatement"){error(getline(node),msg,node.name,"break",getline(n))}else if(n.type==="ContinueStatement"){error(getline(node),msg,node.name,"continue",getline(n))}else if(n.type==="ReturnStatement"){error(getline(node),msg,node.name,"return",getline(n))}else if(n.type==="YieldExpression"){error(getline(node),msg,node.name,"yield",getline(n))}else if(n.type==="Identifier"&&n.name==="arguments"){error(getline(node),msg,node.name,"arguments",getline(n))}else if(n.type==="VariableDeclaration"&&n.kind==="var"){error(getline(node),msg,node.name,"var",getline(n))}else{err=false}if(err){brk(true)}}});return false})}function visit(node){var loopNode=null;if(isReference(node)&&node.$refToScope&&isConstLet(node.$refToScope.getKind(node.name))){for(var n=node.$refToScope.node;;){if(isFunction(n)){return}else if(isLoop(n)){loopNode=n;break}n=n.$parent;if(!n){return}}assert(isLoop(loopNode));var defScope=node.$refToScope;var generateIIFE=options.loopClosures==="iife";for(var s=node.$scope;s;s=s.parent){if(s===defScope){return}else if(isFunction(s.node)){if(!generateIIFE){var msg='loop-variable {0} is captured by a loop-closure. Tried "loopClosures": "iife" in defs-config.json?';return error(getline(node),msg,node.name)}if(loopNode.type==="ForStatement"&&defScope.node===loopNode){var declarationNode=defScope.getNode(node.name);return error(getline(declarationNode),"Not yet specced ES6 feature. {0} is declared in for-loop header and then captured in loop closure",declarationNode.name)}if(detectIifyBodyBlockers(loopNode.body,node)){return}loopNode.$iify=true}}}}}function transformLoopClosures(root,ops,options){function insertOp(pos,str,node){var op={start:pos,end:pos,str:str};if(node){op.node=node}ops.push(op)}traverse(root,{pre:function(node){if(!node.$iify){return}var hasBlock=node.body.type==="BlockStatement";var insertHead=hasBlock?node.body.range[0]+1:node.body.range[0];var insertFoot=hasBlock?node.body.range[1]-1:node.body.range[1];var forInName=isForInOf(node)&&node.left.declarations[0].id.name;var iifeHead=fmt("(function({0}){",forInName?forInName:"");var iifeTail=fmt("}).call(this{0});",forInName?", "+forInName:"");var iifeFragment=options.parse(iifeHead+iifeTail);var iifeExpressionStatement=iifeFragment.body[0];var iifeBlockStatement=iifeExpressionStatement.expression.callee.object.body;if(hasBlock){var forBlockStatement=node.body;var tmp=forBlockStatement.body;forBlockStatement.body=[iifeExpressionStatement];iifeBlockStatement.body=tmp}else{var tmp$0=node.body;node.body=iifeExpressionStatement;iifeBlockStatement.body[0]=tmp$0}insertOp(insertHead,iifeHead);if(forInName){insertOp(insertFoot,"}).call(this, ");var args=iifeExpressionStatement.expression.arguments;var iifeArgumentIdentifier=args[1];iifeArgumentIdentifier.alterop=true;insertOp(insertFoot,forInName,iifeArgumentIdentifier);insertOp(insertFoot,");")}else{insertOp(insertFoot,iifeTail)}}})}function detectConstAssignment(ast){traverse(ast,{pre:function(node){if(isLvalue(node)){var scope=node.$scope.lookup(node.name);if(scope&&scope.getKind(node.name)==="const"){error(getline(node),"can't assign to const variable {0}",node.name)}}}})}function detectConstantLets(ast){traverse(ast,{pre:function(node){if(isLvalue(node)){var scope=node.$scope.lookup(node.name);if(scope){scope.markWrite(node.name)}}}});ast.$scope.detectUnmodifiedLets()}function setupScopeAndReferences(root,opts){traverse(root,{pre:createScopes});var topScope=createTopScope(root.$scope,options.environments,options.globals);var allIdentifiers=stringset();topScope.traverse({pre:function(scope){allIdentifiers.addMany(scope.decls.keys())}});setupReferences(root,allIdentifiers,opts);return allIdentifiers}function cleanupTree(root){traverse(root,{pre:function(node){for(var prop in node){if(prop[0]==="$"){delete node[prop]}}}})}function run(src,config){for(var key in config){options[key]=config[key]}var parsed;if(is.object(src)){if(!options.ast){return{errors:["Can't produce string output when input is an AST. "+"Did you forget to set options.ast = true?"]}}parsed=src}else if(is.string(src)){try{parsed=options.parse(src,{loc:true,range:true})}catch(e){return{errors:[fmt("line {0} column {1}: Error during input file parsing\n{2}\n{3}",e.lineNumber,e.column,src.split("\n")[e.lineNumber-1],fmt.repeat(" ",e.column-1)+"^")]}}}else{return{errors:["Input was neither an AST object nor a string."]}}var ast=parsed;error.reset();var allIdentifiers=setupScopeAndReferences(ast,{});detectLoopClosures(ast);detectConstAssignment(ast);var changes=[];transformLoopClosures(ast,changes,options);if(error.errors.length>=1){return{errors:error.errors}}if(changes.length>0){cleanupTree(ast);allIdentifiers=setupScopeAndReferences(ast,{analyze:false})}assert(error.errors.length===0);var stats=new Stats;varify(ast,stats,allIdentifiers,changes);if(options.ast){cleanupTree(ast);return{stats:stats,ast:ast}}else{var transformedSrc=alter(src,changes);return{stats:stats,src:transformedSrc}}}module.exports=run},{"./error":131,"./jshint_globals/vars.js":132,"./options":133,"./scope":134,"./stats":135,alter:136,assert:90,"ast-traverse":138,breakable:139,"simple-fmt":140,"simple-is":141,stringmap:142,stringset:143}],131:[function(require,module,exports){"use strict";var fmt=require("simple-fmt");var assert=require("assert");function error(line,var_args){assert(arguments.length>=2);var msg=arguments.length===2?String(var_args):fmt.apply(fmt,Array.prototype.slice.call(arguments,1));error.errors.push(line===-1?msg:fmt("line {0}: {1}",line,msg))}error.reset=function(){error.errors=[]};error.getline=function(node){if(node&&node.loc&&node.loc.start){return node.loc.start.line}return-1};error.reset();module.exports=error},{assert:90,"simple-fmt":140}],132:[function(require,module,exports){"use strict";exports.reservedVars={arguments:false,NaN:false};exports.ecmaIdentifiers={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Math:false,Map:false,Number:false,Object:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,Set:false,String:false,SyntaxError:false,TypeError:false,URIError:false,WeakMap:false};exports.browser={ArrayBuffer:false,ArrayBufferView:false,Audio:false,Blob:false,addEventListener:false,applicationCache:false,atob:false,blur:false,btoa:false,clearInterval:false,clearTimeout:false,close:false,closed:false,DataView:false,DOMParser:false,defaultStatus:false,document:false,Element:false,event:false,FileReader:false,Float32Array:false,Float64Array:false,FormData:false,focus:false,frames:false,getComputedStyle:false,HTMLElement:false,HTMLAnchorElement:false,HTMLBaseElement:false,HTMLBlockquoteElement:false,HTMLBodyElement:false,HTMLBRElement:false,HTMLButtonElement:false,HTMLCanvasElement:false,HTMLDirectoryElement:false,HTMLDivElement:false,HTMLDListElement:false,HTMLFieldSetElement:false,HTMLFontElement:false,HTMLFormElement:false,HTMLFrameElement:false,HTMLFrameSetElement:false,HTMLHeadElement:false,HTMLHeadingElement:false,HTMLHRElement:false,HTMLHtmlElement:false,HTMLIFrameElement:false,HTMLImageElement:false,HTMLInputElement:false,HTMLIsIndexElement:false,HTMLLabelElement:false,HTMLLayerElement:false,HTMLLegendElement:false,HTMLLIElement:false,HTMLLinkElement:false,HTMLMapElement:false,HTMLMenuElement:false,HTMLMetaElement:false,HTMLModElement:false,HTMLObjectElement:false,HTMLOListElement:false,HTMLOptGroupElement:false,HTMLOptionElement:false,HTMLParagraphElement:false,HTMLParamElement:false,HTMLPreElement:false,HTMLQuoteElement:false,HTMLScriptElement:false,HTMLSelectElement:false,HTMLStyleElement:false,HTMLTableCaptionElement:false,HTMLTableCellElement:false,HTMLTableColElement:false,HTMLTableElement:false,HTMLTableRowElement:false,HTMLTableSectionElement:false,HTMLTextAreaElement:false,HTMLTitleElement:false,HTMLUListElement:false,HTMLVideoElement:false,history:false,Int16Array:false,Int32Array:false,Int8Array:false,Image:false,length:false,localStorage:false,location:false,MessageChannel:false,MessageEvent:false,MessagePort:false,moveBy:false,moveTo:false,MutationObserver:false,name:false,Node:false,NodeFilter:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,openDatabase:false,opener:false,Option:false,parent:false,print:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,sessionStorage:false,setInterval:false,setTimeout:false,SharedWorker:false,status:false,top:false,Uint16Array:false,Uint32Array:false,Uint8Array:false,Uint8ClampedArray:false,WebSocket:false,window:false,Worker:false,XMLHttpRequest:false,XMLSerializer:false,XPathEvaluator:false,XPathException:false,XPathExpression:false,XPathNamespace:false,XPathNSResolver:false,XPathResult:false};exports.devel={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false};exports.worker={importScripts:true,postMessage:true,self:true};exports.nonstandard={escape:false,unescape:false};exports.couch={require:false,respond:false,getRow:false,emit:false,send:false,start:false,sum:false,log:false,exports:false,module:false,provides:false};exports.node={__filename:false,__dirname:false,Buffer:false,DataView:false,console:false,exports:true,GLOBAL:false,global:false,module:false,process:false,require:false,setTimeout:false,clearTimeout:false,setInterval:false,clearInterval:false};exports.phantom={phantom:true,require:true,WebPage:true};exports.rhino={defineClass:false,deserialize:false,gc:false,help:false,importPackage:false,java:false,load:false,loadClass:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false};exports.wsh={ActiveXObject:true,Enumerator:true,GetObject:true,ScriptEngine:true,ScriptEngineBuildVersion:true,ScriptEngineMajorVersion:true,ScriptEngineMinorVersion:true,VBArray:true,WSH:true,WScript:true,XDomainRequest:true}; exports.dojo={dojo:false,dijit:false,dojox:false,define:false,require:false};exports.jquery={$:false,jQuery:false};exports.mootools={$:false,$$:false,Asset:false,Browser:false,Chain:false,Class:false,Color:false,Cookie:false,Core:false,Document:false,DomReady:false,DOMEvent:false,DOMReady:false,Drag:false,Element:false,Elements:false,Event:false,Events:false,Fx:false,Group:false,Hash:false,HtmlTable:false,Iframe:false,IframeShim:false,InputValidator:false,instanceOf:false,Keyboard:false,Locale:false,Mask:false,MooTools:false,Native:false,Options:false,OverText:false,Request:false,Scroller:false,Slick:false,Slider:false,Sortables:false,Spinner:false,Swiff:false,Tips:false,Type:false,typeOf:false,URI:false,Window:false};exports.prototypejs={$:false,$$:false,$A:false,$F:false,$H:false,$R:false,$break:false,$continue:false,$w:false,Abstract:false,Ajax:false,Class:false,Enumerable:false,Element:false,Event:false,Field:false,Form:false,Hash:false,Insertion:false,ObjectRange:false,PeriodicalExecuter:false,Position:false,Prototype:false,Selector:false,Template:false,Toggle:false,Try:false,Autocompleter:false,Builder:false,Control:false,Draggable:false,Draggables:false,Droppables:false,Effect:false,Sortable:false,SortableObserver:false,Sound:false,Scriptaculous:false};exports.yui={YUI:false,Y:false,YUI_config:false}},{}],133:[function(require,module,exports){module.exports={disallowVars:false,disallowDuplicated:true,disallowUnknownReferences:true,parse:require("esprima-fb").parse}},{"esprima-fb":144}],134:[function(require,module,exports){"use strict";var assert=require("assert");var stringmap=require("stringmap");var stringset=require("stringset");var is=require("simple-is");var fmt=require("simple-fmt");var error=require("./error");var getline=error.getline;var options=require("./options");function Scope(args){assert(is.someof(args.kind,["hoist","block","catch-block"]));assert(is.object(args.node));assert(args.parent===null||is.object(args.parent));this.kind=args.kind;this.node=args.node;this.parent=args.parent;this.children=[];this.decls=stringmap();this.written=stringset();this.propagates=this.kind==="hoist"?stringset():null;if(this.parent){this.parent.children.push(this)}}Scope.prototype.print=function(indent){indent=indent||0;var scope=this;var names=this.decls.keys().map(function(name){return fmt("{0} [{1}]",name,scope.decls.get(name).kind)}).join(", ");var propagates=this.propagates?this.propagates.items().join(", "):"";console.log(fmt("{0}{1}: {2}. propagates: {3}",fmt.repeat(" ",indent),this.node.type,names,propagates));this.children.forEach(function(c){c.print(indent+2)})};Scope.prototype.add=function(name,kind,node,referableFromPos){assert(is.someof(kind,["fun","param","var","caught","const","let"]));function isConstLet(kind){return is.someof(kind,["const","let"])}var scope=this;if(is.someof(kind,["fun","param","var"])){while(scope.kind!=="hoist"){if(scope.decls.has(name)&&isConstLet(scope.decls.get(name).kind)){return error(getline(node),"{0} is already declared",name)}scope=scope.parent}}if(scope.decls.has(name)&&(options.disallowDuplicated||isConstLet(scope.decls.get(name).kind)||isConstLet(kind))){return error(getline(node),"{0} is already declared",name)}var declaration={kind:kind,node:node};if(referableFromPos){assert(is.someof(kind,["var","const","let"]));declaration.from=referableFromPos}scope.decls.set(name,declaration)};Scope.prototype.getKind=function(name){assert(is.string(name));var decl=this.decls.get(name);return decl?decl.kind:null};Scope.prototype.getNode=function(name){assert(is.string(name));var decl=this.decls.get(name);return decl?decl.node:null};Scope.prototype.getFromPos=function(name){assert(is.string(name));var decl=this.decls.get(name);return decl?decl.from:null};Scope.prototype.hasOwn=function(name){return this.decls.has(name)};Scope.prototype.remove=function(name){return this.decls.remove(name)};Scope.prototype.doesPropagate=function(name){return this.propagates.has(name)};Scope.prototype.markPropagates=function(name){this.propagates.add(name)};Scope.prototype.closestHoistScope=function(){var scope=this;while(scope.kind!=="hoist"){scope=scope.parent}return scope};Scope.prototype.hasFunctionScopeBetween=function(outer){function isFunction(node){return is.someof(node.type,["FunctionDeclaration","FunctionExpression"])}for(var scope=this;scope;scope=scope.parent){if(scope===outer){return false}if(isFunction(scope.node)){return true}}throw new Error("wasn't inner scope of outer")};Scope.prototype.lookup=function(name){for(var scope=this;scope;scope=scope.parent){if(scope.decls.has(name)){return scope}else if(scope.kind==="hoist"){scope.propagates.add(name)}}return null};Scope.prototype.markWrite=function(name){assert(is.string(name));this.written.add(name)};Scope.prototype.detectUnmodifiedLets=function(){var outmost=this;function detect(scope){if(scope!==outmost){scope.decls.keys().forEach(function(name){if(scope.getKind(name)==="let"&&!scope.written.has(name)){return error(getline(scope.getNode(name)),"{0} is declared as let but never modified so could be const",name)}})}scope.children.forEach(function(childScope){detect(childScope)})}detect(this)};Scope.prototype.traverse=function(options){options=options||{};var pre=options.pre;var post=options.post;function visit(scope){if(pre){pre(scope)}scope.children.forEach(function(childScope){visit(childScope)});if(post){post(scope)}}visit(this)};module.exports=Scope},{"./error":131,"./options":133,assert:90,"simple-fmt":140,"simple-is":141,stringmap:142,stringset:143}],135:[function(require,module,exports){var fmt=require("simple-fmt");var is=require("simple-is");var assert=require("assert");function Stats(){this.lets=0;this.consts=0;this.renames=[]}Stats.prototype.declarator=function(kind){assert(is.someof(kind,["const","let"]));if(kind==="const"){this.consts++}else{this.lets++}};Stats.prototype.rename=function(oldName,newName,line){this.renames.push({oldName:oldName,newName:newName,line:line})};Stats.prototype.toString=function(){var renames=this.renames.map(function(r){return r}).sort(function(a,b){return a.line-b.line});var renameStr=renames.map(function(rename){return fmt("\nline {0}: {1} => {2}",rename.line,rename.oldName,rename.newName)}).join("");var sum=this.consts+this.lets;var constlets=sum===0?"can't calculate const coverage (0 consts, 0 lets)":fmt("{0}% const coverage ({1} consts, {2} lets)",Math.floor(100*this.consts/sum),this.consts,this.lets);return constlets+renameStr+"\n"};module.exports=Stats},{assert:90,"simple-fmt":140,"simple-is":141}],136:[function(require,module,exports){var assert=require("assert");var stableSort=require("stable");function alter(str,fragments){"use strict";var isArray=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"};assert(typeof str==="string");assert(isArray(fragments));var sortedFragments=stableSort(fragments,function(a,b){return a.start-b.start});var outs=[];var pos=0;for(var i=0;i<sortedFragments.length;i++){var frag=sortedFragments[i];assert(pos<=frag.start);assert(frag.start<=frag.end);outs.push(str.slice(pos,frag.start));outs.push(frag.str);pos=frag.end}if(pos<str.length){outs.push(str.slice(pos))}return outs.join("")}if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=alter}},{assert:90,stable:137}],137:[function(require,module,exports){(function(){var stable=function(arr,comp){return exec(arr.slice(),comp)};stable.inplace=function(arr,comp){var result=exec(arr,comp);if(result!==arr){pass(result,null,arr.length,arr)}return arr};function exec(arr,comp){if(typeof comp!=="function"){comp=function(a,b){return String(a).localeCompare(b)}}var len=arr.length;if(len<=1){return arr}var buffer=new Array(len);for(var chk=1;chk<len;chk*=2){pass(arr,comp,chk,buffer);var tmp=arr;arr=buffer;buffer=tmp}return arr}var pass=function(arr,comp,chk,result){var len=arr.length;var i=0;var dbl=chk*2;var l,r,e;var li,ri;for(l=0;l<len;l+=dbl){r=l+chk;e=r+chk;if(r>len)r=len;if(e>len)e=len;li=l;ri=r;while(true){if(li<r&&ri<e){if(comp(arr[li],arr[ri])<=0){result[i++]=arr[li++]}else{result[i++]=arr[ri++]}}else if(li<r){result[i++]=arr[li++]}else if(ri<e){result[i++]=arr[ri++]}else{break}}}};if(typeof module!=="undefined"){module.exports=stable}else{window.stable=stable}})()},{}],138:[function(require,module,exports){function traverse(root,options){"use strict";options=options||{};var pre=options.pre;var post=options.post;var skipProperty=options.skipProperty;function visit(node,parent,prop,idx){if(!node||typeof node.type!=="string"){return}var res=undefined;if(pre){res=pre(node,parent,prop,idx)}if(res!==false){for(var prop in node){if(skipProperty?skipProperty(prop,node):prop[0]==="$"){continue}var child=node[prop];if(Array.isArray(child)){for(var i=0;i<child.length;i++){visit(child[i],node,prop,i)}}else{visit(child,node,prop)}}}if(post){post(node,parent,prop,idx)}}visit(root,null)}if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=traverse}},{}],139:[function(require,module,exports){var breakable=function(){"use strict";function Val(val,brk){this.val=val;this.brk=brk}function make_brk(){return function brk(val){throw new Val(val,brk)}}function breakable(fn){var brk=make_brk();try{return fn(brk)}catch(e){if(e instanceof Val&&e.brk===brk){return e.val}throw e}}return breakable}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=breakable}},{}],140:[function(require,module,exports){var fmt=function(){"use strict";function fmt(str,var_args){var args=Array.prototype.slice.call(arguments,1);return str.replace(/\{(\d+)\}/g,function(s,match){return match in args?args[match]:s})}function obj(str,obj){return str.replace(/\{([_$a-zA-Z0-9][_$a-zA-Z0-9]*)\}/g,function(s,match){return match in obj?obj[match]:s})}function repeat(str,n){return new Array(n+1).join(str)}fmt.fmt=fmt;fmt.obj=obj;fmt.repeat=repeat;return fmt}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=fmt}},{}],141:[function(require,module,exports){var is=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;var _undefined=void 0;return{nan:function(v){return v!==v},"boolean":function(v){return typeof v==="boolean"},number:function(v){return typeof v==="number"},string:function(v){return typeof v==="string"},fn:function(v){return typeof v==="function"},object:function(v){return v!==null&&typeof v==="object"},primitive:function(v){var t=typeof v;return v===null||v===_undefined||t==="boolean"||t==="number"||t==="string"},array:Array.isArray||function(v){return toString.call(v)==="[object Array]"},finitenumber:function(v){return typeof v==="number"&&isFinite(v)},someof:function(v,values){return values.indexOf(v)>=0},noneof:function(v,values){return values.indexOf(v)===-1},own:function(obj,prop){return hasOwnProperty.call(obj,prop)}}}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=is}},{}],142:[function(require,module,exports){var StringMap=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty;var create=function(){function hasOwnEnumerableProps(obj){for(var prop in obj){if(hasOwnProperty.call(obj,prop)){return true}}return false}function hasOwnPollutedProps(obj){return hasOwnProperty.call(obj,"__count__")||hasOwnProperty.call(obj,"__parent__")}var useObjectCreate=false;if(typeof Object.create==="function"){if(!hasOwnEnumerableProps(Object.create(null))){useObjectCreate=true}}if(useObjectCreate===false){if(hasOwnEnumerableProps({})){throw new Error("StringMap environment error 0, please file a bug at https://github.com/olov/stringmap/issues")}}var o=useObjectCreate?Object.create(null):{};var useProtoClear=false;if(hasOwnPollutedProps(o)){o.__proto__=null;if(hasOwnEnumerableProps(o)||hasOwnPollutedProps(o)){throw new Error("StringMap environment error 1, please file a bug at https://github.com/olov/stringmap/issues")}useProtoClear=true}return function(){var o=useObjectCreate?Object.create(null):{};if(useProtoClear){o.__proto__=null}return o}}();function stringmap(optional_object){if(!(this instanceof stringmap)){return new stringmap(optional_object)}this.obj=create();this.hasProto=false;this.proto=undefined;if(optional_object){this.setMany(optional_object)}}stringmap.prototype.has=function(key){if(typeof key!=="string"){throw new Error("StringMap expected string key")}return key==="__proto__"?this.hasProto:hasOwnProperty.call(this.obj,key)};stringmap.prototype.get=function(key){if(typeof key!=="string"){throw new Error("StringMap expected string key")}return key==="__proto__"?this.proto:hasOwnProperty.call(this.obj,key)?this.obj[key]:undefined};stringmap.prototype.set=function(key,value){if(typeof key!=="string"){throw new Error("StringMap expected string key")}if(key==="__proto__"){this.hasProto=true;this.proto=value}else{this.obj[key]=value}};stringmap.prototype.remove=function(key){if(typeof key!=="string"){throw new Error("StringMap expected string key")}var didExist=this.has(key);if(key==="__proto__"){this.hasProto=false;this.proto=undefined}else{delete this.obj[key]}return didExist};stringmap.prototype["delete"]=stringmap.prototype.remove;stringmap.prototype.isEmpty=function(){for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){return false}}return!this.hasProto};stringmap.prototype.size=function(){var len=0;for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){++len}}return this.hasProto?len+1:len};stringmap.prototype.keys=function(){var keys=[];for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){keys.push(key)}}if(this.hasProto){keys.push("__proto__")}return keys};stringmap.prototype.values=function(){var values=[];for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){values.push(this.obj[key])}}if(this.hasProto){values.push(this.proto)}return values};stringmap.prototype.items=function(){var items=[];for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){items.push([key,this.obj[key]])}}if(this.hasProto){items.push(["__proto__",this.proto])}return items};stringmap.prototype.setMany=function(object){if(object===null||typeof object!=="object"&&typeof object!=="function"){throw new Error("StringMap expected Object")}for(var key in object){if(hasOwnProperty.call(object,key)){this.set(key,object[key])}}return this};stringmap.prototype.merge=function(other){var keys=other.keys();for(var i=0;i<keys.length;i++){var key=keys[i];this.set(key,other.get(key))}return this};stringmap.prototype.map=function(fn){var keys=this.keys();for(var i=0;i<keys.length;i++){var key=keys[i];keys[i]=fn(this.get(key),key)}return keys};stringmap.prototype.forEach=function(fn){var keys=this.keys();for(var i=0;i<keys.length;i++){var key=keys[i];fn(this.get(key),key)}};stringmap.prototype.clone=function(){var other=stringmap();return other.merge(this)};stringmap.prototype.toString=function(){var self=this;return"{"+this.keys().map(function(key){return JSON.stringify(key)+":"+JSON.stringify(self.get(key))}).join(",")+"}"};return stringmap}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=StringMap}},{}],143:[function(require,module,exports){var StringSet=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty;var create=function(){function hasOwnEnumerableProps(obj){for(var prop in obj){if(hasOwnProperty.call(obj,prop)){return true}}return false}function hasOwnPollutedProps(obj){return hasOwnProperty.call(obj,"__count__")||hasOwnProperty.call(obj,"__parent__")}var useObjectCreate=false;if(typeof Object.create==="function"){if(!hasOwnEnumerableProps(Object.create(null))){useObjectCreate=true}}if(useObjectCreate===false){if(hasOwnEnumerableProps({})){throw new Error("StringSet environment error 0, please file a bug at https://github.com/olov/stringset/issues")}}var o=useObjectCreate?Object.create(null):{};var useProtoClear=false;if(hasOwnPollutedProps(o)){o.__proto__=null;if(hasOwnEnumerableProps(o)||hasOwnPollutedProps(o)){throw new Error("StringSet environment error 1, please file a bug at https://github.com/olov/stringset/issues")}useProtoClear=true}return function(){var o=useObjectCreate?Object.create(null):{};if(useProtoClear){o.__proto__=null}return o}}();function stringset(optional_array){if(!(this instanceof stringset)){return new stringset(optional_array)}this.obj=create();this.hasProto=false;if(optional_array){this.addMany(optional_array)}}stringset.prototype.has=function(item){if(typeof item!=="string"){throw new Error("StringSet expected string item")}return item==="__proto__"?this.hasProto:hasOwnProperty.call(this.obj,item)};stringset.prototype.add=function(item){if(typeof item!=="string"){throw new Error("StringSet expected string item")}if(item==="__proto__"){this.hasProto=true}else{this.obj[item]=true}};stringset.prototype.remove=function(item){if(typeof item!=="string"){throw new Error("StringSet expected string item")}var didExist=this.has(item);if(item==="__proto__"){this.hasProto=false}else{delete this.obj[item]}return didExist};stringset.prototype["delete"]=stringset.prototype.remove;stringset.prototype.isEmpty=function(){for(var item in this.obj){if(hasOwnProperty.call(this.obj,item)){return false}}return!this.hasProto};stringset.prototype.size=function(){var len=0;for(var item in this.obj){if(hasOwnProperty.call(this.obj,item)){++len}}return this.hasProto?len+1:len};stringset.prototype.items=function(){var items=[];for(var item in this.obj){if(hasOwnProperty.call(this.obj,item)){items.push(item)}}if(this.hasProto){items.push("__proto__")}return items};stringset.prototype.addMany=function(items){if(!Array.isArray(items)){throw new Error("StringSet expected array")}for(var i=0;i<items.length;i++){this.add(items[i])}return this};stringset.prototype.merge=function(other){this.addMany(other.items());return this};stringset.prototype.clone=function(){var other=stringset();return other.merge(this)};stringset.prototype.toString=function(){return"{"+this.items().map(JSON.stringify).join(",")+"}"};return stringset}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=StringSet}},{}],144:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.esprima={})}})(this,function(exports){"use strict";var Token,TokenName,FnExprTokens,Syntax,PropertyKind,Messages,Regex,SyntaxTreeDelegate,XHTMLEntities,ClassPropertyType,source,strict,index,lineNumber,lineStart,length,delegate,lookahead,state,extra;Token={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10,XJSIdentifier:11,XJSText:12};TokenName={};TokenName[Token.BooleanLiteral]="Boolean";TokenName[Token.EOF]="<end>";TokenName[Token.Identifier]="Identifier";TokenName[Token.Keyword]="Keyword";TokenName[Token.NullLiteral]="Null";TokenName[Token.NumericLiteral]="Numeric";TokenName[Token.Punctuator]="Punctuator";TokenName[Token.StringLiteral]="String";TokenName[Token.XJSIdentifier]="XJSIdentifier";TokenName[Token.XJSText]="XJSText";TokenName[Token.RegularExpression]="RegularExpression";FnExprTokens=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];Syntax={AnyTypeAnnotation:"AnyTypeAnnotation",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrayTypeAnnotation:"ArrayTypeAnnotation",ArrowFunctionExpression:"ArrowFunctionExpression",AssignmentExpression:"AssignmentExpression",BinaryExpression:"BinaryExpression",BlockStatement:"BlockStatement",BooleanTypeAnnotation:"BooleanTypeAnnotation",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ClassImplements:"ClassImplements",ClassProperty:"ClassProperty",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DeclareClass:"DeclareClass",DeclareFunction:"DeclareFunction",DeclareModule:"DeclareModule",DeclareVariable:"DeclareVariable",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportDeclaration:"ExportDeclaration",ExportBatchSpecifier:"ExportBatchSpecifier",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",ForStatement:"ForStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",FunctionTypeAnnotation:"FunctionTypeAnnotation",FunctionTypeParam:"FunctionTypeParam",GenericTypeAnnotation:"GenericTypeAnnotation",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",InterfaceDeclaration:"InterfaceDeclaration",InterfaceExtends:"InterfaceExtends",IntersectionTypeAnnotation:"IntersectionTypeAnnotation",LabeledStatement:"LabeledStatement",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",NullableTypeAnnotation:"NullableTypeAnnotation",NumberTypeAnnotation:"NumberTypeAnnotation",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",ObjectTypeAnnotation:"ObjectTypeAnnotation",ObjectTypeCallProperty:"ObjectTypeCallProperty",ObjectTypeIndexer:"ObjectTypeIndexer",ObjectTypeProperty:"ObjectTypeProperty",Program:"Program",Property:"Property",QualifiedTypeIdentifier:"QualifiedTypeIdentifier",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SpreadProperty:"SpreadProperty",StringLiteralTypeAnnotation:"StringLiteralTypeAnnotation",StringTypeAnnotation:"StringTypeAnnotation",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TupleTypeAnnotation:"TupleTypeAnnotation",TryStatement:"TryStatement",TypeAlias:"TypeAlias",TypeAnnotation:"TypeAnnotation",TypeofTypeAnnotation:"TypeofTypeAnnotation",TypeParameterDeclaration:"TypeParameterDeclaration",TypeParameterInstantiation:"TypeParameterInstantiation",UnaryExpression:"UnaryExpression",UnionTypeAnnotation:"UnionTypeAnnotation",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",VoidTypeAnnotation:"VoidTypeAnnotation",WhileStatement:"WhileStatement",WithStatement:"WithStatement",XJSIdentifier:"XJSIdentifier",XJSNamespacedName:"XJSNamespacedName",XJSMemberExpression:"XJSMemberExpression",XJSEmptyExpression:"XJSEmptyExpression",XJSExpressionContainer:"XJSExpressionContainer",XJSElement:"XJSElement",XJSClosingElement:"XJSClosingElement",XJSOpeningElement:"XJSOpeningElement",XJSAttribute:"XJSAttribute",XJSSpreadAttribute:"XJSSpreadAttribute",XJSText:"XJSText",YieldExpression:"YieldExpression",AwaitExpression:"AwaitExpression"};PropertyKind={Data:1,Get:2,Set:4};ClassPropertyType={"static":"static",prototype:"prototype"};Messages={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInFormalsList:"Invalid left-hand side in formals list",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalDuplicateClassProperty:"Illegal duplicate property in class definition",IllegalReturn:"Illegal return statement",IllegalSpread:"Illegal spread element",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",ParameterAfterRestParameter:"Rest parameter must be final parameter of an argument list",DefaultRestParameter:"Rest parameter can not have a default value",ElementAfterSpreadElement:"Spread must be the final element of an element list",PropertyAfterSpreadProperty:"A rest property must be the final property of an object literal",ObjectPatternAsRestParameter:"Invalid rest parameter",ObjectPatternAsSpread:"Invalid spread argument",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingFromClause:"Missing from clause",NoAsAfterImportNamespace:"Missing as after import *",InvalidModuleSpecifier:"Invalid module specifier",NoUnintializedConst:"Const must be initialized",ComprehensionRequiresBlock:"Comprehension must have at least one block",ComprehensionError:"Comprehension Error",EachNotAllowed:"Each is not supported",InvalidXJSAttributeValue:"XJS value should be either an expression or a quoted XJS text",ExpectedXJSClosingTag:"Expected corresponding XJS closing tag for %0",AdjacentXJSElements:"Adjacent XJS elements must be wrapped in an enclosing tag",ConfusedAboutFunctionType:"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType"};Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),LeadingZeros:new RegExp("^0+(?!$)")};function assert(condition,message){if(!condition){throw new Error("ASSERT: "+message)}}function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return"0123456789abcdefABCDEF".indexOf(ch)>=0}function isOctalDigit(ch){return"01234567".indexOf(ch)>=0}function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&" ᠎              ".indexOf(String.fromCharCode(ch))>0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function isFutureReservedWord(id){switch(id){case"class":case"enum":case"export":case"extends":case"import":case"super":return true;default:return false}}function isStrictModeReservedWord(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true;default:return false}}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isKeyword(id){if(strict&&isStrictModeReservedWord(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try"||id==="let";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function skipComment(){var ch,blockComment,lineComment;blockComment=false;lineComment=false;while(index<length){ch=source.charCodeAt(index);if(lineComment){++index;if(isLineTerminator(ch)){lineComment=false;if(ch===13&&source.charCodeAt(index)===10){++index}++lineNumber;lineStart=index}}else if(blockComment){if(isLineTerminator(ch)){if(ch===13){++index}if(ch!==13||source.charCodeAt(index)===10){++lineNumber;++index;lineStart=index;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}}else{ch=source.charCodeAt(index++);if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL") }if(ch===42){ch=source.charCodeAt(index);if(ch===47){++index;blockComment=false}}}}else if(ch===47){ch=source.charCodeAt(index+1);if(ch===47){index+=2;lineComment=true}else if(ch===42){index+=2;blockComment=true;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{break}}else if(isWhiteSpace(ch)){++index}else if(isLineTerminator(ch)){++index;if(ch===13&&source.charCodeAt(index)===10){++index}++lineNumber;lineStart=index}else{break}}}function scanHexEscape(prefix){var i,len,ch,code=0;len=prefix==="u"?4:2;for(i=0;i<len;++i){if(index<length&&isHexDigit(source[index])){ch=source[index++];code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}else{return""}}return String.fromCharCode(code)}function scanUnicodeCodePointEscape(){var ch,code,cu1,cu2;ch=source[index];code=0;if(ch==="}"){throwError({},Messages.UnexpectedToken,"ILLEGAL")}while(index<length){ch=source[index++];if(!isHexDigit(ch)){break}code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}if(code>1114111||ch!=="}"){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(code<=65535){return String.fromCharCode(code)}cu1=(code-65536>>10)+55296;cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function getEscapedIdentifier(){var ch,id;ch=source.charCodeAt(index++);id=String.fromCharCode(ch);if(ch===92){if(source.charCodeAt(index)!==117){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;ch=scanHexEscape("u");if(!ch||ch==="\\"||!isIdentifierStart(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}id=ch}while(index<length){ch=source.charCodeAt(index);if(!isIdentifierPart(ch)){break}++index;id+=String.fromCharCode(ch);if(ch===92){id=id.substr(0,id.length-1);if(source.charCodeAt(index)!==117){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;ch=scanHexEscape("u");if(!ch||ch==="\\"||!isIdentifierPart(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}id+=ch}}return id}function getIdentifier(){var start,ch;start=index++;while(index<length){ch=source.charCodeAt(index);if(ch===92){index=start;return getEscapedIdentifier()}if(isIdentifierPart(ch)){++index}else{break}}return source.slice(start,index)}function scanIdentifier(){var start,id,type;start=index;id=source.charCodeAt(index)===92?getEscapedIdentifier():getIdentifier();if(id.length===1){type=Token.Identifier}else if(isKeyword(id)){type=Token.Keyword}else if(id==="null"){type=Token.NullLiteral}else if(id==="true"||id==="false"){type=Token.BooleanLiteral}else{type=Token.Identifier}return{type:type,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanPunctuator(){var start=index,code=source.charCodeAt(index),code2,ch1=source[index],ch2,ch3,ch4;switch(code){case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:++index;if(extra.tokenize){if(code===40){extra.openParenToken=extra.tokens.length}else if(code===123){extra.openCurlyToken=extra.tokens.length}}return{type:Token.Punctuator,value:String.fromCharCode(code),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]};default:code2=source.charCodeAt(index+1);if(code2===61){switch(code){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:index+=2;return{type:Token.Punctuator,value:String.fromCharCode(code)+String.fromCharCode(code2),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]};case 33:case 61:index+=2;if(source.charCodeAt(index)===61){++index}return{type:Token.Punctuator,value:source.slice(start,index),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]};default:break}}break}ch2=source[index+1];ch3=source[index+2];ch4=source[index+3];if(ch1===">"&&ch2===">"&&ch3===">"){if(ch4==="="){index+=4;return{type:Token.Punctuator,value:">>>=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}}if(ch1===">"&&ch2===">"&&ch3===">"){index+=3;return{type:Token.Punctuator,value:">>>",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="<"&&ch2==="<"&&ch3==="="){index+=3;return{type:Token.Punctuator,value:"<<=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===">"&&ch2===">"&&ch3==="="){index+=3;return{type:Token.Punctuator,value:">>=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="."&&ch2==="."&&ch3==="."){index+=3;return{type:Token.Punctuator,value:"...",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===ch2&&"+-<>&|".indexOf(ch1)>=0&&!state.inType){index+=2;return{type:Token.Punctuator,value:ch1+ch2,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="="&&ch2===">"){index+=2;return{type:Token.Punctuator,value:"=>",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if("<>=!+-*%&|^/".indexOf(ch1)>=0){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="."){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}throwError({},Messages.UnexpectedToken,"ILLEGAL")}function scanHexLiteral(start){var number="";while(index<length){if(!isHexDigit(source[index])){break}number+=source[index++]}if(number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseInt("0x"+number,16),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanOctalLiteral(prefix,start){var number,octal;if(isOctalDigit(prefix)){octal=true;number="0"+source[index++]}else{octal=false;++index;number=""}while(index<length){if(!isOctalDigit(source[index])){break}number+=source[index++]}if(!octal&&number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(isIdentifierStart(source.charCodeAt(index))||isDecimalDigit(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseInt(number,8),octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanNumericLiteral(){var number,start,ch,octal;ch=source[index];assert(isDecimalDigit(ch.charCodeAt(0))||ch===".","Numeric literal must start with a decimal digit or a decimal point");start=index;number="";if(ch!=="."){number=source[index++];ch=source[index];if(number==="0"){if(ch==="x"||ch==="X"){++index;return scanHexLiteral(start)}if(ch==="b"||ch==="B"){++index;number="";while(index<length){ch=source[index];if(ch!=="0"&&ch!=="1"){break}number+=source[index++]}if(number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(index<length){ch=source.charCodeAt(index);if(isIdentifierStart(ch)||isDecimalDigit(ch)){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}return{type:Token.NumericLiteral,value:parseInt(number,2),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch==="o"||ch==="O"||isOctalDigit(ch)){return scanOctalLiteral(ch,start)}if(ch&&isDecimalDigit(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="."){number+=source[index++];while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="e"||ch==="E"){number+=source[index++];ch=source[index];if(ch==="+"||ch==="-"){number+=source[index++]}if(isDecimalDigit(source.charCodeAt(index))){while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}}else{throwError({},Messages.UnexpectedToken,"ILLEGAL")}}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseFloat(number),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanStringLiteral(){var str="",quote,start,ch,code,unescaped,restore,octal=false;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;while(index<length){ch=source[index++];if(ch===quote){quote="";break}else if(ch==="\\"){ch=source[index++];if(!ch||!isLineTerminator(ch.charCodeAt(0))){switch(ch){case"n":str+="\n";break;case"r":str+="\r";break;case"t":str+=" ";break;case"u":case"x":if(source[index]==="{"){++index;str+=scanUnicodeCodePointEscape()}else{restore=index;unescaped=scanHexEscape(ch);if(unescaped){str+=unescaped}else{index=restore;str+=ch}}break;case"b":str+="\b";break;case"f":str+="\f";break;case"v":str+=" ";break;default:if(isOctalDigit(ch)){code="01234567".indexOf(ch);if(code!==0){octal=true}if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+"01234567".indexOf(source[index++]);if("0123".indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+"01234567".indexOf(source[index++])}}str+=String.fromCharCode(code)}else{str+=ch}break}}else{++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index}}else if(isLineTerminator(ch.charCodeAt(0))){break}else{str+=ch}}if(quote!==""){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.StringLiteral,value:str,octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanTemplate(){var cooked="",ch,start,terminated,tail,restore,unescaped,code,octal;terminated=false;tail=false;start=index;++index;while(index<length){ch=source[index++];if(ch==="`"){tail=true;terminated=true;break}else if(ch==="$"){if(source[index]==="{"){++index;terminated=true;break}cooked+=ch}else if(ch==="\\"){ch=source[index++];if(!isLineTerminator(ch.charCodeAt(0))){switch(ch){case"n":cooked+="\n";break;case"r":cooked+="\r";break;case"t":cooked+=" ";break;case"u":case"x":if(source[index]==="{"){++index;cooked+=scanUnicodeCodePointEscape()}else{restore=index;unescaped=scanHexEscape(ch);if(unescaped){cooked+=unescaped}else{index=restore;cooked+=ch}}break;case"b":cooked+="\b";break;case"f":cooked+="\f";break;case"v":cooked+=" ";break;default:if(isOctalDigit(ch)){code="01234567".indexOf(ch);if(code!==0){octal=true}if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+"01234567".indexOf(source[index++]);if("0123".indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+"01234567".indexOf(source[index++])}}cooked+=String.fromCharCode(code)}else{cooked+=ch}break}}else{++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index}}else if(isLineTerminator(ch.charCodeAt(0))){++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index;cooked+="\n"}else{cooked+=ch}}if(!terminated){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.Template,value:{cooked:cooked,raw:source.slice(start+1,index-(tail?1:2))},tail:tail,octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanTemplateElement(option){var startsWith,template;lookahead=null;skipComment();startsWith=option.head?"`":"}";if(source[index]!==startsWith){throwError({},Messages.UnexpectedToken,"ILLEGAL")}template=scanTemplate();peek();return template}function scanRegExp(){var str,ch,start,pattern,flags,value,classMarker=false,restore,terminated=false,tmp;lookahead=null;skipComment();start=index;ch=source[index];assert(ch==="/","Regular expression literal must start with a slash");str=source[index++];while(index<length){ch=source[index++];str+=ch;if(classMarker){if(ch==="]"){classMarker=false}}else{if(ch==="\\"){ch=source[index++];if(isLineTerminator(ch.charCodeAt(0))){throwError({},Messages.UnterminatedRegExp)}str+=ch}else if(ch==="/"){terminated=true;break}else if(ch==="["){classMarker=true}else if(isLineTerminator(ch.charCodeAt(0))){throwError({},Messages.UnterminatedRegExp)}}}if(!terminated){throwError({},Messages.UnterminatedRegExp)}pattern=str.substr(1,str.length-2);flags="";while(index<length){ch=source[index];if(!isIdentifierPart(ch.charCodeAt(0))){break}++index;if(ch==="\\"&&index<length){ch=source[index];if(ch==="u"){++index;restore=index;ch=scanHexEscape("u");if(ch){flags+=ch;for(str+="\\u";restore<index;++restore){str+=source[restore]}}else{index=restore;flags+="u";str+="\\u"}}else{str+="\\"}}else{flags+=ch;str+=ch}}tmp=pattern;if(flags.indexOf("u")>=0){tmp=tmp.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{value=new RegExp(tmp)}catch(e){throwError({},Messages.InvalidRegExp)}try{value=new RegExp(pattern,flags)}catch(exception){value=null}peek();if(extra.tokenize){return{type:Token.RegularExpression,value:value,regex:{pattern:pattern,flags:flags},lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}return{literal:str,value:value,regex:{pattern:pattern,flags:flags},range:[start,index]}}function isIdentifierName(token){return token.type===Token.Identifier||token.type===Token.Keyword||token.type===Token.BooleanLiteral||token.type===Token.NullLiteral}function advanceSlash(){var prevToken,checkToken;prevToken=extra.tokens[extra.tokens.length-1];if(!prevToken){return scanRegExp()}if(prevToken.type==="Punctuator"){if(prevToken.value===")"){checkToken=extra.tokens[extra.openParenToken-1];if(checkToken&&checkToken.type==="Keyword"&&(checkToken.value==="if"||checkToken.value==="while"||checkToken.value==="for"||checkToken.value==="with")){return scanRegExp()}return scanPunctuator()}if(prevToken.value==="}"){if(extra.tokens[extra.openCurlyToken-3]&&extra.tokens[extra.openCurlyToken-3].type==="Keyword"){checkToken=extra.tokens[extra.openCurlyToken-4];if(!checkToken){return scanPunctuator()}}else if(extra.tokens[extra.openCurlyToken-4]&&extra.tokens[extra.openCurlyToken-4].type==="Keyword"){checkToken=extra.tokens[extra.openCurlyToken-5];if(!checkToken){return scanRegExp()}}else{return scanPunctuator()}if(FnExprTokens.indexOf(checkToken.value)>=0){return scanPunctuator()}return scanRegExp()}return scanRegExp()}if(prevToken.type==="Keyword"){return scanRegExp()}return scanPunctuator()}function advance(){var ch;if(!state.inXJSChild){skipComment()}if(index>=length){return{type:Token.EOF,lineNumber:lineNumber,lineStart:lineStart,range:[index,index]}}if(state.inXJSChild){return advanceXJSChild()}ch=source.charCodeAt(index);if(ch===40||ch===41||ch===58){return scanPunctuator()}if(ch===39||ch===34){if(state.inXJSTag){return scanXJSStringLiteral()}return scanStringLiteral()}if(state.inXJSTag&&isXJSIdentifierStart(ch)){return scanXJSIdentifier()}if(ch===96){return scanTemplate()}if(isIdentifierStart(ch)){return scanIdentifier()}if(ch===46){if(isDecimalDigit(source.charCodeAt(index+1))){return scanNumericLiteral()}return scanPunctuator()}if(isDecimalDigit(ch)){return scanNumericLiteral()}if(extra.tokenize&&ch===47){return advanceSlash()}return scanPunctuator()}function lex(){var token;token=lookahead;index=token.range[1];lineNumber=token.lineNumber;lineStart=token.lineStart;lookahead=advance();index=token.range[1];lineNumber=token.lineNumber;lineStart=token.lineStart;return token}function peek(){var pos,line,start;pos=index;line=lineNumber;start=lineStart;lookahead=advance();index=pos;lineNumber=line;lineStart=start}function lookahead2(){var adv,pos,line,start,result;adv=typeof extra.advance==="function"?extra.advance:advance;pos=index;line=lineNumber;start=lineStart;if(lookahead===null){lookahead=adv()}index=lookahead.range[1];lineNumber=lookahead.lineNumber;lineStart=lookahead.lineStart;result=adv();index=pos;lineNumber=line;lineStart=start;return result}function rewind(token){index=token.range[0];lineNumber=token.lineNumber;lineStart=token.lineStart;lookahead=token}function markerCreate(){if(!extra.loc&&!extra.range){return undefined}skipComment();return{offset:index,line:lineNumber,col:index-lineStart}}function markerCreatePreserveWhitespace(){if(!extra.loc&&!extra.range){return undefined}return{offset:index,line:lineNumber,col:index-lineStart}}function processComment(node){var lastChild,trailingComments,bottomRight=extra.bottomRightStack,last=bottomRight[bottomRight.length-1];if(node.type===Syntax.Program){if(node.body.length>0){return}}if(extra.trailingComments.length>0){if(extra.trailingComments[0].range[0]>=node.range[1]){trailingComments=extra.trailingComments;extra.trailingComments=[]}else{extra.trailingComments.length=0}}else{if(last&&last.trailingComments&&last.trailingComments[0].range[0]>=node.range[1]){trailingComments=last.trailingComments;delete last.trailingComments}}if(last){while(last&&last.range[0]>=node.range[0]){lastChild=last;last=bottomRight.pop()}}if(lastChild){if(lastChild.leadingComments&&lastChild.leadingComments[lastChild.leadingComments.length-1].range[1]<=node.range[0]){node.leadingComments=lastChild.leadingComments;delete lastChild.leadingComments}}else if(extra.leadingComments.length>0&&extra.leadingComments[extra.leadingComments.length-1].range[1]<=node.range[0]){node.leadingComments=extra.leadingComments;extra.leadingComments=[]}if(trailingComments){node.trailingComments=trailingComments}bottomRight.push(node)}function markerApply(marker,node){if(extra.range){node.range=[marker.offset,index]}if(extra.loc){node.loc={start:{line:marker.line,column:marker.col},end:{line:lineNumber,column:index-lineStart}};node=delegate.postProcess(node)}if(extra.attachComment){processComment(node)}return node}SyntaxTreeDelegate={name:"SyntaxTree",postProcess:function(node){return node},createArrayExpression:function(elements){return{type:Syntax.ArrayExpression,elements:elements}},createAssignmentExpression:function(operator,left,right){return{type:Syntax.AssignmentExpression,operator:operator,left:left,right:right}},createBinaryExpression:function(operator,left,right){var type=operator==="||"||operator==="&&"?Syntax.LogicalExpression:Syntax.BinaryExpression;return{type:type,operator:operator,left:left,right:right}},createBlockStatement:function(body){return{type:Syntax.BlockStatement,body:body}},createBreakStatement:function(label){return{type:Syntax.BreakStatement,label:label}},createCallExpression:function(callee,args){return{type:Syntax.CallExpression,callee:callee,arguments:args}},createCatchClause:function(param,body){return{type:Syntax.CatchClause,param:param,body:body}},createConditionalExpression:function(test,consequent,alternate){return{type:Syntax.ConditionalExpression,test:test,consequent:consequent,alternate:alternate}},createContinueStatement:function(label){return{type:Syntax.ContinueStatement,label:label}},createDebuggerStatement:function(){return{type:Syntax.DebuggerStatement}},createDoWhileStatement:function(body,test){return{type:Syntax.DoWhileStatement,body:body,test:test}},createEmptyStatement:function(){return{type:Syntax.EmptyStatement}},createExpressionStatement:function(expression){return{type:Syntax.ExpressionStatement,expression:expression}},createForStatement:function(init,test,update,body){return{type:Syntax.ForStatement,init:init,test:test,update:update,body:body}},createForInStatement:function(left,right,body){return{type:Syntax.ForInStatement,left:left,right:right,body:body,each:false}},createForOfStatement:function(left,right,body){return{type:Syntax.ForOfStatement,left:left,right:right,body:body}},createFunctionDeclaration:function(id,params,defaults,body,rest,generator,expression,isAsync,returnType,typeParameters){var funDecl={type:Syntax.FunctionDeclaration,id:id,params:params,defaults:defaults,body:body,rest:rest,generator:generator,expression:expression,returnType:returnType,typeParameters:typeParameters};if(isAsync){funDecl.async=true}return funDecl},createFunctionExpression:function(id,params,defaults,body,rest,generator,expression,isAsync,returnType,typeParameters){var funExpr={type:Syntax.FunctionExpression,id:id,params:params,defaults:defaults,body:body,rest:rest,generator:generator,expression:expression,returnType:returnType,typeParameters:typeParameters};if(isAsync){funExpr.async=true}return funExpr},createIdentifier:function(name){return{type:Syntax.Identifier,name:name,typeAnnotation:undefined,optional:undefined}},createTypeAnnotation:function(typeAnnotation){return{type:Syntax.TypeAnnotation,typeAnnotation:typeAnnotation}},createFunctionTypeAnnotation:function(params,returnType,rest,typeParameters){return{type:Syntax.FunctionTypeAnnotation,params:params,returnType:returnType,rest:rest,typeParameters:typeParameters}},createFunctionTypeParam:function(name,typeAnnotation,optional){return{type:Syntax.FunctionTypeParam,name:name,typeAnnotation:typeAnnotation,optional:optional}},createNullableTypeAnnotation:function(typeAnnotation){return{type:Syntax.NullableTypeAnnotation,typeAnnotation:typeAnnotation}},createArrayTypeAnnotation:function(elementType){return{type:Syntax.ArrayTypeAnnotation,elementType:elementType}},createGenericTypeAnnotation:function(id,typeParameters){return{type:Syntax.GenericTypeAnnotation,id:id,typeParameters:typeParameters}},createQualifiedTypeIdentifier:function(qualification,id){return{type:Syntax.QualifiedTypeIdentifier,qualification:qualification,id:id}},createTypeParameterDeclaration:function(params){return{type:Syntax.TypeParameterDeclaration,params:params}},createTypeParameterInstantiation:function(params){return{type:Syntax.TypeParameterInstantiation,params:params}},createAnyTypeAnnotation:function(){return{type:Syntax.AnyTypeAnnotation}},createBooleanTypeAnnotation:function(){return{type:Syntax.BooleanTypeAnnotation}},createNumberTypeAnnotation:function(){return{type:Syntax.NumberTypeAnnotation}},createStringTypeAnnotation:function(){return{type:Syntax.StringTypeAnnotation}},createStringLiteralTypeAnnotation:function(token){return{type:Syntax.StringLiteralTypeAnnotation,value:token.value,raw:source.slice(token.range[0],token.range[1])}},createVoidTypeAnnotation:function(){return{type:Syntax.VoidTypeAnnotation}},createTypeofTypeAnnotation:function(argument){return{type:Syntax.TypeofTypeAnnotation,argument:argument}},createTupleTypeAnnotation:function(types){return{type:Syntax.TupleTypeAnnotation,types:types}},createObjectTypeAnnotation:function(properties,indexers,callProperties){return{type:Syntax.ObjectTypeAnnotation,properties:properties,indexers:indexers,callProperties:callProperties}},createObjectTypeIndexer:function(id,key,value,isStatic){return{type:Syntax.ObjectTypeIndexer,id:id,key:key,value:value,"static":isStatic}},createObjectTypeCallProperty:function(value,isStatic){return{type:Syntax.ObjectTypeCallProperty,value:value,"static":isStatic}},createObjectTypeProperty:function(key,value,optional,isStatic){return{type:Syntax.ObjectTypeProperty,key:key,value:value,optional:optional,"static":isStatic}},createUnionTypeAnnotation:function(types){return{type:Syntax.UnionTypeAnnotation,types:types}},createIntersectionTypeAnnotation:function(types){return{type:Syntax.IntersectionTypeAnnotation,types:types}},createTypeAlias:function(id,typeParameters,right){return{type:Syntax.TypeAlias,id:id,typeParameters:typeParameters,right:right}},createInterface:function(id,typeParameters,body,extended){return{type:Syntax.InterfaceDeclaration,id:id,typeParameters:typeParameters,body:body,"extends":extended}},createInterfaceExtends:function(id,typeParameters){return{type:Syntax.InterfaceExtends,id:id,typeParameters:typeParameters}},createDeclareFunction:function(id){return{type:Syntax.DeclareFunction,id:id}},createDeclareVariable:function(id){return{type:Syntax.DeclareVariable,id:id}},createDeclareModule:function(id,body){return{type:Syntax.DeclareModule,id:id,body:body}},createXJSAttribute:function(name,value){return{type:Syntax.XJSAttribute,name:name,value:value||null}},createXJSSpreadAttribute:function(argument){return{type:Syntax.XJSSpreadAttribute,argument:argument}},createXJSIdentifier:function(name){return{type:Syntax.XJSIdentifier,name:name}},createXJSNamespacedName:function(namespace,name){return{type:Syntax.XJSNamespacedName,namespace:namespace,name:name}},createXJSMemberExpression:function(object,property){return{type:Syntax.XJSMemberExpression,object:object,property:property}},createXJSElement:function(openingElement,closingElement,children){return{type:Syntax.XJSElement,openingElement:openingElement,closingElement:closingElement,children:children}},createXJSEmptyExpression:function(){return{type:Syntax.XJSEmptyExpression}},createXJSExpressionContainer:function(expression){return{type:Syntax.XJSExpressionContainer,expression:expression}},createXJSOpeningElement:function(name,attributes,selfClosing){return{type:Syntax.XJSOpeningElement,name:name,selfClosing:selfClosing,attributes:attributes}},createXJSClosingElement:function(name){return{type:Syntax.XJSClosingElement,name:name}},createIfStatement:function(test,consequent,alternate){return{type:Syntax.IfStatement,test:test,consequent:consequent,alternate:alternate}},createLabeledStatement:function(label,body){return{type:Syntax.LabeledStatement,label:label,body:body}},createLiteral:function(token){var object={type:Syntax.Literal,value:token.value,raw:source.slice(token.range[0],token.range[1])};if(token.regex){object.regex=token.regex}return object},createMemberExpression:function(accessor,object,property){return{type:Syntax.MemberExpression,computed:accessor==="[",object:object,property:property}},createNewExpression:function(callee,args){return{type:Syntax.NewExpression,callee:callee,arguments:args}},createObjectExpression:function(properties){return{type:Syntax.ObjectExpression,properties:properties}},createPostfixExpression:function(operator,argument){return{type:Syntax.UpdateExpression,operator:operator,argument:argument,prefix:false}},createProgram:function(body){return{type:Syntax.Program,body:body}},createProperty:function(kind,key,value,method,shorthand,computed){return{type:Syntax.Property,key:key,value:value,kind:kind,method:method,shorthand:shorthand,computed:computed}},createReturnStatement:function(argument){return{type:Syntax.ReturnStatement,argument:argument}},createSequenceExpression:function(expressions){return{type:Syntax.SequenceExpression,expressions:expressions}},createSwitchCase:function(test,consequent){return{type:Syntax.SwitchCase,test:test,consequent:consequent}},createSwitchStatement:function(discriminant,cases){return{type:Syntax.SwitchStatement,discriminant:discriminant,cases:cases}},createThisExpression:function(){return{type:Syntax.ThisExpression}},createThrowStatement:function(argument){return{type:Syntax.ThrowStatement,argument:argument}},createTryStatement:function(block,guardedHandlers,handlers,finalizer){return{type:Syntax.TryStatement,block:block,guardedHandlers:guardedHandlers,handlers:handlers,finalizer:finalizer}},createUnaryExpression:function(operator,argument){if(operator==="++"||operator==="--"){return{type:Syntax.UpdateExpression,operator:operator,argument:argument,prefix:true}}return{type:Syntax.UnaryExpression,operator:operator,argument:argument,prefix:true}},createVariableDeclaration:function(declarations,kind){return{type:Syntax.VariableDeclaration,declarations:declarations,kind:kind}},createVariableDeclarator:function(id,init){return{type:Syntax.VariableDeclarator,id:id,init:init}},createWhileStatement:function(test,body){return{type:Syntax.WhileStatement,test:test,body:body}},createWithStatement:function(object,body){return{type:Syntax.WithStatement,object:object,body:body}},createTemplateElement:function(value,tail){return{type:Syntax.TemplateElement,value:value,tail:tail}},createTemplateLiteral:function(quasis,expressions){return{type:Syntax.TemplateLiteral,quasis:quasis,expressions:expressions}},createSpreadElement:function(argument){return{type:Syntax.SpreadElement,argument:argument}},createSpreadProperty:function(argument){return{type:Syntax.SpreadProperty,argument:argument}},createTaggedTemplateExpression:function(tag,quasi){return{type:Syntax.TaggedTemplateExpression,tag:tag,quasi:quasi}},createArrowFunctionExpression:function(params,defaults,body,rest,expression,isAsync){var arrowExpr={type:Syntax.ArrowFunctionExpression,id:null,params:params,defaults:defaults,body:body,rest:rest,generator:false,expression:expression};if(isAsync){arrowExpr.async=true}return arrowExpr},createMethodDefinition:function(propertyType,kind,key,value){return{type:Syntax.MethodDefinition,key:key,value:value,kind:kind,"static":propertyType===ClassPropertyType.static}},createClassProperty:function(key,typeAnnotation,computed,isStatic){return{type:Syntax.ClassProperty,key:key,typeAnnotation:typeAnnotation,computed:computed,"static":isStatic}},createClassBody:function(body){return{type:Syntax.ClassBody,body:body}},createClassImplements:function(id,typeParameters){return{type:Syntax.ClassImplements,id:id,typeParameters:typeParameters}},createClassExpression:function(id,superClass,body,typeParameters,superTypeParameters,implemented){return{type:Syntax.ClassExpression,id:id,superClass:superClass,body:body,typeParameters:typeParameters,superTypeParameters:superTypeParameters,"implements":implemented}},createClassDeclaration:function(id,superClass,body,typeParameters,superTypeParameters,implemented){return{type:Syntax.ClassDeclaration,id:id,superClass:superClass,body:body,typeParameters:typeParameters,superTypeParameters:superTypeParameters,"implements":implemented}},createModuleSpecifier:function(token){return{type:Syntax.ModuleSpecifier,value:token.value,raw:source.slice(token.range[0],token.range[1])}},createExportSpecifier:function(id,name){return{type:Syntax.ExportSpecifier,id:id,name:name}},createExportBatchSpecifier:function(){return{type:Syntax.ExportBatchSpecifier}},createImportDefaultSpecifier:function(id){return{type:Syntax.ImportDefaultSpecifier,id:id}},createImportNamespaceSpecifier:function(id){return{type:Syntax.ImportNamespaceSpecifier,id:id}},createExportDeclaration:function(isDefault,declaration,specifiers,source){return{type:Syntax.ExportDeclaration,"default":!!isDefault,declaration:declaration,specifiers:specifiers,source:source}},createImportSpecifier:function(id,name){return{type:Syntax.ImportSpecifier,id:id,name:name}},createImportDeclaration:function(specifiers,source){return{type:Syntax.ImportDeclaration,specifiers:specifiers,source:source}},createYieldExpression:function(argument,delegate){return{type:Syntax.YieldExpression,argument:argument,delegate:delegate}},createAwaitExpression:function(argument){return{type:Syntax.AwaitExpression,argument:argument}},createComprehensionExpression:function(filter,blocks,body){return{type:Syntax.ComprehensionExpression,filter:filter,blocks:blocks,body:body}}};function peekLineTerminator(){var pos,line,start,found;pos=index;line=lineNumber;start=lineStart;skipComment();found=lineNumber!==line;index=pos;lineNumber=line;lineStart=start;return found}function throwError(token,messageFormat){var error,args=Array.prototype.slice.call(arguments,2),msg=messageFormat.replace(/%(\d)/g,function(whole,index){assert(index<args.length,"Message reference must be in range");return args[index]});if(typeof token.lineNumber==="number"){error=new Error("Line "+token.lineNumber+": "+msg);error.index=token.range[0];error.lineNumber=token.lineNumber;error.column=token.range[0]-lineStart+1}else{error=new Error("Line "+lineNumber+": "+msg);error.index=index;error.lineNumber=lineNumber;error.column=index-lineStart+1}error.description=msg;throw error}function throwErrorTolerant(){try{throwError.apply(null,arguments)}catch(e){if(extra.errors){extra.errors.push(e)}else{throw e}}}function throwUnexpected(token){if(token.type===Token.EOF){throwError(token,Messages.UnexpectedEOS)}if(token.type===Token.NumericLiteral){throwError(token,Messages.UnexpectedNumber)}if(token.type===Token.StringLiteral||token.type===Token.XJSText){throwError(token,Messages.UnexpectedString)}if(token.type===Token.Identifier){throwError(token,Messages.UnexpectedIdentifier)}if(token.type===Token.Keyword){if(isFutureReservedWord(token.value)){throwError(token,Messages.UnexpectedReserved)}else if(strict&&isStrictModeReservedWord(token.value)){throwErrorTolerant(token,Messages.StrictReservedWord);return}throwError(token,Messages.UnexpectedToken,token.value)}if(token.type===Token.Template){throwError(token,Messages.UnexpectedTemplate,token.value.raw)}throwError(token,Messages.UnexpectedToken,token.value)}function expect(value){var token=lex();if(token.type!==Token.Punctuator||token.value!==value){throwUnexpected(token) }}function expectKeyword(keyword,contextual){var token=lex();if(token.type!==(contextual?Token.Identifier:Token.Keyword)||token.value!==keyword){throwUnexpected(token)}}function expectContextualKeyword(keyword){return expectKeyword(keyword,true)}function match(value){return lookahead.type===Token.Punctuator&&lookahead.value===value}function matchKeyword(keyword,contextual){var expectedType=contextual?Token.Identifier:Token.Keyword;return lookahead.type===expectedType&&lookahead.value===keyword}function matchContextualKeyword(keyword){return matchKeyword(keyword,true)}function matchAssign(){var op;if(lookahead.type!==Token.Punctuator){return false}op=lookahead.value;return op==="="||op==="*="||op==="/="||op==="%="||op==="+="||op==="-="||op==="<<="||op===">>="||op===">>>="||op==="&="||op==="^="||op==="|="}function matchYield(){return state.yieldAllowed&&matchKeyword("yield",!strict)}function matchAsync(){var backtrackToken=lookahead,matches=false;if(matchContextualKeyword("async")){lex();matches=!peekLineTerminator();rewind(backtrackToken)}return matches}function matchAwait(){return state.awaitAllowed&&matchContextualKeyword("await")}function consumeSemicolon(){var line,oldIndex=index,oldLineNumber=lineNumber,oldLineStart=lineStart,oldLookahead=lookahead;if(source.charCodeAt(index)===59){lex();return}line=lineNumber;skipComment();if(lineNumber!==line){index=oldIndex;lineNumber=oldLineNumber;lineStart=oldLineStart;lookahead=oldLookahead;return}if(match(";")){lex();return}if(lookahead.type!==Token.EOF&&!match("}")){throwUnexpected(lookahead)}}function isLeftHandSide(expr){return expr.type===Syntax.Identifier||expr.type===Syntax.MemberExpression}function isAssignableLeftHandSide(expr){return isLeftHandSide(expr)||expr.type===Syntax.ObjectPattern||expr.type===Syntax.ArrayPattern}function parseArrayInitialiser(){var elements=[],blocks=[],filter=null,tmp,possiblecomprehension=true,body,marker=markerCreate();expect("[");while(!match("]")){if(lookahead.value==="for"&&lookahead.type===Token.Keyword){if(!possiblecomprehension){throwError({},Messages.ComprehensionError)}matchKeyword("for");tmp=parseForStatement({ignoreBody:true});tmp.of=tmp.type===Syntax.ForOfStatement;tmp.type=Syntax.ComprehensionBlock;if(tmp.left.kind){throwError({},Messages.ComprehensionError)}blocks.push(tmp)}else if(lookahead.value==="if"&&lookahead.type===Token.Keyword){if(!possiblecomprehension){throwError({},Messages.ComprehensionError)}expectKeyword("if");expect("(");filter=parseExpression();expect(")")}else if(lookahead.value===","&&lookahead.type===Token.Punctuator){possiblecomprehension=false;lex();elements.push(null)}else{tmp=parseSpreadOrAssignmentExpression();elements.push(tmp);if(tmp&&tmp.type===Syntax.SpreadElement){if(!match("]")){throwError({},Messages.ElementAfterSpreadElement)}}else if(!(match("]")||matchKeyword("for")||matchKeyword("if"))){expect(",");possiblecomprehension=false}}}expect("]");if(filter&&!blocks.length){throwError({},Messages.ComprehensionRequiresBlock)}if(blocks.length){if(elements.length!==1){throwError({},Messages.ComprehensionError)}return markerApply(marker,delegate.createComprehensionExpression(filter,blocks,elements[0]))}return markerApply(marker,delegate.createArrayExpression(elements))}function parsePropertyFunction(options){var previousStrict,previousYieldAllowed,previousAwaitAllowed,params,defaults,body,marker=markerCreate();previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=options.generator;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=options.async;params=options.params||[];defaults=options.defaults||[];body=parseConciseBody();if(options.name&&strict&&isRestrictedWord(params[0].name)){throwErrorTolerant(options.name,Messages.StrictParamName)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createFunctionExpression(null,params,defaults,body,options.rest||null,options.generator,body.type!==Syntax.BlockStatement,options.async,options.returnType,options.typeParameters))}function parsePropertyMethodFunction(options){var previousStrict,tmp,method;previousStrict=strict;strict=true;tmp=parseParams();if(tmp.stricted){throwErrorTolerant(tmp.stricted,tmp.message)}method=parsePropertyFunction({params:tmp.params,defaults:tmp.defaults,rest:tmp.rest,generator:options.generator,async:options.async,returnType:tmp.returnType,typeParameters:options.typeParameters});strict=previousStrict;return method}function parseObjectPropertyKey(){var marker=markerCreate(),token=lex(),propertyKey,result;if(token.type===Token.StringLiteral||token.type===Token.NumericLiteral){if(strict&&token.octal){throwErrorTolerant(token,Messages.StrictOctalLiteral)}return markerApply(marker,delegate.createLiteral(token))}if(token.type===Token.Punctuator&&token.value==="["){marker=markerCreate();propertyKey=parseAssignmentExpression();result=markerApply(marker,propertyKey);expect("]");return result}return markerApply(marker,delegate.createIdentifier(token.value))}function parseObjectProperty(){var token,key,id,value,param,expr,computed,marker=markerCreate(),returnType;token=lookahead;computed=token.value==="[";if(token.type===Token.Identifier||computed||matchAsync()){id=parseObjectPropertyKey();if(match(":")){lex();return markerApply(marker,delegate.createProperty("init",id,parseAssignmentExpression(),false,false,computed))}if(match("(")){return markerApply(marker,delegate.createProperty("init",id,parsePropertyMethodFunction({generator:false,async:false}),true,false,computed))}if(token.value==="get"){computed=lookahead.value==="[";key=parseObjectPropertyKey();expect("(");expect(")");if(match(":")){returnType=parseTypeAnnotation()}return markerApply(marker,delegate.createProperty("get",key,parsePropertyFunction({generator:false,async:false,returnType:returnType}),false,false,computed))}if(token.value==="set"){computed=lookahead.value==="[";key=parseObjectPropertyKey();expect("(");token=lookahead;param=[parseTypeAnnotatableIdentifier()];expect(")");if(match(":")){returnType=parseTypeAnnotation()}return markerApply(marker,delegate.createProperty("set",key,parsePropertyFunction({params:param,generator:false,async:false,name:token,returnType:returnType}),false,false,computed))}if(token.value==="async"){computed=lookahead.value==="[";key=parseObjectPropertyKey();return markerApply(marker,delegate.createProperty("init",key,parsePropertyMethodFunction({generator:false,async:true}),true,false,computed))}if(computed){throwUnexpected(lookahead)}return markerApply(marker,delegate.createProperty("init",id,id,false,true,false))}if(token.type===Token.EOF||token.type===Token.Punctuator){if(!match("*")){throwUnexpected(token)}lex();computed=lookahead.type===Token.Punctuator&&lookahead.value==="[";id=parseObjectPropertyKey();if(!match("(")){throwUnexpected(lex())}return markerApply(marker,delegate.createProperty("init",id,parsePropertyMethodFunction({generator:true}),true,false,computed))}key=parseObjectPropertyKey();if(match(":")){lex();return markerApply(marker,delegate.createProperty("init",key,parseAssignmentExpression(),false,false,false))}if(match("(")){return markerApply(marker,delegate.createProperty("init",key,parsePropertyMethodFunction({generator:false}),true,false,false))}throwUnexpected(lex())}function parseObjectSpreadProperty(){var marker=markerCreate();expect("...");return markerApply(marker,delegate.createSpreadProperty(parseAssignmentExpression()))}function parseObjectInitialiser(){var properties=[],property,name,key,kind,map={},toString=String,marker=markerCreate();expect("{");while(!match("}")){if(match("...")){property=parseObjectSpreadProperty()}else{property=parseObjectProperty();if(property.key.type===Syntax.Identifier){name=property.key.name}else{name=toString(property.key.value)}kind=property.kind==="init"?PropertyKind.Data:property.kind==="get"?PropertyKind.Get:PropertyKind.Set;key="$"+name;if(Object.prototype.hasOwnProperty.call(map,key)){if(map[key]===PropertyKind.Data){if(strict&&kind===PropertyKind.Data){throwErrorTolerant({},Messages.StrictDuplicateProperty)}else if(kind!==PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}}else{if(kind===PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}else if(map[key]&kind){throwErrorTolerant({},Messages.AccessorGetSet)}}map[key]|=kind}else{map[key]=kind}}properties.push(property);if(!match("}")){expect(",")}}expect("}");return markerApply(marker,delegate.createObjectExpression(properties))}function parseTemplateElement(option){var marker=markerCreate(),token=scanTemplateElement(option);if(strict&&token.octal){throwError(token,Messages.StrictOctalLiteral)}return markerApply(marker,delegate.createTemplateElement({raw:token.value.raw,cooked:token.value.cooked},token.tail))}function parseTemplateLiteral(){var quasi,quasis,expressions,marker=markerCreate();quasi=parseTemplateElement({head:true});quasis=[quasi];expressions=[];while(!quasi.tail){expressions.push(parseExpression());quasi=parseTemplateElement({head:false});quasis.push(quasi)}return markerApply(marker,delegate.createTemplateLiteral(quasis,expressions))}function parseGroupExpression(){var expr;expect("(");++state.parenthesizedCount;expr=parseExpression();expect(")");return expr}function matchAsyncFuncExprOrDecl(){var token;if(matchAsync()){token=lookahead2();if(token.type===Token.Keyword&&token.value==="function"){return true}}return false}function parsePrimaryExpression(){var marker,type,token,expr;type=lookahead.type;if(type===Token.Identifier){marker=markerCreate();return markerApply(marker,delegate.createIdentifier(lex().value))}if(type===Token.StringLiteral||type===Token.NumericLiteral){if(strict&&lookahead.octal){throwErrorTolerant(lookahead,Messages.StrictOctalLiteral)}marker=markerCreate();return markerApply(marker,delegate.createLiteral(lex()))}if(type===Token.Keyword){if(matchKeyword("this")){marker=markerCreate();lex();return markerApply(marker,delegate.createThisExpression())}if(matchKeyword("function")){return parseFunctionExpression()}if(matchKeyword("class")){return parseClassExpression()}if(matchKeyword("super")){marker=markerCreate();lex();return markerApply(marker,delegate.createIdentifier("super"))}}if(type===Token.BooleanLiteral){marker=markerCreate();token=lex();token.value=token.value==="true";return markerApply(marker,delegate.createLiteral(token))}if(type===Token.NullLiteral){marker=markerCreate();token=lex();token.value=null;return markerApply(marker,delegate.createLiteral(token))}if(match("[")){return parseArrayInitialiser()}if(match("{")){return parseObjectInitialiser()}if(match("(")){return parseGroupExpression()}if(match("/")||match("/=")){marker=markerCreate();return markerApply(marker,delegate.createLiteral(scanRegExp()))}if(type===Token.Template){return parseTemplateLiteral()}if(match("<")){return parseXJSElement()}throwUnexpected(lex())}function parseArguments(){var args=[],arg;expect("(");if(!match(")")){while(index<length){arg=parseSpreadOrAssignmentExpression();args.push(arg);if(match(")")){break}else if(arg.type===Syntax.SpreadElement){throwError({},Messages.ElementAfterSpreadElement)}expect(",")}}expect(")");return args}function parseSpreadOrAssignmentExpression(){if(match("...")){var marker=markerCreate();lex();return markerApply(marker,delegate.createSpreadElement(parseAssignmentExpression()))}return parseAssignmentExpression()}function parseNonComputedProperty(){var marker=markerCreate(),token=lex();if(!isIdentifierName(token)){throwUnexpected(token)}return markerApply(marker,delegate.createIdentifier(token.value))}function parseNonComputedMember(){expect(".");return parseNonComputedProperty()}function parseComputedMember(){var expr;expect("[");expr=parseExpression();expect("]");return expr}function parseNewExpression(){var callee,args,marker=markerCreate();expectKeyword("new");callee=parseLeftHandSideExpression();args=match("(")?parseArguments():[];return markerApply(marker,delegate.createNewExpression(callee,args))}function parseLeftHandSideExpressionAllowCall(){var expr,args,marker=markerCreate();expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")||match("(")||lookahead.type===Token.Template){if(match("(")){args=parseArguments();expr=markerApply(marker,delegate.createCallExpression(expr,args))}else if(match("[")){expr=markerApply(marker,delegate.createMemberExpression("[",expr,parseComputedMember()))}else if(match(".")){expr=markerApply(marker,delegate.createMemberExpression(".",expr,parseNonComputedMember()))}else{expr=markerApply(marker,delegate.createTaggedTemplateExpression(expr,parseTemplateLiteral()))}}return expr}function parseLeftHandSideExpression(){var expr,marker=markerCreate();expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")||lookahead.type===Token.Template){if(match("[")){expr=markerApply(marker,delegate.createMemberExpression("[",expr,parseComputedMember()))}else if(match(".")){expr=markerApply(marker,delegate.createMemberExpression(".",expr,parseNonComputedMember()))}else{expr=markerApply(marker,delegate.createTaggedTemplateExpression(expr,parseTemplateLiteral()))}}return expr}function parsePostfixExpression(){var marker=markerCreate(),expr=parseLeftHandSideExpressionAllowCall(),token;if(lookahead.type!==Token.Punctuator){return expr}if((match("++")||match("--"))&&!peekLineTerminator()){if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant({},Messages.StrictLHSPostfix)}if(!isLeftHandSide(expr)){throwError({},Messages.InvalidLHSInAssignment)}token=lex();expr=markerApply(marker,delegate.createPostfixExpression(token.value,expr))}return expr}function parseUnaryExpression(){var marker,token,expr;if(lookahead.type!==Token.Punctuator&&lookahead.type!==Token.Keyword){return parsePostfixExpression()}if(match("++")||match("--")){marker=markerCreate();token=lex();expr=parseUnaryExpression();if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant({},Messages.StrictLHSPrefix)}if(!isLeftHandSide(expr)){throwError({},Messages.InvalidLHSInAssignment)}return markerApply(marker,delegate.createUnaryExpression(token.value,expr))}if(match("+")||match("-")||match("~")||match("!")){marker=markerCreate();token=lex();expr=parseUnaryExpression();return markerApply(marker,delegate.createUnaryExpression(token.value,expr))}if(matchKeyword("delete")||matchKeyword("void")||matchKeyword("typeof")){marker=markerCreate();token=lex();expr=parseUnaryExpression();expr=markerApply(marker,delegate.createUnaryExpression(token.value,expr));if(strict&&expr.operator==="delete"&&expr.argument.type===Syntax.Identifier){throwErrorTolerant({},Messages.StrictDelete)}return expr}return parsePostfixExpression()}function binaryPrecedence(token,allowIn){var prec=0;if(token.type!==Token.Punctuator&&token.type!==Token.Keyword){return 0}switch(token.value){case"||":prec=1;break;case"&&":prec=2;break;case"|":prec=3;break;case"^":prec=4;break;case"&":prec=5;break;case"==":case"!=":case"===":case"!==":prec=6;break;case"<":case">":case"<=":case">=":case"instanceof":prec=7;break;case"in":prec=allowIn?7:0;break;case"<<":case">>":case">>>":prec=8;break;case"+":case"-":prec=9;break;case"*":case"/":case"%":prec=11;break;default:break}return prec}function parseBinaryExpression(){var expr,token,prec,previousAllowIn,stack,right,operator,left,i,marker,markers;previousAllowIn=state.allowIn;state.allowIn=true;marker=markerCreate();left=parseUnaryExpression();token=lookahead;prec=binaryPrecedence(token,previousAllowIn);if(prec===0){return left}token.prec=prec;lex();markers=[marker,markerCreate()];right=parseUnaryExpression();stack=[left,token,right];while((prec=binaryPrecedence(lookahead,previousAllowIn))>0){while(stack.length>2&&prec<=stack[stack.length-2].prec){right=stack.pop();operator=stack.pop().value;left=stack.pop();expr=delegate.createBinaryExpression(operator,left,right);markers.pop();marker=markers.pop();markerApply(marker,expr);stack.push(expr);markers.push(marker)}token=lex();token.prec=prec;stack.push(token);markers.push(markerCreate());expr=parseUnaryExpression();stack.push(expr)}state.allowIn=previousAllowIn;i=stack.length-1;expr=stack[i];markers.pop();while(i>1){expr=delegate.createBinaryExpression(stack[i-1].value,stack[i-2],expr);i-=2;marker=markers.pop();markerApply(marker,expr)}return expr}function parseConditionalExpression(){var expr,previousAllowIn,consequent,alternate,marker=markerCreate();expr=parseBinaryExpression();if(match("?")){lex();previousAllowIn=state.allowIn;state.allowIn=true;consequent=parseAssignmentExpression();state.allowIn=previousAllowIn;expect(":");alternate=parseAssignmentExpression();expr=markerApply(marker,delegate.createConditionalExpression(expr,consequent,alternate))}return expr}function reinterpretAsAssignmentBindingPattern(expr){var i,len,property,element;if(expr.type===Syntax.ObjectExpression){expr.type=Syntax.ObjectPattern;for(i=0,len=expr.properties.length;i<len;i+=1){property=expr.properties[i];if(property.type===Syntax.SpreadProperty){if(i<len-1){throwError({},Messages.PropertyAfterSpreadProperty)}reinterpretAsAssignmentBindingPattern(property.argument)}else{if(property.kind!=="init"){throwError({},Messages.InvalidLHSInAssignment)}reinterpretAsAssignmentBindingPattern(property.value)}}}else if(expr.type===Syntax.ArrayExpression){expr.type=Syntax.ArrayPattern;for(i=0,len=expr.elements.length;i<len;i+=1){element=expr.elements[i];if(element){reinterpretAsAssignmentBindingPattern(element)}}}else if(expr.type===Syntax.Identifier){if(isRestrictedWord(expr.name)){throwError({},Messages.InvalidLHSInAssignment)}}else if(expr.type===Syntax.SpreadElement){reinterpretAsAssignmentBindingPattern(expr.argument);if(expr.argument.type===Syntax.ObjectPattern){throwError({},Messages.ObjectPatternAsSpread)}}else{if(expr.type!==Syntax.MemberExpression&&expr.type!==Syntax.CallExpression&&expr.type!==Syntax.NewExpression){throwError({},Messages.InvalidLHSInAssignment)}}}function reinterpretAsDestructuredParameter(options,expr){var i,len,property,element;if(expr.type===Syntax.ObjectExpression){expr.type=Syntax.ObjectPattern;for(i=0,len=expr.properties.length;i<len;i+=1){property=expr.properties[i];if(property.type===Syntax.SpreadProperty){if(i<len-1){throwError({},Messages.PropertyAfterSpreadProperty)}reinterpretAsDestructuredParameter(options,property.argument)}else{if(property.kind!=="init"){throwError({},Messages.InvalidLHSInFormalsList)}reinterpretAsDestructuredParameter(options,property.value)}}}else if(expr.type===Syntax.ArrayExpression){expr.type=Syntax.ArrayPattern;for(i=0,len=expr.elements.length;i<len;i+=1){element=expr.elements[i];if(element){reinterpretAsDestructuredParameter(options,element)}}}else if(expr.type===Syntax.Identifier){validateParam(options,expr,expr.name)}else{if(expr.type!==Syntax.MemberExpression){throwError({},Messages.InvalidLHSInFormalsList)}}}function reinterpretAsCoverFormalsList(expressions){var i,len,param,params,defaults,defaultCount,options,rest;params=[];defaults=[];defaultCount=0;rest=null;options={paramSet:{}};for(i=0,len=expressions.length;i<len;i+=1){param=expressions[i];if(param.type===Syntax.Identifier){params.push(param);defaults.push(null);validateParam(options,param,param.name)}else if(param.type===Syntax.ObjectExpression||param.type===Syntax.ArrayExpression){reinterpretAsDestructuredParameter(options,param);params.push(param);defaults.push(null)}else if(param.type===Syntax.SpreadElement){assert(i===len-1,"It is guaranteed that SpreadElement is last element by parseExpression");reinterpretAsDestructuredParameter(options,param.argument);rest=param.argument}else if(param.type===Syntax.AssignmentExpression){params.push(param.left);defaults.push(param.right);++defaultCount;validateParam(options,param.left,param.left.name)}else{return null}}if(options.message===Messages.StrictParamDupe){throwError(strict?options.stricted:options.firstRestricted,options.message)}if(defaultCount===0){defaults=[]}return{params:params,defaults:defaults,rest:rest,stricted:options.stricted,firstRestricted:options.firstRestricted,message:options.message}}function parseArrowFunctionExpression(options,marker){var previousStrict,previousYieldAllowed,previousAwaitAllowed,body;expect("=>");previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=false;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=!!options.async;body=parseConciseBody();if(strict&&options.firstRestricted){throwError(options.firstRestricted,options.message)}if(strict&&options.stricted){throwErrorTolerant(options.stricted,options.message)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createArrowFunctionExpression(options.params,options.defaults,body,options.rest,body.type!==Syntax.BlockStatement,!!options.async))}function parseAssignmentExpression(){var marker,expr,token,params,oldParenthesizedCount,backtrackToken=lookahead,possiblyAsync=false;if(matchYield()){return parseYieldExpression()}if(matchAwait()){return parseAwaitExpression()}oldParenthesizedCount=state.parenthesizedCount;marker=markerCreate();if(matchAsyncFuncExprOrDecl()){return parseFunctionExpression()}if(matchAsync()){possiblyAsync=true;lex()}if(match("(")){token=lookahead2();if(token.type===Token.Punctuator&&token.value===")"||token.value==="..."){params=parseParams();if(!match("=>")){throwUnexpected(lex())}params.async=possiblyAsync;return parseArrowFunctionExpression(params,marker)}}token=lookahead;if(possiblyAsync&&!match("(")&&token.type!==Token.Identifier){possiblyAsync=false;rewind(backtrackToken)}expr=parseConditionalExpression();if(match("=>")&&(state.parenthesizedCount===oldParenthesizedCount||state.parenthesizedCount===oldParenthesizedCount+1)){if(expr.type===Syntax.Identifier){params=reinterpretAsCoverFormalsList([expr])}else if(expr.type===Syntax.SequenceExpression){params=reinterpretAsCoverFormalsList(expr.expressions)}if(params){params.async=possiblyAsync;return parseArrowFunctionExpression(params,marker)}}if(possiblyAsync){possiblyAsync=false;rewind(backtrackToken);expr=parseConditionalExpression()}if(matchAssign()){if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant(token,Messages.StrictLHSAssignment)}if(match("=")&&(expr.type===Syntax.ObjectExpression||expr.type===Syntax.ArrayExpression)){reinterpretAsAssignmentBindingPattern(expr)}else if(!isLeftHandSide(expr)){throwError({},Messages.InvalidLHSInAssignment)}expr=markerApply(marker,delegate.createAssignmentExpression(lex().value,expr,parseAssignmentExpression()))}return expr}function parseExpression(){var marker,expr,expressions,sequence,coverFormalsList,spreadFound,oldParenthesizedCount;oldParenthesizedCount=state.parenthesizedCount;marker=markerCreate();expr=parseAssignmentExpression();expressions=[expr];if(match(",")){while(index<length){if(!match(",")){break}lex();expr=parseSpreadOrAssignmentExpression();expressions.push(expr);if(expr.type===Syntax.SpreadElement){spreadFound=true;if(!match(")")){throwError({},Messages.ElementAfterSpreadElement)}break}}sequence=markerApply(marker,delegate.createSequenceExpression(expressions))}if(match("=>")){if(state.parenthesizedCount===oldParenthesizedCount||state.parenthesizedCount===oldParenthesizedCount+1){expr=expr.type===Syntax.SequenceExpression?expr.expressions:expressions;coverFormalsList=reinterpretAsCoverFormalsList(expr);if(coverFormalsList){return parseArrowFunctionExpression(coverFormalsList,marker)}}throwUnexpected(lex())}if(spreadFound&&lookahead2().value!=="=>"){throwError({},Messages.IllegalSpread)}return sequence||expr}function parseStatementList(){var list=[],statement;while(index<length){if(match("}")){break}statement=parseSourceElement();if(typeof statement==="undefined"){break}list.push(statement)}return list}function parseBlock(){var block,marker=markerCreate();expect("{");block=parseStatementList();expect("}");return markerApply(marker,delegate.createBlockStatement(block))}function parseTypeParameterDeclaration(){var marker=markerCreate(),paramTypes=[];expect("<");while(!match(">")){paramTypes.push(parseVariableIdentifier());if(!match(">")){expect(",")}}expect(">");return markerApply(marker,delegate.createTypeParameterDeclaration(paramTypes))}function parseTypeParameterInstantiation(){var marker=markerCreate(),oldInType=state.inType,paramTypes=[];state.inType=true;expect("<");while(!match(">")){paramTypes.push(parseType());if(!match(">")){expect(",")}}expect(">");state.inType=oldInType;return markerApply(marker,delegate.createTypeParameterInstantiation(paramTypes))}function parseObjectTypeIndexer(marker,isStatic){var id,key,value;expect("[");id=parseObjectPropertyKey();expect(":");key=parseType();expect("]");expect(":");value=parseType();return markerApply(marker,delegate.createObjectTypeIndexer(id,key,value,isStatic))}function parseObjectTypeMethodish(marker){var params=[],rest=null,returnType,typeParameters=null;if(match("<")){typeParameters=parseTypeParameterDeclaration()}expect("(");while(lookahead.type===Token.Identifier){params.push(parseFunctionTypeParam());if(!match(")")){expect(",")}}if(match("...")){lex();rest=parseFunctionTypeParam()}expect(")");expect(":");returnType=parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters))}function parseObjectTypeMethod(marker,isStatic,key){var optional=false,value;value=parseObjectTypeMethodish(marker);return markerApply(marker,delegate.createObjectTypeProperty(key,value,optional,isStatic))}function parseObjectTypeCallProperty(marker,isStatic){var valueMarker=markerCreate();return markerApply(marker,delegate.createObjectTypeCallProperty(parseObjectTypeMethodish(valueMarker),isStatic))}function parseObjectType(allowStatic){var callProperties=[],indexers=[],marker,optional=false,properties=[],property,propertyKey,propertyTypeAnnotation,token,isStatic;expect("{");while(!match("}")){marker=markerCreate();if(allowStatic&&matchContextualKeyword("static")){token=lex();isStatic=true}if(match("[")){indexers.push(parseObjectTypeIndexer(marker,isStatic))}else if(match("(")||match("<")){callProperties.push(parseObjectTypeCallProperty(marker,allowStatic))}else{if(isStatic&&match(":")){propertyKey=markerApply(marker,delegate.createIdentifier(token));throwErrorTolerant(token,Messages.StrictReservedWord)}else{propertyKey=parseObjectPropertyKey()}if(match("<")||match("(")){properties.push(parseObjectTypeMethod(marker,isStatic,propertyKey))}else{if(match("?")){lex();optional=true}expect(":");propertyTypeAnnotation=parseType();properties.push(markerApply(marker,delegate.createObjectTypeProperty(propertyKey,propertyTypeAnnotation,optional,isStatic)))}}if(match(";")){lex()}else if(!match("}")){throwUnexpected(lookahead)}}expect("}");return delegate.createObjectTypeAnnotation(properties,indexers,callProperties)}function parseGenericType(){var marker=markerCreate(),returnType=null,typeParameters=null,typeIdentifier,typeIdentifierMarker=markerCreate;typeIdentifier=parseVariableIdentifier();while(match(".")){expect(".");typeIdentifier=markerApply(marker,delegate.createQualifiedTypeIdentifier(typeIdentifier,parseVariableIdentifier()))}if(match("<")){typeParameters=parseTypeParameterInstantiation()}return markerApply(marker,delegate.createGenericTypeAnnotation(typeIdentifier,typeParameters))}function parseVoidType(){var marker=markerCreate();expectKeyword("void");return markerApply(marker,delegate.createVoidTypeAnnotation())}function parseTypeofType(){var argument,marker=markerCreate();expectKeyword("typeof");argument=parsePrimaryType();return markerApply(marker,delegate.createTypeofTypeAnnotation(argument))}function parseTupleType(){var marker=markerCreate(),types=[];expect("[");while(index<length&&!match("]")){types.push(parseType());if(match("]")){break}expect(",")}expect("]");return markerApply(marker,delegate.createTupleTypeAnnotation(types))}function parseFunctionTypeParam(){var marker=markerCreate(),name,optional=false,typeAnnotation;name=parseVariableIdentifier();if(match("?")){lex();optional=true}expect(":");typeAnnotation=parseType();return markerApply(marker,delegate.createFunctionTypeParam(name,typeAnnotation,optional))}function parseFunctionTypeParams(){var ret={params:[],rest:null};while(lookahead.type===Token.Identifier){ret.params.push(parseFunctionTypeParam());if(!match(")")){expect(",")}}if(match("...")){lex();ret.rest=parseFunctionTypeParam()}return ret}function parsePrimaryType(){var typeIdentifier=null,params=null,returnType=null,marker=markerCreate(),rest=null,tmp,typeParameters,token,type,isGroupedType=false;switch(lookahead.type){case Token.Identifier:switch(lookahead.value){case"any":lex();return markerApply(marker,delegate.createAnyTypeAnnotation());case"bool":case"boolean":lex();return markerApply(marker,delegate.createBooleanTypeAnnotation());case"number":lex();return markerApply(marker,delegate.createNumberTypeAnnotation());case"string":lex();return markerApply(marker,delegate.createStringTypeAnnotation())}return markerApply(marker,parseGenericType());case Token.Punctuator:switch(lookahead.value){case"{":return markerApply(marker,parseObjectType());case"[":return parseTupleType();case"<":typeParameters=parseTypeParameterDeclaration();expect("(");tmp=parseFunctionTypeParams();params=tmp.params;rest=tmp.rest;expect(")");expect("=>");returnType=parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));case"(":lex();if(!match(")")&&!match("...")){if(lookahead.type===Token.Identifier){token=lookahead2();isGroupedType=token.value!=="?"&&token.value!==":"}else{isGroupedType=true}}if(isGroupedType){type=parseType();expect(")");if(match("=>")){throwError({},Messages.ConfusedAboutFunctionType)}return type}tmp=parseFunctionTypeParams();params=tmp.params;rest=tmp.rest;expect(")");expect("=>");returnType=parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,null))}break;case Token.Keyword:switch(lookahead.value){case"void":return markerApply(marker,parseVoidType());case"typeof":return markerApply(marker,parseTypeofType())}break;case Token.StringLiteral:token=lex();if(token.octal){throwError(token,Messages.StrictOctalLiteral)}return markerApply(marker,delegate.createStringLiteralTypeAnnotation(token))}throwUnexpected(lookahead)}function parsePostfixType(){var marker=markerCreate(),t=parsePrimaryType();if(match("[")){expect("[");expect("]");return markerApply(marker,delegate.createArrayTypeAnnotation(t))}return t}function parsePrefixType(){var marker=markerCreate();if(match("?")){lex();return markerApply(marker,delegate.createNullableTypeAnnotation(parsePrefixType()))}return parsePostfixType()}function parseIntersectionType(){var marker=markerCreate(),type,types;type=parsePrefixType();types=[type];while(match("&")){lex();types.push(parsePrefixType())}return types.length===1?type:markerApply(marker,delegate.createIntersectionTypeAnnotation(types))}function parseUnionType(){var marker=markerCreate(),type,types;type=parseIntersectionType();types=[type];while(match("|")){lex();types.push(parseIntersectionType())}return types.length===1?type:markerApply(marker,delegate.createUnionTypeAnnotation(types))}function parseType(){var oldInType=state.inType,type;state.inType=true;type=parseUnionType();state.inType=oldInType;return type}function parseTypeAnnotation(){var marker=markerCreate(),type;expect(":");type=parseType();return markerApply(marker,delegate.createTypeAnnotation(type))}function parseVariableIdentifier(){var marker=markerCreate(),token=lex();if(token.type!==Token.Identifier){throwUnexpected(token)}return markerApply(marker,delegate.createIdentifier(token.value))}function parseTypeAnnotatableIdentifier(requireTypeAnnotation,canBeOptionalParam){var marker=markerCreate(),ident=parseVariableIdentifier(),isOptionalParam=false;if(canBeOptionalParam&&match("?")){expect("?"); isOptionalParam=true}if(requireTypeAnnotation||match(":")){ident.typeAnnotation=parseTypeAnnotation();ident=markerApply(marker,ident)}if(isOptionalParam){ident.optional=true;ident=markerApply(marker,ident)}return ident}function parseVariableDeclaration(kind){var id,marker=markerCreate(),init=null,typeAnnotationMarker=markerCreate();if(match("{")){id=parseObjectInitialiser();reinterpretAsAssignmentBindingPattern(id);if(match(":")){id.typeAnnotation=parseTypeAnnotation();markerApply(typeAnnotationMarker,id)}}else if(match("[")){id=parseArrayInitialiser();reinterpretAsAssignmentBindingPattern(id);if(match(":")){id.typeAnnotation=parseTypeAnnotation();markerApply(typeAnnotationMarker,id)}}else{id=state.allowKeyword?parseNonComputedProperty():parseTypeAnnotatableIdentifier();if(strict&&isRestrictedWord(id.name)){throwErrorTolerant({},Messages.StrictVarName)}}if(kind==="const"){if(!match("=")){throwError({},Messages.NoUnintializedConst)}expect("=");init=parseAssignmentExpression()}else if(match("=")){lex();init=parseAssignmentExpression()}return markerApply(marker,delegate.createVariableDeclarator(id,init))}function parseVariableDeclarationList(kind){var list=[];do{list.push(parseVariableDeclaration(kind));if(!match(",")){break}lex()}while(index<length);return list}function parseVariableStatement(){var declarations,marker=markerCreate();expectKeyword("var");declarations=parseVariableDeclarationList();consumeSemicolon();return markerApply(marker,delegate.createVariableDeclaration(declarations,"var"))}function parseConstLetDeclaration(kind){var declarations,marker=markerCreate();expectKeyword(kind);declarations=parseVariableDeclarationList(kind);consumeSemicolon();return markerApply(marker,delegate.createVariableDeclaration(declarations,kind))}function parseModuleSpecifier(){var marker=markerCreate(),specifier;if(lookahead.type!==Token.StringLiteral){throwError({},Messages.InvalidModuleSpecifier)}specifier=delegate.createModuleSpecifier(lookahead);lex();return markerApply(marker,specifier)}function parseExportBatchSpecifier(){var marker=markerCreate();expect("*");return markerApply(marker,delegate.createExportBatchSpecifier())}function parseExportSpecifier(){var id,name=null,marker=markerCreate(),from;if(matchKeyword("default")){lex();id=markerApply(marker,delegate.createIdentifier("default"))}else{id=parseVariableIdentifier()}if(matchContextualKeyword("as")){lex();name=parseNonComputedProperty()}return markerApply(marker,delegate.createExportSpecifier(id,name))}function parseExportDeclaration(){var backtrackToken,id,previousAllowKeyword,declaration=null,isExportFromIdentifier,src=null,specifiers=[],marker=markerCreate();expectKeyword("export");if(matchKeyword("default")){lex();if(matchKeyword("function")||matchKeyword("class")){backtrackToken=lookahead;lex();if(isIdentifierName(lookahead)){id=parseNonComputedProperty();rewind(backtrackToken);return markerApply(marker,delegate.createExportDeclaration(true,parseSourceElement(),[id],null))}rewind(backtrackToken);switch(lookahead.value){case"class":return markerApply(marker,delegate.createExportDeclaration(true,parseClassExpression(),[],null));case"function":return markerApply(marker,delegate.createExportDeclaration(true,parseFunctionExpression(),[],null))}}if(matchContextualKeyword("from")){throwError({},Messages.UnexpectedToken,lookahead.value)}if(match("{")){declaration=parseObjectInitialiser()}else if(match("[")){declaration=parseArrayInitialiser()}else{declaration=parseAssignmentExpression()}consumeSemicolon();return markerApply(marker,delegate.createExportDeclaration(true,declaration,[],null))}if(lookahead.type===Token.Keyword){switch(lookahead.value){case"let":case"const":case"var":case"class":case"function":return markerApply(marker,delegate.createExportDeclaration(false,parseSourceElement(),specifiers,null))}}if(match("*")){specifiers.push(parseExportBatchSpecifier());if(!matchContextualKeyword("from")){throwError({},lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value)}lex();src=parseModuleSpecifier();consumeSemicolon();return markerApply(marker,delegate.createExportDeclaration(false,null,specifiers,src))}expect("{");do{isExportFromIdentifier=isExportFromIdentifier||matchKeyword("default");specifiers.push(parseExportSpecifier())}while(match(",")&&lex());expect("}");if(matchContextualKeyword("from")){lex();src=parseModuleSpecifier();consumeSemicolon()}else if(isExportFromIdentifier){throwError({},lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value)}else{consumeSemicolon()}return markerApply(marker,delegate.createExportDeclaration(false,declaration,specifiers,src))}function parseImportSpecifier(){var id,name=null,marker=markerCreate();id=parseNonComputedProperty();if(matchContextualKeyword("as")){lex();name=parseVariableIdentifier()}return markerApply(marker,delegate.createImportSpecifier(id,name))}function parseNamedImports(){var specifiers=[];expect("{");do{specifiers.push(parseImportSpecifier())}while(match(",")&&lex());expect("}");return specifiers}function parseImportDefaultSpecifier(){var id,marker=markerCreate();id=parseNonComputedProperty();return markerApply(marker,delegate.createImportDefaultSpecifier(id))}function parseImportNamespaceSpecifier(){var id,marker=markerCreate();expect("*");if(!matchContextualKeyword("as")){throwError({},Messages.NoAsAfterImportNamespace)}lex();id=parseNonComputedProperty();return markerApply(marker,delegate.createImportNamespaceSpecifier(id))}function parseImportDeclaration(){var specifiers,src,marker=markerCreate();expectKeyword("import");specifiers=[];if(lookahead.type===Token.StringLiteral){src=parseModuleSpecifier();consumeSemicolon();return markerApply(marker,delegate.createImportDeclaration(specifiers,src))}if(!matchKeyword("default")&&isIdentifierName(lookahead)){specifiers.push(parseImportDefaultSpecifier());if(match(",")){lex()}}if(match("*")){specifiers.push(parseImportNamespaceSpecifier())}else if(match("{")){specifiers=specifiers.concat(parseNamedImports())}if(!matchContextualKeyword("from")){throwError({},lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value)}lex();src=parseModuleSpecifier();consumeSemicolon();return markerApply(marker,delegate.createImportDeclaration(specifiers,src))}function parseEmptyStatement(){var marker=markerCreate();expect(";");return markerApply(marker,delegate.createEmptyStatement())}function parseExpressionStatement(){var marker=markerCreate(),expr=parseExpression();consumeSemicolon();return markerApply(marker,delegate.createExpressionStatement(expr))}function parseIfStatement(){var test,consequent,alternate,marker=markerCreate();expectKeyword("if");expect("(");test=parseExpression();expect(")");consequent=parseStatement();if(matchKeyword("else")){lex();alternate=parseStatement()}else{alternate=null}return markerApply(marker,delegate.createIfStatement(test,consequent,alternate))}function parseDoWhileStatement(){var body,test,oldInIteration,marker=markerCreate();expectKeyword("do");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;expectKeyword("while");expect("(");test=parseExpression();expect(")");if(match(";")){lex()}return markerApply(marker,delegate.createDoWhileStatement(body,test))}function parseWhileStatement(){var test,body,oldInIteration,marker=markerCreate();expectKeyword("while");expect("(");test=parseExpression();expect(")");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;return markerApply(marker,delegate.createWhileStatement(test,body))}function parseForVariableDeclaration(){var marker=markerCreate(),token=lex(),declarations=parseVariableDeclarationList();return markerApply(marker,delegate.createVariableDeclaration(declarations,token.value))}function parseForStatement(opts){var init,test,update,left,right,body,operator,oldInIteration,marker=markerCreate();init=test=update=null;expectKeyword("for");if(matchContextualKeyword("each")){throwError({},Messages.EachNotAllowed)}expect("(");if(match(";")){lex()}else{if(matchKeyword("var")||matchKeyword("let")||matchKeyword("const")){state.allowIn=false;init=parseForVariableDeclaration();state.allowIn=true;if(init.declarations.length===1){if(matchKeyword("in")||matchContextualKeyword("of")){operator=lookahead;if(!((operator.value==="in"||init.kind!=="var")&&init.declarations[0].init)){lex();left=init;right=parseExpression();init=null}}}}else{state.allowIn=false;init=parseExpression();state.allowIn=true;if(matchContextualKeyword("of")){operator=lex();left=init;right=parseExpression();init=null}else if(matchKeyword("in")){if(!isAssignableLeftHandSide(init)){throwError({},Messages.InvalidLHSInForIn)}operator=lex();left=init;right=parseExpression();init=null}}if(typeof left==="undefined"){expect(";")}}if(typeof left==="undefined"){if(!match(";")){test=parseExpression()}expect(";");if(!match(")")){update=parseExpression()}}expect(")");oldInIteration=state.inIteration;state.inIteration=true;if(!(opts!==undefined&&opts.ignoreBody)){body=parseStatement()}state.inIteration=oldInIteration;if(typeof left==="undefined"){return markerApply(marker,delegate.createForStatement(init,test,update,body))}if(operator.value==="in"){return markerApply(marker,delegate.createForInStatement(left,right,body))}return markerApply(marker,delegate.createForOfStatement(left,right,body))}function parseContinueStatement(){var label=null,key,marker=markerCreate();expectKeyword("continue");if(source.charCodeAt(index)===59){lex();if(!state.inIteration){throwError({},Messages.IllegalContinue)}return markerApply(marker,delegate.createContinueStatement(null))}if(peekLineTerminator()){if(!state.inIteration){throwError({},Messages.IllegalContinue)}return markerApply(marker,delegate.createContinueStatement(null))}if(lookahead.type===Token.Identifier){label=parseVariableIdentifier();key="$"+label.name;if(!Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError({},Messages.UnknownLabel,label.name)}}consumeSemicolon();if(label===null&&!state.inIteration){throwError({},Messages.IllegalContinue)}return markerApply(marker,delegate.createContinueStatement(label))}function parseBreakStatement(){var label=null,key,marker=markerCreate();expectKeyword("break");if(source.charCodeAt(index)===59){lex();if(!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return markerApply(marker,delegate.createBreakStatement(null))}if(peekLineTerminator()){if(!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return markerApply(marker,delegate.createBreakStatement(null))}if(lookahead.type===Token.Identifier){label=parseVariableIdentifier();key="$"+label.name;if(!Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError({},Messages.UnknownLabel,label.name)}}consumeSemicolon();if(label===null&&!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return markerApply(marker,delegate.createBreakStatement(label))}function parseReturnStatement(){var argument=null,marker=markerCreate();expectKeyword("return");if(!state.inFunctionBody){throwErrorTolerant({},Messages.IllegalReturn)}if(source.charCodeAt(index)===32){if(isIdentifierStart(source.charCodeAt(index+1))){argument=parseExpression();consumeSemicolon();return markerApply(marker,delegate.createReturnStatement(argument))}}if(peekLineTerminator()){return markerApply(marker,delegate.createReturnStatement(null))}if(!match(";")){if(!match("}")&&lookahead.type!==Token.EOF){argument=parseExpression()}}consumeSemicolon();return markerApply(marker,delegate.createReturnStatement(argument))}function parseWithStatement(){var object,body,marker=markerCreate();if(strict){throwErrorTolerant({},Messages.StrictModeWith)}expectKeyword("with");expect("(");object=parseExpression();expect(")");body=parseStatement();return markerApply(marker,delegate.createWithStatement(object,body))}function parseSwitchCase(){var test,consequent=[],sourceElement,marker=markerCreate();if(matchKeyword("default")){lex();test=null}else{expectKeyword("case");test=parseExpression()}expect(":");while(index<length){if(match("}")||matchKeyword("default")||matchKeyword("case")){break}sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break}consequent.push(sourceElement)}return markerApply(marker,delegate.createSwitchCase(test,consequent))}function parseSwitchStatement(){var discriminant,cases,clause,oldInSwitch,defaultFound,marker=markerCreate();expectKeyword("switch");expect("(");discriminant=parseExpression();expect(")");expect("{");cases=[];if(match("}")){lex();return markerApply(marker,delegate.createSwitchStatement(discriminant,cases))}oldInSwitch=state.inSwitch;state.inSwitch=true;defaultFound=false;while(index<length){if(match("}")){break}clause=parseSwitchCase();if(clause.test===null){if(defaultFound){throwError({},Messages.MultipleDefaultsInSwitch)}defaultFound=true}cases.push(clause)}state.inSwitch=oldInSwitch;expect("}");return markerApply(marker,delegate.createSwitchStatement(discriminant,cases))}function parseThrowStatement(){var argument,marker=markerCreate();expectKeyword("throw");if(peekLineTerminator()){throwError({},Messages.NewlineAfterThrow)}argument=parseExpression();consumeSemicolon();return markerApply(marker,delegate.createThrowStatement(argument))}function parseCatchClause(){var param,body,marker=markerCreate();expectKeyword("catch");expect("(");if(match(")")){throwUnexpected(lookahead)}param=parseExpression();if(strict&&param.type===Syntax.Identifier&&isRestrictedWord(param.name)){throwErrorTolerant({},Messages.StrictCatchVariable)}expect(")");body=parseBlock();return markerApply(marker,delegate.createCatchClause(param,body))}function parseTryStatement(){var block,handlers=[],finalizer=null,marker=markerCreate();expectKeyword("try");block=parseBlock();if(matchKeyword("catch")){handlers.push(parseCatchClause())}if(matchKeyword("finally")){lex();finalizer=parseBlock()}if(handlers.length===0&&!finalizer){throwError({},Messages.NoCatchOrFinally)}return markerApply(marker,delegate.createTryStatement(block,[],handlers,finalizer))}function parseDebuggerStatement(){var marker=markerCreate();expectKeyword("debugger");consumeSemicolon();return markerApply(marker,delegate.createDebuggerStatement())}function parseStatement(){var type=lookahead.type,marker,expr,labeledBody,key;if(type===Token.EOF){throwUnexpected(lookahead)}if(type===Token.Punctuator){switch(lookahead.value){case";":return parseEmptyStatement();case"{":return parseBlock();case"(":return parseExpressionStatement();default:break}}if(type===Token.Keyword){switch(lookahead.value){case"break":return parseBreakStatement();case"continue":return parseContinueStatement();case"debugger":return parseDebuggerStatement();case"do":return parseDoWhileStatement();case"for":return parseForStatement();case"function":return parseFunctionDeclaration();case"class":return parseClassDeclaration();case"if":return parseIfStatement();case"return":return parseReturnStatement();case"switch":return parseSwitchStatement();case"throw":return parseThrowStatement();case"try":return parseTryStatement();case"var":return parseVariableStatement();case"while":return parseWhileStatement();case"with":return parseWithStatement();default:break}}if(matchAsyncFuncExprOrDecl()){return parseFunctionDeclaration()}marker=markerCreate();expr=parseExpression();if(expr.type===Syntax.Identifier&&match(":")){lex();key="$"+expr.name;if(Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError({},Messages.Redeclaration,"Label",expr.name)}state.labelSet[key]=true;labeledBody=parseStatement();delete state.labelSet[key];return markerApply(marker,delegate.createLabeledStatement(expr,labeledBody))}consumeSemicolon();return markerApply(marker,delegate.createExpressionStatement(expr))}function parseConciseBody(){if(match("{")){return parseFunctionSourceElements()}return parseAssignmentExpression()}function parseFunctionSourceElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted,oldLabelSet,oldInIteration,oldInSwitch,oldInFunctionBody,oldParenthesizedCount,marker=markerCreate();expect("{");while(index<length){if(lookahead.type!==Token.StringLiteral){break}token=lookahead;sourceElement=parseSourceElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=source.slice(token.range[0]+1,token.range[1]-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}oldLabelSet=state.labelSet;oldInIteration=state.inIteration;oldInSwitch=state.inSwitch;oldInFunctionBody=state.inFunctionBody;oldParenthesizedCount=state.parenthesizedCount;state.labelSet={};state.inIteration=false;state.inSwitch=false;state.inFunctionBody=true;state.parenthesizedCount=0;while(index<length){if(match("}")){break}sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break}sourceElements.push(sourceElement)}expect("}");state.labelSet=oldLabelSet;state.inIteration=oldInIteration;state.inSwitch=oldInSwitch;state.inFunctionBody=oldInFunctionBody;state.parenthesizedCount=oldParenthesizedCount;return markerApply(marker,delegate.createBlockStatement(sourceElements))}function validateParam(options,param,name){var key="$"+name;if(strict){if(isRestrictedWord(name)){options.stricted=param;options.message=Messages.StrictParamName}if(Object.prototype.hasOwnProperty.call(options.paramSet,key)){options.stricted=param;options.message=Messages.StrictParamDupe}}else if(!options.firstRestricted){if(isRestrictedWord(name)){options.firstRestricted=param;options.message=Messages.StrictParamName}else if(isStrictModeReservedWord(name)){options.firstRestricted=param;options.message=Messages.StrictReservedWord}else if(Object.prototype.hasOwnProperty.call(options.paramSet,key)){options.firstRestricted=param;options.message=Messages.StrictParamDupe}}options.paramSet[key]=true}function parseParam(options){var marker,token,rest,param,def;token=lookahead;if(token.value==="..."){token=lex();rest=true}if(match("[")){marker=markerCreate();param=parseArrayInitialiser();reinterpretAsDestructuredParameter(options,param);if(match(":")){param.typeAnnotation=parseTypeAnnotation();markerApply(marker,param)}}else if(match("{")){marker=markerCreate();if(rest){throwError({},Messages.ObjectPatternAsRestParameter)}param=parseObjectInitialiser();reinterpretAsDestructuredParameter(options,param);if(match(":")){param.typeAnnotation=parseTypeAnnotation();markerApply(marker,param)}}else{param=rest?parseTypeAnnotatableIdentifier(false,false):parseTypeAnnotatableIdentifier(false,true);validateParam(options,token,token.value)}if(match("=")){if(rest){throwErrorTolerant(lookahead,Messages.DefaultRestParameter)}lex();def=parseAssignmentExpression();++options.defaultCount}if(rest){if(!match(")")){throwError({},Messages.ParameterAfterRestParameter)}options.rest=param;return false}options.params.push(param);options.defaults.push(def);return!match(")")}function parseParams(firstRestricted){var options,marker=markerCreate();options={params:[],defaultCount:0,defaults:[],rest:null,firstRestricted:firstRestricted};expect("(");if(!match(")")){options.paramSet={};while(index<length){if(!parseParam(options)){break}expect(",")}}expect(")");if(options.defaultCount===0){options.defaults=[]}if(match(":")){options.returnType=parseTypeAnnotation()}return markerApply(marker,options)}function parseFunctionDeclaration(){var id,body,token,tmp,firstRestricted,message,generator,isAsync,previousStrict,previousYieldAllowed,previousAwaitAllowed,marker=markerCreate(),typeParameters;isAsync=false;if(matchAsync()){lex();isAsync=true}expectKeyword("function");generator=false;if(match("*")){lex();generator=true}token=lookahead;id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(strict){if(isRestrictedWord(token.value)){throwErrorTolerant(token,Messages.StrictFunctionName)}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}}tmp=parseParams(firstRestricted);firstRestricted=tmp.firstRestricted;if(tmp.message){message=tmp.message}previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=generator;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=isAsync;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwError(firstRestricted,message)}if(strict&&tmp.stricted){throwErrorTolerant(tmp.stricted,message)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createFunctionDeclaration(id,tmp.params,tmp.defaults,body,tmp.rest,generator,false,isAsync,tmp.returnType,typeParameters))}function parseFunctionExpression(){var token,id=null,firstRestricted,message,tmp,body,generator,isAsync,previousStrict,previousYieldAllowed,previousAwaitAllowed,marker=markerCreate(),typeParameters;isAsync=false;if(matchAsync()){lex();isAsync=true}expectKeyword("function");generator=false;if(match("*")){lex();generator=true}if(!match("(")){if(!match("<")){token=lookahead;id=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){throwErrorTolerant(token,Messages.StrictFunctionName)}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}}}if(match("<")){typeParameters=parseTypeParameterDeclaration()}}tmp=parseParams(firstRestricted);firstRestricted=tmp.firstRestricted;if(tmp.message){message=tmp.message}previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=generator;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=isAsync;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwError(firstRestricted,message)}if(strict&&tmp.stricted){throwErrorTolerant(tmp.stricted,message)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createFunctionExpression(id,tmp.params,tmp.defaults,body,tmp.rest,generator,false,isAsync,tmp.returnType,typeParameters))}function parseYieldExpression(){var delegateFlag,expr,marker=markerCreate();expectKeyword("yield",!strict);delegateFlag=false;if(match("*")){lex();delegateFlag=true}expr=parseAssignmentExpression();return markerApply(marker,delegate.createYieldExpression(expr,delegateFlag))}function parseAwaitExpression(){var expr,marker=markerCreate();expectContextualKeyword("await");expr=parseAssignmentExpression();return markerApply(marker,delegate.createAwaitExpression(expr))}function parseMethodDefinition(existingPropNames,key,isStatic,generator,computed){var token,param,propType,isValidDuplicateProp=false,isAsync,typeParameters,tokenValue,returnType,annotationMarker;propType=isStatic?ClassPropertyType.static:ClassPropertyType.prototype;if(generator){return delegate.createMethodDefinition(propType,"",key,parsePropertyMethodFunction({generator:true}))}tokenValue=key.type==="Identifier"&&key.name;if(tokenValue==="get"&&!match("(")){key=parseObjectPropertyKey();if(existingPropNames[propType].hasOwnProperty(key.name)){isValidDuplicateProp=existingPropNames[propType][key.name].get===undefined&&existingPropNames[propType][key.name].data===undefined&&existingPropNames[propType][key.name].set!==undefined;if(!isValidDuplicateProp){throwError(key,Messages.IllegalDuplicateClassProperty)}}else{existingPropNames[propType][key.name]={}}existingPropNames[propType][key.name].get=true;expect("(");expect(")");if(match(":")){returnType=parseTypeAnnotation()}return delegate.createMethodDefinition(propType,"get",key,parsePropertyFunction({generator:false,returnType:returnType}))}if(tokenValue==="set"&&!match("(")){key=parseObjectPropertyKey();if(existingPropNames[propType].hasOwnProperty(key.name)){isValidDuplicateProp=existingPropNames[propType][key.name].set===undefined&&existingPropNames[propType][key.name].data===undefined&&existingPropNames[propType][key.name].get!==undefined;if(!isValidDuplicateProp){throwError(key,Messages.IllegalDuplicateClassProperty)}}else{existingPropNames[propType][key.name]={}}existingPropNames[propType][key.name].set=true;expect("(");token=lookahead;param=[parseTypeAnnotatableIdentifier()];expect(")");if(match(":")){returnType=parseTypeAnnotation()}return delegate.createMethodDefinition(propType,"set",key,parsePropertyFunction({params:param,generator:false,name:token,returnType:returnType}))}if(match("<")){typeParameters=parseTypeParameterDeclaration()}isAsync=tokenValue==="async"&&!match("(");if(isAsync){key=parseObjectPropertyKey()}if(existingPropNames[propType].hasOwnProperty(key.name)){throwError(key,Messages.IllegalDuplicateClassProperty)}else{existingPropNames[propType][key.name]={}}existingPropNames[propType][key.name].data=true;return delegate.createMethodDefinition(propType,"",key,parsePropertyMethodFunction({generator:false,async:isAsync,typeParameters:typeParameters}))}function parseClassProperty(existingPropNames,key,computed,isStatic){var typeAnnotation;typeAnnotation=parseTypeAnnotation();expect(";");return delegate.createClassProperty(key,typeAnnotation,computed,isStatic)}function parseClassElement(existingProps){var computed,generator=false,key,marker=markerCreate(),isStatic=false;if(match(";")){lex();return}if(lookahead.value==="static"){lex();isStatic=true}if(match("*")){lex();generator=true}computed=lookahead.value==="[";key=parseObjectPropertyKey();if(!generator&&lookahead.value===":"){return markerApply(marker,parseClassProperty(existingProps,key,computed,isStatic))}return markerApply(marker,parseMethodDefinition(existingProps,key,isStatic,generator,computed))}function parseClassBody(){var classElement,classElements=[],existingProps={},marker=markerCreate();existingProps[ClassPropertyType.static]={};existingProps[ClassPropertyType.prototype]={};expect("{");while(index<length){if(match("}")){break}classElement=parseClassElement(existingProps);if(typeof classElement!=="undefined"){classElements.push(classElement)}}expect("}");return markerApply(marker,delegate.createClassBody(classElements))}function parseClassImplements(){var id,implemented=[],marker,typeParameters;expectContextualKeyword("implements");while(index<length){marker=markerCreate();id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterInstantiation()}else{typeParameters=null}implemented.push(markerApply(marker,delegate.createClassImplements(id,typeParameters)));if(!match(",")){break}expect(",")}return implemented}function parseClassExpression(){var id,implemented,previousYieldAllowed,superClass=null,superTypeParameters,marker=markerCreate(),typeParameters;expectKeyword("class");if(!matchKeyword("extends")&&!matchContextualKeyword("implements")&&!match("{")){id=parseVariableIdentifier()}if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(matchKeyword("extends")){expectKeyword("extends");previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=false;superClass=parseLeftHandSideExpressionAllowCall();if(match("<")){superTypeParameters=parseTypeParameterInstantiation()}state.yieldAllowed=previousYieldAllowed}if(matchContextualKeyword("implements")){implemented=parseClassImplements()}return markerApply(marker,delegate.createClassExpression(id,superClass,parseClassBody(),typeParameters,superTypeParameters,implemented))}function parseClassDeclaration(){var id,implemented,previousYieldAllowed,superClass=null,superTypeParameters,marker=markerCreate(),typeParameters;expectKeyword("class");id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(matchKeyword("extends")){expectKeyword("extends");previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=false;superClass=parseLeftHandSideExpressionAllowCall();if(match("<")){superTypeParameters=parseTypeParameterInstantiation()}state.yieldAllowed=previousYieldAllowed}if(matchContextualKeyword("implements")){implemented=parseClassImplements()}return markerApply(marker,delegate.createClassDeclaration(id,superClass,parseClassBody(),typeParameters,superTypeParameters,implemented))}function parseSourceElement(){var token;if(lookahead.type===Token.Keyword){switch(lookahead.value){case"const":case"let":return parseConstLetDeclaration(lookahead.value);case"function":return parseFunctionDeclaration();default:return parseStatement()}}if(matchContextualKeyword("type")&&lookahead2().type===Token.Identifier){return parseTypeAlias()}if(matchContextualKeyword("interface")&&lookahead2().type===Token.Identifier){return parseInterface()}if(matchContextualKeyword("declare")){token=lookahead2();if(token.type===Token.Keyword){switch(token.value){case"class":return parseDeclareClass();case"function":return parseDeclareFunction();case"var":return parseDeclareVariable()}}else if(token.type===Token.Identifier&&token.value==="module"){return parseDeclareModule()}}if(lookahead.type!==Token.EOF){return parseStatement()}}function parseProgramElement(){if(lookahead.type===Token.Keyword){switch(lookahead.value){case"export":return parseExportDeclaration();case"import":return parseImportDeclaration()}}return parseSourceElement()}function parseProgramElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted;while(index<length){token=lookahead;if(token.type!==Token.StringLiteral){break}sourceElement=parseProgramElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=source.slice(token.range[0]+1,token.range[1]-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}while(index<length){sourceElement=parseProgramElement();if(typeof sourceElement==="undefined"){break}sourceElements.push(sourceElement)}return sourceElements}function parseProgram(){var body,marker=markerCreate();strict=false;peek();body=parseProgramElements();return markerApply(marker,delegate.createProgram(body))}function addComment(type,value,start,end,loc){var comment;assert(typeof start==="number","Comment must have valid position");if(state.lastCommentStart>=start){return}state.lastCommentStart=start;comment={type:type,value:value};if(extra.range){comment.range=[start,end]}if(extra.loc){comment.loc=loc}extra.comments.push(comment);if(extra.attachComment){extra.leadingComments.push(comment);extra.trailingComments.push(comment)}}function scanComment(){var comment,ch,loc,start,blockComment,lineComment;comment="";blockComment=false;lineComment=false;while(index<length){ch=source[index];if(lineComment){ch=source[index++];if(isLineTerminator(ch.charCodeAt(0))){loc.end={line:lineNumber,column:index-lineStart-1};lineComment=false;addComment("Line",comment,start,index-1,loc);if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index;comment=""}else if(index>=length){lineComment=false;comment+=ch;loc.end={line:lineNumber,column:length-lineStart};addComment("Line",comment,start,length,loc)}else{comment+=ch}}else if(blockComment){if(isLineTerminator(ch.charCodeAt(0))){if(ch==="\r"){++index;comment+="\r"}if(ch!=="\r"||source[index]==="\n"){comment+=source[index];++lineNumber;++index;lineStart=index;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}}else{ch=source[index++];if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}comment+=ch;if(ch==="*"){ch=source[index];if(ch==="/"){comment=comment.substr(0,comment.length-1);blockComment=false;++index;loc.end={line:lineNumber,column:index-lineStart};addComment("Block",comment,start,index,loc);comment=""}}}}else if(ch==="/"){ch=source[index+1];if(ch==="/"){loc={start:{line:lineNumber,column:index-lineStart}}; start=index;index+=2;lineComment=true;if(index>=length){loc.end={line:lineNumber,column:index-lineStart};lineComment=false;addComment("Line",comment,start,index,loc)}}else if(ch==="*"){start=index;index+=2;blockComment=true;loc={start:{line:lineNumber,column:index-lineStart-2}};if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{break}}else if(isWhiteSpace(ch.charCodeAt(0))){++index}else if(isLineTerminator(ch.charCodeAt(0))){++index;if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index}else{break}}}XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function getQualifiedXJSName(object){if(object.type===Syntax.XJSIdentifier){return object.name}if(object.type===Syntax.XJSNamespacedName){return object.namespace.name+":"+object.name.name}if(object.type===Syntax.XJSMemberExpression){return getQualifiedXJSName(object.object)+"."+getQualifiedXJSName(object.property)}}function isXJSIdentifierStart(ch){return ch!==92&&isIdentifierStart(ch)}function isXJSIdentifierPart(ch){return ch!==92&&(ch===45||isIdentifierPart(ch))}function scanXJSIdentifier(){var ch,start,value="";start=index;while(index<length){ch=source.charCodeAt(index);if(!isXJSIdentifierPart(ch)){break}value+=source[index++]}return{type:Token.XJSIdentifier,value:value,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanXJSEntity(){var ch,str="",start=index,count=0,code;ch=source[index];assert(ch==="&","Entity must start with an ampersand");index++;while(index<length&&count++<10){ch=source[index++];if(ch===";"){break}str+=ch}if(ch===";"){if(str[0]==="#"){if(str[1]==="x"){code=+("0"+str.substr(1))}else{code=+str.substr(1).replace(Regex.LeadingZeros,"")}if(!isNaN(code)){return String.fromCharCode(code)}}else if(XHTMLEntities[str]){return XHTMLEntities[str]}}index=start+1;return"&"}function scanXJSText(stopChars){var ch,str="",start;start=index;while(index<length){ch=source[index];if(stopChars.indexOf(ch)!==-1){break}if(ch==="&"){str+=scanXJSEntity()}else{index++;if(ch==="\r"&&source[index]==="\n"){str+=ch;ch=source[index];index++}if(isLineTerminator(ch.charCodeAt(0))){++lineNumber;lineStart=index}str+=ch}}return{type:Token.XJSText,value:str,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanXJSStringLiteral(){var innerToken,quote,start;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;innerToken=scanXJSText([quote]);if(quote!==source[index]){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;innerToken.range=[start,index];return innerToken}function advanceXJSChild(){var ch=source.charCodeAt(index);if(ch!==123&&ch!==60){return scanXJSText(["<","{"])}return scanPunctuator()}function parseXJSIdentifier(){var token,marker=markerCreate();if(lookahead.type!==Token.XJSIdentifier){throwUnexpected(lookahead)}token=lex();return markerApply(marker,delegate.createXJSIdentifier(token.value))}function parseXJSNamespacedName(){var namespace,name,marker=markerCreate();namespace=parseXJSIdentifier();expect(":");name=parseXJSIdentifier();return markerApply(marker,delegate.createXJSNamespacedName(namespace,name))}function parseXJSMemberExpression(){var marker=markerCreate(),expr=parseXJSIdentifier();while(match(".")){lex();expr=markerApply(marker,delegate.createXJSMemberExpression(expr,parseXJSIdentifier()))}return expr}function parseXJSElementName(){if(lookahead2().value===":"){return parseXJSNamespacedName()}if(lookahead2().value==="."){return parseXJSMemberExpression()}return parseXJSIdentifier()}function parseXJSAttributeName(){if(lookahead2().value===":"){return parseXJSNamespacedName()}return parseXJSIdentifier()}function parseXJSAttributeValue(){var value,marker;if(match("{")){value=parseXJSExpressionContainer();if(value.expression.type===Syntax.XJSEmptyExpression){throwError(value,"XJS attributes must only be assigned a non-empty "+"expression")}}else if(match("<")){value=parseXJSElement()}else if(lookahead.type===Token.XJSText){marker=markerCreate();value=markerApply(marker,delegate.createLiteral(lex()))}else{throwError({},Messages.InvalidXJSAttributeValue)}return value}function parseXJSEmptyExpression(){var marker=markerCreatePreserveWhitespace();while(source.charAt(index)!=="}"){index++}return markerApply(marker,delegate.createXJSEmptyExpression())}function parseXJSExpressionContainer(){var expression,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=false;expect("{");if(match("}")){expression=parseXJSEmptyExpression()}else{expression=parseExpression()}state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;expect("}");return markerApply(marker,delegate.createXJSExpressionContainer(expression))}function parseXJSSpreadAttribute(){var expression,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=false;expect("{");expect("...");expression=parseAssignmentExpression();state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;expect("}");return markerApply(marker,delegate.createXJSSpreadAttribute(expression))}function parseXJSAttribute(){var name,marker;if(match("{")){return parseXJSSpreadAttribute()}marker=markerCreate();name=parseXJSAttributeName();if(match("=")){lex();return markerApply(marker,delegate.createXJSAttribute(name,parseXJSAttributeValue()))}return markerApply(marker,delegate.createXJSAttribute(name))}function parseXJSChild(){var token,marker;if(match("{")){token=parseXJSExpressionContainer()}else if(lookahead.type===Token.XJSText){marker=markerCreatePreserveWhitespace();token=markerApply(marker,delegate.createLiteral(lex()))}else{token=parseXJSElement()}return token}function parseXJSClosingElement(){var name,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=true;expect("<");expect("/");name=parseXJSElementName();state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;expect(">");return markerApply(marker,delegate.createXJSClosingElement(name))}function parseXJSOpeningElement(){var name,attribute,attributes=[],selfClosing=false,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=true;expect("<");name=parseXJSElementName();while(index<length&&lookahead.value!=="/"&&lookahead.value!==">"){attributes.push(parseXJSAttribute())}state.inXJSTag=origInXJSTag;if(lookahead.value==="/"){expect("/");state.inXJSChild=origInXJSChild;expect(">");selfClosing=true}else{state.inXJSChild=true;expect(">")}return markerApply(marker,delegate.createXJSOpeningElement(name,attributes,selfClosing))}function parseXJSElement(){var openingElement,closingElement=null,children=[],origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;openingElement=parseXJSOpeningElement();if(!openingElement.selfClosing){while(index<length){state.inXJSChild=false;if(lookahead.value==="<"&&lookahead2().value==="/"){break}state.inXJSChild=true;children.push(parseXJSChild())}state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;closingElement=parseXJSClosingElement();if(getQualifiedXJSName(closingElement.name)!==getQualifiedXJSName(openingElement.name)){throwError({},Messages.ExpectedXJSClosingTag,getQualifiedXJSName(openingElement.name))}}if(!origInXJSChild&&match("<")){throwError(lookahead,Messages.AdjacentXJSElements)}return markerApply(marker,delegate.createXJSElement(openingElement,closingElement,children))}function parseTypeAlias(){var id,marker=markerCreate(),typeParameters=null,right;expectContextualKeyword("type");id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}expect("=");right=parseType();consumeSemicolon();return markerApply(marker,delegate.createTypeAlias(id,typeParameters,right))}function parseInterfaceExtends(){var marker=markerCreate(),id,typeParameters=null;id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterInstantiation()}return markerApply(marker,delegate.createInterfaceExtends(id,typeParameters))}function parseInterfaceish(marker,allowStatic){var body,bodyMarker,extended=[],id,typeParameters=null;id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(matchKeyword("extends")){expectKeyword("extends");while(index<length){extended.push(parseInterfaceExtends());if(!match(",")){break}expect(",")}}bodyMarker=markerCreate();body=markerApply(bodyMarker,parseObjectType(allowStatic));return markerApply(marker,delegate.createInterface(id,typeParameters,body,extended))}function parseInterface(){var body,bodyMarker,extended=[],id,marker=markerCreate(),typeParameters=null;expectContextualKeyword("interface");return parseInterfaceish(marker,false)}function parseDeclareClass(){var marker=markerCreate(),ret;expectContextualKeyword("declare");expectKeyword("class");ret=parseInterfaceish(marker,true);ret.type=Syntax.DeclareClass;return ret}function parseDeclareFunction(){var id,idMarker,marker=markerCreate(),params,returnType,rest,tmp,typeParameters=null,value,valueMarker;expectContextualKeyword("declare");expectKeyword("function");idMarker=markerCreate();id=parseVariableIdentifier();valueMarker=markerCreate();if(match("<")){typeParameters=parseTypeParameterDeclaration()}expect("(");tmp=parseFunctionTypeParams();params=tmp.params;rest=tmp.rest;expect(")");expect(":");returnType=parseType();value=markerApply(valueMarker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));id.typeAnnotation=markerApply(valueMarker,delegate.createTypeAnnotation(value));markerApply(idMarker,id);consumeSemicolon();return markerApply(marker,delegate.createDeclareFunction(id))}function parseDeclareVariable(){var id,marker=markerCreate();expectContextualKeyword("declare");expectKeyword("var");id=parseTypeAnnotatableIdentifier();consumeSemicolon();return markerApply(marker,delegate.createDeclareVariable(id))}function parseDeclareModule(){var body=[],bodyMarker,id,idMarker,marker=markerCreate(),token;expectContextualKeyword("declare");expectContextualKeyword("module");if(lookahead.type===Token.StringLiteral){if(strict&&lookahead.octal){throwErrorTolerant(lookahead,Messages.StrictOctalLiteral)}idMarker=markerCreate();id=markerApply(idMarker,delegate.createLiteral(lex()))}else{id=parseVariableIdentifier()}bodyMarker=markerCreate();expect("{");while(index<length&&!match("}")){token=lookahead2();switch(token.value){case"class":body.push(parseDeclareClass());break;case"function":body.push(parseDeclareFunction());break;case"var":body.push(parseDeclareVariable());break;default:throwUnexpected(lookahead)}}expect("}");return markerApply(marker,delegate.createDeclareModule(id,markerApply(bodyMarker,delegate.createBlockStatement(body))))}function collectToken(){var start,loc,token,range,value,entry;if(!state.inXJSChild){skipComment()}start=index;loc={start:{line:lineNumber,column:index-lineStart}};token=extra.advance();loc.end={line:lineNumber,column:index-lineStart};if(token.type!==Token.EOF){range=[token.range[0],token.range[1]];value=source.slice(token.range[0],token.range[1]);entry={type:TokenName[token.type],value:value,range:range,loc:loc};if(token.regex){entry.regex={pattern:token.regex.pattern,flags:token.regex.flags}}extra.tokens.push(entry)}return token}function collectRegex(){var pos,loc,regex,token;skipComment();pos=index;loc={start:{line:lineNumber,column:index-lineStart}};regex=extra.scanRegExp();loc.end={line:lineNumber,column:index-lineStart};if(!extra.tokenize){if(extra.tokens.length>0){token=extra.tokens[extra.tokens.length-1];if(token.range[0]===pos&&token.type==="Punctuator"){if(token.value==="/"||token.value==="/="){extra.tokens.pop()}}}extra.tokens.push({type:"RegularExpression",value:regex.literal,regex:regex.regex,range:[pos,index],loc:loc})}return regex}function filterTokenLocation(){var i,entry,token,tokens=[];for(i=0;i<extra.tokens.length;++i){entry=extra.tokens[i];token={type:entry.type,value:entry.value};if(entry.regex){token.regex={pattern:entry.regex.pattern,flags:entry.regex.flags}}if(extra.range){token.range=entry.range}if(extra.loc){token.loc=entry.loc}tokens.push(token)}extra.tokens=tokens}function patch(){if(extra.comments){extra.skipComment=skipComment;skipComment=scanComment}if(typeof extra.tokens!=="undefined"){extra.advance=advance;extra.scanRegExp=scanRegExp;advance=collectToken;scanRegExp=collectRegex}}function unpatch(){if(typeof extra.skipComment==="function"){skipComment=extra.skipComment}if(typeof extra.scanRegExp==="function"){advance=extra.advance;scanRegExp=extra.scanRegExp}}function extend(object,properties){var entry,result={};for(entry in object){if(object.hasOwnProperty(entry)){result[entry]=object[entry]}}for(entry in properties){if(properties.hasOwnProperty(entry)){result[entry]=properties[entry]}}return result}function tokenize(code,options){var toString,token,tokens;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}delegate=SyntaxTreeDelegate;source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;lookahead=null;state={allowKeyword:true,allowIn:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1};extra={};options=options||{};options.tokens=true;extra.tokens=[];extra.tokenize=true;extra.openParenToken=-1;extra.openCurlyToken=-1;extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;if(typeof options.comment==="boolean"&&options.comment){extra.comments=[]}if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}if(length>0){if(typeof source[0]==="undefined"){if(code instanceof String){source=code.valueOf()}}}patch();try{peek();if(lookahead.type===Token.EOF){return extra.tokens}token=lex();while(lookahead.type!==Token.EOF){try{token=lex()}catch(lexError){token=lookahead;if(extra.errors){extra.errors.push(lexError);break}else{throw lexError}}}filterTokenLocation();tokens=extra.tokens;if(typeof extra.comments!=="undefined"){tokens.comments=extra.comments}if(typeof extra.errors!=="undefined"){tokens.errors=extra.errors}}catch(e){throw e}finally{unpatch();extra={}}return tokens}function parse(code,options){var program,toString;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}delegate=SyntaxTreeDelegate;source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;lookahead=null;state={allowKeyword:false,allowIn:true,labelSet:{},parenthesizedCount:0,inFunctionBody:false,inIteration:false,inSwitch:false,inXJSChild:false,inXJSTag:false,inType:false,lastCommentStart:-1,yieldAllowed:false,awaitAllowed:false};extra={};if(typeof options!=="undefined"){extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;extra.attachComment=typeof options.attachComment==="boolean"&&options.attachComment;if(extra.loc&&options.source!==null&&options.source!==undefined){delegate=extend(delegate,{postProcess:function(node){node.loc.source=toString(options.source);return node}})}if(typeof options.tokens==="boolean"&&options.tokens){extra.tokens=[]}if(typeof options.comment==="boolean"&&options.comment){extra.comments=[]}if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}if(extra.attachComment){extra.range=true;extra.comments=[];extra.bottomRightStack=[];extra.trailingComments=[];extra.leadingComments=[]}}if(length>0){if(typeof source[0]==="undefined"){if(code instanceof String){source=code.valueOf()}}}patch();try{program=parseProgram();if(typeof extra.comments!=="undefined"){program.comments=extra.comments}if(typeof extra.tokens!=="undefined"){filterTokenLocation();program.tokens=extra.tokens}if(typeof extra.errors!=="undefined"){program.errors=extra.errors}}catch(e){throw e}finally{unpatch();extra={}}return program}exports.version="8001.1001.0-dev-harmony-fb";exports.tokenize=tokenize;exports.parse=parse;exports.Syntax=function(){var name,types={};if(typeof Object.create==="function"){types=Object.create(null)}for(name in Syntax){if(Syntax.hasOwnProperty(name)){types[name]=Syntax[name]}}if(typeof Object.freeze==="function"){Object.freeze(types)}return types}()})},{}],145:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var linesModule=require("./lines");var fromString=linesModule.fromString;var Lines=linesModule.Lines;var concat=linesModule.concat;var comparePos=require("./util").comparePos;var childNodesCacheKey=require("private").makeUniqueKey();function getSortedChildNodes(node,resultArray){if(!node){return}if(resultArray){if(n.Node.check(node)&&n.SourceLocation.check(node.loc)){for(var i=resultArray.length-1;i>=0;--i){if(comparePos(resultArray[i].loc.end,node.loc.start)<=0){break}}resultArray.splice(i+1,0,node);return}}else if(node[childNodesCacheKey]){return node[childNodesCacheKey]}var names;if(isArray.check(node)){names=Object.keys(node)}else if(isObject.check(node)){names=types.getFieldNames(node)}else{return}if(!resultArray){Object.defineProperty(node,childNodesCacheKey,{value:resultArray=[],enumerable:false})}for(var i=0,nameCount=names.length;i<nameCount;++i){getSortedChildNodes(node[names[i]],resultArray)}return resultArray}function decorateComment(node,comment){var childNodes=getSortedChildNodes(node);var left=0,right=childNodes.length;while(left<right){var middle=left+right>>1;var child=childNodes[middle];if(comparePos(child.loc.start,comment.loc.start)<=0&&comparePos(comment.loc.end,child.loc.end)<=0){decorateComment(comment.enclosingNode=child,comment);return}if(comparePos(child.loc.end,comment.loc.start)<=0){var precedingNode=child;left=middle+1;continue}if(comparePos(comment.loc.end,child.loc.start)<=0){var followingNode=child;right=middle;continue}throw new Error("Comment location overlaps with node location")}if(precedingNode){comment.precedingNode=precedingNode}if(followingNode){comment.followingNode=followingNode}}exports.attach=function(comments,ast,lines){if(!isArray.check(comments)){return}var tiesToBreak=[];comments.forEach(function(comment){comment.loc.lines=lines;decorateComment(ast,comment);var pn=comment.precedingNode;var en=comment.enclosingNode;var fn=comment.followingNode;if(pn&&fn){var tieCount=tiesToBreak.length;if(tieCount>0){var lastTie=tiesToBreak[tieCount-1];assert.strictEqual(lastTie.precedingNode===comment.precedingNode,lastTie.followingNode===comment.followingNode);if(lastTie.followingNode!==comment.followingNode){breakTies(tiesToBreak,lines)}}tiesToBreak.push(comment)}else if(pn){breakTies(tiesToBreak,lines);Comments.forNode(pn).addTrailing(comment)}else if(fn){breakTies(tiesToBreak,lines);Comments.forNode(fn).addLeading(comment)}else if(en){breakTies(tiesToBreak,lines);Comments.forNode(en).addDangling(comment)}else{throw new Error("AST contains no nodes at all?")}});breakTies(tiesToBreak,lines)};function breakTies(tiesToBreak,lines){var tieCount=tiesToBreak.length;if(tieCount===0){return}var pn=tiesToBreak[0].precedingNode;var fn=tiesToBreak[0].followingNode;var gapEndPos=fn.loc.start;for(var indexOfFirstLeadingComment=tieCount;indexOfFirstLeadingComment>0;--indexOfFirstLeadingComment){var comment=tiesToBreak[indexOfFirstLeadingComment-1];assert.strictEqual(comment.precedingNode,pn);assert.strictEqual(comment.followingNode,fn);var gap=lines.sliceString(comment.loc.end,gapEndPos);if(/\S/.test(gap)){break}gapEndPos=comment.loc.start}while(indexOfFirstLeadingComment<=tieCount&&(comment=tiesToBreak[indexOfFirstLeadingComment])&&comment.type==="Line"&&comment.loc.start.column>fn.loc.start.column){++indexOfFirstLeadingComment}tiesToBreak.forEach(function(comment,i){if(i<indexOfFirstLeadingComment){Comments.forNode(pn).addTrailing(comment)}else{Comments.forNode(fn).addLeading(comment)}});tiesToBreak.length=0}function Comments(){assert.ok(this instanceof Comments);this.leading=[];this.dangling=[];this.trailing=[]}var Cp=Comments.prototype;Comments.forNode=function forNode(node){var comments=node.comments;if(!comments){Object.defineProperty(node,"comments",{value:comments=new Comments,enumerable:false})}return comments};Cp.forEach=function forEach(callback,context){this.leading.forEach(callback,context);this.trailing.forEach(callback,context)};Cp.addLeading=function addLeading(comment){this.leading.push(comment)};Cp.addDangling=function addDangling(comment){this.dangling.push(comment)};Cp.addTrailing=function addTrailing(comment){comment.trailing=true;if(comment.type==="Block"){this.trailing.push(comment)}else{this.leading.push(comment)}};function printLeadingComment(comment,options){var loc=comment.loc;var lines=loc&&loc.lines;var parts=[];if(comment.type==="Block"){parts.push("/*",fromString(comment.value,options),"*/")}else if(comment.type==="Line"){parts.push("//",fromString(comment.value,options))}else assert.fail(comment.type);if(comment.trailing){parts.push("\n")}else if(lines instanceof Lines){var trailingSpace=lines.slice(loc.end,lines.skipSpaces(loc.end));if(trailingSpace.length===1){parts.push(trailingSpace)}else{parts.push(new Array(trailingSpace.length).join("\n"))}}else{parts.push("\n")}return concat(parts).stripMargin(loc?loc.start.column:0)}function printTrailingComment(comment,options){var loc=comment.loc;var lines=loc&&loc.lines;var parts=[];if(lines instanceof Lines){var fromPos=lines.skipSpaces(loc.start,true)||lines.firstPos();var leadingSpace=lines.slice(fromPos,loc.start);if(leadingSpace.length===1){parts.push(leadingSpace)}else{parts.push(new Array(leadingSpace.length).join("\n"))}}if(comment.type==="Block"){parts.push("/*",fromString(comment.value,options),"*/")}else if(comment.type==="Line"){parts.push("//",fromString(comment.value,options),"\n")}else assert.fail(comment.type);return concat(parts).stripMargin(loc?loc.start.column:0,true)}exports.printComments=function(comments,innerLines,options){if(innerLines){assert.ok(innerLines instanceof Lines)}else{innerLines=fromString("")}if(!comments||!(comments.leading.length+comments.trailing.length)){return innerLines}var parts=[];comments.leading.forEach(function(comment){parts.push(printLeadingComment(comment,options))});parts.push(innerLines);comments.trailing.forEach(function(comment){assert.strictEqual(comment.type,"Block");parts.push(printTrailingComment(comment,options))});return concat(parts)}},{"./lines":146,"./types":152,"./util":153,assert:90,"private":122}],146:[function(require,module,exports){var assert=require("assert");var sourceMap=require("source-map");var normalizeOptions=require("./options").normalize;var secretKey=require("private").makeUniqueKey();var types=require("./types");var isString=types.builtInTypes.string;var comparePos=require("./util").comparePos;var Mapping=require("./mapping");function getSecret(lines){return lines[secretKey]}function Lines(infos,sourceFileName){assert.ok(this instanceof Lines);assert.ok(infos.length>0);if(sourceFileName){isString.assert(sourceFileName)}else{sourceFileName=null}Object.defineProperty(this,secretKey,{value:{infos:infos,mappings:[],name:sourceFileName,cachedSourceMap:null}});if(sourceFileName){getSecret(this).mappings.push(new Mapping(this,{start:this.firstPos(),end:this.lastPos()}))}}exports.Lines=Lines;var Lp=Lines.prototype;Object.defineProperties(Lp,{length:{get:function(){return getSecret(this).infos.length}},name:{get:function(){return getSecret(this).name}}});function copyLineInfo(info){return{line:info.line,indent:info.indent,sliceStart:info.sliceStart,sliceEnd:info.sliceEnd}}var fromStringCache={};var hasOwn=fromStringCache.hasOwnProperty;var maxCacheKeyLen=10;function countSpaces(spaces,tabWidth){var count=0;var len=spaces.length;for(var i=0;i<len;++i){var ch=spaces.charAt(i);if(ch===" "){count+=1}else if(ch===" "){assert.strictEqual(typeof tabWidth,"number");assert.ok(tabWidth>0);var next=Math.ceil(count/tabWidth)*tabWidth;if(next===count){count+=tabWidth}else{count=next}}else if(ch==="\r"){}else{assert.fail("unexpected whitespace character",ch)}}return count}exports.countSpaces=countSpaces;var leadingSpaceExp=/^\s*/;function fromString(string,options){if(string instanceof Lines)return string;string+="";var tabWidth=options&&options.tabWidth;var tabless=string.indexOf(" ")<0;var cacheable=!options&&tabless&&string.length<=maxCacheKeyLen;assert.ok(tabWidth||tabless,"No tab width specified but encountered tabs in string\n"+string);if(cacheable&&hasOwn.call(fromStringCache,string))return fromStringCache[string];var lines=new Lines(string.split("\n").map(function(line){var spaces=leadingSpaceExp.exec(line)[0];return{line:line,indent:countSpaces(spaces,tabWidth),sliceStart:spaces.length,sliceEnd:line.length}}),normalizeOptions(options).sourceFileName);if(cacheable)fromStringCache[string]=lines;return lines}exports.fromString=fromString;function isOnlyWhitespace(string){return!/\S/.test(string)}Lp.toString=function(options){return this.sliceString(this.firstPos(),this.lastPos(),options)};Lp.getSourceMap=function(sourceMapName,sourceRoot){if(!sourceMapName){return null}var targetLines=this;function updateJSON(json){json=json||{};isString.assert(sourceMapName);json.file=sourceMapName;if(sourceRoot){isString.assert(sourceRoot);json.sourceRoot=sourceRoot}return json}var secret=getSecret(targetLines);if(secret.cachedSourceMap){return updateJSON(secret.cachedSourceMap.toJSON())}var smg=new sourceMap.SourceMapGenerator(updateJSON());var sourcesToContents={};secret.mappings.forEach(function(mapping){var sourceCursor=mapping.sourceLines.skipSpaces(mapping.sourceLoc.start)||mapping.sourceLines.lastPos();var targetCursor=targetLines.skipSpaces(mapping.targetLoc.start)||targetLines.lastPos();while(comparePos(sourceCursor,mapping.sourceLoc.end)<0&&comparePos(targetCursor,mapping.targetLoc.end)<0){var sourceChar=mapping.sourceLines.charAt(sourceCursor);var targetChar=targetLines.charAt(targetCursor);assert.strictEqual(sourceChar,targetChar);var sourceName=mapping.sourceLines.name;smg.addMapping({source:sourceName,original:{line:sourceCursor.line,column:sourceCursor.column},generated:{line:targetCursor.line,column:targetCursor.column}});if(!hasOwn.call(sourcesToContents,sourceName)){var sourceContent=mapping.sourceLines.toString();smg.setSourceContent(sourceName,sourceContent);sourcesToContents[sourceName]=sourceContent}targetLines.nextPos(targetCursor,true);mapping.sourceLines.nextPos(sourceCursor,true)}});secret.cachedSourceMap=smg;return smg.toJSON()};Lp.bootstrapCharAt=function(pos){assert.strictEqual(typeof pos,"object");assert.strictEqual(typeof pos.line,"number");assert.strictEqual(typeof pos.column,"number");var line=pos.line,column=pos.column,strings=this.toString().split("\n"),string=strings[line-1];if(typeof string==="undefined")return"";if(column===string.length&&line<strings.length)return"\n";if(column>=string.length)return"";return string.charAt(column)};Lp.charAt=function(pos){assert.strictEqual(typeof pos,"object");assert.strictEqual(typeof pos.line,"number");assert.strictEqual(typeof pos.column,"number");var line=pos.line,column=pos.column,secret=getSecret(this),infos=secret.infos,info=infos[line-1],c=column;if(typeof info==="undefined"||c<0)return"";var indent=this.getIndentAt(line);if(c<indent)return" ";c+=info.sliceStart-indent;if(c===info.sliceEnd&&line<this.length)return"\n";if(c>=info.sliceEnd)return"";return info.line.charAt(c)};Lp.stripMargin=function(width,skipFirstLine){if(width===0)return this;assert.ok(width>0,"negative margin: "+width);if(skipFirstLine&&this.length===1)return this;var secret=getSecret(this);var lines=new Lines(secret.infos.map(function(info,i){if(info.line&&(i>0||!skipFirstLine)){info=copyLineInfo(info);info.indent=Math.max(0,info.indent-width)}return info}));if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){newMappings.push(mapping.indent(width,skipFirstLine,true))})}return lines};Lp.indent=function(by){if(by===0)return this;var secret=getSecret(this);var lines=new Lines(secret.infos.map(function(info){if(info.line){info=copyLineInfo(info);info.indent+=by}return info}));if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){newMappings.push(mapping.indent(by))})}return lines};Lp.indentTail=function(by){if(by===0)return this;if(this.length<2)return this;var secret=getSecret(this);var lines=new Lines(secret.infos.map(function(info,i){if(i>0&&info.line){info=copyLineInfo(info);info.indent+=by}return info}));if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){newMappings.push(mapping.indent(by,true))})}return lines};Lp.getIndentAt=function(line){assert.ok(line>=1,"no line "+line+" (line numbers start from 1)");var secret=getSecret(this),info=secret.infos[line-1];return Math.max(info.indent,0)};Lp.guessTabWidth=function(){var secret=getSecret(this);if(hasOwn.call(secret,"cachedTabWidth")){return secret.cachedTabWidth}var counts=[];var lastIndent=0;for(var line=1,last=this.length;line<=last;++line){var info=secret.infos[line-1];var sliced=info.line.slice(info.sliceStart,info.sliceEnd);if(isOnlyWhitespace(sliced)){continue}var diff=Math.abs(info.indent-lastIndent); counts[diff]=~~counts[diff]+1;lastIndent=info.indent}var maxCount=-1;var result=2;for(var tabWidth=1;tabWidth<counts.length;tabWidth+=1){if(hasOwn.call(counts,tabWidth)&&counts[tabWidth]>maxCount){maxCount=counts[tabWidth];result=tabWidth}}return secret.cachedTabWidth=result};Lp.isOnlyWhitespace=function(){return isOnlyWhitespace(this.toString())};Lp.isPrecededOnlyByWhitespace=function(pos){var secret=getSecret(this);var info=secret.infos[pos.line-1];var indent=Math.max(info.indent,0);var diff=pos.column-indent;if(diff<=0){return true}var start=info.sliceStart;var end=Math.min(start+diff,info.sliceEnd);var prefix=info.line.slice(start,end);return isOnlyWhitespace(prefix)};Lp.getLineLength=function(line){var secret=getSecret(this),info=secret.infos[line-1];return this.getIndentAt(line)+info.sliceEnd-info.sliceStart};Lp.nextPos=function(pos,skipSpaces){var l=Math.max(pos.line,0),c=Math.max(pos.column,0);if(c<this.getLineLength(l)){pos.column+=1;return skipSpaces?!!this.skipSpaces(pos,false,true):true}if(l<this.length){pos.line+=1;pos.column=0;return skipSpaces?!!this.skipSpaces(pos,false,true):true}return false};Lp.prevPos=function(pos,skipSpaces){var l=pos.line,c=pos.column;if(c<1){l-=1;if(l<1)return false;c=this.getLineLength(l)}else{c=Math.min(c-1,this.getLineLength(l))}pos.line=l;pos.column=c;return skipSpaces?!!this.skipSpaces(pos,true,true):true};Lp.firstPos=function(){return{line:1,column:0}};Lp.lastPos=function(){return{line:this.length,column:this.getLineLength(this.length)}};Lp.skipSpaces=function(pos,backward,modifyInPlace){if(pos){pos=modifyInPlace?pos:{line:pos.line,column:pos.column}}else if(backward){pos=this.lastPos()}else{pos=this.firstPos()}if(backward){while(this.prevPos(pos)){if(!isOnlyWhitespace(this.charAt(pos))&&this.nextPos(pos)){return pos}}return null}else{while(isOnlyWhitespace(this.charAt(pos))){if(!this.nextPos(pos)){return null}}return pos}};Lp.trimLeft=function(){var pos=this.skipSpaces(this.firstPos(),false,true);return pos?this.slice(pos):emptyLines};Lp.trimRight=function(){var pos=this.skipSpaces(this.lastPos(),true,true);return pos?this.slice(this.firstPos(),pos):emptyLines};Lp.trim=function(){var start=this.skipSpaces(this.firstPos(),false,true);if(start===null)return emptyLines;var end=this.skipSpaces(this.lastPos(),true,true);assert.notStrictEqual(end,null);return this.slice(start,end)};Lp.eachPos=function(callback,startPos,skipSpaces){var pos=this.firstPos();if(startPos){pos.line=startPos.line,pos.column=startPos.column}if(skipSpaces&&!this.skipSpaces(pos,false,true)){return}do callback.call(this,pos);while(this.nextPos(pos,skipSpaces))};Lp.bootstrapSlice=function(start,end){var strings=this.toString().split("\n").slice(start.line-1,end.line);strings.push(strings.pop().slice(0,end.column));strings[0]=strings[0].slice(start.column);return fromString(strings.join("\n"))};Lp.slice=function(start,end){if(!end){if(!start){return this}end=this.lastPos()}var secret=getSecret(this);var sliced=secret.infos.slice(start.line-1,end.line);if(start.line===end.line){sliced[0]=sliceInfo(sliced[0],start.column,end.column)}else{assert.ok(start.line<end.line);sliced[0]=sliceInfo(sliced[0],start.column);sliced.push(sliceInfo(sliced.pop(),0,end.column))}var lines=new Lines(sliced);if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){var sliced=mapping.slice(this,start,end);if(sliced){newMappings.push(sliced)}},this)}return lines};function sliceInfo(info,startCol,endCol){var sliceStart=info.sliceStart;var sliceEnd=info.sliceEnd;var indent=Math.max(info.indent,0);var lineLength=indent+sliceEnd-sliceStart;if(typeof endCol==="undefined"){endCol=lineLength}startCol=Math.max(startCol,0);endCol=Math.min(endCol,lineLength);endCol=Math.max(endCol,startCol);if(endCol<indent){indent=endCol;sliceEnd=sliceStart}else{sliceEnd-=lineLength-endCol}lineLength=endCol;lineLength-=startCol;if(startCol<indent){indent-=startCol}else{startCol-=indent;indent=0;sliceStart+=startCol}assert.ok(indent>=0);assert.ok(sliceStart<=sliceEnd);assert.strictEqual(lineLength,indent+sliceEnd-sliceStart);if(info.indent===indent&&info.sliceStart===sliceStart&&info.sliceEnd===sliceEnd){return info}return{line:info.line,indent:indent,sliceStart:sliceStart,sliceEnd:sliceEnd}}Lp.bootstrapSliceString=function(start,end,options){return this.slice(start,end).toString(options)};Lp.sliceString=function(start,end,options){if(!end){if(!start){return this}end=this.lastPos()}options=normalizeOptions(options);var infos=getSecret(this).infos;var parts=[];var tabWidth=options.tabWidth;for(var line=start.line;line<=end.line;++line){var info=infos[line-1];if(line===start.line){if(line===end.line){info=sliceInfo(info,start.column,end.column)}else{info=sliceInfo(info,start.column)}}else if(line===end.line){info=sliceInfo(info,0,end.column)}var indent=Math.max(info.indent,0);var before=info.line.slice(0,info.sliceStart);if(options.reuseWhitespace&&isOnlyWhitespace(before)&&countSpaces(before,options.tabWidth)===indent){parts.push(info.line.slice(0,info.sliceEnd));continue}var tabs=0;var spaces=indent;if(options.useTabs){tabs=Math.floor(indent/tabWidth);spaces-=tabs*tabWidth}var result="";if(tabs>0){result+=new Array(tabs+1).join(" ")}if(spaces>0){result+=new Array(spaces+1).join(" ")}result+=info.line.slice(info.sliceStart,info.sliceEnd);parts.push(result)}return parts.join("\n")};Lp.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1};Lp.join=function(elements){var separator=this;var separatorSecret=getSecret(separator);var infos=[];var mappings=[];var prevInfo;function appendSecret(secret){if(secret===null)return;if(prevInfo){var info=secret.infos[0];var indent=new Array(info.indent+1).join(" ");var prevLine=infos.length;var prevColumn=Math.max(prevInfo.indent,0)+prevInfo.sliceEnd-prevInfo.sliceStart;prevInfo.line=prevInfo.line.slice(0,prevInfo.sliceEnd)+indent+info.line.slice(info.sliceStart,info.sliceEnd);prevInfo.sliceEnd=prevInfo.line.length;if(secret.mappings.length>0){secret.mappings.forEach(function(mapping){mappings.push(mapping.add(prevLine,prevColumn))})}}else if(secret.mappings.length>0){mappings.push.apply(mappings,secret.mappings)}secret.infos.forEach(function(info,i){if(!prevInfo||i>0){prevInfo=copyLineInfo(info);infos.push(prevInfo)}})}function appendWithSeparator(secret,i){if(i>0)appendSecret(separatorSecret);appendSecret(secret)}elements.map(function(elem){var lines=fromString(elem);if(lines.isEmpty())return null;return getSecret(lines)}).forEach(separator.isEmpty()?appendSecret:appendWithSeparator);if(infos.length<1)return emptyLines;var lines=new Lines(infos);getSecret(lines).mappings=mappings;return lines};exports.concat=function(elements){return emptyLines.join(elements)};Lp.concat=function(other){var args=arguments,list=[this];list.push.apply(list,args);assert.strictEqual(list.length,args.length+1);return emptyLines.join(list)};var emptyLines=fromString("")},{"./mapping":147,"./options":148,"./types":152,"./util":153,assert:90,"private":122,"source-map":163}],147:[function(require,module,exports){var assert=require("assert");var types=require("./types");var isString=types.builtInTypes.string;var isNumber=types.builtInTypes.number;var SourceLocation=types.namedTypes.SourceLocation;var Position=types.namedTypes.Position;var linesModule=require("./lines");var comparePos=require("./util").comparePos;function Mapping(sourceLines,sourceLoc,targetLoc){assert.ok(this instanceof Mapping);assert.ok(sourceLines instanceof linesModule.Lines);SourceLocation.assert(sourceLoc);if(targetLoc){assert.ok(isNumber.check(targetLoc.start.line)&&isNumber.check(targetLoc.start.column)&&isNumber.check(targetLoc.end.line)&&isNumber.check(targetLoc.end.column))}else{targetLoc=sourceLoc}Object.defineProperties(this,{sourceLines:{value:sourceLines},sourceLoc:{value:sourceLoc},targetLoc:{value:targetLoc}})}var Mp=Mapping.prototype;module.exports=Mapping;Mp.slice=function(lines,start,end){assert.ok(lines instanceof linesModule.Lines);Position.assert(start);if(end){Position.assert(end)}else{end=lines.lastPos()}var sourceLines=this.sourceLines;var sourceLoc=this.sourceLoc;var targetLoc=this.targetLoc;function skip(name){var sourceFromPos=sourceLoc[name];var targetFromPos=targetLoc[name];var targetToPos=start;if(name==="end"){targetToPos=end}else{assert.strictEqual(name,"start")}return skipChars(sourceLines,sourceFromPos,lines,targetFromPos,targetToPos)}if(comparePos(start,targetLoc.start)<=0){if(comparePos(targetLoc.end,end)<=0){targetLoc={start:subtractPos(targetLoc.start,start.line,start.column),end:subtractPos(targetLoc.end,start.line,start.column)}}else if(comparePos(end,targetLoc.start)<=0){return null}else{sourceLoc={start:sourceLoc.start,end:skip("end")};targetLoc={start:subtractPos(targetLoc.start,start.line,start.column),end:subtractPos(end,start.line,start.column)}}}else{if(comparePos(targetLoc.end,start)<=0){return null}if(comparePos(targetLoc.end,end)<=0){sourceLoc={start:skip("start"),end:sourceLoc.end};targetLoc={start:{line:1,column:0},end:subtractPos(targetLoc.end,start.line,start.column)}}else{sourceLoc={start:skip("start"),end:skip("end")};targetLoc={start:{line:1,column:0},end:subtractPos(end,start.line,start.column)}}}return new Mapping(this.sourceLines,sourceLoc,targetLoc)};Mp.add=function(line,column){return new Mapping(this.sourceLines,this.sourceLoc,{start:addPos(this.targetLoc.start,line,column),end:addPos(this.targetLoc.end,line,column)})};function addPos(toPos,line,column){return{line:toPos.line+line-1,column:toPos.line===1?toPos.column+column:toPos.column}}Mp.subtract=function(line,column){return new Mapping(this.sourceLines,this.sourceLoc,{start:subtractPos(this.targetLoc.start,line,column),end:subtractPos(this.targetLoc.end,line,column)})};function subtractPos(fromPos,line,column){return{line:fromPos.line-line+1,column:fromPos.line===line?fromPos.column-column:fromPos.column}}Mp.indent=function(by,skipFirstLine,noNegativeColumns){if(by===0){return this}var targetLoc=this.targetLoc;var startLine=targetLoc.start.line;var endLine=targetLoc.end.line;if(skipFirstLine&&startLine===1&&endLine===1){return this}targetLoc={start:targetLoc.start,end:targetLoc.end};if(!skipFirstLine||startLine>1){var startColumn=targetLoc.start.column+by;targetLoc.start={line:startLine,column:noNegativeColumns?Math.max(0,startColumn):startColumn}}if(!skipFirstLine||endLine>1){var endColumn=targetLoc.end.column+by;targetLoc.end={line:endLine,column:noNegativeColumns?Math.max(0,endColumn):endColumn}}return new Mapping(this.sourceLines,this.sourceLoc,targetLoc)};function skipChars(sourceLines,sourceFromPos,targetLines,targetFromPos,targetToPos){assert.ok(sourceLines instanceof linesModule.Lines);assert.ok(targetLines instanceof linesModule.Lines);Position.assert(sourceFromPos);Position.assert(targetFromPos);Position.assert(targetToPos);var targetComparison=comparePos(targetFromPos,targetToPos);if(targetComparison===0){return sourceFromPos}if(targetComparison<0){var sourceCursor=sourceLines.skipSpaces(sourceFromPos);var targetCursor=targetLines.skipSpaces(targetFromPos);var lineDiff=targetToPos.line-targetCursor.line;sourceCursor.line+=lineDiff;targetCursor.line+=lineDiff;if(lineDiff>0){sourceCursor.column=0;targetCursor.column=0}else{assert.strictEqual(lineDiff,0)}while(comparePos(targetCursor,targetToPos)<0&&targetLines.nextPos(targetCursor,true)){assert.ok(sourceLines.nextPos(sourceCursor,true));assert.strictEqual(sourceLines.charAt(sourceCursor),targetLines.charAt(targetCursor))}}else{var sourceCursor=sourceLines.skipSpaces(sourceFromPos,true);var targetCursor=targetLines.skipSpaces(targetFromPos,true);var lineDiff=targetToPos.line-targetCursor.line;sourceCursor.line+=lineDiff;targetCursor.line+=lineDiff;if(lineDiff<0){sourceCursor.column=sourceLines.getLineLength(sourceCursor.line);targetCursor.column=targetLines.getLineLength(targetCursor.line)}else{assert.strictEqual(lineDiff,0)}while(comparePos(targetToPos,targetCursor)<0&&targetLines.prevPos(targetCursor,true)){assert.ok(sourceLines.prevPos(sourceCursor,true));assert.strictEqual(sourceLines.charAt(sourceCursor),targetLines.charAt(targetCursor))}}return sourceCursor}},{"./lines":146,"./types":152,"./util":153,assert:90}],148:[function(require,module,exports){var defaults={esprima:require("esprima-fb"),tabWidth:4,useTabs:false,reuseWhitespace:true,wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:false,tolerant:true},hasOwn=defaults.hasOwnProperty;exports.normalize=function(options){options=options||defaults;function get(key){return hasOwn.call(options,key)?options[key]:defaults[key]}return{tabWidth:+get("tabWidth"),useTabs:!!get("useTabs"),reuseWhitespace:!!get("reuseWhitespace"),wrapColumn:Math.max(get("wrapColumn"),0),sourceFileName:get("sourceFileName"),sourceMapName:get("sourceMapName"),sourceRoot:get("sourceRoot"),inputSourceMap:get("inputSourceMap"),esprima:get("esprima"),range:get("range"),tolerant:get("tolerant")}}},{"esprima-fb":144}],149:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var b=types.builders;var isObject=types.builtInTypes.object;var isArray=types.builtInTypes.array;var isFunction=types.builtInTypes.function;var Patcher=require("./patcher").Patcher;var normalizeOptions=require("./options").normalize;var fromString=require("./lines").fromString;var attachComments=require("./comments").attach;exports.parse=function parse(source,options){options=normalizeOptions(options);var lines=fromString(source,options);var sourceWithoutTabs=lines.toString({tabWidth:options.tabWidth,reuseWhitespace:false,useTabs:false});var program=options.esprima.parse(sourceWithoutTabs,{loc:true,range:options.range,comment:true,tolerant:options.tolerant});var comments=program.comments;delete program.comments;var file=b.file(program);file.loc={lines:lines,indent:0,start:lines.firstPos(),end:lines.lastPos()};var copy=new TreeCopier(lines).copy(file);attachComments(comments,copy.program,lines);return copy};function TreeCopier(lines){assert.ok(this instanceof TreeCopier);this.lines=lines;this.indent=0}var TCp=TreeCopier.prototype;TCp.copy=function(node){if(isArray.check(node)){return node.map(this.copy,this)}if(!isObject.check(node)){return node}if(n.MethodDefinition&&n.MethodDefinition.check(node)||n.Property.check(node)&&(node.method||node.shorthand)){node.value.loc=null;if(n.FunctionExpression.check(node.value)){node.value.id=null}}var copy=Object.create(Object.getPrototypeOf(node),{original:{value:node,configurable:false,enumerable:false,writable:true}});var loc=node.loc;var oldIndent=this.indent;var newIndent=oldIndent;if(loc){if(loc.start.line<1){loc.start.line=1}if(loc.end.line<1){loc.end.line=1}if(this.lines.isPrecededOnlyByWhitespace(loc.start)){newIndent=this.indent=loc.start.column}loc.lines=this.lines;loc.indent=newIndent}var keys=Object.keys(node);var keyCount=keys.length;for(var i=0;i<keyCount;++i){var key=keys[i];if(key==="loc"){copy[key]=node[key]}else if(key==="comments"){}else{copy[key]=this.copy(node[key])}}this.indent=oldIndent;if(node.comments){Object.defineProperty(copy,"comments",{value:node.comments,enumerable:false})}return copy}},{"./comments":145,"./lines":146,"./options":148,"./patcher":150,"./types":152,assert:90}],150:[function(require,module,exports){var assert=require("assert");var linesModule=require("./lines");var types=require("./types");var getFieldValue=types.getFieldValue;var Node=types.namedTypes.Node;var Expression=types.namedTypes.Expression;var SourceLocation=types.namedTypes.SourceLocation;var util=require("./util");var comparePos=util.comparePos;var NodePath=types.NodePath;var isObject=types.builtInTypes.object;var isArray=types.builtInTypes.array;var isString=types.builtInTypes.string;function Patcher(lines){assert.ok(this instanceof Patcher);assert.ok(lines instanceof linesModule.Lines);var self=this,replacements=[];self.replace=function(loc,lines){if(isString.check(lines))lines=linesModule.fromString(lines);replacements.push({lines:lines,start:loc.start,end:loc.end})};self.get=function(loc){loc=loc||{start:{line:1,column:0},end:{line:lines.length,column:lines.getLineLength(lines.length)}};var sliceFrom=loc.start,toConcat=[];function pushSlice(from,to){assert.ok(comparePos(from,to)<=0);toConcat.push(lines.slice(from,to))}replacements.sort(function(a,b){return comparePos(a.start,b.start)}).forEach(function(rep){if(comparePos(sliceFrom,rep.start)>0){}else{pushSlice(sliceFrom,rep.start);toConcat.push(rep.lines);sliceFrom=rep.end}});pushSlice(sliceFrom,loc.end);return linesModule.concat(toConcat)}}exports.Patcher=Patcher;exports.getReprinter=function(path){assert.ok(path instanceof NodePath);var node=path.value;if(!Node.check(node))return;var orig=node.original;var origLoc=orig&&orig.loc;var lines=origLoc&&origLoc.lines;var reprints=[];if(!lines||!findReprints(path,reprints))return;return function(print){var patcher=new Patcher(lines);reprints.forEach(function(reprint){var old=reprint.oldPath.value;SourceLocation.assert(old.loc,true);patcher.replace(old.loc,print(reprint.newPath).indentTail(old.loc.indent))});return patcher.get(origLoc).indentTail(-orig.loc.indent)}};function findReprints(newPath,reprints){var newNode=newPath.value;Node.assert(newNode);var oldNode=newNode.original;Node.assert(oldNode);assert.deepEqual(reprints,[]);if(newNode.type!==oldNode.type){return false}var oldPath=new NodePath(oldNode);var canReprint=findChildReprints(newPath,oldPath,reprints);if(!canReprint){reprints.length=0}return canReprint}function findAnyReprints(newPath,oldPath,reprints){var newNode=newPath.value;var oldNode=oldPath.value;if(newNode===oldNode)return true;if(isArray.check(newNode))return findArrayReprints(newPath,oldPath,reprints);if(isObject.check(newNode))return findObjectReprints(newPath,oldPath,reprints);return false}function findArrayReprints(newPath,oldPath,reprints){var newNode=newPath.value;var oldNode=oldPath.value;isArray.assert(newNode);var len=newNode.length;if(!(isArray.check(oldNode)&&oldNode.length===len))return false;for(var i=0;i<len;++i)if(!findAnyReprints(newPath.get(i),oldPath.get(i),reprints))return false;return true}function findObjectReprints(newPath,oldPath,reprints){var newNode=newPath.value;isObject.assert(newNode);if(newNode.original===null){return false}var oldNode=oldPath.value;if(!isObject.check(oldNode))return false;if(Node.check(newNode)){if(!Node.check(oldNode)){return false}if(!oldNode.loc){return false}if(newNode.type===oldNode.type){var childReprints=[];if(findChildReprints(newPath,oldPath,childReprints)){reprints.push.apply(reprints,childReprints)}else{reprints.push({newPath:newPath,oldPath:oldPath})}return true}if(Expression.check(newNode)&&Expression.check(oldNode)){reprints.push({newPath:newPath,oldPath:oldPath});return true}return false}return findChildReprints(newPath,oldPath,reprints)}var reusablePos={line:1,column:0};function hasOpeningParen(oldPath){var oldNode=oldPath.value;var loc=oldNode.loc;var lines=loc&&loc.lines;if(lines){var pos=reusablePos;pos.line=loc.start.line;pos.column=loc.start.column;while(lines.prevPos(pos)){var ch=lines.charAt(pos);if(ch==="("){var rootPath=oldPath;while(rootPath.parentPath)rootPath=rootPath.parentPath;return comparePos(rootPath.value.loc.start,pos)<=0}if(ch!==" "){return false}}}return false}function hasClosingParen(oldPath){var oldNode=oldPath.value;var loc=oldNode.loc;var lines=loc&&loc.lines;if(lines){var pos=reusablePos;pos.line=loc.end.line;pos.column=loc.end.column;do{var ch=lines.charAt(pos);if(ch===")"){var rootPath=oldPath;while(rootPath.parentPath)rootPath=rootPath.parentPath;return comparePos(pos,rootPath.value.loc.end)<=0}if(ch!==" "){return false}}while(lines.nextPos(pos))}return false}function hasParens(oldPath){return hasOpeningParen(oldPath)&&hasClosingParen(oldPath)}function findChildReprints(newPath,oldPath,reprints){var newNode=newPath.value;var oldNode=oldPath.value;isObject.assert(newNode);isObject.assert(oldNode);if(newNode.original===null){return false}if(!newPath.canBeFirstInStatement()&&newPath.firstInStatement()&&!hasOpeningParen(oldPath))return false;if(newPath.needsParens(true)&&!hasParens(oldPath)){return false}for(var k in util.getUnionOfKeys(newNode,oldNode)){if(k==="loc")continue;if(!findAnyReprints(newPath.get(k),oldPath.get(k),reprints))return false}return true}},{"./lines":146,"./types":152,"./util":153,assert:90}],151:[function(require,module,exports){var assert=require("assert");var sourceMap=require("source-map");var printComments=require("./comments").printComments;var linesModule=require("./lines");var fromString=linesModule.fromString;var concat=linesModule.concat;var normalizeOptions=require("./options").normalize;var getReprinter=require("./patcher").getReprinter;var types=require("./types");var namedTypes=types.namedTypes;var isString=types.builtInTypes.string;var isObject=types.builtInTypes.object;var NodePath=types.NodePath;var util=require("./util");function PrintResult(code,sourceMap){assert.ok(this instanceof PrintResult);isString.assert(code);this.code=code;if(sourceMap){isObject.assert(sourceMap);this.map=sourceMap}}var PRp=PrintResult.prototype;var warnedAboutToString=false;PRp.toString=function(){if(!warnedAboutToString){console.warn("Deprecation warning: recast.print now returns an object with "+"a .code property. You appear to be treating the object as a "+"string, which might still work but is strongly discouraged.");warnedAboutToString=true}return this.code};var emptyPrintResult=new PrintResult("");function Printer(originalOptions){assert.ok(this instanceof Printer);var explicitTabWidth=originalOptions&&originalOptions.tabWidth;var options=normalizeOptions(originalOptions);assert.notStrictEqual(options,originalOptions);options.sourceFileName=null;function printWithComments(path){assert.ok(path instanceof NodePath);return printComments(path.node.comments,print(path),options)}function print(path,includeComments){if(includeComments)return printWithComments(path);assert.ok(path instanceof NodePath);if(!explicitTabWidth){var oldTabWidth=options.tabWidth;var loc=path.node.loc;if(loc&&loc.lines&&loc.lines.guessTabWidth){options.tabWidth=loc.lines.guessTabWidth();var lines=maybeReprint(path);options.tabWidth=oldTabWidth;return lines}}return maybeReprint(path)}function maybeReprint(path){var reprinter=getReprinter(path);if(reprinter)return maybeAddParens(path,reprinter(maybeReprint));return printRootGenerically(path)}function printRootGenerically(path){return genericPrint(path,options,printWithComments)}function printGenerically(path){return genericPrint(path,options,printGenerically)}this.print=function(ast){if(!ast){return emptyPrintResult}var path=ast instanceof NodePath?ast:new NodePath(ast);var lines=print(path,true);return new PrintResult(lines.toString(options),util.composeSourceMaps(options.inputSourceMap,lines.getSourceMap(options.sourceMapName,options.sourceRoot)))};this.printGenerically=function(ast){if(!ast){return emptyPrintResult}var path=ast instanceof NodePath?ast:new NodePath(ast);var oldReuseWhitespace=options.reuseWhitespace;options.reuseWhitespace=false;var pr=new PrintResult(printGenerically(path).toString(options));options.reuseWhitespace=oldReuseWhitespace;return pr}}exports.Printer=Printer;function maybeAddParens(path,lines){return path.needsParens()?concat(["(",lines,")"]):lines}function genericPrint(path,options,printPath){assert.ok(path instanceof NodePath);return maybeAddParens(path,genericPrintNoParens(path,options,printPath))}function genericPrintNoParens(path,options,print){var n=path.value;if(!n){return fromString("")}if(typeof n==="string"){return fromString(n,options)}namedTypes.Node.assert(n);switch(n.type){case"File":path=path.get("program");n=path.node;namedTypes.Program.assert(n);case"Program":return maybeAddSemicolon(printStatementSequence(path.get("body"),options,print));case"EmptyStatement":return fromString("");case"ExpressionStatement":return concat([print(path.get("expression")),";"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return fromString(" ").join([print(path.get("left")),n.operator,print(path.get("right"))]);case"MemberExpression":var parts=[print(path.get("object"))];if(n.computed)parts.push("[",print(path.get("property")),"]");else parts.push(".",print(path.get("property")));return concat(parts);case"Path":return fromString(".").join(n.body);case"Identifier":return fromString(n.name,options);case"SpreadElement":case"SpreadElementPattern":case"SpreadProperty":case"SpreadPropertyPattern":return concat(["...",print(path.get("argument"))]);case"FunctionDeclaration":case"FunctionExpression":var parts=[];if(n.async)parts.push("async ");parts.push("function");if(n.generator)parts.push("*");if(n.id)parts.push(" ",print(path.get("id")));parts.push("(",printFunctionParams(path,options,print),") ",print(path.get("body")));return concat(parts);case"ArrowFunctionExpression":var parts=[];if(n.async)parts.push("async ");if(n.params.length===1){parts.push(print(path.get("params",0)))}else{parts.push("(",printFunctionParams(path,options,print),")")}parts.push(" => ",print(path.get("body")));return concat(parts);case"MethodDefinition":var parts=[];if(n.static){parts.push("static ")}parts.push(printMethod(n.kind,path.get("key"),path.get("value"),options,print));return concat(parts);case"YieldExpression":var parts=["yield"];if(n.delegate)parts.push("*");if(n.argument)parts.push(" ",print(path.get("argument")));return concat(parts);case"AwaitExpression":var parts=["await"];if(n.all)parts.push("*");if(n.argument)parts.push(" ",print(path.get("argument")));return concat(parts);case"ModuleDeclaration":var parts=["module",print(path.get("id"))];if(n.source){assert.ok(!n.body);parts.push("from",print(path.get("source")))}else{parts.push(print(path.get("body")))}return fromString(" ").join(parts);case"ImportSpecifier":case"ExportSpecifier":var parts=[print(path.get("id"))];if(n.name)parts.push(" as ",print(path.get("name")));return concat(parts);case"ExportBatchSpecifier":return fromString("*");case"ImportNamespaceSpecifier":return concat(["* as ",print(path.get("id"))]);case"ImportDefaultSpecifier":return print(path.get("id"));case"ExportDeclaration":var parts=["export"];if(n["default"]){parts.push(" default")}else if(n.specifiers&&n.specifiers.length>0){if(n.specifiers.length===1&&n.specifiers[0].type==="ExportBatchSpecifier"){parts.push(" *")}else{parts.push(" { ",fromString(", ").join(path.get("specifiers").map(print))," }")}if(n.source)parts.push(" from ",print(path.get("source")));parts.push(";");return concat(parts)}if(n.declaration){if(!namedTypes.Node.check(n.declaration)){console.log(JSON.stringify(n,null,2))}var decLines=print(path.get("declaration"));parts.push(" ",decLines);if(lastNonSpaceCharacter(decLines)!==";"){parts.push(";")}}return concat(parts);case"ImportDeclaration":var parts=["import "];if(n.specifiers&&n.specifiers.length>0){var foundImportSpecifier=false;path.get("specifiers").each(function(sp){if(sp.name>0){parts.push(", ")}if(namedTypes.ImportDefaultSpecifier.check(sp.value)||namedTypes.ImportNamespaceSpecifier.check(sp.value)){assert.strictEqual(foundImportSpecifier,false)}else{namedTypes.ImportSpecifier.assert(sp.value);if(!foundImportSpecifier){foundImportSpecifier=true;parts.push("{")}}parts.push(print(sp))});if(foundImportSpecifier){parts.push("}")}parts.push(" from ")}parts.push(print(path.get("source")),";");return concat(parts);case"BlockStatement":var naked=printStatementSequence(path.get("body"),options,print);if(naked.isEmpty())return fromString("{}");return concat(["{\n",naked.indent(options.tabWidth),"\n}"]);case"ReturnStatement":var parts=["return"];if(n.argument){var argLines=print(path.get("argument"));if(argLines.length>1&&namedTypes.XJSElement&&namedTypes.XJSElement.check(n.argument)){parts.push(" (\n",argLines.indent(options.tabWidth),"\n)")}else{parts.push(" ",argLines)}}parts.push(";");return concat(parts);case"CallExpression":return concat([print(path.get("callee")),printArgumentsList(path,options,print)]);case"ObjectExpression":case"ObjectPattern":var allowBreak=false,len=n.properties.length,parts=[len>0?"{\n":"{"];path.get("properties").map(function(childPath){var prop=childPath.value;var i=childPath.name;var lines=print(childPath).indent(options.tabWidth);var multiLine=lines.length>1;if(multiLine&&allowBreak){parts.push("\n")}parts.push(lines);if(i<len-1){parts.push(multiLine?",\n\n":",\n");allowBreak=!multiLine}});parts.push(len>0?"\n}":"}");return concat(parts);case"PropertyPattern":return concat([print(path.get("key")),": ",print(path.get("pattern"))]);case"Property":if(n.method||n.kind==="get"||n.kind==="set"){return printMethod(n.kind,path.get("key"),path.get("value"),options,print)}if(path.node.shorthand){return print(path.get("key"))}else{return concat([print(path.get("key")),": ",print(path.get("value"))])}case"ArrayExpression":case"ArrayPattern":var elems=n.elements,len=elems.length,parts=["["];path.get("elements").each(function(elemPath){var elem=elemPath.value;if(!elem){parts.push(",")}else{var i=elemPath.name;if(i>0)parts.push(" ");parts.push(print(elemPath));if(i<len-1)parts.push(",")}});parts.push("]");return concat(parts);case"SequenceExpression":return fromString(", ").join(path.get("expressions").map(print));case"ThisExpression":return fromString("this");case"Literal":if(typeof n.value!=="string")return fromString(n.value,options);case"ModuleSpecifier":return fromString(nodeStr(n),options);case"UnaryExpression":var parts=[n.operator];if(/[a-z]$/.test(n.operator))parts.push(" ");parts.push(print(path.get("argument")));return concat(parts);case"UpdateExpression":var parts=[print(path.get("argument")),n.operator];if(n.prefix)parts.reverse();return concat(parts);case"ConditionalExpression":return concat(["(",print(path.get("test"))," ? ",print(path.get("consequent"))," : ",print(path.get("alternate")),")"]);case"NewExpression":var parts=["new ",print(path.get("callee"))];var args=n.arguments;if(args){parts.push(printArgumentsList(path,options,print))}return concat(parts);case"VariableDeclaration":var parts=[n.kind," "];var maxLen=0;var printed=path.get("declarations").map(function(childPath){var lines=print(childPath);maxLen=Math.max(lines.length,maxLen);return lines});if(maxLen===1){parts.push(fromString(", ").join(printed))}else if(printed.length>1){parts.push(fromString(",\n").join(printed).indentTail(n.kind.length+1))}else{parts.push(printed[0])}var parentNode=path.parent&&path.parent.node;if(!namedTypes.ForStatement.check(parentNode)&&!namedTypes.ForInStatement.check(parentNode)&&!(namedTypes.ForOfStatement&&namedTypes.ForOfStatement.check(parentNode))){parts.push(";")}return concat(parts);case"VariableDeclarator":return n.init?fromString(" = ").join([print(path.get("id")),print(path.get("init"))]):print(path.get("id"));case"WithStatement":return concat(["with (",print(path.get("object")),") ",print(path.get("body"))]);case"IfStatement":var con=adjustClause(print(path.get("consequent")),options),parts=["if (",print(path.get("test")),")",con];if(n.alternate)parts.push(endsWithBrace(con)?" else":"\nelse",adjustClause(print(path.get("alternate")),options));return concat(parts);case"ForStatement":var init=print(path.get("init")),sep=init.length>1?";\n":"; ",forParen="for (",indented=fromString(sep).join([init,print(path.get("test")),print(path.get("update"))]).indentTail(forParen.length),head=concat([forParen,indented,")"]),clause=adjustClause(print(path.get("body")),options),parts=[head];if(head.length>1){parts.push("\n");clause=clause.trimLeft()}parts.push(clause);return concat(parts);case"WhileStatement":return concat(["while (",print(path.get("test")),")",adjustClause(print(path.get("body")),options)]);case"ForInStatement":return concat([n.each?"for each (":"for (",print(path.get("left"))," in ",print(path.get("right")),")",adjustClause(print(path.get("body")),options)]);case"ForOfStatement":return concat(["for (",print(path.get("left"))," of ",print(path.get("right")),")",adjustClause(print(path.get("body")),options)]); case"DoWhileStatement":var doBody=concat(["do",adjustClause(print(path.get("body")),options)]),parts=[doBody];if(endsWithBrace(doBody))parts.push(" while");else parts.push("\nwhile");parts.push(" (",print(path.get("test")),");");return concat(parts);case"BreakStatement":var parts=["break"];if(n.label)parts.push(" ",print(path.get("label")));parts.push(";");return concat(parts);case"ContinueStatement":var parts=["continue"];if(n.label)parts.push(" ",print(path.get("label")));parts.push(";");return concat(parts);case"LabeledStatement":return concat([print(path.get("label")),":\n",print(path.get("body"))]);case"TryStatement":var parts=["try ",print(path.get("block"))];path.get("handlers").each(function(handler){parts.push(" ",print(handler))});if(n.finalizer)parts.push(" finally ",print(path.get("finalizer")));return concat(parts);case"CatchClause":var parts=["catch (",print(path.get("param"))];if(n.guard)parts.push(" if ",print(path.get("guard")));parts.push(") ",print(path.get("body")));return concat(parts);case"ThrowStatement":return concat(["throw ",print(path.get("argument")),";"]);case"SwitchStatement":return concat(["switch (",print(path.get("discriminant")),") {\n",fromString("\n").join(path.get("cases").map(print)),"\n}"]);case"SwitchCase":var parts=[];if(n.test)parts.push("case ",print(path.get("test")),":");else parts.push("default:");if(n.consequent.length>0){parts.push("\n",printStatementSequence(path.get("consequent"),options,print).indent(options.tabWidth))}return concat(parts);case"DebuggerStatement":return fromString("debugger;");case"XJSAttribute":var parts=[print(path.get("name"))];if(n.value)parts.push("=",print(path.get("value")));return concat(parts);case"XJSIdentifier":return fromString(n.name,options);case"XJSNamespacedName":return fromString(":").join([print(path.get("namespace")),print(path.get("name"))]);case"XJSMemberExpression":return fromString(".").join([print(path.get("object")),print(path.get("property"))]);case"XJSSpreadAttribute":return concat(["{...",print(path.get("argument")),"}"]);case"XJSExpressionContainer":return concat(["{",print(path.get("expression")),"}"]);case"XJSElement":var openingLines=print(path.get("openingElement"));if(n.openingElement.selfClosing){assert.ok(!n.closingElement);return openingLines}var childLines=concat(path.get("children").map(function(childPath){var child=childPath.value;if(namedTypes.Literal.check(child)&&typeof child.value==="string"){if(/\S/.test(child.value)){return child.value.replace(/^\s+|\s+$/g,"")}else if(/\n/.test(child.value)){return"\n"}}return print(childPath)})).indentTail(options.tabWidth);var closingLines=print(path.get("closingElement"));return concat([openingLines,childLines,closingLines]);case"XJSOpeningElement":var parts=["<",print(path.get("name"))];var attrParts=[];path.get("attributes").each(function(attrPath){attrParts.push(" ",print(attrPath))});var attrLines=concat(attrParts);var needLineWrap=attrLines.length>1||attrLines.getLineLength(1)>options.wrapColumn;if(needLineWrap){attrParts.forEach(function(part,i){if(part===" "){assert.strictEqual(i%2,0);attrParts[i]="\n"}});attrLines=concat(attrParts).indentTail(options.tabWidth)}parts.push(attrLines,n.selfClosing?" />":">");return concat(parts);case"XJSClosingElement":return concat(["</",print(path.get("name")),">"]);case"XJSText":return fromString(n.value,options);case"XJSEmptyExpression":return fromString("");case"TypeAnnotatedIdentifier":var parts=[print(path.get("annotation"))," ",print(path.get("identifier"))];return concat(parts);case"ClassBody":if(n.body.length===0){return fromString("{}")}return concat(["{\n",printStatementSequence(path.get("body"),options,print).indent(options.tabWidth),"\n}"]);case"ClassPropertyDefinition":var parts=["static ",print(path.get("definition"))];if(!namedTypes.MethodDefinition.check(n.definition))parts.push(";");return concat(parts);case"ClassProperty":return concat([print(path.get("id")),";"]);case"ClassDeclaration":case"ClassExpression":var parts=["class"];if(n.id)parts.push(" ",print(path.get("id")));if(n.superClass)parts.push(" extends ",print(path.get("superClass")));parts.push(" ",print(path.get("body")));return concat(parts);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Block":case"Line":throw new Error("unprintable type: "+JSON.stringify(n.type));case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"TaggedTemplateExpression":case"TemplateElement":case"TemplateLiteral":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"AnyTypeAnnotation":case"BooleanTypeAnnotation":case"ClassImplements":case"DeclareClass":case"DeclareFunction":case"DeclareModule":case"DeclareVariable":case"FunctionTypeAnnotation":case"FunctionTypeParam":case"GenericTypeAnnotation":case"InterfaceDeclaration":case"InterfaceExtends":case"IntersectionTypeAnnotation":case"MemberTypeAnnotation":case"NullableTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"QualifiedTypeIdentifier":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"TupleTypeAnnotation":case"Type":case"TypeAlias":case"TypeAnnotation":case"TypeParameterDeclaration":case"TypeParameterInstantiation":case"TypeofTypeAnnotation":case"UnionTypeAnnotation":case"VoidTypeAnnotation":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:debugger;throw new Error("unknown type: "+JSON.stringify(n.type))}return p}function printStatementSequence(path,options,print){var inClassBody=path.parent&&namedTypes.ClassBody&&namedTypes.ClassBody.check(path.parent.node);var filtered=path.filter(function(stmtPath){var stmt=stmtPath.value;if(!stmt)return false;if(stmt.type==="EmptyStatement")return false;if(!inClassBody){namedTypes.Statement.assert(stmt)}return true});var prevTrailingSpace=null;var len=filtered.length;var parts=[];filtered.forEach(function(stmtPath,i){var printed=print(stmtPath);var stmt=stmtPath.value;var needSemicolon=true;var multiLine=printed.length>1;var notFirst=i>0;var notLast=i<len-1;var leadingSpace;var trailingSpace;if(inClassBody){var stmt=stmtPath.value;if(namedTypes.MethodDefinition.check(stmt)||namedTypes.ClassPropertyDefinition.check(stmt)&&namedTypes.MethodDefinition.check(stmt.definition)){needSemicolon=false}}if(needSemicolon){printed=maybeAddSemicolon(printed)}var trueLoc=options.reuseWhitespace&&getTrueLoc(stmt);var lines=trueLoc&&trueLoc.lines;if(notFirst){if(lines){var beforeStart=lines.skipSpaces(trueLoc.start,true);var beforeStartLine=beforeStart?beforeStart.line:1;var leadingGap=trueLoc.start.line-beforeStartLine;leadingSpace=Array(leadingGap+1).join("\n")}else{leadingSpace=multiLine?"\n\n":"\n"}}else{leadingSpace=""}if(notLast){if(lines){var afterEnd=lines.skipSpaces(trueLoc.end);var afterEndLine=afterEnd?afterEnd.line:lines.length;var trailingGap=afterEndLine-trueLoc.end.line;trailingSpace=Array(trailingGap+1).join("\n")}else{trailingSpace=multiLine?"\n\n":"\n"}}else{trailingSpace=""}parts.push(maxSpace(prevTrailingSpace,leadingSpace),printed);if(notLast){prevTrailingSpace=trailingSpace}else if(trailingSpace){parts.push(trailingSpace)}});return concat(parts)}function getTrueLoc(node){if(!node.loc){return null}if(!node.comments){return node.loc}var start=node.loc.start;var end=node.loc.end;node.comments.forEach(function(comment){if(comment.loc){if(util.comparePos(comment.loc.start,start)<0){start=comment.loc.start}if(util.comparePos(end,comment.loc.end)<0){end=comment.loc.end}}});return{lines:node.loc.lines,start:start,end:end}}function maxSpace(s1,s2){if(!s1&&!s2){return fromString("")}if(!s1){return fromString(s2)}if(!s2){return fromString(s1)}var spaceLines1=fromString(s1);var spaceLines2=fromString(s2);if(spaceLines2.length>spaceLines1.length){return spaceLines2}return spaceLines1}function printMethod(kind,keyPath,valuePath,options,print){var parts=[];var key=keyPath.value;var value=valuePath.value;namedTypes.FunctionExpression.assert(value);if(value.async){parts.push("async ")}if(!kind||kind==="init"){if(value.generator){parts.push("*")}}else{assert.ok(kind==="get"||kind==="set");parts.push(kind," ")}parts.push(print(keyPath),"(",printFunctionParams(valuePath,options,print),") ",print(valuePath.get("body")));return concat(parts)}function printArgumentsList(path,options,print){var printed=path.get("arguments").map(print);var joined=fromString(", ").join(printed);if(joined.getLineLength(1)>options.wrapColumn){joined=fromString(",\n").join(printed);return concat(["(\n",joined.indent(options.tabWidth),"\n)"])}return concat(["(",joined,")"])}function printFunctionParams(path,options,print){var fun=path.node;namedTypes.Function.assert(fun);var params=path.get("params");var defaults=path.get("defaults");var printed=params.map(defaults.value?function(param){var p=print(param);var d=defaults.get(param.name);return d.value?concat([p,"=",print(d)]):p}:print);if(fun.rest){printed.push(concat(["...",print(path.get("rest"))]))}var joined=fromString(", ").join(printed);if(joined.length>1||joined.getLineLength(1)>options.wrapColumn){joined=fromString(",\n").join(printed);return concat(["\n",joined.indent(options.tabWidth)])}return joined}function adjustClause(clause,options){if(clause.length>1)return concat([" ",clause]);return concat(["\n",maybeAddSemicolon(clause).indent(options.tabWidth)])}function lastNonSpaceCharacter(lines){var pos=lines.lastPos();do{var ch=lines.charAt(pos);if(/\S/.test(ch))return ch}while(lines.prevPos(pos))}function endsWithBrace(lines){return lastNonSpaceCharacter(lines)==="}"}function nodeStr(n){namedTypes.Literal.assert(n);isString.assert(n.value);return JSON.stringify(n.value)}function maybeAddSemicolon(lines){var eoc=lastNonSpaceCharacter(lines);if(!eoc||"\n};".indexOf(eoc)<0)return concat([lines,";"]);return lines}},{"./comments":145,"./lines":146,"./options":148,"./patcher":150,"./types":152,"./util":153,assert:90,"source-map":163}],152:[function(require,module,exports){var types=require("ast-types");var def=types.Type.def;def("File").bases("Node").build("program").field("program",def("Program"));types.finalize();module.exports=types},{"ast-types":88}],153:[function(require,module,exports){var assert=require("assert");var getFieldValue=require("./types").getFieldValue;var sourceMap=require("source-map");var SourceMapConsumer=sourceMap.SourceMapConsumer;var SourceMapGenerator=sourceMap.SourceMapGenerator;var hasOwn=Object.prototype.hasOwnProperty;function getUnionOfKeys(){var result={};var argc=arguments.length;for(var i=0;i<argc;++i){var keys=Object.keys(arguments[i]);var keyCount=keys.length;for(var j=0;j<keyCount;++j){result[keys[j]]=true}}return result}exports.getUnionOfKeys=getUnionOfKeys;function comparePos(pos1,pos2){return pos1.line-pos2.line||pos1.column-pos2.column}exports.comparePos=comparePos;exports.composeSourceMaps=function(formerMap,latterMap){if(formerMap){if(!latterMap){return formerMap}}else{return latterMap||null}var smcFormer=new SourceMapConsumer(formerMap);var smcLatter=new SourceMapConsumer(latterMap);var smg=new SourceMapGenerator({file:latterMap.file,sourceRoot:latterMap.sourceRoot});var sourcesToContents={};smcLatter.eachMapping(function(mapping){var origPos=smcFormer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});var sourceName=origPos.source;if(sourceName===null){return}smg.addMapping({source:sourceName,original:{line:origPos.line,column:origPos.column},generated:{line:mapping.generatedLine,column:mapping.generatedColumn},name:mapping.name});var sourceContent=smcFormer.sourceContentFor(sourceName);if(sourceContent&&!hasOwn.call(sourcesToContents,sourceName)){sourcesToContents[sourceName]=sourceContent;smg.setSourceContent(sourceName,sourceContent)}});return smg.toJSON()}},{"./types":152,assert:90,"source-map":163}],154:[function(require,module,exports){(function(process){var types=require("./lib/types");var parse=require("./lib/parser").parse;var Printer=require("./lib/printer").Printer;function print(node,options){return new Printer(options).print(node)}function prettyPrint(node,options){return new Printer(options).printGenerically(node)}function run(transformer,options){return runFile(process.argv[2],transformer,options)}function runFile(path,transformer,options){require("fs").readFile(path,"utf-8",function(err,code){if(err){console.error(err);return}runString(code,transformer,options)})}function defaultWriteback(output){process.stdout.write(output)}function runString(code,transformer,options){var writeback=options&&options.writeback||defaultWriteback;transformer(parse(code,options),function(node){writeback(print(node,options).code)})}Object.defineProperties(exports,{parse:{enumerable:true,value:parse},visit:{enumerable:true,value:types.visit},print:{enumerable:true,value:print},prettyPrint:{enumerable:false,value:prettyPrint},types:{enumerable:false,value:types},run:{enumerable:false,value:run}})}).call(this,require("_process"))},{"./lib/parser":149,"./lib/printer":151,"./lib/types":152,_process:99,fs:89}],155:[function(require,module,exports){(function(process){var Stream=require("stream");exports=module.exports=through;through.through=through;function through(write,end,opts){write=write||function(data){this.queue(data)};end=end||function(){this.queue(null)};var ended=false,destroyed=false,buffer=[],_ended=false;var stream=new Stream;stream.readable=stream.writable=true;stream.paused=false;stream.autoDestroy=!(opts&&opts.autoDestroy===false);stream.write=function(data){write.call(this,data);return!stream.paused};function drain(){while(buffer.length&&!stream.paused){var data=buffer.shift();if(null===data)return stream.emit("end");else stream.emit("data",data)}}stream.queue=stream.push=function(data){if(_ended)return stream;if(data==null)_ended=true;buffer.push(data);drain();return stream};stream.on("end",function(){stream.readable=false;if(!stream.writable&&stream.autoDestroy)process.nextTick(function(){stream.destroy()})});function _end(){stream.writable=false;end.call(stream);if(!stream.readable&&stream.autoDestroy)stream.destroy()}stream.end=function(data){if(ended)return;ended=true;if(arguments.length)stream.write(data);_end();return stream};stream.destroy=function(){if(destroyed)return;destroyed=true;ended=true;buffer.length=0;stream.writable=stream.readable=false;stream.emit("close");return stream};stream.pause=function(){if(stream.paused)return;stream.paused=true;return stream};stream.resume=function(){if(stream.paused){stream.paused=false;stream.emit("resume")}drain();if(!stream.paused)stream.emit("drain");return stream};return stream}}).call(this,require("_process"))},{_process:99,stream:111}],156:[function(require,module,exports){!function(){var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";if(typeof regeneratorRuntime==="object"){return}var runtime=regeneratorRuntime=typeof exports==="undefined"?{}:exports;function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])}runtime.wrap=wrap;var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype;GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName="GeneratorFunction";runtime.isGeneratorFunction=function(genFun){var ctor=typeof genFun==="function"&&genFun.constructor;return ctor?ctor===GeneratorFunction||(ctor.displayName||ctor.name)==="GeneratorFunction":false};runtime.mark=function(genFun){genFun.__proto__=GeneratorFunctionPrototype;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){try{var info=this(arg);var value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){return doneResult()}while(true){var delegate=context.delegate;if(delegate){try{var info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;var info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod){return iteratorMethod.call(iterable)}if(typeof iterable.next==="function"){return iterable}if(!isNaN(iterable.length)){var i=-1;function next(){while(++i<iterable.length){if(hasOwn.call(iterable,i)){next.value=iterable[i];next.done=false;return next}}next.value=undefined;next.done=true;return next}return next.next=next}}return{next:doneResult}}runtime.values=values;function doneResult(){return{value:undefined,done:true}}Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}()},{}],157:[function(require,module,exports){var regenerate=require("regenerate");exports.REGULAR={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,65535),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)};exports.UNICODE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)};exports.UNICODE_IGNORE_CASE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:159}],158:[function(require,module,exports){module.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},{}],159:[function(require,module,exports){(function(global){(function(root){var freeExports=typeof exports=="object"&&exports;var freeModule=typeof module=="object"&&module&&module.exports==freeExports&&module;var freeGlobal=typeof global=="object"&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal){root=freeGlobal}var ERRORS={rangeOrder:"A range’s `stop` value must be greater than or equal "+"to the `start` value.",codePointRange:"Invalid code point value. Code points range from "+"U+000000 to U+10FFFF."};var HIGH_SURROGATE_MIN=55296;var HIGH_SURROGATE_MAX=56319;var LOW_SURROGATE_MIN=56320;var LOW_SURROGATE_MAX=57343;var regexNull=/\\x00([^0123456789]|$)/g;var object={};var hasOwnProperty=object.hasOwnProperty;var extend=function(destination,source){var key;for(key in source){if(hasOwnProperty.call(source,key)){destination[key]=source[key]}}return destination};var forEach=function(array,callback){var index=-1;var length=array.length;while(++index<length){callback(array[index],index)}};var toString=object.toString;var isArray=function(value){return toString.call(value)=="[object Array]"};var isNumber=function(value){return typeof value=="number"||toString.call(value)=="[object Number]"};var zeroes="0000";var pad=function(number,totalCharacters){var string=String(number);return string.length<totalCharacters?(zeroes+string).slice(-totalCharacters):string};var hex=function(number){return Number(number).toString(16).toUpperCase()};var slice=[].slice;var dataFromCodePoints=function(codePoints){var index=-1;var length=codePoints.length;var max=length-1;var result=[];var isStart=true;var tmp;var previous=0;while(++index<length){tmp=codePoints[index];if(isStart){result.push(tmp);previous=tmp;isStart=false}else{if(tmp==previous+1){if(index!=max){previous=tmp;continue}else{isStart=true;result.push(tmp+1)}}else{result.push(previous+1,tmp);previous=tmp}}}if(!isStart){result.push(tmp+1)}return result};var dataRemove=function(data,codePoint){var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){if(codePoint==start){if(end==start+1){data.splice(index,2);return data}else{data[index]=codePoint+1;return data}}else if(codePoint==end-1){data[index+1]=codePoint;return data}else{data.splice(index,2,start,codePoint,codePoint+1,end);return data}}index+=2}return data};var dataRemoveRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}var index=0;var start;var end;while(index<data.length){start=data[index];end=data[index+1]-1;if(start>rangeEnd){return data}if(rangeStart<=start&&rangeEnd>=end){data.splice(index,2);continue}if(rangeStart>=start&&rangeEnd<end){if(rangeStart==start){data[index]=rangeEnd+1;data[index+1]=end+1;return data}data.splice(index,2,start,rangeStart,rangeEnd+1,end+1);return data}if(rangeStart>=start&&rangeStart<=end){data[index+1]=rangeStart}else if(rangeEnd>=start&&rangeEnd<=end){data[index]=rangeEnd+1;return data}index+=2}return data};var dataAdd=function(data,codePoint){var index=0;var start;var end;var lastIndex=null;var length=data.length;if(codePoint<0||codePoint>1114111){throw RangeError(ERRORS.codePointRange)}while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return data}if(codePoint==start-1){data[index]=codePoint;return data}if(start>codePoint){data.splice(lastIndex!=null?lastIndex+2:0,0,codePoint,codePoint+1);return data}if(codePoint==end){if(codePoint+1==data[index+2]){data.splice(index,4,start,data[index+3]);return data}data[index+1]=codePoint+1;return data}lastIndex=index;index+=2}data.push(codePoint,codePoint+1);return data};var dataAddData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataAdd(data,start)}else{data=dataAddRange(data,start,end)}index+=2}return data};var dataRemoveData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataRemove(data,start)}else{data=dataRemoveRange(data,start,end)}index+=2}return data};var dataAddRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}if(rangeStart<0||rangeStart>1114111||rangeEnd<0||rangeEnd>1114111){throw RangeError(ERRORS.codePointRange)}var index=0;var start;var end;var added=false;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(added){if(start==rangeEnd+1){data.splice(index-1,2);return data}if(start>rangeEnd){return data}if(start>=rangeStart&&start<=rangeEnd){if(end>rangeStart&&end-1<=rangeEnd){data.splice(index,2);index-=2}else{data.splice(index-1,2);index-=2}}}else if(start==rangeEnd+1){data[index]=rangeStart;return data}else if(start>rangeEnd){data.splice(index,0,rangeStart,rangeEnd+1);return data}else if(rangeStart>=start&&rangeStart<end&&rangeEnd+1<=end){return data}else if(rangeStart>=start&&rangeStart<end||end==rangeStart){data[index+1]=rangeEnd+1;added=true}else if(rangeStart<=start&&rangeEnd+1>=end){data[index]=rangeStart;data[index+1]=rangeEnd+1;added=true}index+=2}if(!added){data.push(rangeStart,rangeEnd+1)}return data};var dataContains=function(data,codePoint){var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return true}index+=2 }return false};var dataIntersection=function(data,codePoints){var index=0;var length=codePoints.length;var codePoint;var result=[];while(index<length){codePoint=codePoints[index];if(dataContains(data,codePoint)){result.push(codePoint)}++index}return dataFromCodePoints(result)};var dataIsEmpty=function(data){return!data.length};var dataIsSingleton=function(data){return data.length==2&&data[0]+1==data[1]};var dataToArray=function(data){var index=0;var start;var end;var result=[];var length=data.length;while(index<length){start=data[index];end=data[index+1];while(start<end){result.push(start);++start}index+=2}return result};var floor=Math.floor;var highSurrogate=function(codePoint){return parseInt(floor((codePoint-65536)/1024)+HIGH_SURROGATE_MIN,10)};var lowSurrogate=function(codePoint){return parseInt((codePoint-65536)%1024+LOW_SURROGATE_MIN,10)};var stringFromCharCode=String.fromCharCode;var codePointToString=function(codePoint){var string;if(codePoint==9){string="\\t"}else if(codePoint==10){string="\\n"}else if(codePoint==12){string="\\f"}else if(codePoint==13){string="\\r"}else if(codePoint==92){string="\\\\"}else if(codePoint==36||codePoint>=40&&codePoint<=43||codePoint==45||codePoint==46||codePoint==63||codePoint>=91&&codePoint<=94||codePoint>=123&&codePoint<=125){string="\\"+stringFromCharCode(codePoint)}else if(codePoint>=32&&codePoint<=126){string=stringFromCharCode(codePoint)}else if(codePoint<=255){string="\\x"+pad(hex(codePoint),2)}else{string="\\u"+pad(hex(codePoint),4)}return string};var symbolToCodePoint=function(symbol){var length=symbol.length;var first=symbol.charCodeAt(0);var second;if(first>=HIGH_SURROGATE_MIN&&first<=HIGH_SURROGATE_MAX&&length>1){second=symbol.charCodeAt(1);return(first-HIGH_SURROGATE_MIN)*1024+second-LOW_SURROGATE_MIN+65536}return first};var createBMPCharacterClasses=function(data){var result="";var index=0;var start;var end;var length=data.length;if(dataIsSingleton(data)){return codePointToString(data[0])}while(index<length){start=data[index];end=data[index+1]-1;if(start==end){result+=codePointToString(start)}else if(start+1==end){result+=codePointToString(start)+codePointToString(end)}else{result+=codePointToString(start)+"-"+codePointToString(end)}index+=2}return"["+result+"]"};var splitAtBMP=function(data){var loneHighSurrogates=[];var bmp=[];var astral=[];var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1]-1;if(start<=65535&&end<=65535){if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){if(end<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,end+1)}else{loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);bmp.push(HIGH_SURROGATE_MAX+1,end+1)}}else if(end>=HIGH_SURROGATE_MIN&&end<=HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN);loneHighSurrogates.push(HIGH_SURROGATE_MIN,end+1)}else if(start<HIGH_SURROGATE_MIN&&end>HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1,end+1);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1)}else{bmp.push(start,end+1)}}else if(start<=65535&&end>65535){if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);bmp.push(HIGH_SURROGATE_MAX+1,65535+1)}else if(start<HIGH_SURROGATE_MIN){bmp.push(start,HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1,65535+1);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1)}else{bmp.push(start,65535+1)}astral.push(65535+1,end+1)}else{astral.push(start,end+1)}index+=2}return{loneHighSurrogates:loneHighSurrogates,bmp:bmp,astral:astral}};var optimizeSurrogateMappings=function(surrogateMappings){var result=[];var tmpLow=[];var addLow=false;var mapping;var nextMapping;var highSurrogates;var lowSurrogates;var nextHighSurrogates;var nextLowSurrogates;var index=-1;var length=surrogateMappings.length;while(++index<length){mapping=surrogateMappings[index];nextMapping=surrogateMappings[index+1];if(!nextMapping){result.push(mapping);continue}highSurrogates=mapping[0];lowSurrogates=mapping[1];nextHighSurrogates=nextMapping[0];nextLowSurrogates=nextMapping[1];tmpLow=lowSurrogates;while(nextHighSurrogates&&highSurrogates[0]==nextHighSurrogates[0]&&highSurrogates[1]==nextHighSurrogates[1]){if(dataIsSingleton(nextLowSurrogates)){tmpLow=dataAdd(tmpLow,nextLowSurrogates[0])}else{tmpLow=dataAddRange(tmpLow,nextLowSurrogates[0],nextLowSurrogates[1]-1)}++index;mapping=surrogateMappings[index];highSurrogates=mapping[0];lowSurrogates=mapping[1];nextMapping=surrogateMappings[index+1];nextHighSurrogates=nextMapping&&nextMapping[0];nextLowSurrogates=nextMapping&&nextMapping[1];addLow=true}result.push([highSurrogates,addLow?tmpLow:lowSurrogates]);addLow=false}return optimizeByLowSurrogates(result)};var optimizeByLowSurrogates=function(surrogateMappings){if(surrogateMappings.length==1){return surrogateMappings}var index=-1;var innerIndex=-1;while(++index<surrogateMappings.length){var mapping=surrogateMappings[index];var lowSurrogates=mapping[1];var lowSurrogateStart=lowSurrogates[0];var lowSurrogateEnd=lowSurrogates[1];innerIndex=index;while(++innerIndex<surrogateMappings.length){var otherMapping=surrogateMappings[innerIndex];var otherLowSurrogates=otherMapping[1];var otherLowSurrogateStart=otherLowSurrogates[0];var otherLowSurrogateEnd=otherLowSurrogates[1];if(lowSurrogateStart==otherLowSurrogateStart&&lowSurrogateEnd==otherLowSurrogateEnd){if(dataIsSingleton(otherMapping[0])){mapping[0]=dataAdd(mapping[0],otherMapping[0][0])}else{mapping[0]=dataAddRange(mapping[0],otherMapping[0][0],otherMapping[0][1]-1)}surrogateMappings.splice(innerIndex,1);--innerIndex}}}return surrogateMappings};var surrogateSet=function(data){if(!data.length){return[]}var index=0;var start;var end;var startHigh;var startLow;var prevStartHigh=0;var prevEndHigh=0;var tmpLow=[];var endHigh;var endLow;var surrogateMappings=[];var length=data.length;var dataHigh=[];while(index<length){start=data[index];end=data[index+1]-1;startHigh=highSurrogate(start);startLow=lowSurrogate(start);endHigh=highSurrogate(end);endLow=lowSurrogate(end);var startsWithLowestLowSurrogate=startLow==LOW_SURROGATE_MIN;var endsWithHighestLowSurrogate=endLow==LOW_SURROGATE_MAX;var complete=false;if(startHigh==endHigh||startsWithLowestLowSurrogate&&endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh,endHigh+1],[startLow,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh,startHigh+1],[startLow,LOW_SURROGATE_MAX+1]])}if(!complete&&startHigh+1<endHigh){if(endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh+1,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh+1,endHigh],[LOW_SURROGATE_MIN,LOW_SURROGATE_MAX+1]])}}if(!complete){surrogateMappings.push([[endHigh,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]])}prevStartHigh=startHigh;prevEndHigh=endHigh;index+=2}return optimizeSurrogateMappings(surrogateMappings)};var createSurrogateCharacterClasses=function(surrogateMappings){var result=[];forEach(surrogateMappings,function(surrogateMapping){var highSurrogates=surrogateMapping[0];var lowSurrogates=surrogateMapping[1];result.push(createBMPCharacterClasses(highSurrogates)+createBMPCharacterClasses(lowSurrogates))});return result.join("|")};var createCharacterClassesFromData=function(data){var result=[];var parts=splitAtBMP(data);var loneHighSurrogates=parts.loneHighSurrogates;var bmp=parts.bmp;var astral=parts.astral;var hasAstral=!dataIsEmpty(parts.astral);var hasLoneSurrogates=!dataIsEmpty(loneHighSurrogates);var surrogateMappings=surrogateSet(astral);if(!hasAstral&&hasLoneSurrogates){bmp=dataAddData(bmp,loneHighSurrogates)}if(!dataIsEmpty(bmp)){result.push(createBMPCharacterClasses(bmp))}if(surrogateMappings.length){result.push(createSurrogateCharacterClasses(surrogateMappings))}if(hasAstral&&hasLoneSurrogates){result.push(createBMPCharacterClasses(loneHighSurrogates))}return result.join("|")};var regenerate=function(value){if(arguments.length>1){value=slice.call(arguments)}if(this instanceof regenerate){this.data=[];return value?this.add(value):this}return(new regenerate).add(value)};regenerate.version="1.0.1";var proto=regenerate.prototype;extend(proto,{add:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataAddData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.add(item)});return $this}$this.data=dataAdd($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},remove:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataRemoveData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.remove(item)});return $this}$this.data=dataRemove($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},addRange:function(start,end){var $this=this;$this.data=dataAddRange($this.data,isNumber(start)?start:symbolToCodePoint(start),isNumber(end)?end:symbolToCodePoint(end));return $this},removeRange:function(start,end){var $this=this;var startCodePoint=isNumber(start)?start:symbolToCodePoint(start);var endCodePoint=isNumber(end)?end:symbolToCodePoint(end);$this.data=dataRemoveRange($this.data,startCodePoint,endCodePoint);return $this},intersection:function(argument){var $this=this;var array=argument instanceof regenerate?dataToArray(argument.data):argument;$this.data=dataIntersection($this.data,array);return $this},contains:function(codePoint){return dataContains(this.data,isNumber(codePoint)?codePoint:symbolToCodePoint(codePoint))},clone:function(){var set=new regenerate;set.data=this.data.slice(0);return set},toString:function(){var result=createCharacterClassesFromData(this.data);return result.replace(regexNull,"\\0$1")},toRegExp:function(flags){return RegExp(this.toString(),flags||"")},valueOf:function(){return dataToArray(this.data)}});proto.toArray=proto.valueOf;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return regenerate})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=regenerate}else{freeExports.regenerate=regenerate}}else{root.regenerate=regenerate}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],160:[function(require,module,exports){(function(global){(function(){"use strict";var objectTypes={"function":true,object:true};var root=objectTypes[typeof window]&&window||this;var oldRoot=root;var freeExports=objectTypes[typeof exports]&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)){root=freeGlobal}var stringFromCharCode=String.fromCharCode;var floor=Math.floor;function fromCodePoint(){var MAX_SIZE=16384;var codeUnits=[];var highSurrogate;var lowSurrogate;var index=-1;var length=arguments.length;if(!length){return""}var result="";while(++index<length){var codePoint=Number(arguments[index]);if(!isFinite(codePoint)||codePoint<0||codePoint>1114111||floor(codePoint)!=codePoint){throw RangeError("Invalid code point: "+codePoint)}if(codePoint<=65535){codeUnits.push(codePoint)}else{codePoint-=65536;highSurrogate=(codePoint>>10)+55296;lowSurrogate=codePoint%1024+56320;codeUnits.push(highSurrogate,lowSurrogate)}if(index+1==length||codeUnits.length>MAX_SIZE){result+=stringFromCharCode.apply(null,codeUnits);codeUnits.length=0}}return result}function assertType(type,expected){if(expected.indexOf("|")==-1){if(type==expected){return}throw Error("Invalid node type: "+type)}expected=assertType.hasOwnProperty(expected)?assertType[expected]:assertType[expected]=RegExp("^(?:"+expected+")$");if(expected.test(type)){return}throw Error("Invalid node type: "+type)}function generate(node){var type=node.type;if(generate.hasOwnProperty(type)&&typeof generate[type]=="function"){return generate[type](node)}throw Error("Invalid node type: "+type)}function generateAlternative(node){assertType(node.type,"alternative");var terms=node.body,length=terms?terms.length:0;if(length==1){return generateTerm(terms[0])}else{var i=-1,result="";while(++i<length){result+=generateTerm(terms[i])}return result}}function generateAnchor(node){assertType(node.type,"anchor");switch(node.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function generateAtom(node){assertType(node.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value");return generate(node)}function generateCharacterClass(node){assertType(node.type,"characterClass");var classRanges=node.body,length=classRanges?classRanges.length:0;var i=-1,result="[";if(node.negative){result+="^"}while(++i<length){result+=generateClassAtom(classRanges[i])}result+="]";return result}function generateCharacterClassEscape(node){assertType(node.type,"characterClassEscape");return"\\"+node.value}function generateCharacterClassRange(node){assertType(node.type,"characterClassRange");var min=node.min,max=node.max;if(min.type=="characterClassRange"||max.type=="characterClassRange"){throw Error("Invalid character class range")}return generateClassAtom(min)+"-"+generateClassAtom(max)}function generateClassAtom(node){assertType(node.type,"anchor|characterClassEscape|characterClassRange|dot|value");return generate(node)}function generateDisjunction(node){assertType(node.type,"disjunction");var body=node.body,length=body?body.length:0;if(length==0){throw Error("No body")}else if(length==1){return generate(body[0])}else{var i=-1,result="";while(++i<length){if(i!=0){result+="|"}result+=generate(body[i])}return result}}function generateDot(node){assertType(node.type,"dot");return"."}function generateGroup(node){assertType(node.type,"group");var result="(";switch(node.behavior){case"normal":break;case"ignore":result+="?:";break;case"lookahead":result+="?=";break;case"negativeLookahead":result+="?!";break;default:throw Error("Invalid behaviour: "+node.behaviour)}var body=node.body,length=body?body.length:0;if(length==1){result+=generate(body[0])}else{var i=-1;while(++i<length){result+=generate(body[i])}}result+=")";return result}function generateQuantifier(node){assertType(node.type,"quantifier");var quantifier="",min=node.min,max=node.max;switch(max){case undefined:case null:switch(min){case 0:quantifier="*";break;case 1:quantifier="+";break;default:quantifier="{"+min+",}";break}break;default:if(min==max){quantifier="{"+min+"}"}else if(min==0&&max==1){quantifier="?"}else{quantifier="{"+min+","+max+"}"}break}if(!node.greedy){quantifier+="?"}return generateAtom(node.body[0])+quantifier}function generateReference(node){assertType(node.type,"reference");return"\\"+node.matchIndex}function generateTerm(node){assertType(node.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value");return generate(node)}function generateValue(node){assertType(node.type,"value");var kind=node.kind,codePoint=node.codePoint;switch(kind){case"controlLetter":return"\\c"+fromCodePoint(codePoint+64);case"hexadecimalEscape":return"\\x"+("00"+codePoint.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+fromCodePoint(codePoint);case"null":return"\\"+codePoint;case"octal":return"\\"+codePoint.toString(8);case"singleEscape":switch(codePoint){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+codePoint)}case"symbol":return fromCodePoint(codePoint);case"unicodeEscape":return"\\u"+("0000"+codePoint.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+codePoint.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+kind)}}generate.alternative=generateAlternative;generate.anchor=generateAnchor;generate.characterClass=generateCharacterClass;generate.characterClassEscape=generateCharacterClassEscape;generate.characterClassRange=generateCharacterClassRange;generate.disjunction=generateDisjunction;generate.dot=generateDot;generate.group=generateGroup;generate.quantifier=generateQuantifier;generate.reference=generateReference;generate.value=generateValue;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return{generate:generate}})}else if(freeExports&&freeModule){freeExports.generate=generate}else{root.regjsgen={generate:generate}}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],161:[function(require,module,exports){(function(){function parse(str,flags){var hasUnicodeFlag=(flags||"").indexOf("u")!==-1;var pos=0;var closedCaptureCounter=0;function addRaw(node){node.raw=str.substring(node.range[0],node.range[1]);return node}function updateRawStart(node,start){node.range[0]=start;return addRaw(node)}function createAnchor(kind,rawLength){return addRaw({type:"anchor",kind:kind,range:[pos-rawLength,pos]})}function createValue(kind,codePoint,from,to){return addRaw({type:"value",kind:kind,codePoint:codePoint,range:[from,to]})}function createEscaped(kind,codePoint,value,fromOffset){fromOffset=fromOffset||0;return createValue(kind,codePoint,pos-(value.length+fromOffset),pos)}function createCharacter(matches){var _char=matches[0];var first=_char.charCodeAt(0);if(hasUnicodeFlag){var second;if(_char.length===1&&first>=55296&&first<=56319){second=lookahead().charCodeAt(0);if(second>=56320&&second<=57343){pos++;return createValue("symbol",(first-55296)*1024+second-56320+65536,pos-2,pos)}}}return createValue("symbol",first,pos-1,pos)}function createDisjunction(alternatives,from,to){return addRaw({type:"disjunction",body:alternatives,range:[from,to]})}function createDot(){return addRaw({type:"dot",range:[pos-1,pos]})}function createCharacterClassEscape(value){return addRaw({type:"characterClassEscape",value:value,range:[pos-2,pos]})}function createReference(matchIndex){return addRaw({type:"reference",matchIndex:parseInt(matchIndex,10),range:[pos-1-matchIndex.length,pos]})}function createGroup(behavior,disjunction,from,to){return addRaw({type:"group",behavior:behavior,body:disjunction,range:[from,to]})}function createQuantifier(min,max,from,to){if(to==null){from=pos-1;to=pos}return addRaw({type:"quantifier",min:min,max:max,greedy:true,body:null,range:[from,to]})}function createAlternative(terms,from,to){return addRaw({type:"alternative",body:terms,range:[from,to]})}function createCharacterClass(classRanges,negative,from,to){return addRaw({type:"characterClass",body:classRanges,negative:negative,range:[from,to]})}function createClassRange(min,max,from,to){if(min.codePoint>max.codePoint){throw SyntaxError("invalid range in character class")}return addRaw({type:"characterClassRange",min:min,max:max,range:[from,to]})}function flattenBody(body){if(body.type==="alternative"){return body.body}else{return[body]}}function isEmpty(obj){return obj.type==="empty"}function incr(amount){amount=amount||1;var res=str.substring(pos,pos+amount);pos+=amount||1;return res}function skip(value){if(!match(value)){throw SyntaxError("character: "+value)}}function match(value){if(str.indexOf(value,pos)===pos){return incr(value.length)}}function lookahead(){return str[pos]}function current(value){return str.indexOf(value,pos)===pos}function next(value){return str[pos+1]===value}function matchReg(regExp){var subStr=str.substring(pos);var res=subStr.match(regExp);if(res){res.range=[];res.range[0]=pos;incr(res[0].length);res.range[1]=pos}return res}function parseDisjunction(){var res=[],from=pos;res.push(parseAlternative());while(match("|")){res.push(parseAlternative())}if(res.length===1){return res[0]}return createDisjunction(res,from,pos)}function parseAlternative(){var res=[],from=pos;var term;while(term=parseTerm()){res.push(term)}if(res.length===1){return res[0]}return createAlternative(res,from,pos)}function parseTerm(){if(pos>=str.length||current("|")||current(")")){return null}var anchor=parseAnchor();if(anchor){return anchor}var atom=parseAtom();if(!atom){throw SyntaxError("Expected atom")}var quantifier=parseQuantifier()||false;if(quantifier){quantifier.body=flattenBody(atom);updateRawStart(quantifier,atom.range[0]);return quantifier}return atom}function parseGroup(matchA,typeA,matchB,typeB){var type=null,from=pos;if(match(matchA)){type=typeA}else if(match(matchB)){type=typeB}else{return false}var body=parseDisjunction();if(!body){throw SyntaxError("Expected disjunction")}skip(")");var group=createGroup(type,flattenBody(body),from,pos);if(type=="normal"){closedCaptureCounter++}return group}function parseAnchor(){var res,from=pos;if(match("^")){return createAnchor("start",1)}else if(match("$")){return createAnchor("end",1)}else if(match("\\b")){return createAnchor("boundary",2)}else if(match("\\B")){return createAnchor("not-boundary",2)}else{return parseGroup("(?=","lookahead","(?!","negativeLookahead")}}function parseQuantifier(){var res;var quantifier;var min,max;if(match("*")){quantifier=createQuantifier(0)}else if(match("+")){quantifier=createQuantifier(1)}else if(match("?")){quantifier=createQuantifier(0,1)}else if(res=matchReg(/^\{([0-9]+)\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,min,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,undefined,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),([0-9]+)\}/)){min=parseInt(res[1],10);max=parseInt(res[2],10);if(min>max){throw SyntaxError("numbers out of order in {} quantifier")}quantifier=createQuantifier(min,max,res.range[0],res.range[1])}if(quantifier){if(match("?")){quantifier.greedy=false;quantifier.range[1]+=1}}return quantifier}function parseAtom(){var res;if(res=matchReg(/^[^^$\\.*+?(){[|]/)){return createCharacter(res)}else if(match(".")){return createDot()}else if(match("\\")){res=parseAtomEscape();if(!res){throw SyntaxError("atomEscape")}return res}else if(res=parseCharacterClass()){return res}else{return parseGroup("(?:","ignore","(","normal")}}function parseUnicodeSurrogatePairEscape(firstEscape){if(hasUnicodeFlag){var first,second;if(firstEscape.kind=="unicodeEscape"&&(first=firstEscape.codePoint)>=55296&&first<=56319&&current("\\")&&next("u")){var prevPos=pos;pos++;var secondEscape=parseClassEscape();if(secondEscape.kind=="unicodeEscape"&&(second=secondEscape.codePoint)>=56320&&second<=57343){firstEscape.range[1]=secondEscape.range[1];firstEscape.codePoint=(first-55296)*1024+second-56320+65536;firstEscape.type="value";firstEscape.kind="unicodeCodePointEscape";addRaw(firstEscape)}else{pos=prevPos}}}return firstEscape}function parseClassEscape(){return parseAtomEscape(true)}function parseAtomEscape(insideCharacterClass){var res;res=parseDecimalEscape();if(res){return res}if(insideCharacterClass){if(match("b")){return createEscaped("singleEscape",8,"\\b")}else if(match("B")){throw SyntaxError("\\B not possible inside of CharacterClass")}}res=parseCharacterEscape();return res}function parseDecimalEscape(){var res,match;if(res=matchReg(/^(?!0)\d+/)){match=res[0];var refIdx=parseInt(res[0],10);if(refIdx<=closedCaptureCounter){return createReference(res[0])}else{incr(-res[0].length);if(res=matchReg(/^[0-7]{1,3}/)){return createEscaped("octal",parseInt(res[0],8),res[0],1)}else{res=createCharacter(matchReg(/^[89]/));return updateRawStart(res,res.range[0]-1)}}}else if(res=matchReg(/^[0-7]{1,3}/)){match=res[0];if(/^0{1,3}$/.test(match)){return createEscaped("null",0,"0",match.length+1)}else{return createEscaped("octal",parseInt(match,8),match,1)}}else if(res=matchReg(/^[dDsSwW]/)){return createCharacterClassEscape(res[0])}return false}function parseCharacterEscape(){var res;if(res=matchReg(/^[fnrtv]/)){var codePoint=0;switch(res[0]){case"t":codePoint=9;break;case"n":codePoint=10;break;case"v":codePoint=11;break;case"f":codePoint=12;break;case"r":codePoint=13;break}return createEscaped("singleEscape",codePoint,"\\"+res[0])}else if(res=matchReg(/^c([a-zA-Z])/)){return createEscaped("controlLetter",res[1].charCodeAt(0)%32,res[1],2)}else if(res=matchReg(/^x([0-9a-fA-F]{2})/)){return createEscaped("hexadecimalEscape",parseInt(res[1],16),res[1],2)}else if(res=matchReg(/^u([0-9a-fA-F]{4})/)){return parseUnicodeSurrogatePairEscape(createEscaped("unicodeEscape",parseInt(res[1],16),res[1],2))}else if(hasUnicodeFlag&&(res=matchReg(/^u\{([0-9a-fA-F]{1,})\}/))){return createEscaped("unicodeCodePointEscape",parseInt(res[1],16),res[1],4)}else{return parseIdentityEscape()}}function isIdentifierPart(ch){var NonAsciiIdentifierPart=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function parseIdentityEscape(){var ZWJ="‌";var ZWNJ="‍";var res;var tmp;if(!isIdentifierPart(lookahead())){tmp=incr();return createEscaped("identifier",tmp.charCodeAt(0),tmp,1)}if(match(ZWJ)){return createEscaped("identifier",8204,ZWJ)}else if(match(ZWNJ)){return createEscaped("identifier",8205,ZWNJ)}return null}function parseCharacterClass(){var res,from=pos;if(res=matchReg(/^\[\^/)){res=parseClassRanges();skip("]");return createCharacterClass(res,true,from,pos)}else if(match("[")){res=parseClassRanges();skip("]");return createCharacterClass(res,false,from,pos)}return null}function parseClassRanges(){var res;if(current("]")){return[]}else{res=parseNonemptyClassRanges();if(!res){throw SyntaxError("nonEmptyClassRanges")}return res}}function parseHelperClassRanges(atom){var from,to,res;if(current("-")&&!next("]")){skip("-");res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}to=pos;var classRanges=parseClassRanges();if(!classRanges){throw SyntaxError("classRanges")}from=atom.range[0];if(classRanges.type==="empty"){return[createClassRange(atom,res,from,to)]}return[createClassRange(atom,res,from,to)].concat(classRanges)}res=parseNonemptyClassRangesNoDash();if(!res){throw SyntaxError("nonEmptyClassRangesNoDash")}return[atom].concat(res)}function parseNonemptyClassRanges(){var atom=parseClassAtom();if(!atom){throw SyntaxError("classAtom")}if(current("]")){return[atom]}return parseHelperClassRanges(atom)}function parseNonemptyClassRangesNoDash(){var res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}if(current("]")){return res}return parseHelperClassRanges(res)}function parseClassAtom(){if(match("-")){return createCharacter("-")}else{return parseClassAtomNoDash()}}function parseClassAtomNoDash(){var res;if(res=matchReg(/^[^\\\]-]/)){return createCharacter(res[0])}else if(match("\\")){res=parseClassEscape();if(!res){throw SyntaxError("classEscape")}return parseUnicodeSurrogatePairEscape(res)}}str=String(str);if(str===""){str="(?:)"}var result=parseDisjunction();if(result.range[1]!==str.length){throw SyntaxError("Could not parse entire input - got stuck: "+str)}return result}var regjsparser={parse:parse};if(typeof module!=="undefined"&&module.exports){module.exports=regjsparser}else{window.regjsparser=regjsparser}})()},{}],162:[function(require,module,exports){var generate=require("regjsgen").generate;var parse=require("regjsparser").parse;var regenerate=require("regenerate");var iuMappings=require("./data/iu-mappings.json");var ESCAPE_SETS=require("./data/character-class-escape-sets.js");function getCharacterClassEscapeSet(character){if(unicode){if(ignoreCase){return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]}return ESCAPE_SETS.UNICODE[character]}return ESCAPE_SETS.REGULAR[character]}var object={};var hasOwnProperty=object.hasOwnProperty;function has(object,property){return hasOwnProperty.call(object,property)}var UNICODE_SET=regenerate().addRange(0,1114111);var BMP_SET=regenerate().addRange(0,65535);var DOT_SET_UNICODE=UNICODE_SET.clone().remove(10,13,8232,8233);var DOT_SET=DOT_SET_UNICODE.clone().intersection(BMP_SET);regenerate.prototype.iuAddRange=function(min,max){var $this=this;do{var folded=caseFold(min);if(folded){$this.add(folded)}}while(++min<=max);return $this};function assign(target,source){for(var key in source){target[key]=source[key]}}function update(item,pattern){var tree=parse(pattern,"");switch(tree.type){case"characterClass":case"group":case"value":break;default:tree=wrap(tree,pattern)}assign(item,tree)}function wrap(tree,pattern){return{type:"group",behavior:"ignore",body:[tree],raw:"(?:"+pattern+")"}}function caseFold(codePoint){return has(iuMappings,codePoint)?iuMappings[codePoint]:false}var ignoreCase=false;var unicode=false;function processCharacterClass(characterClassItem){var set=regenerate();var body=characterClassItem.body.forEach(function(item){switch(item.type){case"value":set.add(item.codePoint);if(ignoreCase&&unicode){var folded=caseFold(item.codePoint);if(folded){set.add(folded)}}break;case"characterClassRange":var min=item.min.codePoint;var max=item.max.codePoint;set.addRange(min,max);if(ignoreCase&&unicode){set.iuAddRange(min,max)}break;case"characterClassEscape":set.add(getCharacterClassEscapeSet(item.value));break;default:throw Error("Unknown term type: "+item.type)}});if(characterClassItem.negative){set=(unicode?UNICODE_SET:BMP_SET).clone().remove(set)}update(characterClassItem,set.toString());return characterClassItem}function processTerm(item){switch(item.type){case"dot":update(item,(unicode?DOT_SET_UNICODE:DOT_SET).toString());break;case"characterClass":item=processCharacterClass(item);break;case"characterClassEscape":update(item,getCharacterClassEscapeSet(item.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":item.body=item.body.map(processTerm);break;case"value":var codePoint=item.codePoint;var set=regenerate(codePoint);if(ignoreCase&&unicode){var folded=caseFold(codePoint);if(folded){set.add(folded)}}update(item,set.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+item.type)}return item}module.exports=function(pattern,flags){var tree=parse(pattern,flags);ignoreCase=flags?flags.indexOf("i")>-1:false;unicode=flags?flags.indexOf("u")>-1:false;assign(tree,processTerm(tree));return generate(tree)}},{"./data/character-class-escape-sets.js":157,"./data/iu-mappings.json":158,regenerate:159,regjsgen:160,regjsparser:161}],163:[function(require,module,exports){exports.SourceMapGenerator=require("./source-map/source-map-generator").SourceMapGenerator;exports.SourceMapConsumer=require("./source-map/source-map-consumer").SourceMapConsumer;exports.SourceNode=require("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":168,"./source-map/source-map-generator":169,"./source-map/source-node":170}],164:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require) }define(function(require,exports,module){var util=require("./util");function ArraySet(){this._array=[];this._set={}}ArraySet.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet;for(var i=0,len=aArray.length;i<len;i++){set.add(aArray[i],aAllowDuplicates)}return set};ArraySet.prototype.add=function ArraySet_add(aStr,aAllowDuplicates){var isDuplicate=this.has(aStr);var idx=this._array.length;if(!isDuplicate||aAllowDuplicates){this._array.push(aStr)}if(!isDuplicate){this._set[util.toSetString(aStr)]=idx}};ArraySet.prototype.has=function ArraySet_has(aStr){return Object.prototype.hasOwnProperty.call(this._set,util.toSetString(aStr))};ArraySet.prototype.indexOf=function ArraySet_indexOf(aStr){if(this.has(aStr)){return this._set[util.toSetString(aStr)]}throw new Error('"'+aStr+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx<this._array.length){return this._array[aIdx]}throw new Error("No element indexed by "+aIdx)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};exports.ArraySet=ArraySet})},{"./util":171,amdefine:172}],165:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64=require("./base64");var VLQ_BASE_SHIFT=5;var VLQ_BASE=1<<VLQ_BASE_SHIFT;var VLQ_BASE_MASK=VLQ_BASE-1;var VLQ_CONTINUATION_BIT=VLQ_BASE;function toVLQSigned(aValue){return aValue<0?(-aValue<<1)+1:(aValue<<1)+0}function fromVLQSigned(aValue){var isNegative=(aValue&1)===1;var shifted=aValue>>1;return isNegative?-shifted:shifted}exports.encode=function base64VLQ_encode(aValue){var encoded="";var digit;var vlq=toVLQSigned(aValue);do{digit=vlq&VLQ_BASE_MASK;vlq>>>=VLQ_BASE_SHIFT;if(vlq>0){digit|=VLQ_CONTINUATION_BIT}encoded+=base64.encode(digit)}while(vlq>0);return encoded};exports.decode=function base64VLQ_decode(aStr,aOutParam){var i=0;var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do{if(i>=strLen){throw new Error("Expected more digits in base 64 VLQ value.")}digit=base64.decode(aStr.charAt(i++));continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<<shift);shift+=VLQ_BASE_SHIFT}while(continuation);aOutParam.value=fromVLQSigned(result);aOutParam.rest=aStr.slice(i)}})},{"./base64":166,amdefine:172}],166:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var charToIntMap={};var intToCharMap={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(ch,index){charToIntMap[ch]=index;intToCharMap[index]=ch});exports.encode=function base64_encode(aNumber){if(aNumber in intToCharMap){return intToCharMap[aNumber]}throw new TypeError("Must be between 0 and 63: "+aNumber)};exports.decode=function base64_decode(aChar){if(aChar in charToIntMap){return charToIntMap[aChar]}throw new TypeError("Not a valid base 64 digit: "+aChar)}})},{amdefine:172}],167:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){var mid=Math.floor((aHigh-aLow)/2)+aLow;var cmp=aCompare(aNeedle,aHaystack[mid],true);if(cmp===0){return aHaystack[mid]}else if(cmp>0){if(aHigh-mid>1){return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare)}return aHaystack[mid]}else{if(mid-aLow>1){return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare)}return aLow<0?null:aHaystack[aLow]}}exports.search=function search(aNeedle,aHaystack,aCompare){return aHaystack.length>0?recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare):null}})},{amdefine:172}],168:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");var binarySearch=require("./binary-search");var ArraySet=require("./array-set").ArraySet;var base64VLQ=require("./base64-vlq");function SourceMapConsumer(aSourceMap){var sourceMap=aSourceMap;if(typeof aSourceMap==="string"){sourceMap=JSON.parse(aSourceMap.replace(/^\)\]\}'/,""))}var version=util.getArg(sourceMap,"version");var sources=util.getArg(sourceMap,"sources");var names=util.getArg(sourceMap,"names",[]);var sourceRoot=util.getArg(sourceMap,"sourceRoot",null);var sourcesContent=util.getArg(sourceMap,"sourcesContent",null);var mappings=util.getArg(sourceMap,"mappings");var file=util.getArg(sourceMap,"file",null);if(version!=this._version){throw new Error("Unsupported version: "+version)}this._names=ArraySet.fromArray(names,true);this._sources=ArraySet.fromArray(sources,true);this.sourceRoot=sourceRoot;this.sourcesContent=sourcesContent;this._mappings=mappings;this.file=file}SourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(aSourceMap){var smc=Object.create(SourceMapConsumer.prototype);smc._names=ArraySet.fromArray(aSourceMap._names.toArray(),true);smc._sources=ArraySet.fromArray(aSourceMap._sources.toArray(),true);smc.sourceRoot=aSourceMap._sourceRoot;smc.sourcesContent=aSourceMap._generateSourcesContent(smc._sources.toArray(),smc.sourceRoot);smc.file=aSourceMap._file;smc.__generatedMappings=aSourceMap._mappings.slice().sort(util.compareByGeneratedPositions);smc.__originalMappings=aSourceMap._mappings.slice().sort(util.compareByOriginalPositions);return smc};SourceMapConsumer.prototype._version=3;Object.defineProperty(SourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map(function(s){return this.sourceRoot!=null?util.join(this.sourceRoot,s):s},this)}});SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._nextCharIsMappingSeparator=function SourceMapConsumer_nextCharIsMappingSeparator(aStr){var c=aStr.charAt(0);return c===";"||c===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(aStr,aSourceRoot){var generatedLine=1;var previousGeneratedColumn=0;var previousOriginalLine=0;var previousOriginalColumn=0;var previousSource=0;var previousName=0;var str=aStr;var temp={};var mapping;while(str.length>0){if(str.charAt(0)===";"){generatedLine++;str=str.slice(1);previousGeneratedColumn=0}else if(str.charAt(0)===","){str=str.slice(1)}else{mapping={};mapping.generatedLine=generatedLine;base64VLQ.decode(str,temp);mapping.generatedColumn=previousGeneratedColumn+temp.value;previousGeneratedColumn=mapping.generatedColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.source=this._sources.at(previousSource+temp.value);previousSource+=temp.value;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source, but no line and column")}base64VLQ.decode(str,temp);mapping.originalLine=previousOriginalLine+temp.value;previousOriginalLine=mapping.originalLine;mapping.originalLine+=1;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source and line, but no column")}base64VLQ.decode(str,temp);mapping.originalColumn=previousOriginalColumn+temp.value;previousOriginalColumn=mapping.originalColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.name=this._names.at(previousName+temp.value);previousName+=temp.value;str=temp.rest}}this.__generatedMappings.push(mapping);if(typeof mapping.originalLine==="number"){this.__originalMappings.push(mapping)}}}this.__generatedMappings.sort(util.compareByGeneratedPositions);this.__originalMappings.sort(util.compareByOriginalPositions)};SourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName,aColumnName,aComparator){if(aNeedle[aLineName]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+aNeedle[aLineName])}if(aNeedle[aColumnName]<0){throw new TypeError("Column must be greater than or equal to 0, got "+aNeedle[aColumnName])}return binarySearch.search(aNeedle,aMappings,aComparator)};SourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(aArgs){var needle={generatedLine:util.getArg(aArgs,"line"),generatedColumn:util.getArg(aArgs,"column")};var mapping=this._findMapping(needle,this._generatedMappings,"generatedLine","generatedColumn",util.compareByGeneratedPositions);if(mapping&&mapping.generatedLine===needle.generatedLine){var source=util.getArg(mapping,"source",null);if(source!=null&&this.sourceRoot!=null){source=util.join(this.sourceRoot,source)}return{source:source,line:util.getArg(mapping,"originalLine",null),column:util.getArg(mapping,"originalColumn",null),name:util.getArg(mapping,"name",null)}}return{source:null,line:null,column:null,name:null}};SourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(aSource){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){aSource=util.relative(this.sourceRoot,aSource)}if(this._sources.has(aSource)){return this.sourcesContent[this._sources.indexOf(aSource)]}var url;if(this.sourceRoot!=null&&(url=util.urlParse(this.sourceRoot))){var fileUriAbsPath=aSource.replace(/^file:\/\//,"");if(url.scheme=="file"&&this._sources.has(fileUriAbsPath)){return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]}if((!url.path||url.path=="/")&&this._sources.has("/"+aSource)){return this.sourcesContent[this._sources.indexOf("/"+aSource)]}}throw new Error('"'+aSource+'" is not in the SourceMap.')};SourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:util.getArg(aArgs,"column")};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var mapping=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(mapping){return{line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null)}}return{line:null,column:null}};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){var context=aContext||null;var order=aOrder||SourceMapConsumer.GENERATED_ORDER;var mappings;switch(order){case SourceMapConsumer.GENERATED_ORDER:mappings=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:mappings=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var sourceRoot=this.sourceRoot;mappings.map(function(mapping){var source=mapping.source;if(source!=null&&sourceRoot!=null){source=util.join(sourceRoot,source)}return{source:source,generatedLine:mapping.generatedLine,generatedColumn:mapping.generatedColumn,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:mapping.name}}).forEach(aCallback,context)};exports.SourceMapConsumer=SourceMapConsumer})},{"./array-set":164,"./base64-vlq":165,"./binary-search":167,"./util":171,amdefine:172}],169:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64VLQ=require("./base64-vlq");var util=require("./util");var ArraySet=require("./array-set").ArraySet;function SourceMapGenerator(aArgs){if(!aArgs){aArgs={}}this._file=util.getArg(aArgs,"file",null);this._sourceRoot=util.getArg(aArgs,"sourceRoot",null);this._sources=new ArraySet;this._names=new ArraySet;this._mappings=[];this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer){var sourceRoot=aSourceMapConsumer.sourceRoot;var generator=new SourceMapGenerator({file:aSourceMapConsumer.file,sourceRoot:sourceRoot});aSourceMapConsumer.eachMapping(function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}};if(mapping.source!=null){newMapping.source=mapping.source;if(sourceRoot!=null){newMapping.source=util.relative(sourceRoot,newMapping.source)}newMapping.original={line:mapping.originalLine,column:mapping.originalColumn};if(mapping.name!=null){newMapping.name=mapping.name}}generator.addMapping(newMapping)});aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){generator.setSourceContent(sourceFile,content)}});return generator};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated");var original=util.getArg(aArgs,"original",null);var source=util.getArg(aArgs,"source",null);var name=util.getArg(aArgs,"name",null);this._validateMapping(generated,original,source,name);if(source!=null&&!this._sources.has(source)){this._sources.add(source)}if(name!=null&&!this._names.has(name)){this._names.add(name)}this._mappings.push({generatedLine:generated.line,generatedColumn:generated.column,originalLine:original!=null&&original.line,originalColumn:original!=null&&original.column,source:source,name:name})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile;if(this._sourceRoot!=null){source=util.relative(this._sourceRoot,source)}if(aSourceContent!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile;if(aSourceFile==null){if(aSourceMapConsumer.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot;if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}var newSources=new ArraySet;var newNames=new ArraySet;this._mappings.forEach(function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});if(original.source!=null){mapping.source=original.source;if(aSourceMapPath!=null){mapping.source=util.join(aSourceMapPath,mapping.source)}if(sourceRoot!=null){mapping.source=util.relative(sourceRoot,mapping.source)}mapping.originalLine=original.line;mapping.originalColumn=original.column;if(original.name!=null){mapping.name=original.name}}}var source=mapping.source;if(source!=null&&!newSources.has(source)){newSources.add(source)}var name=mapping.name;if(name!=null&&!newNames.has(name)){newNames.add(name)}},this);this._sources=newSources;this._names=newNames;aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aSourceMapPath!=null){sourceFile=util.join(aSourceMapPath,sourceFile)}if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}this.setSourceContent(sourceFile,content)}},this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(aGenerated,aOriginal,aSource,aName){if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName){return}else if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0;var previousGeneratedLine=1;var previousOriginalColumn=0;var previousOriginalLine=0;var previousName=0;var previousSource=0;var result="";var mapping;this._mappings.sort(util.compareByGeneratedPositions);for(var i=0,len=this._mappings.length;i<len;i++){mapping=this._mappings[i];if(mapping.generatedLine!==previousGeneratedLine){previousGeneratedColumn=0;while(mapping.generatedLine!==previousGeneratedLine){result+=";";previousGeneratedLine++}}else{if(i>0){if(!util.compareByGeneratedPositions(mapping,this._mappings[i-1])){continue}result+=","}}result+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn);previousGeneratedColumn=mapping.generatedColumn;if(mapping.source!=null){result+=base64VLQ.encode(this._sources.indexOf(mapping.source)-previousSource);previousSource=this._sources.indexOf(mapping.source);result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOriginalLine=mapping.originalLine-1;result+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn);previousOriginalColumn=mapping.originalColumn;if(mapping.name!=null){result+=base64VLQ.encode(this._names.indexOf(mapping.name)-previousName);previousName=this._names.indexOf(mapping.name)}}}return result};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map(function(source){if(!this._sourcesContents){return null}if(aSourceRoot!=null){source=util.relative(aSourceRoot,source)}var key=util.toSetString(source);return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null},this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)}return map};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this)};exports.SourceMapGenerator=SourceMapGenerator})},{"./array-set":164,"./base64-vlq":165,"./util":171,amdefine:172}],170:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var SourceMapGenerator=require("./source-map-generator").SourceMapGenerator;var util=require("./util");var REGEX_NEWLINE=/(\r?\n)/;var REGEX_CHARACTER=/\r\n|[\s\S]/g;function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;if(aChunks!=null)this.add(aChunks)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer,aRelativePath){var node=new SourceNode;var remainingLines=aGeneratedCode.split(REGEX_NEWLINE);var shiftNextLine=function(){var lineContents=remainingLines.shift();var newLine=remainingLines.shift()||"";return lineContents+newLine};var lastGeneratedLine=1,lastGeneratedColumn=0;var lastMapping=null;aSourceMapConsumer.eachMapping(function(mapping){if(lastMapping!==null){if(lastGeneratedLine<mapping.generatedLine){var code="";addMappingWithCode(lastMapping,shiftNextLine());lastGeneratedLine++;lastGeneratedColumn=0}else{var nextLine=remainingLines[0];var code=nextLine.substr(0,mapping.generatedColumn-lastGeneratedColumn);remainingLines[0]=nextLine.substr(mapping.generatedColumn-lastGeneratedColumn);lastGeneratedColumn=mapping.generatedColumn;addMappingWithCode(lastMapping,code);lastMapping=mapping;return}}while(lastGeneratedLine<mapping.generatedLine){node.add(shiftNextLine());lastGeneratedLine++}if(lastGeneratedColumn<mapping.generatedColumn){var nextLine=remainingLines[0];node.add(nextLine.substr(0,mapping.generatedColumn));remainingLines[0]=nextLine.substr(mapping.generatedColumn);lastGeneratedColumn=mapping.generatedColumn}lastMapping=mapping},this);if(remainingLines.length>0){if(lastMapping){addMappingWithCode(lastMapping,shiftNextLine())}node.add(remainingLines.join(""))}aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aRelativePath!=null){sourceFile=util.join(aRelativePath,sourceFile)}node.setSourceContent(sourceFile,content)}});return node;function addMappingWithCode(mapping,code){if(mapping===null||mapping.source===undefined){node.add(code)}else{var source=aRelativePath?util.join(aRelativePath,mapping.source):mapping.source;node.add(new SourceNode(mapping.originalLine,mapping.originalColumn,source,code,mapping.name))}}};SourceNode.prototype.add=function SourceNode_add(aChunk){if(Array.isArray(aChunk)){aChunk.forEach(function(chunk){this.add(chunk)},this)}else if(aChunk instanceof SourceNode||typeof aChunk==="string"){if(aChunk){this.children.push(aChunk)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.prepend=function SourceNode_prepend(aChunk){if(Array.isArray(aChunk)){for(var i=aChunk.length-1;i>=0;i--){this.prepend(aChunk[i])}}else if(aChunk instanceof SourceNode||typeof aChunk==="string"){this.children.unshift(aChunk)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.walk=function SourceNode_walk(aFn){var chunk;for(var i=0,len=this.children.length;i<len;i++){chunk=this.children[i];if(chunk instanceof SourceNode){chunk.walk(aFn)}else{if(chunk!==""){aFn(chunk,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};SourceNode.prototype.join=function SourceNode_join(aSep){var newChildren;var i;var len=this.children.length;if(len>0){newChildren=[];for(i=0;i<len-1;i++){newChildren.push(this.children[i]);newChildren.push(aSep)}newChildren.push(this.children[i]);this.children=newChildren}return this};SourceNode.prototype.replaceRight=function SourceNode_replaceRight(aPattern,aReplacement){var lastChild=this.children[this.children.length-1];if(lastChild instanceof SourceNode){lastChild.replaceRight(aPattern,aReplacement)}else if(typeof lastChild==="string"){this.children[this.children.length-1]=lastChild.replace(aPattern,aReplacement)}else{this.children.push("".replace(aPattern,aReplacement))}return this};SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(aSourceFile,aSourceContent){this.sourceContents[util.toSetString(aSourceFile)]=aSourceContent};SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(aFn){for(var i=0,len=this.children.length;i<len;i++){if(this.children[i]instanceof SourceNode){this.children[i].walkSourceContents(aFn)}}var sources=Object.keys(this.sourceContents);for(var i=0,len=sources.length;i<len;i++){aFn(util.fromSetString(sources[i]),this.sourceContents[sources[i]])}};SourceNode.prototype.toString=function SourceNode_toString(){var str="";this.walk(function(chunk){str+=chunk});return str};SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false}chunk.match(REGEX_CHARACTER).forEach(function(ch,idx,array){if(REGEX_NEWLINE.test(ch)){generated.line++;generated.column=0;if(idx+1===array.length){lastOriginalSource=null;sourceMappingActive=false}else if(sourceMappingActive){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}}else{generated.column+=ch.length}})});this.walkSourceContents(function(sourceFile,sourceContent){map.setSourceContent(sourceFile,sourceContent)});return{code:generated.code,map:map}};exports.SourceNode=SourceNode})},{"./source-map-generator":169,"./util":171,amdefine:172}],171:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName]}else if(arguments.length===3){return aDefaultValue}else{throw new Error('"'+aName+'" is a required argument.')}}exports.getArg=getArg;var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;var dataUrlRegexp=/^data:.+\,.+$/;function urlParse(aUrl){var match=aUrl.match(urlRegexp);if(!match){return null}return{scheme:match[1],auth:match[2],host:match[3],port:match[4],path:match[5]}}exports.urlParse=urlParse;function urlGenerate(aParsedUrl){var url="";if(aParsedUrl.scheme){url+=aParsedUrl.scheme+":"}url+="//";if(aParsedUrl.auth){url+=aParsedUrl.auth+"@"}if(aParsedUrl.host){url+=aParsedUrl.host}if(aParsedUrl.port){url+=":"+aParsedUrl.port}if(aParsedUrl.path){url+=aParsedUrl.path}return url}exports.urlGenerate=urlGenerate;function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath}path=url.path}var isAbsolute=path.charAt(0)==="/";var parts=path.split(/\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==="."){parts.splice(i,1)}else if(part===".."){up++}else if(up>0){if(part===""){parts.splice(i+1,up);up=0}else{parts.splice(i,2);up--}}}path=parts.join("/");if(path===""){path=isAbsolute?"/":"."}if(url){url.path=path;return urlGenerate(url)}return path}exports.normalize=normalize;function join(aRoot,aPath){if(aRoot===""){aRoot="."}if(aPath===""){aPath="."}var aPathUrl=urlParse(aPath);var aRootUrl=urlParse(aRoot);if(aRootUrl){aRoot=aRootUrl.path||"/"}if(aPathUrl&&!aPathUrl.scheme){if(aRootUrl){aPathUrl.scheme=aRootUrl.scheme}return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp)){return aPath}if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath;return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath);if(aRootUrl){aRootUrl.path=joined;return urlGenerate(aRootUrl)}return joined}exports.join=join;function relative(aRoot,aPath){if(aRoot===""){aRoot="."}aRoot=aRoot.replace(/\/$/,"");var url=urlParse(aRoot);if(aPath.charAt(0)=="/"&&url&&url.path=="/"){return aPath.slice(1)}return aPath.indexOf(aRoot+"/")===0?aPath.substr(aRoot.length+1):aPath}exports.relative=relative;function toSetString(aStr){return"$"+aStr}exports.toSetString=toSetString;function fromSetString(aStr){return aStr.substr(1)}exports.fromSetString=fromSetString;function strcmp(aStr1,aStr2){var s1=aStr1||"";var s2=aStr2||"";return(s1>s2)-(s1<s2)}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp;cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp||onlyCompareOriginal){return cmp}cmp=strcmp(mappingA.name,mappingB.name);if(cmp){return cmp}cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}return mappingA.generatedColumn-mappingB.generatedColumn}exports.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositions(mappingA,mappingB,onlyCompareGenerated){var cmp;cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp||onlyCompareGenerated){return cmp}cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp){return cmp}return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositions=compareByGeneratedPositions})},{amdefine:172}],172:[function(require,module,exports){(function(process,__filename){"use strict";function amdefine(module,requireFn){"use strict";var defineCache={},loaderCache={},alreadyCalled=false,path=require("path"),makeRequire,stringRequire;function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName){var baseParts;if(name&&name.charAt(0)==="."){if(baseName){baseParts=baseName.split("/");baseParts=baseParts.slice(0,baseParts.length-1);baseParts=baseParts.concat(name.split("/"));trimDots(baseParts);name=baseParts.join("/")}}return name}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(id){function load(value){loaderCache[id]=value}load.fromText=function(id,text){throw new Error("amdefine does not implement load.fromText")};return load}makeRequire=function(systemRequire,exports,module,relId){function amdRequire(deps,callback){if(typeof deps==="string"){return stringRequire(systemRequire,exports,module,deps,relId)}else{deps=deps.map(function(depName){return stringRequire(systemRequire,exports,module,depName,relId)});process.nextTick(function(){callback.apply(null,deps)})}}amdRequire.toUrl=function(filePath){if(filePath.indexOf(".")===0){return normalize(filePath,path.dirname(module.filename))}else{return filePath}};return amdRequire};requireFn=requireFn||function req(){return module.require.apply(module,arguments)};function runFactory(id,deps,factory){var r,e,m,result;if(id){e=loaderCache[id]={};m={id:id,uri:__filename,exports:e};r=makeRequire(requireFn,e,m,id)}else{if(alreadyCalled){throw new Error("amdefine with no module ID cannot be called more than once per file.")}alreadyCalled=true;e=module.exports;m=module;r=makeRequire(requireFn,e,m,module.id)}if(deps){deps=deps.map(function(depName){return r(depName)})}if(typeof factory==="function"){result=factory.apply(m.exports,deps)}else{result=factory}if(result!==undefined){m.exports=result;if(id){loaderCache[id]=m.exports}}}stringRequire=function(systemRequire,exports,module,id,relId){var index=id.indexOf("!"),originalId=id,prefix,plugin;if(index===-1){id=normalize(id,relId);if(id==="require"){return makeRequire(systemRequire,exports,module,relId)}else if(id==="exports"){return exports}else if(id==="module"){return module}else if(loaderCache.hasOwnProperty(id)){return loaderCache[id]}else if(defineCache[id]){runFactory.apply(null,defineCache[id]); return loaderCache[id]}else{if(systemRequire){return systemRequire(originalId)}else{throw new Error("No module with ID: "+id)}}}else{prefix=id.substring(0,index);id=id.substring(index+1,id.length);plugin=stringRequire(systemRequire,exports,module,prefix,relId);if(plugin.normalize){id=plugin.normalize(id,makeNormalize(relId))}else{id=normalize(id,relId)}if(loaderCache[id]){return loaderCache[id]}else{plugin.load(id,makeRequire(systemRequire,exports,module,relId),makeLoad(id),{});return loaderCache[id]}}};function define(id,deps,factory){if(Array.isArray(id)){factory=deps;deps=id;id=undefined}else if(typeof id!=="string"){factory=id;id=deps=undefined}if(deps&&!Array.isArray(deps)){factory=deps;deps=undefined}if(!deps){deps=["require","exports","module"]}if(id){defineCache[id]=[id,deps,factory]}else{runFactory(id,deps,factory)}}define.require=function(id){if(loaderCache[id]){return loaderCache[id]}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}};define.amd={};return define}module.exports=amdefine}).call(this,require("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:99,path:98}],173:[function(require,module,exports){module.exports={"abstract-expression-call":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceGet"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"}]},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"abstract-expression-delete":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceDelete"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"abstract-expression-get":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceGet"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"abstract-expression-set":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceSet"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"},{type:"Identifier",name:"VALUE"}]}}]},"apply-constructor":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"Constructor"},{type:"Identifier",name:"args"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"instance"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"create"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"Constructor"},property:{type:"Identifier",name:"prototype"},computed:false}]}}],kind:"var"},{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"result"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Constructor"},property:{type:"Identifier",name:"apply"},computed:false},arguments:[{type:"Identifier",name:"instance"},{type:"Identifier",name:"args"}]}}],kind:"var"},{type:"ReturnStatement",argument:{type:"ConditionalExpression",test:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"Identifier",name:"result"},operator:"!=",right:{type:"Literal",value:null}},operator:"&&",right:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"result"}},operator:"==",right:{type:"Literal",value:"object"}},operator:"||",right:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"result"}},operator:"==",right:{type:"Literal",value:"function"}}}},consequent:{type:"Identifier",name:"result"},alternate:{type:"Identifier",name:"instance"}}}]},expression:false}}]},"array-comprehension-container":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"KEY"},init:{type:"ArrayExpression",elements:[]}}],kind:"var"},{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false},arguments:[]}}]},"array-comprehension-for-each":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"forEach"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[]},expression:false}]}}]},"array-expression-comprehension-filter":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"filter"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"FILTER"}}]},expression:false}]},property:{type:"Identifier",name:"map"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"STATEMENT"}}]},expression:false}]}}]},"array-expression-comprehension-map":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"map"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"STATEMENT"}}]},expression:false}]}}]},"array-from":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"from"},computed:false},arguments:[{type:"Identifier",name:"VALUE"}]}}]},"array-push":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"KEY"},property:{type:"Identifier",name:"push"},computed:false},arguments:[{type:"Identifier",name:"STATEMENT"}]}}]},call:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"CONTEXT"}]}}]},"class-super-constructor-call":{type:"Program",body:[{type:"IfStatement",test:{type:"Identifier",name:"SUPER_NAME"},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"SUPER_NAME"},property:{type:"Identifier",name:"apply"},computed:false},arguments:[{type:"ThisExpression"},{type:"Identifier",name:"arguments"}]}}]},alternate:null}]},"exports-assign":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"KEY"},computed:false},right:{type:"Identifier",name:"VALUE"}}}]},"exports-default-module-override":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"exports"},right:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"module"},property:{type:"Identifier",name:"exports"},computed:false},right:{type:"Identifier",name:"VALUE"}}}}]},"exports-default-module":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"module"},property:{type:"Identifier",name:"exports"},computed:false},right:{type:"Identifier",name:"VALUE"}}}]},"exports-wildcard":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ForInStatement",left:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"i"},init:null}],kind:"var"},right:{type:"Identifier",name:"obj"},body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"i"},computed:true},right:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Identifier",name:"i"},computed:true}}}]}}]},expression:false},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"for-of":{type:"Program",body:[{type:"ForStatement",init:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"ITERATOR_KEY"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"iterator"},computed:false},computed:true},arguments:[]}},{type:"VariableDeclarator",id:{type:"Identifier",name:"STEP_KEY"},init:null}],kind:"var"},test:{type:"UnaryExpression",operator:"!",prefix:true,argument:{type:"MemberExpression",object:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"STEP_KEY"},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ITERATOR_KEY"},property:{type:"Identifier",name:"next"},computed:false},arguments:[]}},property:{type:"Identifier",name:"done"},computed:false}},update:null,body:{type:"BlockStatement",body:[]}}]},"function-return-obj":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"has-own":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"hasOwnProperty"},computed:false}}]},"if-undefined-set-to":{type:"Program",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"Identifier",name:"VARIABLE"},operator:"===",right:{type:"Identifier",name:"undefined"}},consequent:{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"VARIABLE"},right:{type:"Identifier",name:"DEFAULT"}}},alternate:null}]},inherits:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"child"},{type:"Identifier",name:"parent"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"prototype"},computed:false},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"create"},computed:false},arguments:[{type:"LogicalExpression",left:{type:"Identifier",name:"parent"},operator:"&&",right:{type:"MemberExpression",object:{type:"Identifier",name:"parent"},property:{type:"Identifier",name:"prototype"},computed:false}},{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"constructor"},value:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"value"},value:{type:"Identifier",name:"child"},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"enumerable"},value:{type:"Literal",value:false},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"writable"},value:{type:"Literal",value:true},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"configurable"},value:{type:"Literal",value:true},kind:"init"}]},kind:"init"}]}]}}},{type:"IfStatement",test:{type:"Identifier",name:"parent"},consequent:{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"__proto__"},computed:false},right:{type:"Identifier",name:"parent"}}},alternate:null}]},expression:false}}]},"interop-require":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"LogicalExpression",left:{type:"Identifier",name:"obj"},operator:"&&",right:{type:"LogicalExpression",left:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Literal",value:"default"},computed:true},operator:"||",right:{type:"Identifier",name:"obj"}}}}]},expression:false}}]},"let-scoping-return":{type:"Program",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"RETURN"}},operator:"===",right:{type:"Literal",value:"object"}},consequent:{type:"ReturnStatement",argument:{type:"MemberExpression",object:{type:"Identifier",name:"RETURN"},property:{type:"Identifier",name:"v"},computed:false}},alternate:null}]},"object-define-properties-closure":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"Identifier",name:"CONTENT"}},{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"object-define-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"OBJECT"},{type:"Identifier",name:"PROPS"}]}}]},"object-without-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"},{type:"Identifier",name:"keys"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"target"},init:{type:"ObjectExpression",properties:[]}}],kind:"var"},{type:"ForInStatement",left:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"i"},init:null}],kind:"var"},right:{type:"Identifier",name:"obj"},body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"keys"},property:{type:"Identifier",name:"indexOf"},computed:false},arguments:[{type:"Identifier",name:"i"}]},operator:">=",right:{type:"Literal",value:0}},consequent:{type:"ContinueStatement",label:null},alternate:null},{type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:true,argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"hasOwnProperty"},computed:false},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"obj"},{type:"Identifier",name:"i"}]}},consequent:{type:"ContinueStatement",label:null},alternate:null},{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"target"},property:{type:"Identifier",name:"i"},computed:true},right:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Identifier",name:"i"},computed:true}}}]}},{type:"ReturnStatement",argument:{type:"Identifier",name:"target"}}]},expression:false}}]},"prototype-identifier":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"Identifier",name:"CLASS_NAME"},property:{type:"Identifier",name:"prototype"},computed:false}}]},"prototype-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"child"},{type:"Identifier",name:"staticProps"},{type:"Identifier",name:"instanceProps"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"Identifier",name:"staticProps"},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"child"},{type:"Identifier",name:"staticProps"}]}},alternate:null},{type:"IfStatement",test:{type:"Identifier",name:"instanceProps"},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"prototype"},computed:false},{type:"Identifier",name:"instanceProps"}]}},alternate:null}]},expression:false}}]},"require-assign-key":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]},property:{type:"Identifier",name:"KEY"},computed:false}}],kind:"var"}]},"require-assign":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]}}],kind:"var"}]},require:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]}}]},"self-global":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"ConditionalExpression",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"global"}},operator:"===",right:{type:"Literal",value:"undefined"}},consequent:{type:"Identifier",name:"self"},alternate:{type:"Identifier",name:"global"}}}]},slice:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"slice"},computed:false}}]},system:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"System"},property:{type:"Identifier",name:"register"},computed:false},arguments:[{type:"Identifier",name:"MODULE_NAME"},{type:"Identifier",name:"MODULE_DEPENDENCIES"},{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"EXPORT_IDENTIFIER"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"setters"},value:{type:"Identifier",name:"SETTERS"},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"execute"},value:{type:"Identifier",name:"EXECUTE"},kind:"init"}]}}]},expression:false}]}}]},"tagged-template-literal":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"strings"},{type:"Identifier",name:"raw"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"freeze"},computed:false},arguments:[{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"strings"},{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"raw"},value:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"value"},value:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"freeze"},computed:false},arguments:[{type:"Identifier",name:"raw"}]},kind:"init"}]},kind:"init"}]}]}]}}]},expression:false}}]},"to-array":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"arr"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"ConditionalExpression",test:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"isArray"},computed:false},arguments:[{type:"Identifier",name:"arr"}]},consequent:{type:"Identifier",name:"arr"},alternate:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"from"},computed:false},arguments:[{type:"Identifier",name:"arr"}]}}}]},expression:false}}]},"umd-runner-body":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"factory"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"define"}},operator:"===",right:{type:"Literal",value:"function"}},operator:"&&",right:{type:"MemberExpression",object:{type:"Identifier",name:"define"},property:{type:"Identifier",name:"amd"},computed:false}},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"define"},arguments:[{type:"Identifier",name:"AMD_ARGUMENTS"},{type:"Identifier",name:"factory"}]}}]},alternate:{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"exports"}},operator:"!==",right:{type:"Literal",value:"undefined"}},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"factory"},arguments:[{type:"Identifier",name:"exports"},{type:"Identifier",name:"COMMON_ARGUMENTS"}]}}]},alternate:null}}]},expression:false}}]}}},{}]},{},[2])(2)});
ajax/libs/6to5/1.14.6/browser-polyfill.js
CosmicWebServices/cdnjs
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){(function(global){var ensureSymbol=function(key){Symbol[key]=Symbol[key]||Symbol()};var ensureProto=function(Constructor,key,val){var proto=Constructor.prototype;proto[key]=proto[key]||val};if(typeof Symbol==="undefined"){require("es6-symbol/implement")}require("es6-shim");require("./transformation/transformers/es6-generators/runtime");ensureSymbol("referenceGet");ensureSymbol("referenceSet");ensureSymbol("referenceDelete");ensureProto(Function,Symbol.referenceGet,function(){return this});ensureProto(Map,Symbol.referenceGet,Map.prototype.get);ensureProto(Map,Symbol.referenceSet,Map.prototype.set);ensureProto(Map,Symbol.referenceDelete,Map.prototype.delete);if(global.WeakMap){ensureProto(WeakMap,Symbol.referenceGet,WeakMap.prototype.get);ensureProto(WeakMap,Symbol.referenceSet,WeakMap.prototype.set);ensureProto(WeakMap,Symbol.referenceDelete,WeakMap.prototype.delete)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./transformation/transformers/es6-generators/runtime":2,"es6-shim":4,"es6-symbol/implement":5}],2:[function(require,module,exports){(function(global){var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";var runtime=global.regeneratorRuntime=exports;var hasOwn=Object.prototype.hasOwnProperty;var wrap=runtime.wrap=function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])};var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};var GF=function GeneratorFunction(){};var GFp=function GeneratorFunctionPrototype(){};var Gp=GFp.prototype=Generator.prototype;(GFp.constructor=GF).prototype=Gp.constructor=GFp;var GFName="GeneratorFunction";if(GF.name!==GFName)GF.name=GFName;if(GF.name!==GFName)throw new Error(GFName+" renamed?");runtime.isGeneratorFunction=function(genFun){var ctor=genFun&&genFun.constructor;return ctor?GF.name===ctor.name:false};runtime.mark=function(genFun){genFun.__proto__=GFp;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){var info;var value;try{info=this(arg);value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){throw new Error("Generator has already finished")}while(true){var delegate=context.delegate;var info;if(delegate){try{info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){var iterator=iterable;if(iteratorSymbol in iterable){iterator=iterable[iteratorSymbol]()}else if(!isNaN(iterable.length)){var i=-1;iterator=function next(){while(++i<iterable.length){if(i in iterable){next.value=iterable[i];next.done=false;return next}}next.done=true;return next};iterator.next=iterator}return iterator}runtime.values=values;Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;var thrown;if(record.type==="throw"){thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],4:[function(require,module,exports){(function(process){(function(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.returnExports=factory()}})(this,function(){"use strict";var isCallableWithoutNew=function(func){try{func()}catch(e){return false}return true};var supportsSubclassing=function(C,f){try{var Sub=function(){C.apply(this,arguments)};if(!Sub.__proto__){return false}Object.setPrototypeOf(Sub,C);Sub.prototype=Object.create(C.prototype,{constructor:{value:C}});return f(Sub)}catch(e){return false}};var arePropertyDescriptorsSupported=function(){try{Object.defineProperty({},"x",{});return true}catch(e){return false}};var startsWithRejectsRegex=function(){var rejectsRegex=false;if(String.prototype.startsWith){try{"/a/".startsWith(/a/)}catch(e){rejectsRegex=true}}return rejectsRegex};var getGlobal=new Function("return this;");var globals=getGlobal();var global_isFinite=globals.isFinite;var supportsDescriptors=!!Object.defineProperty&&arePropertyDescriptorsSupported();var startsWithIsCompliant=startsWithRejectsRegex();var _slice=Array.prototype.slice;var _indexOf=String.prototype.indexOf;var _toString=Object.prototype.toString;var _hasOwnProperty=Object.prototype.hasOwnProperty;var ArrayIterator;var defineProperty=function(object,name,value,force){if(!force&&name in object){return}if(supportsDescriptors){Object.defineProperty(object,name,{configurable:true,enumerable:false,writable:true,value:value})}else{object[name]=value}};var defineProperties=function(object,map){Object.keys(map).forEach(function(name){var method=map[name];defineProperty(object,name,method,false)})};var create=Object.create||function(prototype,properties){function Type(){}Type.prototype=prototype;var object=new Type;if(typeof properties!=="undefined"){defineProperties(object,properties)}return object};var $iterator$=typeof Symbol==="function"&&Symbol.iterator||"_es6shim_iterator_";if(globals.Set&&typeof(new globals.Set)["@@iterator"]==="function"){$iterator$="@@iterator"}var addIterator=function(prototype,impl){if(!impl){impl=function iterator(){return this}}var o={};o[$iterator$]=impl;defineProperties(prototype,o);if(!prototype[$iterator$]&&typeof $iterator$==="symbol"){prototype[$iterator$]=impl}};var isArguments=function isArguments(value){var str=_toString.call(value);var result=str==="[object Arguments]";if(!result){result=str!=="[object Array]"&&value!==null&&typeof value==="object"&&typeof value.length==="number"&&value.length>=0&&_toString.call(value.callee)==="[object Function]"}return result};var emulateES6construct=function(o){if(!ES.TypeIsObject(o)){throw new TypeError("bad object")}if(!o._es6construct){if(o.constructor&&ES.IsCallable(o.constructor["@@create"])){o=o.constructor["@@create"](o)}defineProperties(o,{_es6construct:true})}return o};var ES={CheckObjectCoercible:function(x,optMessage){if(x==null){throw new TypeError(optMessage||"Cannot call method on "+x)}return x},TypeIsObject:function(x){return x!=null&&Object(x)===x},ToObject:function(o,optMessage){return Object(ES.CheckObjectCoercible(o,optMessage))},IsCallable:function(x){return typeof x==="function"&&_toString.call(x)==="[object Function]"},ToInt32:function(x){return x>>0},ToUint32:function(x){return x>>>0},ToInteger:function(value){var number=+value;if(Number.isNaN(number)){return 0}if(number===0||!Number.isFinite(number)){return number}return(number>0?1:-1)*Math.floor(Math.abs(number))},ToLength:function(value){var len=ES.ToInteger(value);if(len<=0){return 0}if(len>Number.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return len},SameValue:function(a,b){if(a===b){if(a===0){return 1/a===1/b}return true}return Number.isNaN(a)&&Number.isNaN(b)},SameValueZero:function(a,b){return a===b||Number.isNaN(a)&&Number.isNaN(b)},IsIterable:function(o){return ES.TypeIsObject(o)&&(typeof o[$iterator$]!=="undefined"||isArguments(o))},GetIterator:function(o){if(isArguments(o)){return new ArrayIterator(o,"value")}var itFn=o[$iterator$];if(!ES.IsCallable(itFn)){throw new TypeError("value is not an iterable")}var it=itFn.call(o);if(!ES.TypeIsObject(it)){throw new TypeError("bad iterator")}return it},IteratorNext:function(it){var result=arguments.length>1?it.next(arguments[1]):it.next();if(!ES.TypeIsObject(result)){throw new TypeError("bad iterator")}return result},Construct:function(C,args){var obj;if(ES.IsCallable(C["@@create"])){obj=C["@@create"]()}else{obj=create(C.prototype||null)}defineProperties(obj,{_es6construct:true});var result=C.apply(obj,args);return ES.TypeIsObject(result)?result:obj}};var numberConversion=function(){function roundToEven(n){var w=Math.floor(n),f=n-w;if(f<.5){return w}if(f>.5){return w+1}return w%2?w+1:w}function packIEEE754(v,ebits,fbits){var bias=(1<<ebits-1)-1,s,e,f,i,bits,str,bytes;if(v!==v){e=(1<<ebits)-1;f=Math.pow(2,fbits-1);s=0}else if(v===Infinity||v===-Infinity){e=(1<<ebits)-1;f=0;s=v<0?1:0}else if(v===0){e=0;f=0;s=1/v===-Infinity?1:0}else{s=v<0;v=Math.abs(v);if(v>=Math.pow(2,1-bias)){e=Math.min(Math.floor(Math.log(v)/Math.LN2),1023);f=roundToEven(v/Math.pow(2,e)*Math.pow(2,fbits));if(f/Math.pow(2,fbits)>=2){e=e+1;f=1}if(e>bias){e=(1<<ebits)-1;f=0}else{e=e+bias;f=f-Math.pow(2,fbits)}}else{e=0;f=roundToEven(v/Math.pow(2,1-bias-fbits))}}bits=[];for(i=fbits;i;i-=1){bits.push(f%2?1:0);f=Math.floor(f/2)}for(i=ebits;i;i-=1){bits.push(e%2?1:0);e=Math.floor(e/2)}bits.push(s?1:0);bits.reverse();str=bits.join("");bytes=[];while(str.length){bytes.push(parseInt(str.slice(0,8),2));str=str.slice(8)}return bytes}function unpackIEEE754(bytes,ebits,fbits){var bits=[],i,j,b,str,bias,s,e,f;for(i=bytes.length;i;i-=1){b=bytes[i-1];for(j=8;j;j-=1){bits.push(b%2?1:0);b=b>>1}}bits.reverse();str=bits.join("");bias=(1<<ebits-1)-1;s=parseInt(str.slice(0,1),2)?-1:1;e=parseInt(str.slice(1,1+ebits),2);f=parseInt(str.slice(1+ebits),2);if(e===(1<<ebits)-1){return f!==0?NaN:s*Infinity}else if(e>0){return s*Math.pow(2,e-bias)*(1+f/Math.pow(2,fbits))}else if(f!==0){return s*Math.pow(2,-(bias-1))*(f/Math.pow(2,fbits))}else{return s<0?-0:0}}function unpackFloat64(b){return unpackIEEE754(b,11,52)}function packFloat64(v){return packIEEE754(v,11,52)}function unpackFloat32(b){return unpackIEEE754(b,8,23)}function packFloat32(v){return packIEEE754(v,8,23)}var conversions={toFloat32:function(num){return unpackFloat32(packFloat32(num))}};if(typeof Float32Array!=="undefined"){var float32array=new Float32Array(1);conversions.toFloat32=function(num){float32array[0]=num;return float32array[0]}}return conversions}();defineProperties(String,{fromCodePoint:function(_){var points=_slice.call(arguments,0,arguments.length);var result=[];var next;for(var i=0,length=points.length;i<length;i++){next=Number(points[i]);if(!ES.SameValue(next,ES.ToInteger(next))||next<0||next>1114111){throw new RangeError("Invalid code point "+next)}if(next<65536){result.push(String.fromCharCode(next))}else{next-=65536;result.push(String.fromCharCode((next>>10)+55296));result.push(String.fromCharCode(next%1024+56320))}}return result.join("")},raw:function(callSite){var substitutions=_slice.call(arguments,1,arguments.length);var cooked=ES.ToObject(callSite,"bad callSite");var rawValue=cooked.raw;var raw=ES.ToObject(rawValue,"bad raw value");var len=Object.keys(raw).length;var literalsegments=ES.ToLength(len);if(literalsegments===0){return""}var stringElements=[];var nextIndex=0;var nextKey,next,nextSeg,nextSub;while(nextIndex<literalsegments){nextKey=String(nextIndex);next=raw[nextKey];nextSeg=String(next);stringElements.push(nextSeg);if(nextIndex+1>=literalsegments){break}next=substitutions[nextKey];if(typeof next==="undefined"){break}nextSub=String(next);stringElements.push(nextSub);nextIndex++}return stringElements.join("")}});if(String.fromCodePoint.length!==1){var originalFromCodePoint=String.fromCodePoint;defineProperty(String,"fromCodePoint",function(_){return originalFromCodePoint.apply(this,arguments)},true)}var StringShims={repeat:function(){var repeat=function(s,times){if(times<1){return""}if(times%2){return repeat(s,times-1)+s}var half=repeat(s,times/2);return half+half};return function(times){var thisStr=String(ES.CheckObjectCoercible(this));times=ES.ToInteger(times);if(times<0||times===Infinity){throw new RangeError("Invalid String#repeat value")}return repeat(thisStr,times)}}(),startsWith:function(searchStr){var thisStr=String(ES.CheckObjectCoercible(this));if(_toString.call(searchStr)==="[object RegExp]"){throw new TypeError('Cannot call method "startsWith" with a regex')}searchStr=String(searchStr);var startArg=arguments.length>1?arguments[1]:void 0;var start=Math.max(ES.ToInteger(startArg),0);return thisStr.slice(start,start+searchStr.length)===searchStr},endsWith:function(searchStr){var thisStr=String(ES.CheckObjectCoercible(this));if(_toString.call(searchStr)==="[object RegExp]"){throw new TypeError('Cannot call method "endsWith" with a regex')}searchStr=String(searchStr);var thisLen=thisStr.length;var posArg=arguments.length>1?arguments[1]:void 0;var pos=typeof posArg==="undefined"?thisLen:ES.ToInteger(posArg);var end=Math.min(Math.max(pos,0),thisLen);return thisStr.slice(end-searchStr.length,end)===searchStr},contains:function(searchString){var position=arguments.length>1?arguments[1]:void 0;return _indexOf.call(this,searchString,position)!==-1},codePointAt:function(pos){var thisStr=String(ES.CheckObjectCoercible(this));var position=ES.ToInteger(pos);var length=thisStr.length;if(position<0||position>=length){return}var first=thisStr.charCodeAt(position);var isEnd=position+1===length;if(first<55296||first>56319||isEnd){return first}var second=thisStr.charCodeAt(position+1);if(second<56320||second>57343){return first}return(first-55296)*1024+(second-56320)+65536}};defineProperties(String.prototype,StringShims);var hasStringTrimBug="…".trim().length!==1;if(hasStringTrimBug){var originalStringTrim=String.prototype.trim;delete String.prototype.trim;var ws=[" \n \f\r   ᠎    ","          \u2028","\u2029"].join("");var trimRegexp=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g");defineProperties(String.prototype,{trim:function(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(trimRegexp,"")}})}var StringIterator=function(s){this._s=String(ES.CheckObjectCoercible(s));this._i=0};StringIterator.prototype.next=function(){var s=this._s,i=this._i;if(typeof s==="undefined"||i>=s.length){this._s=void 0;return{value:void 0,done:true}}var first=s.charCodeAt(i),second,len;if(first<55296||first>56319||i+1==s.length){len=1}else{second=s.charCodeAt(i+1);len=second<56320||second>57343?1:2}this._i=i+len;return{value:s.substr(i,len),done:false}};addIterator(StringIterator.prototype);addIterator(String.prototype,function(){return new StringIterator(this)});if(!startsWithIsCompliant){String.prototype.startsWith=StringShims.startsWith;String.prototype.endsWith=StringShims.endsWith}var ArrayShims={from:function(iterable){var mapFn=arguments.length>1?arguments[1]:void 0;var list=ES.ToObject(iterable,"bad iterable");if(typeof mapFn!=="undefined"&&!ES.IsCallable(mapFn)){throw new TypeError("Array.from: when provided, the second argument must be a function")}var hasThisArg=arguments.length>2;var thisArg=hasThisArg?arguments[2]:void 0;var usingIterator=ES.IsIterable(list);var length;var result,i,value;if(usingIterator){i=0;result=ES.IsCallable(this)?Object(new this):[];var it=usingIterator?ES.GetIterator(list):null;var iterationValue;do{iterationValue=ES.IteratorNext(it);if(!iterationValue.done){value=iterationValue.value;if(mapFn){result[i]=hasThisArg?mapFn.call(thisArg,value,i):mapFn(value,i)}else{result[i]=value}i+=1}}while(!iterationValue.done);length=i}else{length=ES.ToLength(list.length);result=ES.IsCallable(this)?Object(new this(length)):new Array(length);for(i=0;i<length;++i){value=list[i];if(mapFn){result[i]=hasThisArg?mapFn.call(thisArg,value,i):mapFn(value,i)}else{result[i]=value}}}result.length=length;return result},of:function(){return Array.from(arguments)}};defineProperties(Array,ArrayShims);var arrayFromSwallowsNegativeLengths=function(){try{return Array.from({length:-1}).length===0}catch(e){return false}};if(!arrayFromSwallowsNegativeLengths()){defineProperty(Array,"from",ArrayShims.from,true)}ArrayIterator=function(array,kind){this.i=0;this.array=array;this.kind=kind};defineProperties(ArrayIterator.prototype,{next:function(){var i=this.i,array=this.array;if(!(this instanceof ArrayIterator)){throw new TypeError("Not an ArrayIterator")}if(typeof array!=="undefined"){var len=ES.ToLength(array.length);for(;i<len;i++){var kind=this.kind;var retval;if(kind==="key"){retval=i}else if(kind==="value"){retval=array[i]}else if(kind==="entry"){retval=[i,array[i]]}this.i=i+1;return{value:retval,done:false}}}this.array=void 0;return{value:void 0,done:true}}});addIterator(ArrayIterator.prototype);var ArrayPrototypeShims={copyWithin:function(target,start){var end=arguments[2];var o=ES.ToObject(this);var len=ES.ToLength(o.length);target=ES.ToInteger(target);start=ES.ToInteger(start);var to=target<0?Math.max(len+target,0):Math.min(target,len);var from=start<0?Math.max(len+start,0):Math.min(start,len);end=typeof end==="undefined"?len:ES.ToInteger(end);var fin=end<0?Math.max(len+end,0):Math.min(end,len);var count=Math.min(fin-from,len-to);var direction=1;if(from<to&&to<from+count){direction=-1;from+=count-1;to+=count-1}while(count>0){if(_hasOwnProperty.call(o,from)){o[to]=o[from]}else{delete o[from]}from+=direction;to+=direction;count-=1}return o},fill:function(value){var start=arguments.length>1?arguments[1]:void 0;var end=arguments.length>2?arguments[2]:void 0;var O=ES.ToObject(this);var len=ES.ToLength(O.length);start=ES.ToInteger(typeof start==="undefined"?0:start);end=ES.ToInteger(typeof end==="undefined"?len:end);var relativeStart=start<0?Math.max(len+start,0):Math.min(start,len);var relativeEnd=end<0?len+end:end;for(var i=relativeStart;i<len&&i<relativeEnd;++i){O[i]=value}return O},find:function find(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#find: predicate must be a function")}var thisArg=arguments[1];for(var i=0,value;i<length;i++){value=list[i];if(predicate.call(thisArg,value,i,list)){return value}}return},findIndex:function findIndex(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#findIndex: predicate must be a function")}var thisArg=arguments[1];for(var i=0;i<length;i++){if(predicate.call(thisArg,list[i],i,list)){return i}}return-1},keys:function(){return new ArrayIterator(this,"key")},values:function(){return new ArrayIterator(this,"value")},entries:function(){return new ArrayIterator(this,"entry")}};if(Array.prototype.keys&&!ES.IsCallable([1].keys().next)){delete Array.prototype.keys}if(Array.prototype.entries&&!ES.IsCallable([1].entries().next)){delete Array.prototype.entries}if(Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[$iterator$]){defineProperties(Array.prototype,{values:Array.prototype[$iterator$]})}defineProperties(Array.prototype,ArrayPrototypeShims);addIterator(Array.prototype,function(){return this.values()});if(Object.getPrototypeOf){addIterator(Object.getPrototypeOf([].values()))}var maxSafeInteger=Math.pow(2,53)-1;defineProperties(Number,{MAX_SAFE_INTEGER:maxSafeInteger,MIN_SAFE_INTEGER:-maxSafeInteger,EPSILON:2.220446049250313e-16,parseInt:globals.parseInt,parseFloat:globals.parseFloat,isFinite:function(value){return typeof value==="number"&&global_isFinite(value)},isInteger:function(value){return Number.isFinite(value)&&ES.ToInteger(value)===value},isSafeInteger:function(value){return Number.isInteger(value)&&Math.abs(value)<=Number.MAX_SAFE_INTEGER},isNaN:function(value){return value!==value}});if(![,1].find(function(item,idx){return idx===0})){defineProperty(Array.prototype,"find",ArrayPrototypeShims.find,true)}if([,1].findIndex(function(item,idx){return idx===0})!==0){defineProperty(Array.prototype,"findIndex",ArrayPrototypeShims.findIndex,true)}if(supportsDescriptors){defineProperties(Object,{getPropertyDescriptor:function(subject,name){var pd=Object.getOwnPropertyDescriptor(subject,name);var proto=Object.getPrototypeOf(subject);while(typeof pd==="undefined"&&proto!==null){pd=Object.getOwnPropertyDescriptor(proto,name);proto=Object.getPrototypeOf(proto)}return pd},getPropertyNames:function(subject){var result=Object.getOwnPropertyNames(subject);var proto=Object.getPrototypeOf(subject);var addProperty=function(property){if(result.indexOf(property)===-1){result.push(property)}};while(proto!==null){Object.getOwnPropertyNames(proto).forEach(addProperty);proto=Object.getPrototypeOf(proto)}return result}});defineProperties(Object,{assign:function(target,source){if(!ES.TypeIsObject(target)){throw new TypeError("target must be an object")}return Array.prototype.reduce.call(arguments,function(target,source){return Object.keys(Object(source)).reduce(function(target,key){target[key]=source[key];return target},target)})},is:function(a,b){return ES.SameValue(a,b)},setPrototypeOf:function(Object,magic){var set;var checkArgs=function(O,proto){if(!ES.TypeIsObject(O)){throw new TypeError("cannot set prototype on a non-object")}if(!(proto===null||ES.TypeIsObject(proto))){throw new TypeError("can only set prototype to an object or null"+proto)}};var setPrototypeOf=function(O,proto){checkArgs(O,proto);set.call(O,proto);return O};try{set=Object.getOwnPropertyDescriptor(Object.prototype,magic).set;set.call({},null)}catch(e){if(Object.prototype!=={}[magic]){return}set=function(proto){this[magic]=proto};setPrototypeOf.polyfill=setPrototypeOf(setPrototypeOf({},null),Object.prototype)instanceof Object}return setPrototypeOf}(Object,"__proto__")})}if(Object.setPrototypeOf&&Object.getPrototypeOf&&Object.getPrototypeOf(Object.setPrototypeOf({},null))!==null&&Object.getPrototypeOf(Object.create(null))===null){(function(){var FAKENULL=Object.create(null);var gpo=Object.getPrototypeOf,spo=Object.setPrototypeOf;Object.getPrototypeOf=function(o){var result=gpo(o);return result===FAKENULL?null:result};Object.setPrototypeOf=function(o,p){if(p===null){p=FAKENULL}return spo(o,p)};Object.setPrototypeOf.polyfill=false})()}try{Object.keys("foo")}catch(e){var originalObjectKeys=Object.keys;Object.keys=function(obj){return originalObjectKeys(ES.ToObject(obj))}}var MathShims={acosh:function(value){value=Number(value);if(Number.isNaN(value)||value<1){return NaN}if(value===1){return 0}if(value===Infinity){return value}return Math.log(value+Math.sqrt(value*value-1))},asinh:function(value){value=Number(value);if(value===0||!global_isFinite(value)){return value}return value<0?-Math.asinh(-value):Math.log(value+Math.sqrt(value*value+1))},atanh:function(value){value=Number(value);if(Number.isNaN(value)||value<-1||value>1){return NaN}if(value===-1){return-Infinity}if(value===1){return Infinity}if(value===0){return value}return.5*Math.log((1+value)/(1-value))},cbrt:function(value){value=Number(value);if(value===0){return value}var negate=value<0,result;if(negate){value=-value}result=Math.pow(value,1/3);return negate?-result:result},clz32:function(value){value=Number(value);var number=ES.ToUint32(value);if(number===0){return 32}return 32-number.toString(2).length},cosh:function(value){value=Number(value);if(value===0){return 1}if(Number.isNaN(value)){return NaN}if(!global_isFinite(value)){return Infinity}if(value<0){value=-value}if(value>21){return Math.exp(value)/2}return(Math.exp(value)+Math.exp(-value))/2},expm1:function(value){value=Number(value);if(value===-Infinity){return-1}if(!global_isFinite(value)||value===0){return value}return Math.exp(value)-1},hypot:function(x,y){var anyNaN=false;var allZero=true;var anyInfinity=false;var numbers=[];Array.prototype.every.call(arguments,function(arg){var num=Number(arg);if(Number.isNaN(num)){anyNaN=true}else if(num===Infinity||num===-Infinity){anyInfinity=true}else if(num!==0){allZero=false}if(anyInfinity){return false}else if(!anyNaN){numbers.push(Math.abs(num))}return true});if(anyInfinity){return Infinity}if(anyNaN){return NaN}if(allZero){return 0}numbers.sort(function(a,b){return b-a});var largest=numbers[0];var divided=numbers.map(function(number){return number/largest});var sum=divided.reduce(function(sum,number){return sum+=number*number},0);return largest*Math.sqrt(sum)},log2:function(value){return Math.log(value)*Math.LOG2E},log10:function(value){return Math.log(value)*Math.LOG10E},log1p:function(value){value=Number(value);if(value<-1||Number.isNaN(value)){return NaN}if(value===0||value===Infinity){return value}if(value===-1){return-Infinity}var result=0;var n=50;if(value<0||value>1){return Math.log(1+value)}for(var i=1;i<n;i++){if(i%2===0){result-=Math.pow(value,i)/i}else{result+=Math.pow(value,i)/i}}return result},sign:function(value){var number=+value;if(number===0){return number}if(Number.isNaN(number)){return number}return number<0?-1:1},sinh:function(value){value=Number(value);if(!global_isFinite(value)||value===0){return value}return(Math.exp(value)-Math.exp(-value))/2},tanh:function(value){value=Number(value);if(Number.isNaN(value)||value===0){return value}if(value===Infinity){return 1}if(value===-Infinity){return-1}return(Math.exp(value)-Math.exp(-value))/(Math.exp(value)+Math.exp(-value))},trunc:function(value){var number=Number(value);return number<0?-Math.floor(-number):Math.floor(number)},imul:function(x,y){x=ES.ToUint32(x);y=ES.ToUint32(y);var ah=x>>>16&65535;var al=x&65535;var bh=y>>>16&65535;var bl=y&65535;return al*bl+(ah*bl+al*bh<<16>>>0)|0},fround:function(x){if(x===0||x===Infinity||x===-Infinity||Number.isNaN(x)){return x}var num=Number(x);return numberConversion.toFloat32(num)}};defineProperties(Math,MathShims);if(Math.imul(4294967295,5)!==-5){Math.imul=MathShims.imul }var PromiseShim=function(){var Promise,Promise$prototype;ES.IsPromise=function(promise){if(!ES.TypeIsObject(promise)){return false}if(!promise._promiseConstructor){return false}if(typeof promise._status==="undefined"){return false}return true};var PromiseCapability=function(C){if(!ES.IsCallable(C)){throw new TypeError("bad promise constructor")}var capability=this;var resolver=function(resolve,reject){capability.resolve=resolve;capability.reject=reject};capability.promise=ES.Construct(C,[resolver]);if(!capability.promise._es6construct){throw new TypeError("bad promise constructor")}if(!(ES.IsCallable(capability.resolve)&&ES.IsCallable(capability.reject))){throw new TypeError("bad promise constructor")}};var setTimeout=globals.setTimeout;var makeZeroTimeout;if(typeof window!=="undefined"&&ES.IsCallable(window.postMessage)){makeZeroTimeout=function(){var timeouts=[];var messageName="zero-timeout-message";var setZeroTimeout=function(fn){timeouts.push(fn);window.postMessage(messageName,"*")};var handleMessage=function(event){if(event.source==window&&event.data==messageName){event.stopPropagation();if(timeouts.length===0){return}var fn=timeouts.shift();fn()}};window.addEventListener("message",handleMessage,true);return setZeroTimeout}}var makePromiseAsap=function(){var P=globals.Promise;return P&&P.resolve&&function(task){return P.resolve().then(task)}};var enqueue=ES.IsCallable(globals.setImmediate)?globals.setImmediate.bind(globals):typeof process==="object"&&process.nextTick?process.nextTick:makePromiseAsap()||(ES.IsCallable(makeZeroTimeout)?makeZeroTimeout():function(task){setTimeout(task,0)});var triggerPromiseReactions=function(reactions,x){reactions.forEach(function(reaction){enqueue(function(){var handler=reaction.handler;var capability=reaction.capability;var resolve=capability.resolve;var reject=capability.reject;try{var result=handler(x);if(result===capability.promise){throw new TypeError("self resolution")}var updateResult=updatePromiseFromPotentialThenable(result,capability);if(!updateResult){resolve(result)}}catch(e){reject(e)}})})};var updatePromiseFromPotentialThenable=function(x,capability){if(!ES.TypeIsObject(x)){return false}var resolve=capability.resolve;var reject=capability.reject;try{var then=x.then;if(!ES.IsCallable(then)){return false}then.call(x,resolve,reject)}catch(e){reject(e)}return true};var promiseResolutionHandler=function(promise,onFulfilled,onRejected){return function(x){if(x===promise){return onRejected(new TypeError("self resolution"))}var C=promise._promiseConstructor;var capability=new PromiseCapability(C);var updateResult=updatePromiseFromPotentialThenable(x,capability);if(updateResult){return capability.promise.then(onFulfilled,onRejected)}else{return onFulfilled(x)}}};Promise=function(resolver){var promise=this;promise=emulateES6construct(promise);if(!promise._promiseConstructor){throw new TypeError("bad promise")}if(typeof promise._status!=="undefined"){throw new TypeError("promise already initialized")}if(!ES.IsCallable(resolver)){throw new TypeError("not a valid resolver")}promise._status="unresolved";promise._resolveReactions=[];promise._rejectReactions=[];var resolve=function(resolution){if(promise._status!=="unresolved"){return}var reactions=promise._resolveReactions;promise._result=resolution;promise._resolveReactions=void 0;promise._rejectReactions=void 0;promise._status="has-resolution";triggerPromiseReactions(reactions,resolution)};var reject=function(reason){if(promise._status!=="unresolved"){return}var reactions=promise._rejectReactions;promise._result=reason;promise._resolveReactions=void 0;promise._rejectReactions=void 0;promise._status="has-rejection";triggerPromiseReactions(reactions,reason)};try{resolver(resolve,reject)}catch(e){reject(e)}return promise};Promise$prototype=Promise.prototype;defineProperties(Promise,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Promise$prototype;obj=obj||create(prototype);defineProperties(obj,{_status:void 0,_result:void 0,_resolveReactions:void 0,_rejectReactions:void 0,_promiseConstructor:void 0});obj._promiseConstructor=constructor;return obj}});var _promiseAllResolver=function(index,values,capability,remaining){var done=false;return function(x){if(done){return}done=true;values[index]=x;if(--remaining.count===0){var resolve=capability.resolve;resolve(values)}}};Promise.all=function(iterable){var C=this;var capability=new PromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;try{if(!ES.IsIterable(iterable)){throw new TypeError("bad iterable")}var it=ES.GetIterator(iterable);var values=[],remaining={count:1};for(var index=0;;index++){var next=ES.IteratorNext(it);if(next.done){break}var nextPromise=C.resolve(next.value);var resolveElement=_promiseAllResolver(index,values,capability,remaining);remaining.count++;nextPromise.then(resolveElement,capability.reject)}if(--remaining.count===0){resolve(values)}}catch(e){reject(e)}return capability.promise};Promise.race=function(iterable){var C=this;var capability=new PromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;try{if(!ES.IsIterable(iterable)){throw new TypeError("bad iterable")}var it=ES.GetIterator(iterable);while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextPromise=C.resolve(next.value);nextPromise.then(resolve,reject)}}catch(e){reject(e)}return capability.promise};Promise.reject=function(reason){var C=this;var capability=new PromiseCapability(C);var reject=capability.reject;reject(reason);return capability.promise};Promise.resolve=function(v){var C=this;if(ES.IsPromise(v)){var constructor=v._promiseConstructor;if(constructor===C){return v}}var capability=new PromiseCapability(C);var resolve=capability.resolve;resolve(v);return capability.promise};Promise.prototype["catch"]=function(onRejected){return this.then(void 0,onRejected)};Promise.prototype.then=function(onFulfilled,onRejected){var promise=this;if(!ES.IsPromise(promise)){throw new TypeError("not a promise")}var C=this.constructor;var capability=new PromiseCapability(C);if(!ES.IsCallable(onRejected)){onRejected=function(e){throw e}}if(!ES.IsCallable(onFulfilled)){onFulfilled=function(x){return x}}var resolutionHandler=promiseResolutionHandler(promise,onFulfilled,onRejected);var resolveReaction={capability:capability,handler:resolutionHandler};var rejectReaction={capability:capability,handler:onRejected};switch(promise._status){case"unresolved":promise._resolveReactions.push(resolveReaction);promise._rejectReactions.push(rejectReaction);break;case"has-resolution":triggerPromiseReactions([resolveReaction],promise._result);break;case"has-rejection":triggerPromiseReactions([rejectReaction],promise._result);break;default:throw new TypeError("unexpected")}return capability.promise};return Promise}();defineProperties(globals,{Promise:PromiseShim});var promiseSupportsSubclassing=supportsSubclassing(globals.Promise,function(S){return S.resolve(42)instanceof S});var promiseIgnoresNonFunctionThenCallbacks=function(){try{globals.Promise.reject(42).then(null,5).then(null,function(){});return true}catch(ex){return false}}();var promiseRequiresObjectContext=function(){try{Promise.call(3,function(){})}catch(e){return true}return false}();if(!promiseSupportsSubclassing||!promiseIgnoresNonFunctionThenCallbacks||!promiseRequiresObjectContext){globals.Promise=PromiseShim}var testOrder=function(a){var b=Object.keys(a.reduce(function(o,k){o[k]=true;return o},{}));return a.join(":")===b.join(":")};var preservesInsertionOrder=testOrder(["z","a","bb"]);var preservesNumericInsertionOrder=testOrder(["z",1,"a","3",2]);if(supportsDescriptors){var fastkey=function fastkey(key){if(!preservesInsertionOrder){return null}var type=typeof key;if(type==="string"){return"$"+key}else if(type==="number"){if(!preservesNumericInsertionOrder){return"n"+key}return key}return null};var emptyObject=function emptyObject(){return Object.create?Object.create(null):{}};var collectionShims={Map:function(){var empty={};function MapEntry(key,value){this.key=key;this.value=value;this.next=null;this.prev=null}MapEntry.prototype.isRemoved=function(){return this.key===empty};function MapIterator(map,kind){this.head=map._head;this.i=this.head;this.kind=kind}MapIterator.prototype={next:function(){var i=this.i,kind=this.kind,head=this.head,result;if(typeof this.i==="undefined"){return{value:void 0,done:true}}while(i.isRemoved()&&i!==head){i=i.prev}while(i.next!==head){i=i.next;if(!i.isRemoved()){if(kind==="key"){result=i.key}else if(kind==="value"){result=i.value}else{result=[i.key,i.value]}this.i=i;return{value:result,done:false}}}this.i=void 0;return{value:void 0,done:true}}};addIterator(MapIterator.prototype);function Map(iterable){var map=this;if(!ES.TypeIsObject(map)){throw new TypeError("Map does not accept arguments when called as a function")}map=emulateES6construct(map);if(!map._es6map){throw new TypeError("bad map")}var head=new MapEntry(null,null);head.next=head.prev=head;defineProperties(map,{_head:head,_storage:emptyObject(),_size:0});if(typeof iterable!=="undefined"&&iterable!==null){var it=ES.GetIterator(iterable);var adder=map.set;if(!ES.IsCallable(adder)){throw new TypeError("bad map")}while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextItem=next.value;if(!ES.TypeIsObject(nextItem)){throw new TypeError("expected iterable of pairs")}adder.call(map,nextItem[0],nextItem[1])}}return map}var Map$prototype=Map.prototype;defineProperties(Map,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Map$prototype;obj=obj||create(prototype);defineProperties(obj,{_es6map:true});return obj}});Object.defineProperty(Map.prototype,"size",{configurable:true,enumerable:false,get:function(){if(typeof this._size==="undefined"){throw new TypeError("size method called on incompatible Map")}return this._size}});defineProperties(Map.prototype,{get:function(key){var fkey=fastkey(key);if(fkey!==null){var entry=this._storage[fkey];if(entry){return entry.value}else{return}}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return i.value}}return},has:function(key){var fkey=fastkey(key);if(fkey!==null){return typeof this._storage[fkey]!=="undefined"}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return true}}return false},set:function(key,value){var head=this._head,i=head,entry;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]!=="undefined"){this._storage[fkey].value=value;return this}else{entry=this._storage[fkey]=new MapEntry(key,value);i=head.prev}}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.value=value;return this}}entry=entry||new MapEntry(key,value);if(ES.SameValue(-0,key)){entry.key=+0}entry.next=this._head;entry.prev=this._head.prev;entry.prev.next=entry;entry.next.prev=entry;this._size+=1;return this},"delete":function(key){var head=this._head,i=head;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]==="undefined"){return false}i=this._storage[fkey].prev;delete this._storage[fkey]}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.key=i.value=empty;i.prev.next=i.next;i.next.prev=i.prev;this._size-=1;return true}}return false},clear:function(){this._size=0;this._storage=emptyObject();var head=this._head,i=head,p=i.next;while((i=p)!==head){i.key=i.value=empty;p=i.next;i.next=i.prev=head}head.next=head.prev=head},keys:function(){return new MapIterator(this,"key")},values:function(){return new MapIterator(this,"value")},entries:function(){return new MapIterator(this,"key+value")},forEach:function(callback){var context=arguments.length>1?arguments[1]:null;var it=this.entries();for(var entry=it.next();!entry.done;entry=it.next()){callback.call(context,entry.value[1],entry.value[0],this)}}});addIterator(Map.prototype,function(){return this.entries()});return Map}(),Set:function(){var SetShim=function Set(iterable){var set=this;if(!ES.TypeIsObject(set)){throw new TypeError("Set does not accept arguments when called as a function")}set=emulateES6construct(set);if(!set._es6set){throw new TypeError("bad set")}defineProperties(set,{"[[SetData]]":null,_storage:emptyObject()});if(typeof iterable!=="undefined"&&iterable!==null){var it=ES.GetIterator(iterable);var adder=set.add;if(!ES.IsCallable(adder)){throw new TypeError("bad set")}while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextItem=next.value;adder.call(set,nextItem)}}return set};var Set$prototype=SetShim.prototype;defineProperties(SetShim,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Set$prototype;obj=obj||create(prototype);defineProperties(obj,{_es6set:true});return obj}});var ensureMap=function ensureMap(set){if(!set["[[SetData]]"]){var m=set["[[SetData]]"]=new collectionShims.Map;Object.keys(set._storage).forEach(function(k){if(k.charCodeAt(0)===36){k=k.slice(1)}else if(k.charAt(0)==="n"){k=+k.slice(1)}else{k=+k}m.set(k,k)});set._storage=null}};Object.defineProperty(SetShim.prototype,"size",{configurable:true,enumerable:false,get:function(){if(typeof this._storage==="undefined"){throw new TypeError("size method called on incompatible Set")}ensureMap(this);return this["[[SetData]]"].size}});defineProperties(SetShim.prototype,{has:function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){return!!this._storage[fkey]}ensureMap(this);return this["[[SetData]]"].has(key)},add:function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){this._storage[fkey]=true;return this}ensureMap(this);this["[[SetData]]"].set(key,key);return this},"delete":function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){var hasFKey=_hasOwnProperty.call(this._storage,fkey);return delete this._storage[fkey]&&hasFKey}ensureMap(this);return this["[[SetData]]"]["delete"](key)},clear:function(){if(this._storage){this._storage=emptyObject();return}return this["[[SetData]]"].clear()},keys:function(){ensureMap(this);return this["[[SetData]]"].keys()},values:function(){ensureMap(this);return this["[[SetData]]"].values()},entries:function(){ensureMap(this);return this["[[SetData]]"].entries()},forEach:function(callback){var context=arguments.length>1?arguments[1]:null;var entireSet=this;ensureMap(this);this["[[SetData]]"].forEach(function(value,key){callback.call(context,key,key,entireSet)})}});addIterator(SetShim.prototype,function(){return this.values()});return SetShim}()};defineProperties(globals,collectionShims);if(globals.Map||globals.Set){if(typeof globals.Map.prototype.clear!=="function"||(new globals.Set).size!==0||(new globals.Map).size!==0||typeof globals.Map.prototype.keys!=="function"||typeof globals.Set.prototype.keys!=="function"||typeof globals.Map.prototype.forEach!=="function"||typeof globals.Set.prototype.forEach!=="function"||isCallableWithoutNew(globals.Map)||isCallableWithoutNew(globals.Set)||!supportsSubclassing(globals.Map,function(M){var m=new M([]);m.set(42,42);return m instanceof M})){globals.Map=collectionShims.Map;globals.Set=collectionShims.Set}}addIterator(Object.getPrototypeOf((new globals.Map).keys()));addIterator(Object.getPrototypeOf((new globals.Set).keys()))}return globals})}).call(this,require("_process"))},{_process:3}],5:[function(require,module,exports){"use strict";if(!require("./is-implemented")()){Object.defineProperty(require("es5-ext/global"),"Symbol",{value:require("./polyfill"),configurable:true,enumerable:false,writable:true})}},{"./is-implemented":6,"./polyfill":21,"es5-ext/global":8}],6:[function(require,module,exports){"use strict";module.exports=function(){var symbol;if(typeof Symbol!=="function")return false;symbol=Symbol("test symbol");try{String(symbol)}catch(e){return false}if(typeof Symbol.iterator==="symbol")return true;if(typeof Symbol.isConcatSpreadable!=="object")return false;if(typeof Symbol.isRegExp!=="object")return false;if(typeof Symbol.iterator!=="object")return false;if(typeof Symbol.toPrimitive!=="object")return false;if(typeof Symbol.toStringTag!=="object")return false;if(typeof Symbol.unscopables!=="object")return false;return true}},{}],7:[function(require,module,exports){"use strict";var assign=require("es5-ext/object/assign"),normalizeOpts=require("es5-ext/object/normalize-options"),isCallable=require("es5-ext/object/is-callable"),contains=require("es5-ext/string/#/contains"),d;d=module.exports=function(dscr,value){var c,e,w,options,desc;if(arguments.length<2||typeof dscr!=="string"){options=value;value=dscr;dscr=null}else{options=arguments[2]}if(dscr==null){c=w=true;e=false}else{c=contains.call(dscr,"c");e=contains.call(dscr,"e");w=contains.call(dscr,"w")}desc={value:value,configurable:c,enumerable:e,writable:w};return!options?desc:assign(normalizeOpts(options),desc)};d.gs=function(dscr,get,set){var c,e,options,desc;if(typeof dscr!=="string"){options=set;set=get;get=dscr;dscr=null}else{options=arguments[3]}if(get==null){get=undefined}else if(!isCallable(get)){options=get;get=set=undefined}else if(set==null){set=undefined}else if(!isCallable(set)){options=set;set=undefined}if(dscr==null){c=true;e=false}else{c=contains.call(dscr,"c");e=contains.call(dscr,"e")}desc={get:get,set:set,configurable:c,enumerable:e};return!options?desc:assign(normalizeOpts(options),desc)}},{"es5-ext/object/assign":9,"es5-ext/object/is-callable":12,"es5-ext/object/normalize-options":16,"es5-ext/string/#/contains":18}],8:[function(require,module,exports){"use strict";module.exports=new Function("return this")()},{}],9:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":10,"./shim":11}],10:[function(require,module,exports){"use strict";module.exports=function(){var assign=Object.assign,obj;if(typeof assign!=="function")return false;obj={foo:"raz"};assign(obj,{bar:"dwa"},{trzy:"trzy"});return obj.foo+obj.bar+obj.trzy==="razdwatrzy"}},{}],11:[function(require,module,exports){"use strict";var keys=require("../keys"),value=require("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,l=max(arguments.length,2),assign;dest=Object(value(dest));assign=function(key){try{dest[key]=src[key]}catch(e){if(!error)error=e}};for(i=1;i<l;++i){src=arguments[i];keys(src).forEach(assign)}if(error!==undefined)throw error;return dest}},{"../keys":13,"../valid-value":17}],12:[function(require,module,exports){"use strict";module.exports=function(obj){return typeof obj==="function"}},{}],13:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.keys:require("./shim")},{"./is-implemented":14,"./shim":15}],14:[function(require,module,exports){"use strict";module.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},{}],15:[function(require,module,exports){"use strict";var keys=Object.keys;module.exports=function(object){return keys(object==null?object:Object(object))}},{}],16:[function(require,module,exports){"use strict";var assign=require("./assign"),forEach=Array.prototype.forEach,create=Object.create,getPrototypeOf=Object.getPrototypeOf,process;process=function(src,obj){var proto=getPrototypeOf(src);return assign(proto?process(proto,obj):obj,src)};module.exports=function(options){var result=create(null);forEach.call(arguments,function(options){if(options==null)return;process(Object(options),result)});return result}},{"./assign":9}],17:[function(require,module,exports){"use strict";module.exports=function(value){if(value==null)throw new TypeError("Cannot use null or undefined");return value}},{}],18:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?String.prototype.contains:require("./shim")},{"./is-implemented":19,"./shim":20}],19:[function(require,module,exports){"use strict";var str="razdwatrzy";module.exports=function(){if(typeof str.contains!=="function")return false;return str.contains("dwa")===true&&str.contains("foo")===false}},{}],20:[function(require,module,exports){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],21:[function(require,module,exports){"use strict";var d=require("d"),create=Object.create,defineProperties=Object.defineProperties,generateName,Symbol;generateName=function(){var created=create(null);return function(desc){var postfix=0;while(created[desc+(postfix||"")])++postfix;desc+=postfix||"";created[desc]=true;return"@@"+desc}}();module.exports=Symbol=function(description){var symbol;if(this instanceof Symbol){throw new TypeError("TypeError: Symbol is not a constructor")}symbol=create(Symbol.prototype);description=description===undefined?"":String(description);return defineProperties(symbol,{__description__:d("",description),__name__:d("",generateName(description))})};Object.defineProperties(Symbol,{create:d("",Symbol("create")),hasInstance:d("",Symbol("hasInstance")),isConcatSpreadable:d("",Symbol("isConcatSpreadable")),isRegExp:d("",Symbol("isRegExp")),iterator:d("",Symbol("iterator")),toPrimitive:d("",Symbol("toPrimitive")),toStringTag:d("",Symbol("toStringTag")),unscopables:d("",Symbol("unscopables"))});defineProperties(Symbol.prototype,{properToString:d(function(){return"Symbol ("+this.__description__+")"}),toString:d("",function(){return this.__name__})});Object.defineProperty(Symbol.prototype,Symbol.toPrimitive,d("",function(hint){throw new TypeError("Conversion of symbol objects is not allowed")}));Object.defineProperty(Symbol.prototype,Symbol.toStringTag,d("c","Symbol"))},{d:7}]},{},[1]);
src/ProgressLabel.js
Copy-of-Kate/copy-of-kate.com
import React from 'react'; import './Progress.css'; import './ProgressLabel.css'; const ProgressLabel = props => { const chapterData = props.chapterData || {}; return ( <span className={'Progress-label Progress--' + chapterData.progress}> {chapterData.progressLabel} </span> ); }; export default ProgressLabel;
assets/node_modules/react-router/es6/RoutingContext.js
janta-devs/janta
import React from 'react'; import RouterContext from './RouterContext'; import warning from './routerWarning'; var RoutingContext = React.createClass({ displayName: 'RoutingContext', componentWillMount: function componentWillMount() { process.env.NODE_ENV !== 'production' ? warning(false, '`RoutingContext` has been renamed to `RouterContext`. Please use `import { RouterContext } from \'react-router\'`. http://tiny.cc/router-routercontext') : void 0; }, render: function render() { return React.createElement(RouterContext, this.props); } }); export default RoutingContext;
src/routes/Home/components/HomeView.js
thanhiro/tuha-ui-tpl
import React from 'react'; import classes from './HomeView.scss'; import {FormattedDate, FormattedMessage} from 'react-intl'; import TranslatableHelmet from '../../../components/TranslatableHelmet'; export const HomeView = () => ( <div> <TranslatableHelmet transKey="home_title" /> <h4 className={classes.tst}> <FormattedMessage id="welcome" /></h4> <br /> localized date:<br /> <FormattedDate value={Date.now()} /> </div> ); export default HomeView;
front-end/src/containers/NotFound.js
afaquejam/serverless-web-services
import React, { Component } from 'react'; import './NotFound.css'; export default class NotFound extends Component { render() { return ( <div className="NotFound"> <h3>Sorry, page not found!</h3> </div> ); } }
test/TabSpec.js
adampickeral/react-bootstrap
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import Tab from '../src/Tab'; describe('Tab', function () { it('Should have class', function () { let instance = ReactTestUtils.renderIntoDocument( <Tab>Item content</Tab> ); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'tab-pane')); }); it('Should add active class', function () { let instance = ReactTestUtils.renderIntoDocument( <Tab active={true}>Item content</Tab> ); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'active')); }); describe('Web Accessibility', function(){ it('Should have aria-hidden', function () { let instance = ReactTestUtils.renderIntoDocument( <Tab active>Item content</Tab> ); assert.equal(React.findDOMNode(instance).getAttribute('aria-hidden'), 'false'); }); it('Should have role', function () { let instance = ReactTestUtils.renderIntoDocument( <Tab active>Item content</Tab> ); assert.equal(React.findDOMNode(instance).getAttribute('role'), 'tabpanel'); }); }); });
ADnD_2E_Revised/javascript/sheetWorkers.js
ap3h3ad/roll20-character-sheets
// --- ALL SHEET WORKERS START --- // const SUCCESS = 'success'; const INFO = 'info'; const WARNING = 'warning'; const ERROR = 'error'; const BOOK_FIELDS = [ 'book-phb', 'book-tcfhb', 'book-tcthb', 'book-tcprhb', 'book-tcwhb', 'book-tom', 'book-aaeg', 'book-dwarves', 'book-bards', 'book-elves', 'book-humanoids', 'book-rangers', 'book-paladins', 'book-druids', 'book-barbarians', 'book-necromancers', 'book-ninjas' ]; const SCHOOL_FIELDS = ['school-spells&magic']; const SPHERE_FIELDS = ['sphere-druids', 'sphere-necromancers', 'sphere-spells&magic']; //#region Helper function function capitalizeFirst(s) { if (typeof s !== 'string') return ''; return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase(); } const displaySize = function(size) { if (typeof size !== 'string') return ''; size = size.toLowerCase(); switch (size) { case 't': return 'Tiny'; case 'tiny': return 'Tiny'; case 's': return 'Small'; case 'small': return 'Small'; case 'm': return 'Medium'; case 'medium': return 'Medium'; case 'l': return 'Large'; case 'large': return 'Large'; case 'h': return 'Huge'; case 'huge': return 'Huge'; case 'g': return 'Gargantuan'; case 'gargantuan': return 'Gargantuan'; default: capitalizeFirst(size); } } const sizeToInt = function(size) { size = displaySize(size); switch (size) { case 'Tiny': return 0; case 'Small': return 1; case 'Medium': return 2; case 'Large': return 3; case 'Huge': return 4; case 'Gargantuan': return 5; } } const displayWeaponType = function (type) { if (typeof type !== 'string') return ''; type = type.toLowerCase(); switch (type) { case 's': return 'Slashing'; case 'p': return 'Piercing'; case 'b': return 'Bludgeoning'; default: capitalizeFirst(type); } } const conditionalLog = function (bool, msg) { if (bool) console.log(msg); } const extractQueryResult = async function(query){//Sends a message to query the user for some behavior, returns the selected option. let queryRoll = await startRoll(`!{{query=[[0[response=${query}]]]}}`); finishRoll(queryRoll.rollId); return queryRoll.results.query.expression.replace(/^.+?response=|\]$/g,''); }; const extractRoll = async function(rollExpression) { let queryRoll = await startRoll(`!{{roll=[[${rollExpression}]]}}`); finishRoll(queryRoll.rollId); return queryRoll.results.roll; }; const extractRollResult = async function(rollExpression) { let roll = await extractRoll(rollExpression); return roll.result; }; const isRollValid = function (rollExpression, field) { let expression = rollExpression.trim(); if (!expression) return false; let message = `In the field @{${field}} you have unmatched opening and closing`; let openPara = (expression.match(/\(/g) || []).length let closePara = (expression.match(/\)/g) || []).length if (openPara !== closePara) { showToast(ERROR, 'Unmatched Parenthesis', `${message} parenthesis. You have:\n${openPara}x '('\n${closePara}x ')'`); return false; } let openCurly = (expression.match(/{/g) || []).length let closeCurly = (expression.match(/}/g) || []).length if (openCurly !== closeCurly) { showToast(ERROR, 'Unmatched Curly brackets', `${message} curly brackets. You have:\n${openCurly}x '{'\n${closeCurly}x '}'`); return false; } let openSquare = (expression.match(/\[/g) || []).length let closeSquare = (expression.match(/]/g) || []).length if (openSquare !== closeSquare) { showToast(ERROR, 'Unmatched Square brackets', `${message} square brackets. You have:\n${openSquare}x '['\n${closeSquare}x ']'`); return false; } if (openSquare % 2 !== 0) { showToast(ERROR, 'Square brackets error', `The field @{${field}} have too few square brackets. Square brackets are used in pairs of two, ie. [[ ]].\nThe expression have an uneven number of bracket pairs: ${openSquare}`); return false; } return true; } const calculateFormula = async function(formulaField, calculatedField, silent = false) { getAttrs([formulaField], async function (values) { let rollExpression = values[formulaField]; let valid = isRollValid(rollExpression, formulaField); if (!valid) return; setAttrs({ [calculatedField]: await extractRollResult(rollExpression, formulaField) },{silent:silent}); }); } const getToastObject = function (type, title, message) { let content switch (type) { case SUCCESS: content = 1; break; case INFO: content = 2; break; case WARNING: content = 3; break; case ERROR: content = 4; break; } return { ['toast']: 1, ['toast-content']: content, [`toast-title-${type}`]: title, [`toast-message-${type}`]: message } } const showToast = function(type, title, message) { setAttrs(getToastObject(type, title, message)); } const getActiveSettings = function (settingFields, values) { return settingFields.map(bField => values[bField]) .filter(Boolean) .filter(book => book !== '0') } const isBookInactive = function (books, obj) { let activeBooks = getActiveSettings(BOOK_FIELDS, books); return !activeBooks.includes(obj['book']); } const bookInactiveShowToast = function(books, obj) { let bookInactive = isBookInactive(books, obj); if (bookInactive) showToast(ERROR, 'Missing Book', `The book *${obj['book']}* is currently not active on your sheet.\nGo to the *Sheet Settings* and activate the book (if your DM allows for its usage)`); return bookInactive; }; const isRemoving0 = function(eventInfo, fieldNames) { return fieldNames.some(fieldName => !parseInt(eventInfo.removedInfo[`${eventInfo.sourceAttribute}_${fieldName}`])); }; const isOverwriting0 = function(eventInfo) { return !parseInt(eventInfo.newValue) && !parseInt(eventInfo.previousValue); }; const doEarlyReturn = function(eventInfo, fieldNames) { return eventInfo.removedInfo ? isRemoving0(eventInfo, fieldNames) : isOverwriting0(eventInfo); }; const repeatingMultiplySum = function(section, valueField, multiplierField, destination, decimals) { TAS.repeating(section) .attr(destination) .field([valueField, multiplierField]) .reduce(function(m, r) { return m + r.F[valueField] * r.F[multiplierField]; }, 0, function(t,r,a) { let dec = parseInt(decimals); if (isNaN(dec)) { a[destination] = t; } else { a.D[dec][destination] = t; } }) .execute(); }; const repeatingCalculateRemaining = function(repeatingName, repeatingFieldsToSum, totalField, remainingField) { TAS.repeating(repeatingName) .attrs([totalField, remainingField]) .fields(repeatingFieldsToSum) .reduce(function (memo, row) { repeatingFieldsToSum.forEach(column => { memo += row.I[column]; }); return memo; }, 0, function (memo,_,attrSet) { attrSet.I[remainingField] = attrSet.I[totalField] - memo; }).execute(); }; //#endregion //#region Generic Setup functions function setupCalculateTotal(totalField, fieldsToSum, maxValue) { let onChange = fieldsToSum.map(field => `change:${field}`).join(' '); on(onChange, function () { getAttrs(fieldsToSum, function (values) { let total = 0; fieldsToSum.forEach(field => { total += parseInt(values[field]) || 0; }); if (!isNaN(maxValue)) total = Math.min(total, maxValue); setAttrs({ [totalField]: total }); }); }); } function setupRepeatingRowCalculateTotal(repeatingTotalField, repeatingFieldsToSum, repeatingName, maxValue) { let onChange = repeatingFieldsToSum.map(field => `change:repeating_${repeatingName}:${field}`).join(' '); let allFields = [...repeatingFieldsToSum]; allFields.push(repeatingTotalField); on(`${onChange} remove:repeating_${repeatingName}`, function(eventInfo){ if (eventInfo.removedInfo) return; TAS.repeating(repeatingName) .fields(allFields) .tap(function(rowSet) { let rowId = eventInfo.sourceAttribute.split('_')[2]; let row = rowSet[rowId]; let total = 0; repeatingFieldsToSum.forEach(column => { total += row.I[column]; }); if (!isNaN(maxValue)) total = Math.min(total, maxValue); row[repeatingTotalField] = total; }) .execute(); }); } //#endregion on('clicked:hide-toast', function(eventInfo) { setAttrs({ ['toast']: 0, ['toast-content']: 0, }); }); //#region Ability Scores logic // Ability Score Parser function const squareBracketsRegex = /18\[([0-9]{1,3})]/; // Ie. 18[65] const parenthesisRegex = /18\(([0-9]{1,3})\)/; // Ie. 18(65) function getLookupValue(abilityScoreString, defaultValue, isStrength = false) { if (abilityScoreString === '') { return defaultValue; } let abilityScoreNumber = parseInt(abilityScoreString); if (isNaN(abilityScoreNumber) || abilityScoreNumber < 1 || abilityScoreNumber > 25) { return 0; // Return error value } if (isStrength) { let exceptionalMatch = abilityScoreString.match(squareBracketsRegex) || abilityScoreString.match(parenthesisRegex); if (exceptionalMatch !== null) { let exceptionalStrNumber = parseInt(exceptionalMatch[1]); if (1 <= exceptionalStrNumber && exceptionalStrNumber <= 50) { return '18[01-50]'; } if (51 <= exceptionalStrNumber && exceptionalStrNumber <= 75) { return '18[51-75]' } if (76 <= exceptionalStrNumber && exceptionalStrNumber <= 90) { return '18[76-90]' } if (91 <= exceptionalStrNumber && exceptionalStrNumber <= 99) { return '18[91-99]' } // 100 can be written as [00] or [100] if (exceptionalStrNumber === 0 || exceptionalStrNumber === 100) { return '18[00]' } } } return abilityScoreNumber; } //Set sub-attributes based on Strength, Stamina, and Muscle on('change:strength change:stamina change:muscle', function() { getAttrs(['strength','stamina','muscle'], function(values) { let strengthRaw = values.strength.replace(/\s+/g, ''); let staminaRaw = values.stamina.replace(/\s+/g, ''); let muscleRaw = values.muscle.replace(/\s+/g, ''); let strength = getLookupValue(strengthRaw, '', true); if (strength === '') { return; } if (strength === 0) { assignStr(0,0, strengthTable['strnotes'][0], strengthTable['str2notes'][0]); return; } let stamina = getLookupValue(staminaRaw, strength, true); let muscle = getLookupValue(muscleRaw, strength, true); let strnotes; let str2notes; if (staminaRaw === '' && muscleRaw === '') { strnotes = [strengthTable['str2notes'][strength], strengthTable['strnotes'][strength]].filter(Boolean).join(', '); str2notes = ''; } else { strnotes = stamina === 0 ? 'INVALID STAMINA' : strengthTable['strnotes'][strength]; str2notes = muscle === 0 ? 'INVALID MUSCLE' : strengthTable['str2notes'][muscle]; } assignStr(stamina, muscle, strnotes, str2notes); function assignStr(stamina, muscle, strnotes, str2notes) { setAttrs({ strengthhit: strengthTable['strengthhit'][muscle], strengthdmg: strengthTable['strengthdmg'][muscle], carryweight: strengthTable['carryweight'][stamina], maxpress: strengthTable['maxpress'][muscle], opendoor: strengthTable['opendoor'][muscle], bendbar: strengthTable['bendbar'][muscle], strnotes: strnotes, str2notes: str2notes, }); } }); }); // Set sub-attributes based on Dexterity, Aim, and Balance on('change:dexterity change:aim change:balance', function() { getAttrs(['dexterity','aim','balance'], function(values) { let dexterityRaw = values.dexterity.replace(/\s+/g, ''); let aimRaw = values.aim.replace(/\s+/g, ''); let balanceRaw = values.balance.replace(/\s+/g, ''); let dexterity = getLookupValue(dexterityRaw, ''); if (dexterity === '') { return; } if (dexterity === 0) { assignAttributes(0, 0, 0, dexterityTable['dexnotes'][0], dexterityTable['dexnotes'][0], false); return; } let aim = getLookupValue(aimRaw, ''); let balance = getLookupValue(balanceRaw, ''); let dexnotes; let dex2notes; let standardRules = false; if (aimRaw === '' && balanceRaw === '') { dexnotes = ''; dex2notes = ''; standardRules = true; } else { dexnotes = aim === 0 ? 'INVALID AIM' : ''; dex2notes = balance === 0 ? 'INVALID BALANCE' : ''; } assignAttributes(dexterity, aim, balance, dexnotes, dex2notes, standardRules); function assignAttributes(dexterity, aim, balance, dexnotes, dex2notes, standardRules) { setAttrs({ ppd: dexterityTable['aim-pickpocket'][aim] || dexterityTable['dex-pickpocket'][dexterity], old: dexterityTable['aim-openlocks'][aim] || dexterityTable['dex-openlocks'][dexterity], rtd: dexterityTable['dex-findtraps'][dexterity], msd: dexterityTable['balance-movesilently'][balance] || dexterityTable['dex-movesilently'][dexterity], hsd: dexterityTable['dex-hideinshadows'][dexterity], cwd: standardRules ? '0' : dexterityTable['balance-climbwalls'][balance] || dexterityTable['dex-climbwalls'][dexterity], tud: standardRules ? '0' : dexterityTable['dex-tunneling'][dexterity], ebd: standardRules ? '0' : dexterityTable['dex-escapebonds'][dexterity], dexreact: dexterityTable['dexreact'][getLookupValue(balance, dexterity)], dexmissile: dexterityTable['dexmissile'][getLookupValue(aim, dexterity)], dexdefense: dexterityTable['dexdefense'][getLookupValue(balance, dexterity)], dexnotes: dexnotes, dex2notes: dex2notes, }); } }); }); // Set sub-attributes based on Constitution, Health, and Fitness on('change:constitution change:health change:fitness', function() { getAttrs(['constitution','health','fitness'], function(values) { let constitutionRaw = values.constitution.replace(/\s+/g, ''); let healthRaw = values.health.replace(/\s+/g, ''); let fitnessRaw = values.fitness.replace(/\s+/g, ''); let constitution = getLookupValue(constitutionRaw, ''); if (constitution === '') { return; } if (constitution === 0) { assignAttributes(0,0, 0, constitutionTable['connotes'][0], constitutionTable['con2notes'][0]); return; } let health = getLookupValue(healthRaw, constitution); let fitness = getLookupValue(fitnessRaw, constitution); let connotes; let con2notes; if (healthRaw === '' && fitnessRaw === '') { connotes = [constitutionTable['con2notes'][constitution], constitutionTable['connotes'][constitution]].filter(Boolean).join(', '); con2notes = ''; } else { connotes = health === 0 ? 'INVALID HEALTH' : constitutionTable['connotes'][constitution]; con2notes = fitness === 0 ? 'INVALID FITNESS' : constitutionTable['con2notes'][fitness]; } assignAttributes(constitution, health, fitness, connotes, con2notes); function assignAttributes(constitution, health, fitness, connotes, con2notes) { setAttrs({ conadj: constitutionTable['conadj'][fitness], conshock: constitutionTable['conshock'][health], conres: constitutionTable['conres'][fitness], conpoisonsave: constitutionTable['conpoisonsave'][health], conregen: constitutionTable['conregen'][constitution], connotes: connotes, con2notes: con2notes, }); } }); }); // Set sub-attributes based on Intelligence, Reason, and Knowledge on('change:intelligence change:reason change:knowledge', function() { getAttrs(['intelligence','reason','knowledge'], function(values) { let intelligenceRaw = values.intelligence.replace(/\s+/g, ''); let reasonRaw = values.reason.replace(/\s+/g, ''); let knowledgeRaw = values.knowledge.replace(/\s+/g, ''); let intelligence = getLookupValue(intelligenceRaw, ''); if (intelligence === '') { return; } if (intelligence === 0) { assignAttributes(0, 0, 0, intelligenceTable['intnotes'][0], intelligenceTable['intnotes'][0]); return; } let reason = getLookupValue(reasonRaw, intelligence); let knowledge = getLookupValue(knowledgeRaw, intelligence); let intnotes; let int2notes; if (reasonRaw === '' && knowledgeRaw === '') { intnotes = intelligenceTable['intnotes'][intelligence]; int2notes = ''; } else { intnotes = reason === 0 ? 'INVALID REASON' : ''; int2notes = knowledge === 0 ? 'INVALID KNOWLEDGE' : intelligenceTable['intnotes'][knowledge]; } assignAttributes(intelligence, reason, knowledge, intnotes, int2notes); function assignAttributes(intelligence, reason, knowledge, intnotes, int2notes) { setAttrs({ intlang: intelligenceTable['intlang'][knowledge], intlvl: intelligenceTable['intlvl'][reason], intchance: intelligenceTable['intchance'][knowledge], intmax: intelligenceTable['intmax'][reason], intimm1st: intelligenceTable['intimm1st'][reason], intimm2nd: intelligenceTable['intimm2nd'][reason], intimm3rd: intelligenceTable['intimm3rd'][reason], intimm4th: intelligenceTable['intimm4th'][reason], intimm5th: intelligenceTable['intimm5th'][reason], intimm6th: intelligenceTable['intimm6th'][reason], intimm7th: intelligenceTable['intimm7th'][reason], intnotes: intnotes, int2notes: int2notes, }); } }); }); // Set sub-attributes based on Wisdom, Intuition, and Willpower function parseWisBonus(abilityScore) { if (abilityScore < 13) { return { '1st': 0, '2nd': 0, '3rd': 0, '4th': 0, '5th': 0, '6th': 0, '7th': 0, 'wisbonus': wisdomTable['wisbonus'][abilityScore], 'wisbonus-prime': wisdomTable['wisbonus'][abilityScore], 'wisbonus-extra': wisdomTable['wisbonus'][abilityScore], }; } // Combine all spell levels into one string let bonusString = ''; for (let i = 13; i <= abilityScore; i++) { bonusString += wisdomTable['wisbonus'][i]; } // Count instances of each spell level let bonus = { '1st': (bonusString.match(/1st/g) || []).length, '2nd': (bonusString.match(/2nd/g) || []).length, '3rd': (bonusString.match(/3rd/g) || []).length, '4th': (bonusString.match(/4th/g) || []).length, '5th': (bonusString.match(/5th/g) || []).length, '6th': (bonusString.match(/6th/g) || []).length, '7th': (bonusString.match(/7th/g) || []).length, }; // Generate bonus prime and bonus extra strings bonus['wisbonus-prime'] = wisdomTable['wisbonus-prime'][abilityScore]; bonus['wisbonus-extra'] = wisdomTable['wisbonus-extra'][abilityScore]; bonus['wisbonus'] = [bonus['wisbonus-prime'], bonus['wisbonus-extra']].filter(Boolean).join(', '); return bonus; } on('change:wisdom change:intuition change:willpower', function() { getAttrs(['wisdom','intuition','willpower'], function(values) { let wisdomRaw = values.wisdom.replace(/\s+/g, ''); let intuitionRaw = values.intuition.replace(/\s+/g, ''); let willpowerRaw = values.willpower.replace(/\s+/g, ''); let wisdom = getLookupValue(wisdomRaw, ''); if (wisdom === '') { return; } let bonusSpells; if (wisdom === 0) { bonusSpell = parseWisBonus(0); assignAttributes(0, 0, 0, bonusSpells, wisdomTable['wisimmune'][0], wisdomTable['wisimmune'][0], wisdomTable['wisnotes'][0], wisdomTable['wisnotes'][0]); return; } let intuition = getLookupValue(intuitionRaw, wisdom); let willpower = getLookupValue(willpowerRaw, wisdom); let wisimm1; let wisimm2; let wisnotes; let wis2notes; if (intuitionRaw === '' && willpowerRaw === '') { wisnotes = wisdomTable['wisnotes'][wisdom]; wis2notes = ''; wisimm2 = ''; let wisImmuneArray = []; for (let i = wisdom; i > 18; i--) { wisImmuneArray.push(wisdomTable['wisimmune'][i]); } wisimm1 = wisImmuneArray.filter(Boolean).join(', '); } else { wisnotes = intuition === 0 ? 'INVALID INTUITION' : wisdomTable['wisnotes'][intuition]; wis2notes = willpower === 0 ? 'INVALID WILLPOWER' : wisdomTable['wisnotes'][willpower]; let wisImmuneArray = []; for (let i = willpower; i > 18; i--) { wisImmuneArray.push(wisdomTable['wisimmune'][i]); } let slicePoint = Math.round(wisImmuneArray.length/2); wisimm1 = wisImmuneArray.slice(0, slicePoint).filter(Boolean).join(', '); wisimm2 = wisImmuneArray.slice(slicePoint).filter(Boolean).join(', '); } bonusSpells = parseWisBonus(willpower); assignAttributes(wisdom, intuition, willpower, bonusSpells, wisimm1, wisimm2, wisnotes, wis2notes); function assignAttributes(wisdom, intuition, willpower, bonusSpells, wisimm1, wisimm2, wisnotes, wis2notes) { setAttrs({ wisdef: wisdomTable['wisdef'][willpower], wisbonus: bonusSpells['wisbonus'], 'wisbonus-prime': bonusSpells['wisbonus-prime'], 'wisbonus-extra': bonusSpells['wisbonus-extra'], wisfail: wisdomTable['wisfail'][intuition], wisimm: wisimm1, wisimm1: wisimm1, wisimm2: wisimm2, wisnotes: wisnotes, wis2notes: wis2notes, 'spell-priest-level1-wisdom': bonusSpells['1st'], 'spell-priest-level2-wisdom': bonusSpells['2nd'], 'spell-priest-level3-wisdom': bonusSpells['3rd'], 'spell-priest-level4-wisdom': bonusSpells['4th'], 'spell-priest-level5-wisdom': bonusSpells['5th'], 'spell-priest-level6-wisdom': bonusSpells['6th'], 'spell-priest-level7-wisdom': bonusSpells['7th'], }); } }); }); // Set sub-attributes based on Charisma, Leadership, and Appearance on('change:charisma change:leadership change:appearance', function() { getAttrs(['charisma','leadership','appearance'], function(values) { let charismaRaw = values.charisma.replace(/\s+/g, ''); let leadershipRaw = values.leadership.replace(/\s+/g, ''); let appearanceRaw = values.appearance.replace(/\s+/g, ''); let charisma = getLookupValue(charismaRaw, ''); if (charisma === '') { return; } if (charisma === 0) { assignAttributes(0,0, 0, charismaTable['chanotes'][0], charismaTable['chanotes'][0]); return; } let leadership = getLookupValue(leadershipRaw, charisma); let appearance = getLookupValue(appearanceRaw, charisma); let chanotes; let cha2notes; if (leadershipRaw === '' && appearanceRaw === '') { chanotes = charismaTable['chanotes'][charisma]; cha2notes = ''; } else { chanotes = leadership === 0 ? 'INVALID LEADERSHIP' : charismaTable['chanotes'][leadership]; cha2notes = appearance === 0 ? 'INVALID APPEARANCE' : charismaTable['chanotes'][appearance]; } assignAttributes(charisma, leadership, appearance, chanotes, cha2notes); function assignAttributes(charisma, leadership, appearance, chanotes, cha2notes) { setAttrs({ chamax: charismaTable['chamax'][leadership], chaloy: charismaTable['chaloy'][leadership], chareact: charismaTable['chareact'][appearance], chanotes: chanotes, cha2notes: cha2notes, }); } }); }); //#endregion //#region Wizard and Priest Spells slot counting function isNewSpellSection(section) { return section.startsWith('wiz') || section.startsWith('pri'); } // --- Start summing numbers from repeating spells for wizard and priest --- // function recursiveSpellSum(tail, acc, oldField, newField, resultFieldName) { let head = tail.shift(); if (head === undefined) { console.log(`Summing ended. Final sum is ${acc}`); console.timeEnd('Summing time'); setAttrs({ [resultFieldName] : acc }); return; } let repeatingName; let fieldName; if (isNewSpellSection(head)) { repeatingName = `spells-${head}` fieldName = newField; } else { repeatingName = `spells${head}` fieldName = `${oldField}${head}` } console.timeLog('Summing time'); TAS.repeating(repeatingName) .fields(fieldName) .each(function (r) { acc += (r.I[fieldName]); console.log(`Recursion ${repeatingName} updated sum to ${acc}`); }) .execute(() => recursiveSpellSum(tail, acc, oldField, newField, resultFieldName)); // Fat arrow function to lazy load value. } function setupRepeatingSpellSumming(sections, oldField, newField, resultFieldName) { sections.forEach(section => { let repeatingName; let fieldName; if (isNewSpellSection(section)) { repeatingName = `spells-${section}` fieldName = newField; } else { repeatingName = `spells${section}` fieldName = `${oldField}${section}` } let onChange = `change:repeating_${repeatingName}:${fieldName} remove:repeating_${repeatingName}`; on(onChange, function (eventInfo) { if (doEarlyReturn(eventInfo, [fieldName])) return; console.log(`Summing started by section ${repeatingName}. Fieldname ${fieldName}`); console.time('Summing time'); let levelsCopy = [...sections]; let accumulator = 0; recursiveSpellSum(levelsCopy, accumulator, oldField, newField, resultFieldName); }); }); } function setupCalculateRemaining(totalField, sumField, remainingField) { on(`change:${totalField} change:${sumField}`, function () { getAttrs([totalField, sumField], function (values) { let intTotal = parseInt(values[totalField]); let intSum = parseInt(values[sumField]); console.log(`Setting ${remainingField} with value from ${totalField}: ${intTotal} and ${sumField}: ${intSum}`); setAttrs({ [remainingField]: intTotal - intSum }); }); }); } //#endregion //#region Priest Spells based on Spheres const ELEMENTAL = 'Elemental'; const PRIEST_SPHERES = [ // Player's Handbook 'All','Animal','Astral','Charm','Combat','Creation','Divination',ELEMENTAL,'Guardian','Healing', 'Necromantic','Plant','Protection','Summoning','Sun','Weather', // Tome of Magic Spheres 'Chaos','Law','Numbers','Thought','Time','Travelers','War','Wards' ]; const primarySphereRegex = new RegExp(PRIEST_SPHERES.join('|'), 'gi'); const noElementalRegex = new RegExp(PRIEST_SPHERES.filter(s => s !== ELEMENTAL).join('|'), 'gi'); const elementalRegex = /Earth|Air|Fire|Water/gi function parseSpheres(spheresStrings, regex) { let spheres = new Set(); spheresStrings.map(s => s.match(regex)) .flat() .filter(Boolean) .map(s => capitalizeFirst(s)) .forEach(s => spheres.add(s)); return spheres; } const getSpellSpheres = function (spell, sphereRules) { let sphere = spell['sphere']; sphereRules.forEach(rule => sphere += spell[rule] || ''); return sphere; } function isSpellAvailable(spellName, spell, availableSpheres, elementalSpheres, activeBooks, optionalSpheres) { if (!activeBooks.includes(spell['book'])) return false; let spheres = getSpellSpheres(spell, optionalSpheres); let primarySpellSpheres = spheres.match(noElementalRegex) || []; let isAvailable = primarySpellSpheres.some(sphere => availableSpheres.has(sphere)); if (isAvailable) return true; if (!availableSpheres.has(ELEMENTAL)) return false; if (!spheres.includes(ELEMENTAL)) return false; if (spheres.includes(`${ELEMENTAL} (`)) return spheres.match(elementalRegex).some((element) => elementalSpheres.has(element)) // The player and the spell has the elemental sphere (without any sub elements) // Currently only 'Commune With Nature' in the revised Player's Handbook (1995) has this property return true; } function setupAddPriestSpell(postfix) { if (!priestSpells[postfix]) return; on(`clicked:add-spells-${postfix}`, function () { const section = `spells-${postfix}`; const field = 'spell-name'; let sphereFields = ['sphere-major']; if (postfix.match(/[123]/)) sphereFields.push("sphere-minor"); TAS.repeating(section) .attrs([...sphereFields, ...BOOK_FIELDS, ...SPHERE_FIELDS]) .fields(field) .reduce(function(knownSpells, row){ knownSpells.add(row.S[field]); return knownSpells; }, new Set(), function (knownSpells,_,attrSet){ let primarySpheres = parseSpheres(sphereFields.map(aField => attrSet.S[aField]), primarySphereRegex); let elementalSpheres = parseSpheres(sphereFields.map(aField => attrSet.S[aField]), elementalRegex); if (primarySpheres.size < 1) { showToast(WARNING, 'No spheres found', `No valid spheres found. Please write or select some spheres`); return; } let activeBooks = getActiveSettings(BOOK_FIELDS, attrSet); let optionalSpheres = getActiveSettings(SPHERE_FIELDS, attrSet); let spellsToAdd = []; for (const [spellName, spell] of Object.entries(priestSpells[postfix])) { let isAvailable = isSpellAvailable(spellName, spell, primarySpheres, elementalSpheres, activeBooks, optionalSpheres); if (isAvailable) { spellsToAdd.push({name: spellName, book: spell['book']}); } } console.log(spellsToAdd); if (spellsToAdd.length < 1) { showToast(ERROR, 'No spells found', `No spells found for the selected spheres`); return; } spellsToAdd = spellsToAdd.filter(spell => !knownSpells.has(spell.name)); console.log(spellsToAdd); if (spellsToAdd.length < 1) { showToast(INFO, 'All spells added', `Found no more spells to add based on spheres`); return; } let books = [...new Set(spellsToAdd.map(s => `\n • ${s.book}`))].join(''); let toastObject = getToastObject(SUCCESS, 'Added new spells!', `Spells was added from the following books:${books}`); let newValue = {...toastObject}; spellsToAdd.forEach(spell => { let newrowid = generateRowID(); newValue[`repeating_${section}_${newrowid}_${field}`] = spell.name; }); setAttrs(newValue); }) .execute(); }); } //#endregion //#region Wizard and Priest reset buttons function resetCastSlots(row, castField, memField) { row.I[castField] = 0; } function resetCastAndMemSlots(row, castField, memField) { row.I[castField] = 0; row.I[memField] = 0; } function resetSpentSlots(row, castField, memField) { row.I[memField] = row.I[memField] - row.I[castField]; row.I[castField] = 0; } function setupSpellSlotsReset(buttonName, tab, spellLevels, allSections) { let isPowers = !spellLevels || !tab; let attributes = ['spell-slot-reset-sections', 'spell-slot-reset-function'] if (!isPowers) attributes.push(tab); on(`clicked:${buttonName}`, function () { getAttrs(attributes, function (values) { let resetSection = values['spell-slot-reset-sections']; let resetFunction = values['spell-slot-reset-function']; let sections = []; if (resetSection === 'all' || isPowers) sections = allSections; else if (resetSection === 'level') { let level = values[tab]; if (!level) return; let spellLevel = spellLevels.spellLevel(sl => sl.level === level); if (!spellLevel) return; sections = spellLevel.sections || []; } if (!sections.length) return let updateFunction; if (resetFunction === '1' || isPowers) updateFunction = resetCastSlots; else if (resetFunction === '2') updateFunction = resetCastAndMemSlots; else if (resetFunction === '3') updateFunction = resetSpentSlots; if (!updateFunction) return; sections.forEach(section => { let repSection; let castField; let memField; if (isNewSpellSection(section)) { repSection = `spells-${section}`; castField = 'spell-cast-value'; memField = 'spell-memorized'; } else { repSection = `spells${section}`; castField = `cast-value${section}`; memField = `cast-max${section}`; } TAS.repeating(repSection) .fields(castField, memField) .each(function(row) { updateFunction(row, castField, memField); }) .execute(); }); }); }); } //#endregion //#region Wizard and Priest spells and Powers setup function setupAutoFillSpellInfo(section, spellsTable, levelFunc, optionalRulesFields) { if (!spellsTable[section]) return; on(`change:repeating_spells-${section}:spell-name`, function (eventInfo) { let spell = spellsTable[section][eventInfo.newValue]; if (!spell) return; getAttrs([...BOOK_FIELDS, ...optionalRulesFields], function(books) { if (bookInactiveShowToast(books, spell)) return; let spellInfo = { [`repeating_spells-${section}_spell-cast-time`] : spell['cast-time'], [`repeating_spells-${section}_spell-level`] : levelFunc(spell['level']), [`repeating_spells-${section}_spell-school`] : spell['school'], [`repeating_spells-${section}_spell-components`] : spell['components'], [`repeating_spells-${section}_spell-range`] : spell['range'], [`repeating_spells-${section}_spell-aoe`] : spell['aoe'], [`repeating_spells-${section}_spell-duration`] : spell['duration'], [`repeating_spells-${section}_spell-damage`] : spell['damage'], [`repeating_spells-${section}_spell-damage-type`] : spell['damage-type'], [`repeating_spells-${section}_spell-saving-throw`] : spell['saving-throw'], [`repeating_spells-${section}_spell-healing`] : spell['healing'], [`repeating_spells-${section}_spell-materials`] : spell['materials'], [`repeating_spells-${section}_spell-reference`] : `${spell['reference']}, ${spell['book']}`, [`repeating_spells-${section}_spell-effect`] : spell['effect'] }; if (section.startsWith('pri')) { let sphereRules = getActiveSettings(SPHERE_FIELDS, books); spellInfo[`repeating_spells-${section}_spell-sphere`] = getSpellSpheres(spell, sphereRules); } setAttrs(spellInfo); }); }); } let wizardSpellLevelsSections = [ {level: '1', sections: ['', '2', '3', 'wiz1']}, {level: '2', sections: ['4', '5', '6', 'wiz2']}, {level: '3', sections: ['7', '8', '9', 'wiz3']}, {level: '4', sections: ['10', '11', '12', 'wiz4']}, {level: '5', sections: ['70', '71', '72', 'wiz5']}, //... legacy naming convention {level: '6', sections: ['13', '14', '15', 'wiz6']}, {level: '7', sections: ['16', '17', '18', 'wiz7']}, {level: '8', sections: ['19', '20', '21', 'wiz8']}, {level: '9', sections: ['22', '23', '24', 'wiz9']}, {level: '10', sections: ['25', '26', '27', 'wiz10']}, {level: '11', sections: ['52', '53', '54', 'wiz11']}, //... legacy naming convention {level: '12', sections: ['55', '56', '57', 'wiz12']}, {level: '13', sections: ['58', '59', '60', 'wiz13']}, {level: '14', sections: ['61', '62', '63', 'wiz14']}, {level: '15', sections: ['64', '65', '66', 'wiz15']}, ]; let priestSpellLevelsSections = [ {level: '1', sections: ['28', '29', '30', 'pri1']}, {level: '2', sections: ['31', '32', '33', 'pri2']}, {level: '3', sections: ['34', '35', '36', 'pri3']}, {level: '4', sections: ['37', '38', '39', 'pri4']}, {level: '5', sections: ['40', '41', '42', 'pri5']}, {level: '6', sections: ['43', '44', '45', 'pri6']}, {level: '7', sections: ['46', '47', '48', 'pri7']}, {level: 'q', sections: ['49', '50', '51', 'priq']}, ]; function wizardDisplayLevel(s) { return `Level ${s} Wizard`; } function priestDisplayLevel(s) { return s === 'q' ? 'Quest Spell Priest' : `Level ${s} Priest`; } // --- Start setup Spell Slots --- // wizardSpellLevelsSections.forEach(spellLevel => { let prefix = `spell-level${spellLevel.level}`; setupCalculateTotal(`${prefix}-total`, [`${prefix}-castable`, `${prefix}-specialist`, `${prefix}-misc`]); setupRepeatingSpellSumming(spellLevel.sections, 'cast-value', 'spell-cast-value', `${prefix}-cast-value-sum`); setupRepeatingSpellSumming(spellLevel.sections, 'cast-max', 'spell-memorized', `${prefix}-cast-max-sum`); setupCalculateRemaining(`${prefix}-total`, `${prefix}-cast-max-sum`, `${prefix}-selected`); setupCalculateRemaining(`${prefix}-total`, `${prefix}-cast-value-sum`, `${prefix}-remaining`); // Auto set spell info function let lastSection = spellLevel.sections[spellLevel.sections.length - 1]; if (isNewSpellSection(lastSection)) { setupAutoFillSpellInfo(lastSection, wizardSpells, wizardDisplayLevel, []); } }); setupAutoFillSpellInfo("wizmonster", wizardSpells, wizardDisplayLevel, []); priestSpellLevelsSections.forEach(spellLevel => { let prefix = `spell-priest-level${spellLevel.level}`; setupCalculateTotal(`${prefix}-total`, [`${prefix}-castable`, `${prefix}-wisdom`, `${prefix}-misc`]); setupRepeatingSpellSumming(spellLevel.sections, 'cast-value', 'spell-cast-value', `${prefix}-cast-value-sum`); setupRepeatingSpellSumming(spellLevel.sections, 'cast-max', 'spell-memorized', `${prefix}-cast-max-sum`); setupCalculateRemaining(`${prefix}-total`, `${prefix}-cast-max-sum`, `${prefix}-selected`); setupCalculateRemaining(`${prefix}-total`, `${prefix}-cast-value-sum`, `${prefix}-remaining`); // Auto set spell info function let lastSection = spellLevel.sections[spellLevel.sections.length - 1]; if (isNewSpellSection(lastSection)) { setupAutoFillSpellInfo(lastSection, priestSpells, priestDisplayLevel, SPHERE_FIELDS); } }); setupAutoFillSpellInfo("primonster", priestSpells, priestDisplayLevel, SPHERE_FIELDS); // --- End setup Spell Slots --- // // --- Start setup Spell Points, Arc, and Wind --- // let wizardSpellPoints = 'spell-points'; let arc = 'total-arc'; let allWizardSpellSections = wizardSpellLevelsSections.flatMap(sl => sl.sections); setupCalculateTotal(`${wizardSpellPoints}-total`, [`${wizardSpellPoints}-lvl`, `${wizardSpellPoints}-spc`, `${wizardSpellPoints}-int`]); setupRepeatingSpellSumming(allWizardSpellSections, wizardSpellPoints, 'spell-points', `${wizardSpellPoints}-sum`, true); setupRepeatingSpellSumming(allWizardSpellSections, 'arc', 'spell-arc', `${arc}-sum`, true); setupCalculateRemaining(`${wizardSpellPoints}-total`, `${wizardSpellPoints}-sum`, `${wizardSpellPoints}-remaining`); setupCalculateRemaining(arc, `${arc}-sum`, `${arc}-remaining`); let priestSpellPoints = 'spell-points-priest'; let wind = 'total-wind'; let allPriestSpellSections = priestSpellLevelsSections.flatMap(sl => sl.sections); setupCalculateTotal(`${priestSpellPoints}-total`, [`${priestSpellPoints}-lvl`, `${priestSpellPoints}-wis`]); setupRepeatingSpellSumming(allPriestSpellSections, priestSpellPoints, 'spell-points', `${priestSpellPoints}-sum`, true); setupRepeatingSpellSumming(allPriestSpellSections, 'wind', 'spell-wind', `${wind}-sum`, true); setupCalculateRemaining(`${priestSpellPoints}-total`, `${priestSpellPoints}-sum`, `${priestSpellPoints}-remaining`); setupCalculateRemaining(wind, `${wind}-sum`, `${wind}-remaining`); // --- End setup Spell Points, Arc, and Wind --- // // --- Start setup reset buttons --- // //tab6 = wizard levels //tab7 = priest levels setupSpellSlotsReset('reset-spent-slots-wiz', 'tab6', wizardSpellLevelsSections, allWizardSpellSections); let allPriestSectionsExceptQuest = priestSpellLevelsSections.slice(0, -1).flatMap(sl => sl.sections); setupSpellSlotsReset('reset-spent-slots-pri', 'tab7', priestSpellLevelsSections, allPriestSectionsExceptQuest); // --- End setup reset buttons --- // // --- Start setup Granted Powers --- // let powerSpellSections = ['67', '68', '69']; let spellPower = 'spell-power'; setupRepeatingSpellSumming(powerSpellSections, 'cast-value', '', `${spellPower}-sum`); setupRepeatingSpellSumming(powerSpellSections, 'cast-max', '', `${spellPower}-available`); setupCalculateRemaining(`${spellPower}-available`, `${spellPower}-sum`, `${spellPower}-remaining`); setupSpellSlotsReset('reset-spent-slots-pow', null, null, powerSpellSections) // --- End setup Granted Powers --- // //#endregion //#region Rogue skills // --- Start setup Rogue skills total --- // let rogueStandardSkills = ['pp', 'ol', 'rt', 'ms', 'hs', 'dn', 'cw', 'rl', 'ib']; let rogueStandardColumns = ['b', 'r', 'd', 'k', 'm', 'l']; rogueStandardSkills.forEach(skill => { setupCalculateTotal(`${skill}t-hidden`, rogueStandardColumns.map(column => `${skill}${column}`)); setupCalculateTotal(`${skill}t`, [`${skill}t-hidden`], 95); setupCalculateTotal(`${skill}noarmort`, [`${skill}t-hidden`, `${skill}noarmorb`], 95); setupCalculateTotal(`${skill}armort`, [`${skill}t-hidden`, `${skill}armorp`], 95); }); // Setup custom rogue skills total setupRepeatingRowCalculateTotal('crt-hidden', rogueStandardColumns.map(column => `cr${column}`), 'customrogue'); setupRepeatingRowCalculateTotal('crt', ['crt-hidden'], 'customrogue', 95); setupRepeatingRowCalculateTotal('crnoarmort', ['crt-hidden', 'crnoarmorb'], 'customrogue', 95); setupRepeatingRowCalculateTotal('crarmort', ['crt-hidden', 'crarmorp'], 'customrogue', 95); // --- End setup Rogue skills total --- // //Rogue armor modifier auto fill on('change:armorname', function(eventInfo) { let armor = rogueArmor[eventInfo.newValue]; if (armor === undefined) return; let armorModifiers = { 'pparmorp': armor['Pick Pockets'], 'olarmorp': armor['Open Locks'] || '-0', 'rtarmorp': armor['Find/Remove Traps'] || '-0', 'msarmorp': armor['Move Silently'] || '-0', 'hsarmorp': armor['Hide in Shadows'] || '-0', 'dnarmorp': armor['Detect Noise'], 'cwarmorp': armor['Climb Walls'], }; setAttrs(armorModifiers); }); //Rogue Custom Skills level sum on('change:repeating_customrogue:crl remove:repeating_customrogue', function(){ TAS.repeating('customrogue') .attrs('newskill') .fields('crl') .reduce(function(m,r){ m.crl+=(r.I.crl); return m; },{crl:0},function(m,r,a){ a.newskill=m.crl; }) .execute(); }); // --- End setup Rogue skills total --- // //#endregion //#region Weapons tab logic and autofil //Used in version.js const updateNonprofPenalty = function () { getAttrs(['nonprof-penalty'], function(values) { let nonprof = Math.abs(parseInt(values['nonprof-penalty'])) * -1; let famil = Math.floor(nonprof / 2) setAttrs({ ['nonprof-penalty']: nonprof, ['famil-penalty']: famil },{silent:true}); }); } on('change:nonprof-penalty', function (eventInfo){ updateNonprofPenalty(); }); //Used in version.js const updateThac0 = (silent) => calculateFormula('thac0-base', 'thac0-base-calc', silent); on('change:thac0-base', function(eventInfo) { updateThac0(false); }); on('change:thac0-base-calc', function(eventInfo) { TAS.repeating('weapons') .fields('ThAC0') .each(function (row) { if (`${row['ThAC0']}` === `${eventInfo.previousValue}`) row['ThAC0'] = eventInfo.newValue; }) .execute(); TAS.repeating('weapons2') .fields('ThAC02') .each(function (row) { if (`${row['ThAC02']}` === `${eventInfo.previousValue}`) row['ThAC02'] = eventInfo.newValue; }) .execute(); }); //#region Weapons autofill function setWeaponWithBonus(weaponName, setWeaponFunc, thac0Field, isMonster) { if (!weaponName) return; weaponName = weaponName.toLowerCase(); let fields = [...BOOK_FIELDS, thac0Field].filter(x => x !== undefined); getAttrs(fields, function(values) { let thac0 = parseInt(values[thac0Field]); thac0 = isNaN(thac0) ? 20 : thac0; let baseWeapon = weapons[weaponName] if (baseWeapon) { if (bookInactiveShowToast(values, baseWeapon)) return; setWeaponFunc({ ...baseWeapon, 'thac0' : thac0, 'bonus' : '0' }); return; } let match = weaponName.match(/\s*\+([0-9]+)\s*/); if (!match) return; let baseWeaponName = weaponName.replace(match[0], ' ').trim(); baseWeapon = weapons[baseWeaponName]; if (!baseWeapon) return; if (bookInactiveShowToast(values, baseWeapon)) return; let bonusString = match[1]; let bonus = parseInt(bonusString) if (isNaN(bonus)) return; if (bonus < 1) { setWeaponFunc({ ...baseWeapon, 'thac0' : thac0, 'bonus' : '0' }); return; } let weaponWithBonus = { ...baseWeapon, 'thac0' : thac0, 'speed' : Math.max(baseWeapon['speed'] - bonus, 0), 'bonus' : `+${bonus}` } if (isMonster) { weaponWithBonus['small-medium'] += `+${bonus}`; weaponWithBonus['large'] += `+${bonus}`; weaponWithBonus['thac0'] = thac0 - bonus; } setWeaponFunc(weaponWithBonus); }); } //melee hit autofill on('change:repeating_weapons:weaponname', function(eventInfo) { let setWeaponFunc = function (weapon) { let weaponInfo = { 'repeating_weapons_attackadj' : weapon['bonus'], 'repeating_weapons_ThAC0' : weapon['thac0'], 'repeating_weapons_range' : 'Melee', 'repeating_weapons_size' : weapon['size'], 'repeating_weapons_weapspeed' : weapon['speed'], 'repeating_weapons_weaptype-slash' : weapon['type'].includes('S') ? 1 : 0, 'repeating_weapons_weaptype-pierce': weapon['type'].includes('P') ? 1 : 0, 'repeating_weapons_weaptype-blunt' : weapon['type'].includes('B') ? 1 : 0, }; setAttrs(weaponInfo); }; setWeaponWithBonus(eventInfo.newValue, setWeaponFunc, 'thac0-base-calc'); }); //melee damage autofill on('change:repeating_weapons-damage:weaponname1', function(eventInfo){ let setWeaponFunc = function (weapon) { let weaponInfo = { 'repeating_weapons-damage_damadj' : weapon['bonus'], 'repeating_weapons-damage_damsm' : weapon['small-medium'], 'repeating_weapons-damage_daml' : weapon['large'], 'repeating_weapons-damage_knockdown1' : weapon['knockdown'] || '' }; setAttrs(weaponInfo); }; setWeaponWithBonus(eventInfo.newValue, setWeaponFunc); }); //range hit autofill on('change:repeating_weapons2:weaponname2', function(eventInfo){ let setWeaponFunc = function (weapon) { let weaponInfo = { 'repeating_weapons2_strbonus2' : weapon['strength'] ? 1 : 0, 'repeating_weapons2_attacknum2' : weapon['rof'] || '', 'repeating_weapons2_attackadj2' : weapon['bonus'], 'repeating_weapons2_ThAC02' : weapon['thac0'], 'repeating_weapons2_range2' : weapon['range'] || '', 'repeating_weapons2_size2' : weapon['size'], 'repeating_weapons2_weapspeed2' : weapon['speed'], 'repeating_weapons2_weaptype-slash2' : weapon['type'].includes('S') ? 1 : 0, 'repeating_weapons2_weaptype-pierce2' : weapon['type'].includes('P') ? 1 : 0, 'repeating_weapons2_weaptype-blunt2' : weapon['type'].includes('B') ? 1 : 0, }; setAttrs(weaponInfo); }; setWeaponWithBonus(eventInfo.newValue, setWeaponFunc, 'thac0-base-calc'); }); //range damage autofill on('change:repeating_ammo:ammoname', function(eventInfo){ let setWeaponFunc = function (weapon) { let weaponInfo = { 'repeating_weapons2_strbonus3' : weapon['strength'] ? 1 : 0, 'repeating_ammo_damadj2' : weapon['bonus'], 'repeating_ammo_damsm2' : weapon['small-medium'], 'repeating_ammo_daml2' : weapon['large'], 'repeating_weapons-damage_knockdown2' : weapon['knockdown'] || '' }; setAttrs(weaponInfo); } setWeaponWithBonus(eventInfo.newValue, setWeaponFunc); }); //Follower weapons function setupFollowerWeaponsAutoFill(repeating, sections) { let prefix = ''; let onChange = ''; if (repeating !== '') { prefix = `repeating_${repeating}_` onChange = `repeating_${repeating}:` } sections.forEach(section => { on(`change:${onChange}weaponnamehench${section}`, function(eventInfo) { let setWeaponFunc = function (weapon) { let weaponInfo = { [`${prefix}attacknumhench${section}`]: weapon['rof'] || '1', [`${prefix}attackadjhench${section}`]: weapon['bonus'], [`${prefix}damadjhench${section}`]: weapon['bonus'], [`${prefix}damsmhench${section}`]: weapon['small-medium'], [`${prefix}damlhench${section}`]: weapon['large'], [`${prefix}rangehench${section}`]: weapon['range'] || 'Melee', [`${prefix}weaptypehench${section}`]: weapon['type'], [`${prefix}weapspeedhench${section}`]: weapon['speed'], }; setAttrs(weaponInfo); }; setWeaponWithBonus(eventInfo.newValue, setWeaponFunc); }); }); } const followerWeapons = [ {repeating: '', sections: ['', '001', '002']}, {repeating: 'hench', sections: ['003', '004', '005']}, {repeating: '', sections: ['006', '007', '008']}, {repeating: 'hench2', sections: ['009', '010', '011']}, {repeating: '', sections: ['012', '013', '014']}, {repeating: 'hench3', sections: ['015', '016', '017']}, {repeating: '', sections: ['018', '019', '020']}, {repeating: 'hench4', sections: ['021', '022', '023']}, {repeating: '', sections: ['024', '025', '026']}, {repeating: 'hench5', sections: ['027', '028', '029']}, {repeating: '', sections: ['030', '031', '032']}, {repeating: 'hench6', sections: ['033', '034', '035']}, ]; followerWeapons.forEach(fw => { setupFollowerWeaponsAutoFill(fw.repeating, fw.sections) }); // Monster weapons on('change:repeating_monsterweapons:weaponname', function(eventInfo){ let setWeaponFunc = function (weapon) { let weaponInfo = { [`repeating_monsterweapons_attacknum`] : weapon['rof'] || '1', [`repeating_monsterweapons_ThAC0`] : weapon['thac0'], [`repeating_monsterweapons_damsm`] : weapon['small-medium'], [`repeating_monsterweapons_daml`] : weapon['large'], [`repeating_monsterweapons_weapspeed`] : weapon['speed'], }; setAttrs(weaponInfo); }; setWeaponWithBonus(eventInfo.newValue, setWeaponFunc, 'monsterthac0', true); }); //#endregion on('clicked:grenade-miss', async function (eventInfo) { getAttrs(['character_name'], async function(values) { let characterName = values['character_name']; let finalRollText = '&{template:2Egrenademiss} '; let grenade = await extractQueryResult('?{What grenade have been thrown?|Acid|Holy water|Oil (lit)|Poison|Other}'); switch (grenade) { case 'Acid': finalRollText += `{{name=Acid}} {{aoe=[[1]]}} {{aoesplash=[[1+6]]}} {{hitdmg=[Damage](~${characterName}|acid-hit)}} {{splashdmg=[Damage](~${characterName}|acid-splash)}}`; break; case 'Holy water': finalRollText += `{{name=Holy water}} {{aoe=[[1]]}} {{aoesplash=[[1+6]]}} {{hitdmg=[Damage](~${characterName}|holy-water-hit)}} {{splashdmg=[Damage](~${characterName}|holy-water-splash)}}`; break; case 'Oil (lit)': finalRollText += `{{name=Oil (lit)}} {{aoe=[[3]]}} {{aoesplash=[[3+6]]}} {{hitdmg=[Round 1](~${characterName}|oil-lit-hit1) [Round 2](~${characterName}|oil-lit-hit2)}} {{splashdmg=[Damage](~${characterName}|oil-lit-splash)}}`; break; case 'Poison': finalRollText += `{{name=Poison}} {{aoe=[[1]]}} {{aoesplash=[[1+6]]}} {{hitdmg=Special}} {{splashdmg=Special}}`; break; case 'Other': { let name = await extractQueryResult('?{Grenade name}'); let aoe = await extractQueryResult('?{Area of effect (Diameter in feet)|1}'); let damage = await extractQueryResult('?{Direct damage|1d6}'); let splash = await extractQueryResult('?{Splash damage|1d3}'); var customGrenade = {} customGrenade['custom-grenade-name'] = name; customGrenade['custom-grenade-hit'] = damage; customGrenade['custom-grenade-splash'] = splash; setAttrs(customGrenade); finalRollText += `{{name=${name}}} {{aoe=[[${aoe}]]}} {{aoesplash=[[${aoe}+6]]}} {{hitdmg=[Damage](~${characterName}|custom-grenade-hit)}} {{splashdmg=[Damage](~${characterName}|custom-grenade-splash)}}`; } } let distanceName = await extractQueryResult('?{How far was it thrown?|Short|Medium|Long}'); finalRollText += `{{direction=[[1d10]]}} {{distancename=${distanceName}}} `; switch (distanceName) { case 'Short': finalRollText += '{{distance=[[1d6]]}} '; break; case 'Medium': finalRollText += '{{distance=[[1d10]]}} '; break; case 'Long': finalRollText += '{{distance=[[2d10]]}} '; break; } finalRollText += '{{hit=[[0]]}} {{splash=[[0]]}} '; console.log(finalRollText); startRoll(finalRollText, function (roll) { console.log(roll); let computedRolls = { hit: 0, splash: 0 }; // See if monster is within direct hit if (roll.results.distance.result <= roll.results.aoe.result / 2) { computedRolls.hit = 1; } else if (roll.results.distance.result <= roll.results.aoesplash.result / 2) { computedRolls.splash = 1; } console.log(computedRolls); finishRoll(roll.rollId, computedRolls); }); }); }); //#endregion //#region Proficiencies //Weapon proficiency slots //Used in version.js const updateWeaponProfsTotal = () => calculateFormula('weapprof-slots-total', 'weapprof-slots-total-calc'); on('change:weapprof-slots-total', function (eventInfo) { updateWeaponProfsTotal(); }); const updateWeaponProfsRemaining = () => repeatingCalculateRemaining('weaponprofs', ['weapprofnum'], 'weapprof-slots-total-calc', 'weapprof-slots-remain'); on('change:repeating_weaponprofs:weapprofnum remove:repeating_weaponprofs change:weapprof-slots-total-calc', function(eventInfo) { if (doEarlyReturn(eventInfo, ['weapprofnum'])) return; updateWeaponProfsRemaining(); }); //Weapon proficiency autofill on('change:repeating_weaponprofs:weapprofname', function(eventInfo) { let weaponProficiency = weaponProficiencies[eventInfo.newValue]; if (!weaponProficiency) return; getAttrs(BOOK_FIELDS, function (books) { if (bookInactiveShowToast(books, weaponProficiency)) return; setAttrs({ 'repeating_weaponprofs_weapprofnum' : weaponProficiency['slots'], }); }); }); //Nonweapon proficiency slots //Used in version.js const updateNonWeaponProfsTotal = () => calculateFormula('prof-slots-total', 'prof-slots-total-calc'); on('change:prof-slots-total', function (eventInfo) { updateNonWeaponProfsTotal(); }); const updateNonWeaponProfsRemaining = () => repeatingCalculateRemaining('profs', ['profslots'], 'prof-slots-total-calc', 'prof-slots-remain'); on('change:repeating_profs:profslots remove:repeating_profs change:prof-slots-total-calc', function(eventInfo){ if (doEarlyReturn(eventInfo, ['profslots'])) return; updateNonWeaponProfsRemaining(); }); //Nonweapon proficiency autofill on('change:repeating_profs:profname', function (eventInfo) { let nonweaponProficiency = nonweaponProficiencies[eventInfo.newValue]; if (!nonweaponProficiency) return; getAttrs(BOOK_FIELDS, function (books) { if (bookInactiveShowToast(books, nonweaponProficiency)) return; setAttrs({ 'repeating_profs_profslots' : nonweaponProficiency['slots'], 'repeating_profs_profstatnum': nonweaponProficiency['abilityScore'], 'repeating_profs_profmod' : nonweaponProficiency['modifier'], }); }); }); //#endregion //#region Equipment //Equipment Carried Section on('change:repeating_gear:gearweight change:repeating_gear:gearqty remove:repeating_gear', function(eventInfo){ if (doEarlyReturn(eventInfo, ['gearweight', 'gearqty'])) return; repeatingMultiplySum('gear', 'gearweight', 'gearqty', 'gearweighttotal', 2); }); //Equipment Stored Section on('change:repeating_gear-stored:gear-stored-weight change:repeating_gear-stored:gear-stored-qty change:repeating_gear-stored:on-mount remove:repeating_gear-stored', function(eventInfo){ if (doEarlyReturn(eventInfo, ['gear-stored-weight', 'gear-stored-qty'])) return; TAS.repeating('gear-stored') .attrs('mount-gear-weight-total','stored-gear-weight-total') .fields('on-mount','gear-stored-weight','gear-stored-qty') .reduce(function(m,r){ m.allgearweight+=(r.F['gear-stored-weight'] * r.I['gear-stored-qty']); m.mountgearweight+=(r.F['gear-stored-weight'] * r.I['gear-stored-qty'] * r.I['on-mount']); return m; },{allgearweight:0,mountgearweight:0, desc: []},function(m,r,a){ a.D[2]['mount-gear-weight-total']=m.mountgearweight; a.D[2]['stored-gear-weight-total']=(m.allgearweight-m.mountgearweight); }) .execute(); }) //#endregion on(`change:repeating_gem:gemvalue change:repeating_gem:gemqty remove:repeating_gem`, function(eventInfo) { if (doEarlyReturn(eventInfo, ['gemvalue', 'gemqty'])) return; repeatingMultiplySum('gem', 'gemvalue', 'gemqty', 'gemstotalvalue'); }) // Psionic tabs, control hidden or visible options const setPsionicDisciplineVisibility = function(newValue) { let elements = $20('.sheet-section-psionics .sheet-hidden'); if (newValue === "1") { elements.addClass('sheet-show'); } else { elements.removeClass('sheet-show'); } } on('change:tab8', function (eventInfo) { setPsionicDisciplineVisibility(eventInfo.newValue); }); on('sheet:opened', function () { getAttrs(['tab8'], function (values) { setPsionicDisciplineVisibility(values['tab8']); }) }); // Fix for Roll20 not handling quotes correctly from sheet.json const fixQuotes = function (currentValue, attribute, event) { if (currentValue.includes('’')) { let newValue = {}; newValue[attribute] = currentValue.replaceAll('’', '\''); console.log(`${attribute} was updated via ${event}`); setAttrs(newValue,{silent:true}); } } on(BOOK_FIELDS.map(b => `change:${b}`).join(' '), function (eventInfo) { if (eventInfo.newValue) { fixQuotes(eventInfo.newValue, eventInfo.sourceAttribute, "eventInfo.newValue"); } else { getAttrs([eventInfo.sourceAttribute], function (values) { fixQuotes(values[eventInfo.sourceAttribute], eventInfo.sourceAttribute, "getAttrs"); }); } }); // --- ALL SHEET WORKERS END --- //
admin/client/components/ItemsTable/ItemsTableDragDrop.js
suryagh/keystone
import React from 'react'; import { DragDropContext } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; import { Sortable } from './ItemsTableRow'; import DropZone from './ItemsTableDragDropZone'; var ItemsTableDragDrop = React.createClass({ displayName: 'ItemsTableDragDrop', propTypes: { columns: React.PropTypes.array, id: React.PropTypes.any, index: React.PropTypes.number, items: React.PropTypes.object, list: React.PropTypes.object, }, render () { return ( <tbody > {this.props.items.results.map((item, i) => { return ( <Sortable key={item.id} index={i} sortOrder={item.sortOrder || 0} id={item.id} item={item} { ...this.props } /> ); })} <DropZone { ...this.props } /> </tbody> ); }, }); module.exports = DragDropContext(HTML5Backend)(ItemsTableDragDrop);
src/svg-icons/editor/format-color-fill.js
ruifortes/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorFormatColorFill = (props) => ( <SvgIcon {...props}> <path d="M16.56 8.94L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10L10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z"/><path fillOpacity=".36" d="M0 20h24v4H0z"/> </SvgIcon> ); EditorFormatColorFill = pure(EditorFormatColorFill); EditorFormatColorFill.displayName = 'EditorFormatColorFill'; EditorFormatColorFill.muiName = 'SvgIcon'; export default EditorFormatColorFill;
src/index.js
wpcfan/hello-react
import React from 'react'; import { render } from 'react-dom'; import Root from './components/Root'; import configureStore from './store/configureStore'; const store = configureStore(); render( <Root store={store} />, document.getElementById('root') );
src/components/CardCity/index.js
Cirych/WeatherApp
import React from 'react'; import { Card, CardHeader } from 'material-ui/Card'; import WeatherAvatar from '../WeatherAvatar'; const styles = { cardStyle: { backgroundColor: 'rgba(0, 0, 0, 0.5)' }, cardHeaderStyle: { titleStyle: { color: 'white' }, subTitleStyle: { color: 'silver' } } }; export const CardCity = ({ id, name, main: {temp} = 0, weather = [{"icon": "01d"}], selectLocation, style: { cardStyle, cardHeaderStyle: { titleStyle, subTitleStyle } } = styles }) => <Card style={cardStyle} onClick={()=>selectLocation(id)} > <CardHeader title={name} subtitle="18:00" titleStyle={titleStyle} subtitleStyle={subTitleStyle} avatar={ <WeatherAvatar temp={temp} iconCode={weather[0].icon} /> } > </CardHeader> </Card> export default CardCity;
.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ReportSystem/resources/js/components/user/span-item.js
LittleLazyCat/TXEY
import React from 'react' export default class SpanItem extends React.Component{ render() { return ( <span>{this.props.value}</span> ); } }
ajax/libs/muicss/0.9.28/extra/mui-react-combined.js
ahocevar/cdnjs
(function (global) { var babelHelpers = global.babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); babelHelpers.extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { default: obj }; }; babelHelpers.interopRequireWildcard = function (obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }; babelHelpers.objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; })(typeof global === "undefined" ? self : global);(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; process.nextTick = (function () { var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener ; if (canSetImmediate) { return function (f) { return window.setImmediate(f) }; } if (canPost) { var queue = []; window.addEventListener('message', function (ev) { var source = ev.source; if ((source === window || source === null) && ev.data === 'process-tick') { ev.stopPropagation(); if (queue.length > 0) { var fn = queue.shift(); fn(); } } }, true); return function nextTick(fn) { queue.push(fn); window.postMessage('process-tick', '*'); }; } return function nextTick(fn) { setTimeout(fn, 0); }; })(); process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); } // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; },{}],2:[function(require,module,exports){ 'use strict'; /** * MUI React main module * @module react/main */ (function (win) { // return if library has been loaded already if (win._muiReactLoaded) return;else win._muiReactLoaded = true; var mui = win.mui = win.mui || [], react = mui.react = {}, lib; react.Appbar = require('src/react/appbar'); react.Button = require('src/react/button'); react.Caret = require('src/react/caret'); react.Checkbox = require('src/react/checkbox'); react.Col = require('src/react/col'); react.Container = require('src/react/container'); react.Divider = require('src/react/divider'); react.Dropdown = require('src/react/dropdown'), react.DropdownItem = require('src/react/dropdown-item'), react.Form = require('src/react/form'); react.Input = require('src/react/input'); react.Option = require('src/react/option'); react.Panel = require('src/react/panel'); react.Radio = require('src/react/radio'); react.Row = require('src/react/row'); react.Select = require('src/react/select'); react.Tab = require('src/react/tab'); react.Tabs = require('src/react/tabs'); react.Textarea = require('src/react/textarea'); })(window); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNkbi1yZWFjdC5qcyJdLCJuYW1lcyI6WyJ3aW4iLCJfbXVpUmVhY3RMb2FkZWQiLCJtdWkiLCJyZWFjdCIsImxpYiIsIkFwcGJhciIsInJlcXVpcmUiLCJCdXR0b24iLCJDYXJldCIsIkNoZWNrYm94IiwiQ29sIiwiQ29udGFpbmVyIiwiRGl2aWRlciIsIkRyb3Bkb3duIiwiRHJvcGRvd25JdGVtIiwiRm9ybSIsIklucHV0IiwiT3B0aW9uIiwiUGFuZWwiLCJSYWRpbyIsIlJvdyIsIlNlbGVjdCIsIlRhYiIsIlRhYnMiLCJUZXh0YXJlYSIsIndpbmRvdyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7QUFLQSxDQUFDLFVBQVNBLEdBQVQsRUFBYztBQUNiO0FBQ0EsTUFBSUEsSUFBSUMsZUFBUixFQUF5QixPQUF6QixLQUNLRCxJQUFJQyxlQUFKLEdBQXNCLElBQXRCOztBQUVMLE1BQUlDLE1BQU1GLElBQUlFLEdBQUosR0FBVUYsSUFBSUUsR0FBSixJQUFXLEVBQS9CO0FBQUEsTUFDSUMsUUFBUUQsSUFBSUMsS0FBSixHQUFZLEVBRHhCO0FBQUEsTUFFSUMsR0FGSjs7QUFJQUQsUUFBTUUsTUFBTixHQUFlQyxRQUFRLGtCQUFSLENBQWY7QUFDQUgsUUFBTUksTUFBTixHQUFlRCxRQUFRLGtCQUFSLENBQWY7QUFDQUgsUUFBTUssS0FBTixHQUFjRixRQUFRLGlCQUFSLENBQWQ7QUFDQUgsUUFBTU0sUUFBTixHQUFpQkgsUUFBUSxvQkFBUixDQUFqQjtBQUNBSCxRQUFNTyxHQUFOLEdBQVlKLFFBQVEsZUFBUixDQUFaO0FBQ0FILFFBQU1RLFNBQU4sR0FBa0JMLFFBQVEscUJBQVIsQ0FBbEI7QUFDQUgsUUFBTVMsT0FBTixHQUFnQk4sUUFBUSxtQkFBUixDQUFoQjtBQUNBSCxRQUFNVSxRQUFOLEdBQWlCUCxRQUFRLG9CQUFSLENBQWpCLEVBQ0FILE1BQU1XLFlBQU4sR0FBcUJSLFFBQVEseUJBQVIsQ0FEckIsRUFFQUgsTUFBTVksSUFBTixHQUFhVCxRQUFRLGdCQUFSLENBRmI7QUFHQUgsUUFBTWEsS0FBTixHQUFjVixRQUFRLGlCQUFSLENBQWQ7QUFDQUgsUUFBTWMsTUFBTixHQUFlWCxRQUFRLGtCQUFSLENBQWY7QUFDQUgsUUFBTWUsS0FBTixHQUFjWixRQUFRLGlCQUFSLENBQWQ7QUFDQUgsUUFBTWdCLEtBQU4sR0FBY2IsUUFBUSxpQkFBUixDQUFkO0FBQ0FILFFBQU1pQixHQUFOLEdBQVlkLFFBQVEsZUFBUixDQUFaO0FBQ0FILFFBQU1rQixNQUFOLEdBQWVmLFFBQVEsa0JBQVIsQ0FBZjtBQUNBSCxRQUFNbUIsR0FBTixHQUFZaEIsUUFBUSxlQUFSLENBQVo7QUFDQUgsUUFBTW9CLElBQU4sR0FBYWpCLFFBQVEsZ0JBQVIsQ0FBYjtBQUNBSCxRQUFNcUIsUUFBTixHQUFpQmxCLFFBQVEsb0JBQVIsQ0FBakI7QUFDRCxDQTVCRCxFQTRCR21CLE1BNUJIIiwiZmlsZSI6ImNkbi1yZWFjdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IG1haW4gbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L21haW5cbiAqL1xuXG4oZnVuY3Rpb24od2luKSB7XG4gIC8vIHJldHVybiBpZiBsaWJyYXJ5IGhhcyBiZWVuIGxvYWRlZCBhbHJlYWR5XG4gIGlmICh3aW4uX211aVJlYWN0TG9hZGVkKSByZXR1cm47XG4gIGVsc2Ugd2luLl9tdWlSZWFjdExvYWRlZCA9IHRydWU7XG4gIFxuICB2YXIgbXVpID0gd2luLm11aSA9IHdpbi5tdWkgfHwgW10sXG4gICAgICByZWFjdCA9IG11aS5yZWFjdCA9IHt9LFxuICAgICAgbGliO1xuXG4gIHJlYWN0LkFwcGJhciA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9hcHBiYXInKTtcbiAgcmVhY3QuQnV0dG9uID0gcmVxdWlyZSgnc3JjL3JlYWN0L2J1dHRvbicpO1xuICByZWFjdC5DYXJldCA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9jYXJldCcpO1xuICByZWFjdC5DaGVja2JveCA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9jaGVja2JveCcpO1xuICByZWFjdC5Db2wgPSByZXF1aXJlKCdzcmMvcmVhY3QvY29sJyk7XG4gIHJlYWN0LkNvbnRhaW5lciA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9jb250YWluZXInKTtcbiAgcmVhY3QuRGl2aWRlciA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9kaXZpZGVyJyk7XG4gIHJlYWN0LkRyb3Bkb3duID0gcmVxdWlyZSgnc3JjL3JlYWN0L2Ryb3Bkb3duJyksXG4gIHJlYWN0LkRyb3Bkb3duSXRlbSA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9kcm9wZG93bi1pdGVtJyksXG4gIHJlYWN0LkZvcm0gPSByZXF1aXJlKCdzcmMvcmVhY3QvZm9ybScpO1xuICByZWFjdC5JbnB1dCA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9pbnB1dCcpO1xuICByZWFjdC5PcHRpb24gPSByZXF1aXJlKCdzcmMvcmVhY3Qvb3B0aW9uJyk7XG4gIHJlYWN0LlBhbmVsID0gcmVxdWlyZSgnc3JjL3JlYWN0L3BhbmVsJyk7XG4gIHJlYWN0LlJhZGlvID0gcmVxdWlyZSgnc3JjL3JlYWN0L3JhZGlvJyk7XG4gIHJlYWN0LlJvdyA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9yb3cnKTtcbiAgcmVhY3QuU2VsZWN0ID0gcmVxdWlyZSgnc3JjL3JlYWN0L3NlbGVjdCcpO1xuICByZWFjdC5UYWIgPSByZXF1aXJlKCdzcmMvcmVhY3QvdGFiJyk7XG4gIHJlYWN0LlRhYnMgPSByZXF1aXJlKCdzcmMvcmVhY3QvdGFicycpO1xuICByZWFjdC5UZXh0YXJlYSA9IHJlcXVpcmUoJ3NyYy9yZWFjdC90ZXh0YXJlYScpO1xufSkod2luZG93KTtcbiJdfQ== },{"src/react/appbar":15,"src/react/button":16,"src/react/caret":17,"src/react/checkbox":18,"src/react/col":19,"src/react/container":20,"src/react/divider":21,"src/react/dropdown":23,"src/react/dropdown-item":22,"src/react/form":24,"src/react/input":25,"src/react/option":26,"src/react/panel":27,"src/react/radio":28,"src/react/row":29,"src/react/select":30,"src/react/tab":31,"src/react/tabs":32,"src/react/textarea":33}],3:[function(require,module,exports){ 'use strict'; /** * MUI Combined React module * @module react/mui-combined */ (function (win) { // return if library has already been loaded if (win._muiReactCombinedLoaded) return;else win._muiReactCombinedLoaded = true; var util = require('src/js/lib/util'); // load css util.loadStyle(require('mui.min.css')); // load js require('./cdn-react'); })(window); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZha2VfYzMwMDcxNC5qcyJdLCJuYW1lcyI6WyJ3aW4iLCJfbXVpUmVhY3RDb21iaW5lZExvYWRlZCIsInV0aWwiLCJyZXF1aXJlIiwibG9hZFN0eWxlIiwid2luZG93Il0sIm1hcHBpbmdzIjoiOztBQUFBOzs7O0FBSUEsQ0FBQyxVQUFTQSxHQUFULEVBQWM7QUFDYjtBQUNBLE1BQUlBLElBQUlDLHVCQUFSLEVBQWlDLE9BQWpDLEtBQ0tELElBQUlDLHVCQUFKLEdBQThCLElBQTlCOztBQUVMLE1BQUlDLE9BQU9DLFFBQVEsaUJBQVIsQ0FBWDs7QUFFQTtBQUNBRCxPQUFLRSxTQUFMLENBQWVELFFBQVEsYUFBUixDQUFmOztBQUVBO0FBQ0FBLFVBQVEsYUFBUjtBQUNELENBWkQsRUFZR0UsTUFaSCIsImZpbGUiOiJmYWtlX2MzMDA3MTQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBDb21iaW5lZCBSZWFjdCBtb2R1bGVcbiAqIEBtb2R1bGUgcmVhY3QvbXVpLWNvbWJpbmVkXG4gKi9cbihmdW5jdGlvbih3aW4pIHtcbiAgLy8gcmV0dXJuIGlmIGxpYnJhcnkgaGFzIGFscmVhZHkgYmVlbiBsb2FkZWRcbiAgaWYgKHdpbi5fbXVpUmVhY3RDb21iaW5lZExvYWRlZCkgcmV0dXJuO1xuICBlbHNlIHdpbi5fbXVpUmVhY3RDb21iaW5lZExvYWRlZCA9IHRydWU7XG5cbiAgdmFyIHV0aWwgPSByZXF1aXJlKCdzcmMvanMvbGliL3V0aWwnKTtcblxuICAvLyBsb2FkIGNzc1xuICB1dGlsLmxvYWRTdHlsZShyZXF1aXJlKCdtdWkubWluLmNzcycpKTtcblxuICAvLyBsb2FkIGpzXG4gIHJlcXVpcmUoJy4vY2RuLXJlYWN0Jyk7XG59KSh3aW5kb3cpO1xuIl19 },{"./cdn-react":2,"mui.min.css":13,"src/js/lib/util":14}],4:[function(require,module,exports){ "use strict"; /** * MUI config module * @module config */ /** Define module API */ module.exports = { /** Use debug mode */ debug: true }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbmZpZy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiZGVidWciXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7O0FBS0E7QUFDQUEsT0FBT0MsT0FBUCxHQUFpQjtBQUNmO0FBQ0FDLFNBQU87QUFGUSxDQUFqQiIsImZpbGUiOiJjb25maWcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBjb25maWcgbW9kdWxlXG4gKiBAbW9kdWxlIGNvbmZpZ1xuICovXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xubW9kdWxlLmV4cG9ydHMgPSB7XG4gIC8qKiBVc2UgZGVidWcgbW9kZSAqL1xuICBkZWJ1ZzogdHJ1ZVxufTtcbiJdfQ== },{}],5:[function(require,module,exports){ /** * MUI CSS/JS form helpers module * @module lib/forms.py */ 'use strict'; var jqLite = require('./jqLite'); /** * Menu position/size/scroll helper * @returns {Object} Object with keys 'height', 'top', 'scrollTop' */ function getMenuPositionalCSSFn(wrapperEl, menuEl, selectedRow) { var viewHeight = document.documentElement.clientHeight, numRows = menuEl.children.length; // determine menu height var h = parseInt(menuEl.offsetHeight), height = Math.min(h, viewHeight); // determine row height var p = parseInt(jqLite.css(menuEl, 'padding-top')), rowHeight = (h - 2 * p) / numRows; // determine 'top' var top, initTop, minTop, maxTop; initTop = -1 * selectedRow * rowHeight; minTop = -1 * wrapperEl.getBoundingClientRect().top; maxTop = viewHeight - height + minTop; top = Math.min(Math.max(initTop, minTop), maxTop); // determine 'scrollTop' var scrollTop = 0, scrollIdeal, scrollMax; if (h > viewHeight) { scrollIdeal = top + p + selectedRow * rowHeight; scrollMax = numRows * rowHeight + 2 * p - height; scrollTop = Math.min(scrollIdeal, scrollMax); } return { 'height': height + 'px', 'top': top + 'px', 'scrollTop': scrollTop }; } /** Define module API */ module.exports = { getMenuPositionalCSS: getMenuPositionalCSSFn }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvcm1zLmpzIl0sIm5hbWVzIjpbImpxTGl0ZSIsInJlcXVpcmUiLCJnZXRNZW51UG9zaXRpb25hbENTU0ZuIiwid3JhcHBlckVsIiwibWVudUVsIiwic2VsZWN0ZWRSb3ciLCJ2aWV3SGVpZ2h0IiwiZG9jdW1lbnQiLCJkb2N1bWVudEVsZW1lbnQiLCJjbGllbnRIZWlnaHQiLCJudW1Sb3dzIiwiY2hpbGRyZW4iLCJsZW5ndGgiLCJoIiwicGFyc2VJbnQiLCJvZmZzZXRIZWlnaHQiLCJoZWlnaHQiLCJNYXRoIiwibWluIiwicCIsImNzcyIsInJvd0hlaWdodCIsInRvcCIsImluaXRUb3AiLCJtaW5Ub3AiLCJtYXhUb3AiLCJnZXRCb3VuZGluZ0NsaWVudFJlY3QiLCJtYXgiLCJzY3JvbGxUb3AiLCJzY3JvbGxJZGVhbCIsInNjcm9sbE1heCIsIm1vZHVsZSIsImV4cG9ydHMiLCJnZXRNZW51UG9zaXRpb25hbENTUyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7O0FBRUEsSUFBSUEsU0FBU0MsUUFBUSxVQUFSLENBQWI7O0FBR0E7Ozs7QUFJQSxTQUFTQyxzQkFBVCxDQUFnQ0MsU0FBaEMsRUFBMkNDLE1BQTNDLEVBQW1EQyxXQUFuRCxFQUFnRTtBQUM5RCxNQUFJQyxhQUFhQyxTQUFTQyxlQUFULENBQXlCQyxZQUExQztBQUFBLE1BQ0lDLFVBQVVOLE9BQU9PLFFBQVAsQ0FBZ0JDLE1BRDlCOztBQUdBO0FBQ0EsTUFBSUMsSUFBSUMsU0FBU1YsT0FBT1csWUFBaEIsQ0FBUjtBQUFBLE1BQ0lDLFNBQVNDLEtBQUtDLEdBQUwsQ0FBU0wsQ0FBVCxFQUFZUCxVQUFaLENBRGI7O0FBR0E7QUFDQSxNQUFJYSxJQUFJTCxTQUFTZCxPQUFPb0IsR0FBUCxDQUFXaEIsTUFBWCxFQUFtQixhQUFuQixDQUFULENBQVI7QUFBQSxNQUNJaUIsWUFBWSxDQUFDUixJQUFJLElBQUlNLENBQVQsSUFBY1QsT0FEOUI7O0FBR0E7QUFDQSxNQUFJWSxHQUFKLEVBQVNDLE9BQVQsRUFBa0JDLE1BQWxCLEVBQTBCQyxNQUExQjs7QUFFQUYsWUFBVSxDQUFDLENBQUQsR0FBS2xCLFdBQUwsR0FBbUJnQixTQUE3QjtBQUNBRyxXQUFTLENBQUMsQ0FBRCxHQUFLckIsVUFBVXVCLHFCQUFWLEdBQWtDSixHQUFoRDtBQUNBRyxXQUFVbkIsYUFBYVUsTUFBZCxHQUF3QlEsTUFBakM7O0FBRUFGLFFBQU1MLEtBQUtDLEdBQUwsQ0FBU0QsS0FBS1UsR0FBTCxDQUFTSixPQUFULEVBQWtCQyxNQUFsQixDQUFULEVBQW9DQyxNQUFwQyxDQUFOOztBQUVBO0FBQ0EsTUFBSUcsWUFBWSxDQUFoQjtBQUFBLE1BQ0lDLFdBREo7QUFBQSxNQUVJQyxTQUZKOztBQUlBLE1BQUlqQixJQUFJUCxVQUFSLEVBQW9CO0FBQ2xCdUIsa0JBQWNQLE1BQU1ILENBQU4sR0FBVWQsY0FBY2dCLFNBQXRDO0FBQ0FTLGdCQUFZcEIsVUFBVVcsU0FBVixHQUFzQixJQUFJRixDQUExQixHQUE4QkgsTUFBMUM7QUFDQVksZ0JBQVlYLEtBQUtDLEdBQUwsQ0FBU1csV0FBVCxFQUFzQkMsU0FBdEIsQ0FBWjtBQUNEOztBQUVELFNBQU87QUFDTCxjQUFVZCxTQUFTLElBRGQ7QUFFTCxXQUFPTSxNQUFNLElBRlI7QUFHTCxpQkFBYU07QUFIUixHQUFQO0FBS0Q7O0FBR0Q7QUFDQUcsT0FBT0MsT0FBUCxHQUFpQjtBQUNmQyx3QkFBc0IvQjtBQURQLENBQWpCIiwiZmlsZSI6ImZvcm1zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgQ1NTL0pTIGZvcm0gaGVscGVycyBtb2R1bGVcbiAqIEBtb2R1bGUgbGliL2Zvcm1zLnB5XG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG52YXIganFMaXRlID0gcmVxdWlyZSgnLi9qcUxpdGUnKTtcblxuXG4vKipcbiAqIE1lbnUgcG9zaXRpb24vc2l6ZS9zY3JvbGwgaGVscGVyXG4gKiBAcmV0dXJucyB7T2JqZWN0fSBPYmplY3Qgd2l0aCBrZXlzICdoZWlnaHQnLCAndG9wJywgJ3Njcm9sbFRvcCdcbiAqL1xuZnVuY3Rpb24gZ2V0TWVudVBvc2l0aW9uYWxDU1NGbih3cmFwcGVyRWwsIG1lbnVFbCwgc2VsZWN0ZWRSb3cpIHtcbiAgdmFyIHZpZXdIZWlnaHQgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuY2xpZW50SGVpZ2h0LFxuICAgICAgbnVtUm93cyA9IG1lbnVFbC5jaGlsZHJlbi5sZW5ndGg7XG5cbiAgLy8gZGV0ZXJtaW5lIG1lbnUgaGVpZ2h0XG4gIHZhciBoID0gcGFyc2VJbnQobWVudUVsLm9mZnNldEhlaWdodCksXG4gICAgICBoZWlnaHQgPSBNYXRoLm1pbihoLCB2aWV3SGVpZ2h0KTtcblxuICAvLyBkZXRlcm1pbmUgcm93IGhlaWdodFxuICB2YXIgcCA9IHBhcnNlSW50KGpxTGl0ZS5jc3MobWVudUVsLCAncGFkZGluZy10b3AnKSksXG4gICAgICByb3dIZWlnaHQgPSAoaCAtIDIgKiBwKSAvIG51bVJvd3M7XG5cbiAgLy8gZGV0ZXJtaW5lICd0b3AnXG4gIHZhciB0b3AsIGluaXRUb3AsIG1pblRvcCwgbWF4VG9wO1xuXG4gIGluaXRUb3AgPSAtMSAqIHNlbGVjdGVkUm93ICogcm93SGVpZ2h0O1xuICBtaW5Ub3AgPSAtMSAqIHdyYXBwZXJFbC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS50b3A7XG4gIG1heFRvcCA9ICh2aWV3SGVpZ2h0IC0gaGVpZ2h0KSArIG1pblRvcDtcblxuICB0b3AgPSBNYXRoLm1pbihNYXRoLm1heChpbml0VG9wLCBtaW5Ub3ApLCBtYXhUb3ApO1xuXG4gIC8vIGRldGVybWluZSAnc2Nyb2xsVG9wJ1xuICB2YXIgc2Nyb2xsVG9wID0gMCxcbiAgICAgIHNjcm9sbElkZWFsLFxuICAgICAgc2Nyb2xsTWF4O1xuXG4gIGlmIChoID4gdmlld0hlaWdodCkge1xuICAgIHNjcm9sbElkZWFsID0gdG9wICsgcCArIHNlbGVjdGVkUm93ICogcm93SGVpZ2h0O1xuICAgIHNjcm9sbE1heCA9IG51bVJvd3MgKiByb3dIZWlnaHQgKyAyICogcCAtIGhlaWdodDtcbiAgICBzY3JvbGxUb3AgPSBNYXRoLm1pbihzY3JvbGxJZGVhbCwgc2Nyb2xsTWF4KTtcbiAgfVxuXG4gIHJldHVybiB7XG4gICAgJ2hlaWdodCc6IGhlaWdodCArICdweCcsXG4gICAgJ3RvcCc6IHRvcCArICdweCcsXG4gICAgJ3Njcm9sbFRvcCc6IHNjcm9sbFRvcFxuICB9O1xufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xubW9kdWxlLmV4cG9ydHMgPSB7XG4gIGdldE1lbnVQb3NpdGlvbmFsQ1NTOiBnZXRNZW51UG9zaXRpb25hbENTU0ZuXG59O1xuIl19 },{"./jqLite":6}],6:[function(require,module,exports){ /** * MUI CSS/JS jqLite module * @module lib/jqLite */ 'use strict'; /** * Add a class to an element. * @param {Element} element - The DOM element. * @param {string} cssClasses - Space separated list of class names. */ function jqLiteAddClass(element, cssClasses) { if (!cssClasses || !element.setAttribute) return; var existingClasses = _getExistingClasses(element), splitClasses = cssClasses.split(' '), cssClass; for (var i = 0; i < splitClasses.length; i++) { cssClass = splitClasses[i].trim(); if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) { existingClasses += cssClass + ' '; } } element.setAttribute('class', existingClasses.trim()); } /** * Get or set CSS properties. * @param {Element} element - The DOM element. * @param {string} [name] - The property name. * @param {string} [value] - The property value. */ function jqLiteCss(element, name, value) { // Return full style object if (name === undefined) { return getComputedStyle(element); } var nameType = jqLiteType(name); // Set multiple values if (nameType === 'object') { for (var key in name) { element.style[_camelCase(key)] = name[key]; }return; } // Set a single value if (nameType === 'string' && value !== undefined) { element.style[_camelCase(name)] = value; } var styleObj = getComputedStyle(element), isArray = jqLiteType(name) === 'array'; // Read single value if (!isArray) return _getCurrCssProp(element, name, styleObj); // Read multiple values var outObj = {}, key; for (var i = 0; i < name.length; i++) { key = name[i]; outObj[key] = _getCurrCssProp(element, key, styleObj); } return outObj; } /** * Check if element has class. * @param {Element} element - The DOM element. * @param {string} cls - The class name string. */ function jqLiteHasClass(element, cls) { if (!cls || !element.getAttribute) return false; return _getExistingClasses(element).indexOf(' ' + cls + ' ') > -1; } /** * Return the type of a variable. * @param {} somevar - The JavaScript variable. */ function jqLiteType(somevar) { // handle undefined if (somevar === undefined) return 'undefined'; // handle others (of type [object <Type>]) var typeStr = Object.prototype.toString.call(somevar); if (typeStr.indexOf('[object ') === 0) { return typeStr.slice(8, -1).toLowerCase(); } else { throw new Error("MUI: Could not understand type: " + typeStr); } } /** * Attach an event handler to a DOM element * @param {Element} element - The DOM element. * @param {string} events - Space separated event names. * @param {Function} callback - The callback function. * @param {Boolean} useCapture - Use capture flag. */ function jqLiteOn(element, events, callback, useCapture) { useCapture = useCapture === undefined ? false : useCapture; var cache = element._muiEventCache = element._muiEventCache || {}; events.split(' ').map(function (event) { // add to DOM element.addEventListener(event, callback, useCapture); // add to cache cache[event] = cache[event] || []; cache[event].push([callback, useCapture]); }); } /** * Remove an event handler from a DOM element * @param {Element} element - The DOM element. * @param {string} events - Space separated event names. * @param {Function} callback - The callback function. * @param {Boolean} useCapture - Use capture flag. */ function jqLiteOff(element, events, callback, useCapture) { useCapture = useCapture === undefined ? false : useCapture; // remove from cache var cache = element._muiEventCache = element._muiEventCache || {}, argsList, args, i; events.split(' ').map(function (event) { argsList = cache[event] || []; i = argsList.length; while (i--) { args = argsList[i]; // remove all events if callback is undefined if (callback === undefined || args[0] === callback && args[1] === useCapture) { // remove from cache argsList.splice(i, 1); // remove from DOM element.removeEventListener(event, args[0], args[1]); } } }); } /** * Attach an event hander which will only execute once per element per event * @param {Element} element - The DOM element. * @param {string} events - Space separated event names. * @param {Function} callback - The callback function. * @param {Boolean} useCapture - Use capture flag. */ function jqLiteOne(element, events, callback, useCapture) { events.split(' ').map(function (event) { jqLiteOn(element, event, function onFn(ev) { // execute callback if (callback) callback.apply(this, arguments); // remove wrapper jqLiteOff(element, event, onFn, useCapture); }, useCapture); }); } /** * Get or set horizontal scroll position * @param {Element} element - The DOM element * @param {number} [value] - The scroll position */ function jqLiteScrollLeft(element, value) { var win = window; // get if (value === undefined) { if (element === win) { var docEl = document.documentElement; return (win.pageXOffset || docEl.scrollLeft) - (docEl.clientLeft || 0); } else { return element.scrollLeft; } } // set if (element === win) win.scrollTo(value, jqLiteScrollTop(win));else element.scrollLeft = value; } /** * Get or set vertical scroll position * @param {Element} element - The DOM element * @param {number} value - The scroll position */ function jqLiteScrollTop(element, value) { var win = window; // get if (value === undefined) { if (element === win) { var docEl = document.documentElement; return (win.pageYOffset || docEl.scrollTop) - (docEl.clientTop || 0); } else { return element.scrollTop; } } // set if (element === win) win.scrollTo(jqLiteScrollLeft(win), value);else element.scrollTop = value; } /** * Return object representing top/left offset and element height/width. * @param {Element} element - The DOM element. */ function jqLiteOffset(element) { var win = window, rect = element.getBoundingClientRect(), scrollTop = jqLiteScrollTop(win), scrollLeft = jqLiteScrollLeft(win); return { top: rect.top + scrollTop, left: rect.left + scrollLeft, height: rect.height, width: rect.width }; } /** * Attach a callback to the DOM ready event listener * @param {Function} fn - The callback function. */ function jqLiteReady(fn) { var done = false, top = true, doc = document, win = doc.defaultView, root = doc.documentElement, add = doc.addEventListener ? 'addEventListener' : 'attachEvent', rem = doc.addEventListener ? 'removeEventListener' : 'detachEvent', pre = doc.addEventListener ? '' : 'on'; var init = function init(e) { if (e.type == 'readystatechange' && doc.readyState != 'complete') { return; } (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false); if (!done && (done = true)) fn.call(win, e.type || e); }; var poll = function poll() { try { root.doScroll('left'); } catch (e) { setTimeout(poll, 50);return; } init('poll'); }; if (doc.readyState == 'complete') { fn.call(win, 'lazy'); } else { if (doc.createEventObject && root.doScroll) { try { top = !win.frameElement; } catch (e) {} if (top) poll(); } doc[add](pre + 'DOMContentLoaded', init, false); doc[add](pre + 'readystatechange', init, false); win[add](pre + 'load', init, false); } } /** * Remove classes from a DOM element * @param {Element} element - The DOM element. * @param {string} cssClasses - Space separated list of class names. */ function jqLiteRemoveClass(element, cssClasses) { if (!cssClasses || !element.setAttribute) return; var existingClasses = _getExistingClasses(element), splitClasses = cssClasses.split(' '), cssClass; for (var i = 0; i < splitClasses.length; i++) { cssClass = splitClasses[i].trim(); while (existingClasses.indexOf(' ' + cssClass + ' ') >= 0) { existingClasses = existingClasses.replace(' ' + cssClass + ' ', ' '); } } element.setAttribute('class', existingClasses.trim()); } // ------------------------------ // Utilities // ------------------------------ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g, MOZ_HACK_REGEXP = /^moz([A-Z])/, ESCAPE_REGEXP = /([.*+?^=!:${}()|\[\]\/\\])/g; function _getExistingClasses(element) { var classes = (element.getAttribute('class') || '').replace(/[\n\t]/g, ''); return ' ' + classes + ' '; } function _camelCase(name) { return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) { return offset ? letter.toUpperCase() : letter; }).replace(MOZ_HACK_REGEXP, 'Moz$1'); } function _escapeRegExp(string) { return string.replace(ESCAPE_REGEXP, "\\$1"); } function _getCurrCssProp(elem, name, computed) { var ret; // try computed style ret = computed.getPropertyValue(name); // try style attribute (if element is not attached to document) if (ret === '' && !elem.ownerDocument) ret = elem.style[_camelCase(name)]; return ret; } /** * Module API */ module.exports = { /** Add classes */ addClass: jqLiteAddClass, /** Get or set CSS properties */ css: jqLiteCss, /** Check for class */ hasClass: jqLiteHasClass, /** Remove event handlers */ off: jqLiteOff, /** Return offset values */ offset: jqLiteOffset, /** Add event handlers */ on: jqLiteOn, /** Add an execute-once event handler */ one: jqLiteOne, /** DOM ready event handler */ ready: jqLiteReady, /** Remove classes */ removeClass: jqLiteRemoveClass, /** Check JavaScript variable instance type */ type: jqLiteType, /** Get or set horizontal scroll position */ scrollLeft: jqLiteScrollLeft, /** Get or set vertical scroll position */ scrollTop: jqLiteScrollTop }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxTGl0ZS5qcyJdLCJuYW1lcyI6WyJqcUxpdGVBZGRDbGFzcyIsImVsZW1lbnQiLCJjc3NDbGFzc2VzIiwic2V0QXR0cmlidXRlIiwiZXhpc3RpbmdDbGFzc2VzIiwiX2dldEV4aXN0aW5nQ2xhc3NlcyIsInNwbGl0Q2xhc3NlcyIsInNwbGl0IiwiY3NzQ2xhc3MiLCJpIiwibGVuZ3RoIiwidHJpbSIsImluZGV4T2YiLCJqcUxpdGVDc3MiLCJuYW1lIiwidmFsdWUiLCJ1bmRlZmluZWQiLCJnZXRDb21wdXRlZFN0eWxlIiwibmFtZVR5cGUiLCJqcUxpdGVUeXBlIiwia2V5Iiwic3R5bGUiLCJfY2FtZWxDYXNlIiwic3R5bGVPYmoiLCJpc0FycmF5IiwiX2dldEN1cnJDc3NQcm9wIiwib3V0T2JqIiwianFMaXRlSGFzQ2xhc3MiLCJjbHMiLCJnZXRBdHRyaWJ1dGUiLCJzb21ldmFyIiwidHlwZVN0ciIsIk9iamVjdCIsInByb3RvdHlwZSIsInRvU3RyaW5nIiwiY2FsbCIsInNsaWNlIiwidG9Mb3dlckNhc2UiLCJFcnJvciIsImpxTGl0ZU9uIiwiZXZlbnRzIiwiY2FsbGJhY2siLCJ1c2VDYXB0dXJlIiwiY2FjaGUiLCJfbXVpRXZlbnRDYWNoZSIsIm1hcCIsImV2ZW50IiwiYWRkRXZlbnRMaXN0ZW5lciIsInB1c2giLCJqcUxpdGVPZmYiLCJhcmdzTGlzdCIsImFyZ3MiLCJzcGxpY2UiLCJyZW1vdmVFdmVudExpc3RlbmVyIiwianFMaXRlT25lIiwib25GbiIsImV2IiwiYXBwbHkiLCJhcmd1bWVudHMiLCJqcUxpdGVTY3JvbGxMZWZ0Iiwid2luIiwid2luZG93IiwiZG9jRWwiLCJkb2N1bWVudCIsImRvY3VtZW50RWxlbWVudCIsInBhZ2VYT2Zmc2V0Iiwic2Nyb2xsTGVmdCIsImNsaWVudExlZnQiLCJzY3JvbGxUbyIsImpxTGl0ZVNjcm9sbFRvcCIsInBhZ2VZT2Zmc2V0Iiwic2Nyb2xsVG9wIiwiY2xpZW50VG9wIiwianFMaXRlT2Zmc2V0IiwicmVjdCIsImdldEJvdW5kaW5nQ2xpZW50UmVjdCIsInRvcCIsImxlZnQiLCJoZWlnaHQiLCJ3aWR0aCIsImpxTGl0ZVJlYWR5IiwiZm4iLCJkb25lIiwiZG9jIiwiZGVmYXVsdFZpZXciLCJyb290IiwiYWRkIiwicmVtIiwicHJlIiwiaW5pdCIsImUiLCJ0eXBlIiwicmVhZHlTdGF0ZSIsInBvbGwiLCJkb1Njcm9sbCIsInNldFRpbWVvdXQiLCJjcmVhdGVFdmVudE9iamVjdCIsImZyYW1lRWxlbWVudCIsImpxTGl0ZVJlbW92ZUNsYXNzIiwicmVwbGFjZSIsIlNQRUNJQUxfQ0hBUlNfUkVHRVhQIiwiTU9aX0hBQ0tfUkVHRVhQIiwiRVNDQVBFX1JFR0VYUCIsImNsYXNzZXMiLCJfIiwic2VwYXJhdG9yIiwibGV0dGVyIiwib2Zmc2V0IiwidG9VcHBlckNhc2UiLCJfZXNjYXBlUmVnRXhwIiwic3RyaW5nIiwiZWxlbSIsImNvbXB1dGVkIiwicmV0IiwiZ2V0UHJvcGVydHlWYWx1ZSIsIm93bmVyRG9jdW1lbnQiLCJtb2R1bGUiLCJleHBvcnRzIiwiYWRkQ2xhc3MiLCJjc3MiLCJoYXNDbGFzcyIsIm9mZiIsIm9uIiwib25lIiwicmVhZHkiLCJyZW1vdmVDbGFzcyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7O0FBR0E7Ozs7OztBQUtBLFNBQVNBLGNBQVQsQ0FBd0JDLE9BQXhCLEVBQWlDQyxVQUFqQyxFQUE2QztBQUMzQyxNQUFJLENBQUNBLFVBQUQsSUFBZSxDQUFDRCxRQUFRRSxZQUE1QixFQUEwQzs7QUFFMUMsTUFBSUMsa0JBQWtCQyxvQkFBb0JKLE9BQXBCLENBQXRCO0FBQUEsTUFDSUssZUFBZUosV0FBV0ssS0FBWCxDQUFpQixHQUFqQixDQURuQjtBQUFBLE1BRUlDLFFBRko7O0FBSUEsT0FBSyxJQUFJQyxJQUFFLENBQVgsRUFBY0EsSUFBSUgsYUFBYUksTUFBL0IsRUFBdUNELEdBQXZDLEVBQTRDO0FBQzFDRCxlQUFXRixhQUFhRyxDQUFiLEVBQWdCRSxJQUFoQixFQUFYO0FBQ0EsUUFBSVAsZ0JBQWdCUSxPQUFoQixDQUF3QixNQUFNSixRQUFOLEdBQWlCLEdBQXpDLE1BQWtELENBQUMsQ0FBdkQsRUFBMEQ7QUFDeERKLHlCQUFtQkksV0FBVyxHQUE5QjtBQUNEO0FBQ0Y7O0FBRURQLFVBQVFFLFlBQVIsQ0FBcUIsT0FBckIsRUFBOEJDLGdCQUFnQk8sSUFBaEIsRUFBOUI7QUFDRDs7QUFHRDs7Ozs7O0FBTUEsU0FBU0UsU0FBVCxDQUFtQlosT0FBbkIsRUFBNEJhLElBQTVCLEVBQWtDQyxLQUFsQyxFQUF5QztBQUN2QztBQUNBLE1BQUlELFNBQVNFLFNBQWIsRUFBd0I7QUFDdEIsV0FBT0MsaUJBQWlCaEIsT0FBakIsQ0FBUDtBQUNEOztBQUVELE1BQUlpQixXQUFXQyxXQUFXTCxJQUFYLENBQWY7O0FBRUE7QUFDQSxNQUFJSSxhQUFhLFFBQWpCLEVBQTJCO0FBQ3pCLFNBQUssSUFBSUUsR0FBVCxJQUFnQk4sSUFBaEI7QUFBc0JiLGNBQVFvQixLQUFSLENBQWNDLFdBQVdGLEdBQVgsQ0FBZCxJQUFpQ04sS0FBS00sR0FBTCxDQUFqQztBQUF0QixLQUNBO0FBQ0Q7O0FBRUQ7QUFDQSxNQUFJRixhQUFhLFFBQWIsSUFBeUJILFVBQVVDLFNBQXZDLEVBQWtEO0FBQ2hEZixZQUFRb0IsS0FBUixDQUFjQyxXQUFXUixJQUFYLENBQWQsSUFBa0NDLEtBQWxDO0FBQ0Q7O0FBRUQsTUFBSVEsV0FBV04saUJBQWlCaEIsT0FBakIsQ0FBZjtBQUFBLE1BQ0l1QixVQUFXTCxXQUFXTCxJQUFYLE1BQXFCLE9BRHBDOztBQUdBO0FBQ0EsTUFBSSxDQUFDVSxPQUFMLEVBQWMsT0FBT0MsZ0JBQWdCeEIsT0FBaEIsRUFBeUJhLElBQXpCLEVBQStCUyxRQUEvQixDQUFQOztBQUVkO0FBQ0EsTUFBSUcsU0FBUyxFQUFiO0FBQUEsTUFDSU4sR0FESjs7QUFHQSxPQUFLLElBQUlYLElBQUUsQ0FBWCxFQUFjQSxJQUFJSyxLQUFLSixNQUF2QixFQUErQkQsR0FBL0IsRUFBb0M7QUFDbENXLFVBQU1OLEtBQUtMLENBQUwsQ0FBTjtBQUNBaUIsV0FBT04sR0FBUCxJQUFjSyxnQkFBZ0J4QixPQUFoQixFQUF5Qm1CLEdBQXpCLEVBQThCRyxRQUE5QixDQUFkO0FBQ0Q7O0FBRUQsU0FBT0csTUFBUDtBQUNEOztBQUdEOzs7OztBQUtBLFNBQVNDLGNBQVQsQ0FBd0IxQixPQUF4QixFQUFpQzJCLEdBQWpDLEVBQXNDO0FBQ3BDLE1BQUksQ0FBQ0EsR0FBRCxJQUFRLENBQUMzQixRQUFRNEIsWUFBckIsRUFBbUMsT0FBTyxLQUFQO0FBQ25DLFNBQVF4QixvQkFBb0JKLE9BQXBCLEVBQTZCVyxPQUE3QixDQUFxQyxNQUFNZ0IsR0FBTixHQUFZLEdBQWpELElBQXdELENBQUMsQ0FBakU7QUFDRDs7QUFHRDs7OztBQUlBLFNBQVNULFVBQVQsQ0FBb0JXLE9BQXBCLEVBQTZCO0FBQzNCO0FBQ0EsTUFBSUEsWUFBWWQsU0FBaEIsRUFBMkIsT0FBTyxXQUFQOztBQUUzQjtBQUNBLE1BQUllLFVBQVVDLE9BQU9DLFNBQVAsQ0FBaUJDLFFBQWpCLENBQTBCQyxJQUExQixDQUErQkwsT0FBL0IsQ0FBZDtBQUNBLE1BQUlDLFFBQVFuQixPQUFSLENBQWdCLFVBQWhCLE1BQWdDLENBQXBDLEVBQXVDO0FBQ3JDLFdBQU9tQixRQUFRSyxLQUFSLENBQWMsQ0FBZCxFQUFpQixDQUFDLENBQWxCLEVBQXFCQyxXQUFyQixFQUFQO0FBQ0QsR0FGRCxNQUVPO0FBQ0wsVUFBTSxJQUFJQyxLQUFKLENBQVUscUNBQXFDUCxPQUEvQyxDQUFOO0FBQ0Q7QUFDRjs7QUFHRDs7Ozs7OztBQU9BLFNBQVNRLFFBQVQsQ0FBa0J0QyxPQUFsQixFQUEyQnVDLE1BQTNCLEVBQW1DQyxRQUFuQyxFQUE2Q0MsVUFBN0MsRUFBeUQ7QUFDdkRBLGVBQWNBLGVBQWUxQixTQUFoQixHQUE2QixLQUE3QixHQUFxQzBCLFVBQWxEOztBQUVBLE1BQUlDLFFBQVExQyxRQUFRMkMsY0FBUixHQUF5QjNDLFFBQVEyQyxjQUFSLElBQTBCLEVBQS9EOztBQUVBSixTQUFPakMsS0FBUCxDQUFhLEdBQWIsRUFBa0JzQyxHQUFsQixDQUFzQixVQUFTQyxLQUFULEVBQWdCO0FBQ3BDO0FBQ0E3QyxZQUFROEMsZ0JBQVIsQ0FBeUJELEtBQXpCLEVBQWdDTCxRQUFoQyxFQUEwQ0MsVUFBMUM7O0FBRUE7QUFDQUMsVUFBTUcsS0FBTixJQUFlSCxNQUFNRyxLQUFOLEtBQWdCLEVBQS9CO0FBQ0FILFVBQU1HLEtBQU4sRUFBYUUsSUFBYixDQUFrQixDQUFDUCxRQUFELEVBQVdDLFVBQVgsQ0FBbEI7QUFDRCxHQVBEO0FBUUQ7O0FBR0Q7Ozs7Ozs7QUFPQSxTQUFTTyxTQUFULENBQW1CaEQsT0FBbkIsRUFBNEJ1QyxNQUE1QixFQUFvQ0MsUUFBcEMsRUFBOENDLFVBQTlDLEVBQTBEO0FBQ3hEQSxlQUFjQSxlQUFlMUIsU0FBaEIsR0FBNkIsS0FBN0IsR0FBcUMwQixVQUFsRDs7QUFFQTtBQUNBLE1BQUlDLFFBQVExQyxRQUFRMkMsY0FBUixHQUF5QjNDLFFBQVEyQyxjQUFSLElBQTBCLEVBQS9EO0FBQUEsTUFDSU0sUUFESjtBQUFBLE1BRUlDLElBRko7QUFBQSxNQUdJMUMsQ0FISjs7QUFLQStCLFNBQU9qQyxLQUFQLENBQWEsR0FBYixFQUFrQnNDLEdBQWxCLENBQXNCLFVBQVNDLEtBQVQsRUFBZ0I7QUFDcENJLGVBQVdQLE1BQU1HLEtBQU4sS0FBZ0IsRUFBM0I7O0FBRUFyQyxRQUFJeUMsU0FBU3hDLE1BQWI7QUFDQSxXQUFPRCxHQUFQLEVBQVk7QUFDVjBDLGFBQU9ELFNBQVN6QyxDQUFULENBQVA7O0FBRUE7QUFDQSxVQUFJZ0MsYUFBYXpCLFNBQWIsSUFDQ21DLEtBQUssQ0FBTCxNQUFZVixRQUFaLElBQXdCVSxLQUFLLENBQUwsTUFBWVQsVUFEekMsRUFDc0Q7O0FBRXBEO0FBQ0FRLGlCQUFTRSxNQUFULENBQWdCM0MsQ0FBaEIsRUFBbUIsQ0FBbkI7O0FBRUE7QUFDQVIsZ0JBQVFvRCxtQkFBUixDQUE0QlAsS0FBNUIsRUFBbUNLLEtBQUssQ0FBTCxDQUFuQyxFQUE0Q0EsS0FBSyxDQUFMLENBQTVDO0FBQ0Q7QUFDRjtBQUNGLEdBbEJEO0FBbUJEOztBQUdEOzs7Ozs7O0FBT0EsU0FBU0csU0FBVCxDQUFtQnJELE9BQW5CLEVBQTRCdUMsTUFBNUIsRUFBb0NDLFFBQXBDLEVBQThDQyxVQUE5QyxFQUEwRDtBQUN4REYsU0FBT2pDLEtBQVAsQ0FBYSxHQUFiLEVBQWtCc0MsR0FBbEIsQ0FBc0IsVUFBU0MsS0FBVCxFQUFnQjtBQUNwQ1AsYUFBU3RDLE9BQVQsRUFBa0I2QyxLQUFsQixFQUF5QixTQUFTUyxJQUFULENBQWNDLEVBQWQsRUFBa0I7QUFDekM7QUFDQSxVQUFJZixRQUFKLEVBQWNBLFNBQVNnQixLQUFULENBQWUsSUFBZixFQUFxQkMsU0FBckI7O0FBRWQ7QUFDQVQsZ0JBQVVoRCxPQUFWLEVBQW1CNkMsS0FBbkIsRUFBMEJTLElBQTFCLEVBQWdDYixVQUFoQztBQUNELEtBTkQsRUFNR0EsVUFOSDtBQU9ELEdBUkQ7QUFTRDs7QUFHRDs7Ozs7QUFLQSxTQUFTaUIsZ0JBQVQsQ0FBMEIxRCxPQUExQixFQUFtQ2MsS0FBbkMsRUFBMEM7QUFDeEMsTUFBSTZDLE1BQU1DLE1BQVY7O0FBRUE7QUFDQSxNQUFJOUMsVUFBVUMsU0FBZCxFQUF5QjtBQUN2QixRQUFJZixZQUFZMkQsR0FBaEIsRUFBcUI7QUFDbkIsVUFBSUUsUUFBUUMsU0FBU0MsZUFBckI7QUFDQSxhQUFPLENBQUNKLElBQUlLLFdBQUosSUFBbUJILE1BQU1JLFVBQTFCLEtBQXlDSixNQUFNSyxVQUFOLElBQW9CLENBQTdELENBQVA7QUFDRCxLQUhELE1BR087QUFDTCxhQUFPbEUsUUFBUWlFLFVBQWY7QUFDRDtBQUNGOztBQUVEO0FBQ0EsTUFBSWpFLFlBQVkyRCxHQUFoQixFQUFxQkEsSUFBSVEsUUFBSixDQUFhckQsS0FBYixFQUFvQnNELGdCQUFnQlQsR0FBaEIsQ0FBcEIsRUFBckIsS0FDSzNELFFBQVFpRSxVQUFSLEdBQXFCbkQsS0FBckI7QUFDTjs7QUFHRDs7Ozs7QUFLQSxTQUFTc0QsZUFBVCxDQUF5QnBFLE9BQXpCLEVBQWtDYyxLQUFsQyxFQUF5QztBQUN2QyxNQUFJNkMsTUFBTUMsTUFBVjs7QUFFQTtBQUNBLE1BQUk5QyxVQUFVQyxTQUFkLEVBQXlCO0FBQ3ZCLFFBQUlmLFlBQVkyRCxHQUFoQixFQUFxQjtBQUNuQixVQUFJRSxRQUFRQyxTQUFTQyxlQUFyQjtBQUNBLGFBQU8sQ0FBQ0osSUFBSVUsV0FBSixJQUFtQlIsTUFBTVMsU0FBMUIsS0FBd0NULE1BQU1VLFNBQU4sSUFBbUIsQ0FBM0QsQ0FBUDtBQUNELEtBSEQsTUFHTztBQUNMLGFBQU92RSxRQUFRc0UsU0FBZjtBQUNEO0FBQ0Y7O0FBRUQ7QUFDQSxNQUFJdEUsWUFBWTJELEdBQWhCLEVBQXFCQSxJQUFJUSxRQUFKLENBQWFULGlCQUFpQkMsR0FBakIsQ0FBYixFQUFvQzdDLEtBQXBDLEVBQXJCLEtBQ0tkLFFBQVFzRSxTQUFSLEdBQW9CeEQsS0FBcEI7QUFDTjs7QUFHRDs7OztBQUlBLFNBQVMwRCxZQUFULENBQXNCeEUsT0FBdEIsRUFBK0I7QUFDN0IsTUFBSTJELE1BQU1DLE1BQVY7QUFBQSxNQUNJYSxPQUFPekUsUUFBUTBFLHFCQUFSLEVBRFg7QUFBQSxNQUVJSixZQUFZRixnQkFBZ0JULEdBQWhCLENBRmhCO0FBQUEsTUFHSU0sYUFBYVAsaUJBQWlCQyxHQUFqQixDQUhqQjs7QUFLQSxTQUFPO0FBQ0xnQixTQUFLRixLQUFLRSxHQUFMLEdBQVdMLFNBRFg7QUFFTE0sVUFBTUgsS0FBS0csSUFBTCxHQUFZWCxVQUZiO0FBR0xZLFlBQVFKLEtBQUtJLE1BSFI7QUFJTEMsV0FBT0wsS0FBS0s7QUFKUCxHQUFQO0FBTUQ7O0FBR0Q7Ozs7QUFJQSxTQUFTQyxXQUFULENBQXFCQyxFQUFyQixFQUF5QjtBQUN2QixNQUFJQyxPQUFPLEtBQVg7QUFBQSxNQUNJTixNQUFNLElBRFY7QUFBQSxNQUVJTyxNQUFNcEIsUUFGVjtBQUFBLE1BR0lILE1BQU11QixJQUFJQyxXQUhkO0FBQUEsTUFJSUMsT0FBT0YsSUFBSW5CLGVBSmY7QUFBQSxNQUtJc0IsTUFBTUgsSUFBSXBDLGdCQUFKLEdBQXVCLGtCQUF2QixHQUE0QyxhQUx0RDtBQUFBLE1BTUl3QyxNQUFNSixJQUFJcEMsZ0JBQUosR0FBdUIscUJBQXZCLEdBQStDLGFBTnpEO0FBQUEsTUFPSXlDLE1BQU1MLElBQUlwQyxnQkFBSixHQUF1QixFQUF2QixHQUE0QixJQVB0Qzs7QUFTQSxNQUFJMEMsT0FBTyxTQUFQQSxJQUFPLENBQVNDLENBQVQsRUFBWTtBQUNyQixRQUFJQSxFQUFFQyxJQUFGLElBQVUsa0JBQVYsSUFBZ0NSLElBQUlTLFVBQUosSUFBa0IsVUFBdEQsRUFBa0U7QUFDaEU7QUFDRDs7QUFFRCxLQUFDRixFQUFFQyxJQUFGLElBQVUsTUFBVixHQUFtQi9CLEdBQW5CLEdBQXlCdUIsR0FBMUIsRUFBK0JJLEdBQS9CLEVBQW9DQyxNQUFNRSxFQUFFQyxJQUE1QyxFQUFrREYsSUFBbEQsRUFBd0QsS0FBeEQ7QUFDQSxRQUFJLENBQUNQLElBQUQsS0FBVUEsT0FBTyxJQUFqQixDQUFKLEVBQTRCRCxHQUFHOUMsSUFBSCxDQUFReUIsR0FBUixFQUFhOEIsRUFBRUMsSUFBRixJQUFVRCxDQUF2QjtBQUM3QixHQVBEOztBQVNBLE1BQUlHLE9BQU8sU0FBUEEsSUFBTyxHQUFXO0FBQ3BCLFFBQUk7QUFBRVIsV0FBS1MsUUFBTCxDQUFjLE1BQWQ7QUFBd0IsS0FBOUIsQ0FBK0IsT0FBTUosQ0FBTixFQUFTO0FBQUVLLGlCQUFXRixJQUFYLEVBQWlCLEVBQWpCLEVBQXNCO0FBQVM7QUFDekVKLFNBQUssTUFBTDtBQUNELEdBSEQ7O0FBS0EsTUFBSU4sSUFBSVMsVUFBSixJQUFrQixVQUF0QixFQUFrQztBQUNoQ1gsT0FBRzlDLElBQUgsQ0FBUXlCLEdBQVIsRUFBYSxNQUFiO0FBQ0QsR0FGRCxNQUVPO0FBQ0wsUUFBSXVCLElBQUlhLGlCQUFKLElBQXlCWCxLQUFLUyxRQUFsQyxFQUE0QztBQUMxQyxVQUFJO0FBQUVsQixjQUFNLENBQUNoQixJQUFJcUMsWUFBWDtBQUEwQixPQUFoQyxDQUFpQyxPQUFNUCxDQUFOLEVBQVMsQ0FBRztBQUM3QyxVQUFJZCxHQUFKLEVBQVNpQjtBQUNWO0FBQ0RWLFFBQUlHLEdBQUosRUFBU0UsTUFBTSxrQkFBZixFQUFtQ0MsSUFBbkMsRUFBeUMsS0FBekM7QUFDQU4sUUFBSUcsR0FBSixFQUFTRSxNQUFNLGtCQUFmLEVBQW1DQyxJQUFuQyxFQUF5QyxLQUF6QztBQUNBN0IsUUFBSTBCLEdBQUosRUFBU0UsTUFBTSxNQUFmLEVBQXVCQyxJQUF2QixFQUE2QixLQUE3QjtBQUNEO0FBQ0Y7O0FBR0Q7Ozs7O0FBS0EsU0FBU1MsaUJBQVQsQ0FBMkJqRyxPQUEzQixFQUFvQ0MsVUFBcEMsRUFBZ0Q7QUFDOUMsTUFBSSxDQUFDQSxVQUFELElBQWUsQ0FBQ0QsUUFBUUUsWUFBNUIsRUFBMEM7O0FBRTFDLE1BQUlDLGtCQUFrQkMsb0JBQW9CSixPQUFwQixDQUF0QjtBQUFBLE1BQ0lLLGVBQWVKLFdBQVdLLEtBQVgsQ0FBaUIsR0FBakIsQ0FEbkI7QUFBQSxNQUVJQyxRQUZKOztBQUlBLE9BQUssSUFBSUMsSUFBRSxDQUFYLEVBQWNBLElBQUlILGFBQWFJLE1BQS9CLEVBQXVDRCxHQUF2QyxFQUE0QztBQUMxQ0QsZUFBV0YsYUFBYUcsQ0FBYixFQUFnQkUsSUFBaEIsRUFBWDtBQUNBLFdBQU9QLGdCQUFnQlEsT0FBaEIsQ0FBd0IsTUFBTUosUUFBTixHQUFpQixHQUF6QyxLQUFpRCxDQUF4RCxFQUEyRDtBQUN6REosd0JBQWtCQSxnQkFBZ0IrRixPQUFoQixDQUF3QixNQUFNM0YsUUFBTixHQUFpQixHQUF6QyxFQUE4QyxHQUE5QyxDQUFsQjtBQUNEO0FBQ0Y7O0FBRURQLFVBQVFFLFlBQVIsQ0FBcUIsT0FBckIsRUFBOEJDLGdCQUFnQk8sSUFBaEIsRUFBOUI7QUFDRDs7QUFHRDtBQUNBO0FBQ0E7QUFDQSxJQUFJeUYsdUJBQXVCLGlCQUEzQjtBQUFBLElBQ0lDLGtCQUFrQixhQUR0QjtBQUFBLElBRUlDLGdCQUFnQiw2QkFGcEI7O0FBS0EsU0FBU2pHLG1CQUFULENBQTZCSixPQUE3QixFQUFzQztBQUNwQyxNQUFJc0csVUFBVSxDQUFDdEcsUUFBUTRCLFlBQVIsQ0FBcUIsT0FBckIsS0FBaUMsRUFBbEMsRUFBc0NzRSxPQUF0QyxDQUE4QyxTQUE5QyxFQUF5RCxFQUF6RCxDQUFkO0FBQ0EsU0FBTyxNQUFNSSxPQUFOLEdBQWdCLEdBQXZCO0FBQ0Q7O0FBR0QsU0FBU2pGLFVBQVQsQ0FBb0JSLElBQXBCLEVBQTBCO0FBQ3hCLFNBQU9BLEtBQ0xxRixPQURLLENBQ0dDLG9CQURILEVBQ3lCLFVBQVNJLENBQVQsRUFBWUMsU0FBWixFQUF1QkMsTUFBdkIsRUFBK0JDLE1BQS9CLEVBQXVDO0FBQ25FLFdBQU9BLFNBQVNELE9BQU9FLFdBQVAsRUFBVCxHQUFnQ0YsTUFBdkM7QUFDRCxHQUhJLEVBSUxQLE9BSkssQ0FJR0UsZUFKSCxFQUlvQixPQUpwQixDQUFQO0FBS0Q7O0FBR0QsU0FBU1EsYUFBVCxDQUF1QkMsTUFBdkIsRUFBK0I7QUFDN0IsU0FBT0EsT0FBT1gsT0FBUCxDQUFlRyxhQUFmLEVBQThCLE1BQTlCLENBQVA7QUFDRDs7QUFHRCxTQUFTN0UsZUFBVCxDQUF5QnNGLElBQXpCLEVBQStCakcsSUFBL0IsRUFBcUNrRyxRQUFyQyxFQUErQztBQUM3QyxNQUFJQyxHQUFKOztBQUVBO0FBQ0FBLFFBQU1ELFNBQVNFLGdCQUFULENBQTBCcEcsSUFBMUIsQ0FBTjs7QUFFQTtBQUNBLE1BQUltRyxRQUFRLEVBQVIsSUFBYyxDQUFDRixLQUFLSSxhQUF4QixFQUF1Q0YsTUFBTUYsS0FBSzFGLEtBQUwsQ0FBV0MsV0FBV1IsSUFBWCxDQUFYLENBQU47O0FBRXZDLFNBQU9tRyxHQUFQO0FBQ0Q7O0FBR0Q7OztBQUdBRyxPQUFPQyxPQUFQLEdBQWlCO0FBQ2Y7QUFDQUMsWUFBVXRILGNBRks7O0FBSWY7QUFDQXVILE9BQUsxRyxTQUxVOztBQU9mO0FBQ0EyRyxZQUFVN0YsY0FSSzs7QUFVZjtBQUNBOEYsT0FBS3hFLFNBWFU7O0FBYWY7QUFDQTBELFVBQVFsQyxZQWRPOztBQWdCZjtBQUNBaUQsTUFBSW5GLFFBakJXOztBQW1CZjtBQUNBb0YsT0FBS3JFLFNBcEJVOztBQXNCZjtBQUNBc0UsU0FBTzVDLFdBdkJROztBQXlCZjtBQUNBNkMsZUFBYTNCLGlCQTFCRTs7QUE0QmY7QUFDQVAsUUFBTXhFLFVBN0JTOztBQStCZjtBQUNBK0MsY0FBWVAsZ0JBaENHOztBQWtDZjtBQUNBWSxhQUFXRjtBQW5DSSxDQUFqQiIsImZpbGUiOiJqcUxpdGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBDU1MvSlMganFMaXRlIG1vZHVsZVxuICogQG1vZHVsZSBsaWIvanFMaXRlXG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5cbi8qKlxuICogQWRkIGEgY2xhc3MgdG8gYW4gZWxlbWVudC5cbiAqIEBwYXJhbSB7RWxlbWVudH0gZWxlbWVudCAtIFRoZSBET00gZWxlbWVudC5cbiAqIEBwYXJhbSB7c3RyaW5nfSBjc3NDbGFzc2VzIC0gU3BhY2Ugc2VwYXJhdGVkIGxpc3Qgb2YgY2xhc3MgbmFtZXMuXG4gKi9cbmZ1bmN0aW9uIGpxTGl0ZUFkZENsYXNzKGVsZW1lbnQsIGNzc0NsYXNzZXMpIHtcbiAgaWYgKCFjc3NDbGFzc2VzIHx8ICFlbGVtZW50LnNldEF0dHJpYnV0ZSkgcmV0dXJuO1xuXG4gIHZhciBleGlzdGluZ0NsYXNzZXMgPSBfZ2V0RXhpc3RpbmdDbGFzc2VzKGVsZW1lbnQpLFxuICAgICAgc3BsaXRDbGFzc2VzID0gY3NzQ2xhc3Nlcy5zcGxpdCgnICcpLFxuICAgICAgY3NzQ2xhc3M7XG5cbiAgZm9yICh2YXIgaT0wOyBpIDwgc3BsaXRDbGFzc2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgY3NzQ2xhc3MgPSBzcGxpdENsYXNzZXNbaV0udHJpbSgpO1xuICAgIGlmIChleGlzdGluZ0NsYXNzZXMuaW5kZXhPZignICcgKyBjc3NDbGFzcyArICcgJykgPT09IC0xKSB7XG4gICAgICBleGlzdGluZ0NsYXNzZXMgKz0gY3NzQ2xhc3MgKyAnICc7XG4gICAgfVxuICB9XG4gIFxuICBlbGVtZW50LnNldEF0dHJpYnV0ZSgnY2xhc3MnLCBleGlzdGluZ0NsYXNzZXMudHJpbSgpKTtcbn1cblxuXG4vKipcbiAqIEdldCBvciBzZXQgQ1NTIHByb3BlcnRpZXMuXG4gKiBAcGFyYW0ge0VsZW1lbnR9IGVsZW1lbnQgLSBUaGUgRE9NIGVsZW1lbnQuXG4gKiBAcGFyYW0ge3N0cmluZ30gW25hbWVdIC0gVGhlIHByb3BlcnR5IG5hbWUuXG4gKiBAcGFyYW0ge3N0cmluZ30gW3ZhbHVlXSAtIFRoZSBwcm9wZXJ0eSB2YWx1ZS5cbiAqL1xuZnVuY3Rpb24ganFMaXRlQ3NzKGVsZW1lbnQsIG5hbWUsIHZhbHVlKSB7XG4gIC8vIFJldHVybiBmdWxsIHN0eWxlIG9iamVjdFxuICBpZiAobmFtZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIGdldENvbXB1dGVkU3R5bGUoZWxlbWVudCk7XG4gIH1cblxuICB2YXIgbmFtZVR5cGUgPSBqcUxpdGVUeXBlKG5hbWUpO1xuXG4gIC8vIFNldCBtdWx0aXBsZSB2YWx1ZXNcbiAgaWYgKG5hbWVUeXBlID09PSAnb2JqZWN0Jykge1xuICAgIGZvciAodmFyIGtleSBpbiBuYW1lKSBlbGVtZW50LnN0eWxlW19jYW1lbENhc2Uoa2V5KV0gPSBuYW1lW2tleV07XG4gICAgcmV0dXJuO1xuICB9XG5cbiAgLy8gU2V0IGEgc2luZ2xlIHZhbHVlXG4gIGlmIChuYW1lVHlwZSA9PT0gJ3N0cmluZycgJiYgdmFsdWUgIT09IHVuZGVmaW5lZCkge1xuICAgIGVsZW1lbnQuc3R5bGVbX2NhbWVsQ2FzZShuYW1lKV0gPSB2YWx1ZTtcbiAgfVxuXG4gIHZhciBzdHlsZU9iaiA9IGdldENvbXB1dGVkU3R5bGUoZWxlbWVudCksXG4gICAgICBpc0FycmF5ID0gKGpxTGl0ZVR5cGUobmFtZSkgPT09ICdhcnJheScpO1xuXG4gIC8vIFJlYWQgc2luZ2xlIHZhbHVlXG4gIGlmICghaXNBcnJheSkgcmV0dXJuIF9nZXRDdXJyQ3NzUHJvcChlbGVtZW50LCBuYW1lLCBzdHlsZU9iaik7XG5cbiAgLy8gUmVhZCBtdWx0aXBsZSB2YWx1ZXNcbiAgdmFyIG91dE9iaiA9IHt9LFxuICAgICAga2V5O1xuXG4gIGZvciAodmFyIGk9MDsgaSA8IG5hbWUubGVuZ3RoOyBpKyspIHtcbiAgICBrZXkgPSBuYW1lW2ldO1xuICAgIG91dE9ialtrZXldID0gX2dldEN1cnJDc3NQcm9wKGVsZW1lbnQsIGtleSwgc3R5bGVPYmopO1xuICB9XG5cbiAgcmV0dXJuIG91dE9iajtcbn1cblxuXG4vKipcbiAqIENoZWNrIGlmIGVsZW1lbnQgaGFzIGNsYXNzLlxuICogQHBhcmFtIHtFbGVtZW50fSBlbGVtZW50IC0gVGhlIERPTSBlbGVtZW50LlxuICogQHBhcmFtIHtzdHJpbmd9IGNscyAtIFRoZSBjbGFzcyBuYW1lIHN0cmluZy5cbiAqL1xuZnVuY3Rpb24ganFMaXRlSGFzQ2xhc3MoZWxlbWVudCwgY2xzKSB7XG4gIGlmICghY2xzIHx8ICFlbGVtZW50LmdldEF0dHJpYnV0ZSkgcmV0dXJuIGZhbHNlO1xuICByZXR1cm4gKF9nZXRFeGlzdGluZ0NsYXNzZXMoZWxlbWVudCkuaW5kZXhPZignICcgKyBjbHMgKyAnICcpID4gLTEpO1xufVxuXG5cbi8qKlxuICogUmV0dXJuIHRoZSB0eXBlIG9mIGEgdmFyaWFibGUuXG4gKiBAcGFyYW0ge30gc29tZXZhciAtIFRoZSBKYXZhU2NyaXB0IHZhcmlhYmxlLlxuICovXG5mdW5jdGlvbiBqcUxpdGVUeXBlKHNvbWV2YXIpIHtcbiAgLy8gaGFuZGxlIHVuZGVmaW5lZFxuICBpZiAoc29tZXZhciA9PT0gdW5kZWZpbmVkKSByZXR1cm4gJ3VuZGVmaW5lZCc7XG5cbiAgLy8gaGFuZGxlIG90aGVycyAob2YgdHlwZSBbb2JqZWN0IDxUeXBlPl0pXG4gIHZhciB0eXBlU3RyID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKHNvbWV2YXIpO1xuICBpZiAodHlwZVN0ci5pbmRleE9mKCdbb2JqZWN0ICcpID09PSAwKSB7XG4gICAgcmV0dXJuIHR5cGVTdHIuc2xpY2UoOCwgLTEpLnRvTG93ZXJDYXNlKCk7XG4gIH0gZWxzZSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKFwiTVVJOiBDb3VsZCBub3QgdW5kZXJzdGFuZCB0eXBlOiBcIiArIHR5cGVTdHIpO1xuICB9ICAgIFxufVxuXG5cbi8qKlxuICogQXR0YWNoIGFuIGV2ZW50IGhhbmRsZXIgdG8gYSBET00gZWxlbWVudFxuICogQHBhcmFtIHtFbGVtZW50fSBlbGVtZW50IC0gVGhlIERPTSBlbGVtZW50LlxuICogQHBhcmFtIHtzdHJpbmd9IGV2ZW50cyAtIFNwYWNlIHNlcGFyYXRlZCBldmVudCBuYW1lcy5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGNhbGxiYWNrIC0gVGhlIGNhbGxiYWNrIGZ1bmN0aW9uLlxuICogQHBhcmFtIHtCb29sZWFufSB1c2VDYXB0dXJlIC0gVXNlIGNhcHR1cmUgZmxhZy5cbiAqL1xuZnVuY3Rpb24ganFMaXRlT24oZWxlbWVudCwgZXZlbnRzLCBjYWxsYmFjaywgdXNlQ2FwdHVyZSkge1xuICB1c2VDYXB0dXJlID0gKHVzZUNhcHR1cmUgPT09IHVuZGVmaW5lZCkgPyBmYWxzZSA6IHVzZUNhcHR1cmU7XG5cbiAgdmFyIGNhY2hlID0gZWxlbWVudC5fbXVpRXZlbnRDYWNoZSA9IGVsZW1lbnQuX211aUV2ZW50Q2FjaGUgfHwge307ICBcblxuICBldmVudHMuc3BsaXQoJyAnKS5tYXAoZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAvLyBhZGQgdG8gRE9NXG4gICAgZWxlbWVudC5hZGRFdmVudExpc3RlbmVyKGV2ZW50LCBjYWxsYmFjaywgdXNlQ2FwdHVyZSk7XG5cbiAgICAvLyBhZGQgdG8gY2FjaGVcbiAgICBjYWNoZVtldmVudF0gPSBjYWNoZVtldmVudF0gfHwgW107XG4gICAgY2FjaGVbZXZlbnRdLnB1c2goW2NhbGxiYWNrLCB1c2VDYXB0dXJlXSk7XG4gIH0pO1xufVxuXG5cbi8qKlxuICogUmVtb3ZlIGFuIGV2ZW50IGhhbmRsZXIgZnJvbSBhIERPTSBlbGVtZW50XG4gKiBAcGFyYW0ge0VsZW1lbnR9IGVsZW1lbnQgLSBUaGUgRE9NIGVsZW1lbnQuXG4gKiBAcGFyYW0ge3N0cmluZ30gZXZlbnRzIC0gU3BhY2Ugc2VwYXJhdGVkIGV2ZW50IG5hbWVzLlxuICogQHBhcmFtIHtGdW5jdGlvbn0gY2FsbGJhY2sgLSBUaGUgY2FsbGJhY2sgZnVuY3Rpb24uXG4gKiBAcGFyYW0ge0Jvb2xlYW59IHVzZUNhcHR1cmUgLSBVc2UgY2FwdHVyZSBmbGFnLlxuICovXG5mdW5jdGlvbiBqcUxpdGVPZmYoZWxlbWVudCwgZXZlbnRzLCBjYWxsYmFjaywgdXNlQ2FwdHVyZSkge1xuICB1c2VDYXB0dXJlID0gKHVzZUNhcHR1cmUgPT09IHVuZGVmaW5lZCkgPyBmYWxzZSA6IHVzZUNhcHR1cmU7XG5cbiAgLy8gcmVtb3ZlIGZyb20gY2FjaGVcbiAgdmFyIGNhY2hlID0gZWxlbWVudC5fbXVpRXZlbnRDYWNoZSA9IGVsZW1lbnQuX211aUV2ZW50Q2FjaGUgfHwge30sXG4gICAgICBhcmdzTGlzdCxcbiAgICAgIGFyZ3MsXG4gICAgICBpO1xuXG4gIGV2ZW50cy5zcGxpdCgnICcpLm1hcChmdW5jdGlvbihldmVudCkge1xuICAgIGFyZ3NMaXN0ID0gY2FjaGVbZXZlbnRdIHx8IFtdO1xuXG4gICAgaSA9IGFyZ3NMaXN0Lmxlbmd0aDtcbiAgICB3aGlsZSAoaS0tKSB7XG4gICAgICBhcmdzID0gYXJnc0xpc3RbaV07XG5cbiAgICAgIC8vIHJlbW92ZSBhbGwgZXZlbnRzIGlmIGNhbGxiYWNrIGlzIHVuZGVmaW5lZFxuICAgICAgaWYgKGNhbGxiYWNrID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAoYXJnc1swXSA9PT0gY2FsbGJhY2sgJiYgYXJnc1sxXSA9PT0gdXNlQ2FwdHVyZSkpIHtcblxuICAgICAgICAvLyByZW1vdmUgZnJvbSBjYWNoZVxuICAgICAgICBhcmdzTGlzdC5zcGxpY2UoaSwgMSk7XG4gICAgICAgIFxuICAgICAgICAvLyByZW1vdmUgZnJvbSBET01cbiAgICAgICAgZWxlbWVudC5yZW1vdmVFdmVudExpc3RlbmVyKGV2ZW50LCBhcmdzWzBdLCBhcmdzWzFdKTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufVxuXG5cbi8qKlxuICogQXR0YWNoIGFuIGV2ZW50IGhhbmRlciB3aGljaCB3aWxsIG9ubHkgZXhlY3V0ZSBvbmNlIHBlciBlbGVtZW50IHBlciBldmVudFxuICogQHBhcmFtIHtFbGVtZW50fSBlbGVtZW50IC0gVGhlIERPTSBlbGVtZW50LlxuICogQHBhcmFtIHtzdHJpbmd9IGV2ZW50cyAtIFNwYWNlIHNlcGFyYXRlZCBldmVudCBuYW1lcy5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGNhbGxiYWNrIC0gVGhlIGNhbGxiYWNrIGZ1bmN0aW9uLlxuICogQHBhcmFtIHtCb29sZWFufSB1c2VDYXB0dXJlIC0gVXNlIGNhcHR1cmUgZmxhZy5cbiAqL1xuZnVuY3Rpb24ganFMaXRlT25lKGVsZW1lbnQsIGV2ZW50cywgY2FsbGJhY2ssIHVzZUNhcHR1cmUpIHtcbiAgZXZlbnRzLnNwbGl0KCcgJykubWFwKGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAganFMaXRlT24oZWxlbWVudCwgZXZlbnQsIGZ1bmN0aW9uIG9uRm4oZXYpIHtcbiAgICAgIC8vIGV4ZWN1dGUgY2FsbGJhY2tcbiAgICAgIGlmIChjYWxsYmFjaykgY2FsbGJhY2suYXBwbHkodGhpcywgYXJndW1lbnRzKTtcblxuICAgICAgLy8gcmVtb3ZlIHdyYXBwZXJcbiAgICAgIGpxTGl0ZU9mZihlbGVtZW50LCBldmVudCwgb25GbiwgdXNlQ2FwdHVyZSk7XG4gICAgfSwgdXNlQ2FwdHVyZSk7XG4gIH0pO1xufVxuXG5cbi8qKlxuICogR2V0IG9yIHNldCBob3Jpem9udGFsIHNjcm9sbCBwb3NpdGlvblxuICogQHBhcmFtIHtFbGVtZW50fSBlbGVtZW50IC0gVGhlIERPTSBlbGVtZW50XG4gKiBAcGFyYW0ge251bWJlcn0gW3ZhbHVlXSAtIFRoZSBzY3JvbGwgcG9zaXRpb25cbiAqL1xuZnVuY3Rpb24ganFMaXRlU2Nyb2xsTGVmdChlbGVtZW50LCB2YWx1ZSkge1xuICB2YXIgd2luID0gd2luZG93O1xuXG4gIC8vIGdldFxuICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCkge1xuICAgIGlmIChlbGVtZW50ID09PSB3aW4pIHtcbiAgICAgIHZhciBkb2NFbCA9IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudDtcbiAgICAgIHJldHVybiAod2luLnBhZ2VYT2Zmc2V0IHx8IGRvY0VsLnNjcm9sbExlZnQpIC0gKGRvY0VsLmNsaWVudExlZnQgfHwgMCk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBlbGVtZW50LnNjcm9sbExlZnQ7XG4gICAgfVxuICB9XG5cbiAgLy8gc2V0XG4gIGlmIChlbGVtZW50ID09PSB3aW4pIHdpbi5zY3JvbGxUbyh2YWx1ZSwganFMaXRlU2Nyb2xsVG9wKHdpbikpO1xuICBlbHNlIGVsZW1lbnQuc2Nyb2xsTGVmdCA9IHZhbHVlO1xufVxuXG5cbi8qKlxuICogR2V0IG9yIHNldCB2ZXJ0aWNhbCBzY3JvbGwgcG9zaXRpb25cbiAqIEBwYXJhbSB7RWxlbWVudH0gZWxlbWVudCAtIFRoZSBET00gZWxlbWVudFxuICogQHBhcmFtIHtudW1iZXJ9IHZhbHVlIC0gVGhlIHNjcm9sbCBwb3NpdGlvblxuICovXG5mdW5jdGlvbiBqcUxpdGVTY3JvbGxUb3AoZWxlbWVudCwgdmFsdWUpIHtcbiAgdmFyIHdpbiA9IHdpbmRvdztcblxuICAvLyBnZXRcbiAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICBpZiAoZWxlbWVudCA9PT0gd2luKSB7XG4gICAgICB2YXIgZG9jRWwgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQ7XG4gICAgICByZXR1cm4gKHdpbi5wYWdlWU9mZnNldCB8fCBkb2NFbC5zY3JvbGxUb3ApIC0gKGRvY0VsLmNsaWVudFRvcCB8fCAwKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGVsZW1lbnQuc2Nyb2xsVG9wO1xuICAgIH1cbiAgfVxuXG4gIC8vIHNldFxuICBpZiAoZWxlbWVudCA9PT0gd2luKSB3aW4uc2Nyb2xsVG8oanFMaXRlU2Nyb2xsTGVmdCh3aW4pLCB2YWx1ZSk7XG4gIGVsc2UgZWxlbWVudC5zY3JvbGxUb3AgPSB2YWx1ZTtcbn1cblxuXG4vKipcbiAqIFJldHVybiBvYmplY3QgcmVwcmVzZW50aW5nIHRvcC9sZWZ0IG9mZnNldCBhbmQgZWxlbWVudCBoZWlnaHQvd2lkdGguXG4gKiBAcGFyYW0ge0VsZW1lbnR9IGVsZW1lbnQgLSBUaGUgRE9NIGVsZW1lbnQuXG4gKi9cbmZ1bmN0aW9uIGpxTGl0ZU9mZnNldChlbGVtZW50KSB7XG4gIHZhciB3aW4gPSB3aW5kb3csXG4gICAgICByZWN0ID0gZWxlbWVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxcbiAgICAgIHNjcm9sbFRvcCA9IGpxTGl0ZVNjcm9sbFRvcCh3aW4pLFxuICAgICAgc2Nyb2xsTGVmdCA9IGpxTGl0ZVNjcm9sbExlZnQod2luKTtcblxuICByZXR1cm4ge1xuICAgIHRvcDogcmVjdC50b3AgKyBzY3JvbGxUb3AsXG4gICAgbGVmdDogcmVjdC5sZWZ0ICsgc2Nyb2xsTGVmdCxcbiAgICBoZWlnaHQ6IHJlY3QuaGVpZ2h0LFxuICAgIHdpZHRoOiByZWN0LndpZHRoXG4gIH07XG59XG5cblxuLyoqXG4gKiBBdHRhY2ggYSBjYWxsYmFjayB0byB0aGUgRE9NIHJlYWR5IGV2ZW50IGxpc3RlbmVyXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBmbiAtIFRoZSBjYWxsYmFjayBmdW5jdGlvbi5cbiAqL1xuZnVuY3Rpb24ganFMaXRlUmVhZHkoZm4pIHtcbiAgdmFyIGRvbmUgPSBmYWxzZSxcbiAgICAgIHRvcCA9IHRydWUsXG4gICAgICBkb2MgPSBkb2N1bWVudCxcbiAgICAgIHdpbiA9IGRvYy5kZWZhdWx0VmlldyxcbiAgICAgIHJvb3QgPSBkb2MuZG9jdW1lbnRFbGVtZW50LFxuICAgICAgYWRkID0gZG9jLmFkZEV2ZW50TGlzdGVuZXIgPyAnYWRkRXZlbnRMaXN0ZW5lcicgOiAnYXR0YWNoRXZlbnQnLFxuICAgICAgcmVtID0gZG9jLmFkZEV2ZW50TGlzdGVuZXIgPyAncmVtb3ZlRXZlbnRMaXN0ZW5lcicgOiAnZGV0YWNoRXZlbnQnLFxuICAgICAgcHJlID0gZG9jLmFkZEV2ZW50TGlzdGVuZXIgPyAnJyA6ICdvbic7XG5cbiAgdmFyIGluaXQgPSBmdW5jdGlvbihlKSB7XG4gICAgaWYgKGUudHlwZSA9PSAncmVhZHlzdGF0ZWNoYW5nZScgJiYgZG9jLnJlYWR5U3RhdGUgIT0gJ2NvbXBsZXRlJykge1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIChlLnR5cGUgPT0gJ2xvYWQnID8gd2luIDogZG9jKVtyZW1dKHByZSArIGUudHlwZSwgaW5pdCwgZmFsc2UpO1xuICAgIGlmICghZG9uZSAmJiAoZG9uZSA9IHRydWUpKSBmbi5jYWxsKHdpbiwgZS50eXBlIHx8IGUpO1xuICB9O1xuXG4gIHZhciBwb2xsID0gZnVuY3Rpb24oKSB7XG4gICAgdHJ5IHsgcm9vdC5kb1Njcm9sbCgnbGVmdCcpOyB9IGNhdGNoKGUpIHsgc2V0VGltZW91dChwb2xsLCA1MCk7IHJldHVybjsgfVxuICAgIGluaXQoJ3BvbGwnKTtcbiAgfTtcblxuICBpZiAoZG9jLnJlYWR5U3RhdGUgPT0gJ2NvbXBsZXRlJykge1xuICAgIGZuLmNhbGwod2luLCAnbGF6eScpO1xuICB9IGVsc2Uge1xuICAgIGlmIChkb2MuY3JlYXRlRXZlbnRPYmplY3QgJiYgcm9vdC5kb1Njcm9sbCkge1xuICAgICAgdHJ5IHsgdG9wID0gIXdpbi5mcmFtZUVsZW1lbnQ7IH0gY2F0Y2goZSkgeyB9XG4gICAgICBpZiAodG9wKSBwb2xsKCk7XG4gICAgfVxuICAgIGRvY1thZGRdKHByZSArICdET01Db250ZW50TG9hZGVkJywgaW5pdCwgZmFsc2UpO1xuICAgIGRvY1thZGRdKHByZSArICdyZWFkeXN0YXRlY2hhbmdlJywgaW5pdCwgZmFsc2UpO1xuICAgIHdpblthZGRdKHByZSArICdsb2FkJywgaW5pdCwgZmFsc2UpO1xuICB9XG59XG5cblxuLyoqXG4gKiBSZW1vdmUgY2xhc3NlcyBmcm9tIGEgRE9NIGVsZW1lbnRcbiAqIEBwYXJhbSB7RWxlbWVudH0gZWxlbWVudCAtIFRoZSBET00gZWxlbWVudC5cbiAqIEBwYXJhbSB7c3RyaW5nfSBjc3NDbGFzc2VzIC0gU3BhY2Ugc2VwYXJhdGVkIGxpc3Qgb2YgY2xhc3MgbmFtZXMuXG4gKi9cbmZ1bmN0aW9uIGpxTGl0ZVJlbW92ZUNsYXNzKGVsZW1lbnQsIGNzc0NsYXNzZXMpIHtcbiAgaWYgKCFjc3NDbGFzc2VzIHx8ICFlbGVtZW50LnNldEF0dHJpYnV0ZSkgcmV0dXJuO1xuXG4gIHZhciBleGlzdGluZ0NsYXNzZXMgPSBfZ2V0RXhpc3RpbmdDbGFzc2VzKGVsZW1lbnQpLFxuICAgICAgc3BsaXRDbGFzc2VzID0gY3NzQ2xhc3Nlcy5zcGxpdCgnICcpLFxuICAgICAgY3NzQ2xhc3M7XG4gIFxuICBmb3IgKHZhciBpPTA7IGkgPCBzcGxpdENsYXNzZXMubGVuZ3RoOyBpKyspIHtcbiAgICBjc3NDbGFzcyA9IHNwbGl0Q2xhc3Nlc1tpXS50cmltKCk7XG4gICAgd2hpbGUgKGV4aXN0aW5nQ2xhc3Nlcy5pbmRleE9mKCcgJyArIGNzc0NsYXNzICsgJyAnKSA+PSAwKSB7XG4gICAgICBleGlzdGluZ0NsYXNzZXMgPSBleGlzdGluZ0NsYXNzZXMucmVwbGFjZSgnICcgKyBjc3NDbGFzcyArICcgJywgJyAnKTtcbiAgICB9XG4gIH1cblxuICBlbGVtZW50LnNldEF0dHJpYnV0ZSgnY2xhc3MnLCBleGlzdGluZ0NsYXNzZXMudHJpbSgpKTtcbn1cblxuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cbi8vIFV0aWxpdGllc1xuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG52YXIgU1BFQ0lBTF9DSEFSU19SRUdFWFAgPSAvKFtcXDpcXC1cXF9dKyguKSkvZyxcbiAgICBNT1pfSEFDS19SRUdFWFAgPSAvXm1veihbQS1aXSkvLFxuICAgIEVTQ0FQRV9SRUdFWFAgPSAvKFsuKis/Xj0hOiR7fSgpfFxcW1xcXVxcL1xcXFxdKS9nO1xuXG5cbmZ1bmN0aW9uIF9nZXRFeGlzdGluZ0NsYXNzZXMoZWxlbWVudCkge1xuICB2YXIgY2xhc3NlcyA9IChlbGVtZW50LmdldEF0dHJpYnV0ZSgnY2xhc3MnKSB8fCAnJykucmVwbGFjZSgvW1xcblxcdF0vZywgJycpO1xuICByZXR1cm4gJyAnICsgY2xhc3NlcyArICcgJztcbn1cblxuXG5mdW5jdGlvbiBfY2FtZWxDYXNlKG5hbWUpIHtcbiAgcmV0dXJuIG5hbWUuXG4gICAgcmVwbGFjZShTUEVDSUFMX0NIQVJTX1JFR0VYUCwgZnVuY3Rpb24oXywgc2VwYXJhdG9yLCBsZXR0ZXIsIG9mZnNldCkge1xuICAgICAgcmV0dXJuIG9mZnNldCA/IGxldHRlci50b1VwcGVyQ2FzZSgpIDogbGV0dGVyO1xuICAgIH0pLlxuICAgIHJlcGxhY2UoTU9aX0hBQ0tfUkVHRVhQLCAnTW96JDEnKTtcbn1cblxuXG5mdW5jdGlvbiBfZXNjYXBlUmVnRXhwKHN0cmluZykge1xuICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoRVNDQVBFX1JFR0VYUCwgXCJcXFxcJDFcIik7XG59XG5cblxuZnVuY3Rpb24gX2dldEN1cnJDc3NQcm9wKGVsZW0sIG5hbWUsIGNvbXB1dGVkKSB7XG4gIHZhciByZXQ7XG5cbiAgLy8gdHJ5IGNvbXB1dGVkIHN0eWxlXG4gIHJldCA9IGNvbXB1dGVkLmdldFByb3BlcnR5VmFsdWUobmFtZSk7XG5cbiAgLy8gdHJ5IHN0eWxlIGF0dHJpYnV0ZSAoaWYgZWxlbWVudCBpcyBub3QgYXR0YWNoZWQgdG8gZG9jdW1lbnQpXG4gIGlmIChyZXQgPT09ICcnICYmICFlbGVtLm93bmVyRG9jdW1lbnQpIHJldCA9IGVsZW0uc3R5bGVbX2NhbWVsQ2FzZShuYW1lKV07XG5cbiAgcmV0dXJuIHJldDtcbn1cblxuXG4vKipcbiAqIE1vZHVsZSBBUElcbiAqL1xubW9kdWxlLmV4cG9ydHMgPSB7XG4gIC8qKiBBZGQgY2xhc3NlcyAqL1xuICBhZGRDbGFzczoganFMaXRlQWRkQ2xhc3MsXG5cbiAgLyoqIEdldCBvciBzZXQgQ1NTIHByb3BlcnRpZXMgKi9cbiAgY3NzOiBqcUxpdGVDc3MsXG5cbiAgLyoqIENoZWNrIGZvciBjbGFzcyAqL1xuICBoYXNDbGFzczoganFMaXRlSGFzQ2xhc3MsXG5cbiAgLyoqIFJlbW92ZSBldmVudCBoYW5kbGVycyAqL1xuICBvZmY6IGpxTGl0ZU9mZixcblxuICAvKiogUmV0dXJuIG9mZnNldCB2YWx1ZXMgKi9cbiAgb2Zmc2V0OiBqcUxpdGVPZmZzZXQsXG5cbiAgLyoqIEFkZCBldmVudCBoYW5kbGVycyAqL1xuICBvbjoganFMaXRlT24sXG5cbiAgLyoqIEFkZCBhbiBleGVjdXRlLW9uY2UgZXZlbnQgaGFuZGxlciAqL1xuICBvbmU6IGpxTGl0ZU9uZSxcblxuICAvKiogRE9NIHJlYWR5IGV2ZW50IGhhbmRsZXIgKi9cbiAgcmVhZHk6IGpxTGl0ZVJlYWR5LFxuXG4gIC8qKiBSZW1vdmUgY2xhc3NlcyAqL1xuICByZW1vdmVDbGFzczoganFMaXRlUmVtb3ZlQ2xhc3MsXG5cbiAgLyoqIENoZWNrIEphdmFTY3JpcHQgdmFyaWFibGUgaW5zdGFuY2UgdHlwZSAqL1xuICB0eXBlOiBqcUxpdGVUeXBlLFxuXG4gIC8qKiBHZXQgb3Igc2V0IGhvcml6b250YWwgc2Nyb2xsIHBvc2l0aW9uICovXG4gIHNjcm9sbExlZnQ6IGpxTGl0ZVNjcm9sbExlZnQsXG5cbiAgLyoqIEdldCBvciBzZXQgdmVydGljYWwgc2Nyb2xsIHBvc2l0aW9uICovXG4gIHNjcm9sbFRvcDoganFMaXRlU2Nyb2xsVG9wXG59O1xuIl19 },{}],7:[function(require,module,exports){ /** * MUI CSS/JS utilities module * @module lib/util */ 'use strict'; var config = require('../config'), jqLite = require('./jqLite'), scrollLock = 0, scrollLockCls = 'mui-scroll-lock', scrollLockPos, scrollStyleEl, scrollEventHandler, _scrollBarWidth, _supportsPointerEvents; scrollEventHandler = function scrollEventHandler(ev) { // stop propagation on window scroll events if (!ev.target.tagName) ev.stopImmediatePropagation(); }; /** * Logging function */ function logFn() { var win = window; if (config.debug && typeof win.console !== "undefined") { try { win.console.log.apply(win.console, arguments); } catch (a) { var e = Array.prototype.slice.call(arguments); win.console.log(e.join("\n")); } } } /** * Load CSS text in new stylesheet * @param {string} cssText - The css text. */ function loadStyleFn(cssText) { var doc = document, head; // copied from jQuery head = doc.head || doc.getElementsByTagName('head')[0] || doc.documentElement; var e = doc.createElement('style'); e.type = 'text/css'; if (e.styleSheet) e.styleSheet.cssText = cssText;else e.appendChild(doc.createTextNode(cssText)); // add to document head.insertBefore(e, head.firstChild); return e; } /** * Raise an error * @param {string} msg - The error message. */ function raiseErrorFn(msg, useConsole) { if (useConsole) { if (typeof console !== 'undefined') console.warn('MUI Warning: ' + msg); } else { throw new Error('MUI: ' + msg); } } /** * Convert Classname object, with class as key and true/false as value, to an * class string. * @param {Object} classes The classes * @return {String} class string */ function classNamesFn(classes) { var cs = ''; for (var i in classes) { cs += classes[i] ? i + ' ' : ''; } return cs.trim(); } /** * Check if client supports pointer events. */ function supportsPointerEventsFn() { // check cache if (_supportsPointerEvents !== undefined) return _supportsPointerEvents; var element = document.createElement('x'); element.style.cssText = 'pointer-events:auto'; _supportsPointerEvents = element.style.pointerEvents === 'auto'; return _supportsPointerEvents; } /** * Create callback closure. * @param {Object} instance - The object instance. * @param {String} funcName - The name of the callback function. */ function callbackFn(instance, funcName) { return function () { instance[funcName].apply(instance, arguments); }; } /** * Dispatch event. * @param {Element} element - The DOM element. * @param {String} eventType - The event type. * @param {Boolean} bubbles=true - If true, event bubbles. * @param {Boolean} cancelable=true = If true, event is cancelable * @param {Object} [data] - Data to add to event object */ function dispatchEventFn(element, eventType, bubbles, cancelable, data) { var ev = document.createEvent('HTMLEvents'), bubbles = bubbles !== undefined ? bubbles : true, cancelable = cancelable !== undefined ? cancelable : true, k; ev.initEvent(eventType, bubbles, cancelable); // add data to event object if (data) for (k in data) { ev[k] = data[k]; } // dispatch if (element) element.dispatchEvent(ev); return ev; } /** * Turn on window scroll lock. */ function enableScrollLockFn() { // increment counter scrollLock += 1; // add lock if (scrollLock === 1) { var doc = document, win = window, htmlEl = doc.documentElement, bodyEl = doc.body, scrollBarWidth = getScrollBarWidth(), cssProps, cssStr, x; // define scroll lock class dynamically cssProps = ['overflow:hidden']; if (scrollBarWidth) { // scrollbar-y if (htmlEl.scrollHeight > htmlEl.clientHeight) { x = parseInt(jqLite.css(bodyEl, 'padding-right')) + scrollBarWidth; cssProps.push('padding-right:' + x + 'px'); } // scrollbar-x if (htmlEl.scrollWidth > htmlEl.clientWidth) { x = parseInt(jqLite.css(bodyEl, 'padding-bottom')) + scrollBarWidth; cssProps.push('padding-bottom:' + x + 'px'); } } // define css class dynamically cssStr = '.' + scrollLockCls + '{'; cssStr += cssProps.join(' !important;') + ' !important;}'; scrollStyleEl = loadStyleFn(cssStr); // cancel 'scroll' event listener callbacks jqLite.on(win, 'scroll', scrollEventHandler, true); // add scroll lock scrollLockPos = { left: jqLite.scrollLeft(win), top: jqLite.scrollTop(win) }; jqLite.addClass(bodyEl, scrollLockCls); } } /** * Turn off window scroll lock. * @param {Boolean} resetPos - Reset scroll position to original value. */ function disableScrollLockFn(resetPos) { // ignore if (scrollLock === 0) return; // decrement counter scrollLock -= 1; // remove lock if (scrollLock === 0) { // remove scroll lock and delete style element jqLite.removeClass(document.body, scrollLockCls); scrollStyleEl.parentNode.removeChild(scrollStyleEl); // restore scroll position if (resetPos) window.scrollTo(scrollLockPos.left, scrollLockPos.top); // restore scroll event listeners jqLite.off(window, 'scroll', scrollEventHandler, true); } } /** * Return scroll bar width. */ var getScrollBarWidth = function getScrollBarWidth() { // check cache if (_scrollBarWidth !== undefined) return _scrollBarWidth; // calculate scroll bar width var doc = document, bodyEl = doc.body, el = doc.createElement('div'); el.innerHTML = '<div style="width:50px;height:50px;position:absolute;' + 'left:-50px;top:-50px;overflow:auto;"><div style="width:1px;' + 'height:100px;"></div></div>'; el = el.firstChild; bodyEl.appendChild(el); _scrollBarWidth = el.offsetWidth - el.clientWidth; bodyEl.removeChild(el); return _scrollBarWidth; }; /** * requestAnimationFrame polyfilled * @param {Function} callback - The callback function */ function requestAnimationFrameFn(callback) { var fn = window.requestAnimationFrame; if (fn) fn(callback);else setTimeout(callback, 0); } /** * Define the module API */ module.exports = { /** Create callback closures */ callback: callbackFn, /** Classnames object to string */ classNames: classNamesFn, /** Disable scroll lock */ disableScrollLock: disableScrollLockFn, /** Dispatch event */ dispatchEvent: dispatchEventFn, /** Enable scroll lock */ enableScrollLock: enableScrollLockFn, /** Log messages to the console when debug is turned on */ log: logFn, /** Load CSS text as new stylesheet */ loadStyle: loadStyleFn, /** Raise MUI error */ raiseError: raiseErrorFn, /** Request animation frame */ requestAnimationFrame: requestAnimationFrameFn, /** Support Pointer Events check */ supportsPointerEvents: supportsPointerEventsFn }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInV0aWwuanMiXSwibmFtZXMiOlsiY29uZmlnIiwicmVxdWlyZSIsImpxTGl0ZSIsInNjcm9sbExvY2siLCJzY3JvbGxMb2NrQ2xzIiwic2Nyb2xsTG9ja1BvcyIsInNjcm9sbFN0eWxlRWwiLCJzY3JvbGxFdmVudEhhbmRsZXIiLCJfc2Nyb2xsQmFyV2lkdGgiLCJfc3VwcG9ydHNQb2ludGVyRXZlbnRzIiwiZXYiLCJ0YXJnZXQiLCJ0YWdOYW1lIiwic3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uIiwibG9nRm4iLCJ3aW4iLCJ3aW5kb3ciLCJkZWJ1ZyIsImNvbnNvbGUiLCJsb2ciLCJhcHBseSIsImFyZ3VtZW50cyIsImEiLCJlIiwiQXJyYXkiLCJwcm90b3R5cGUiLCJzbGljZSIsImNhbGwiLCJqb2luIiwibG9hZFN0eWxlRm4iLCJjc3NUZXh0IiwiZG9jIiwiZG9jdW1lbnQiLCJoZWFkIiwiZ2V0RWxlbWVudHNCeVRhZ05hbWUiLCJkb2N1bWVudEVsZW1lbnQiLCJjcmVhdGVFbGVtZW50IiwidHlwZSIsInN0eWxlU2hlZXQiLCJhcHBlbmRDaGlsZCIsImNyZWF0ZVRleHROb2RlIiwiaW5zZXJ0QmVmb3JlIiwiZmlyc3RDaGlsZCIsInJhaXNlRXJyb3JGbiIsIm1zZyIsInVzZUNvbnNvbGUiLCJ3YXJuIiwiRXJyb3IiLCJjbGFzc05hbWVzRm4iLCJjbGFzc2VzIiwiY3MiLCJpIiwidHJpbSIsInN1cHBvcnRzUG9pbnRlckV2ZW50c0ZuIiwidW5kZWZpbmVkIiwiZWxlbWVudCIsInN0eWxlIiwicG9pbnRlckV2ZW50cyIsImNhbGxiYWNrRm4iLCJpbnN0YW5jZSIsImZ1bmNOYW1lIiwiZGlzcGF0Y2hFdmVudEZuIiwiZXZlbnRUeXBlIiwiYnViYmxlcyIsImNhbmNlbGFibGUiLCJkYXRhIiwiY3JlYXRlRXZlbnQiLCJrIiwiaW5pdEV2ZW50IiwiZGlzcGF0Y2hFdmVudCIsImVuYWJsZVNjcm9sbExvY2tGbiIsImh0bWxFbCIsImJvZHlFbCIsImJvZHkiLCJzY3JvbGxCYXJXaWR0aCIsImdldFNjcm9sbEJhcldpZHRoIiwiY3NzUHJvcHMiLCJjc3NTdHIiLCJ4Iiwic2Nyb2xsSGVpZ2h0IiwiY2xpZW50SGVpZ2h0IiwicGFyc2VJbnQiLCJjc3MiLCJwdXNoIiwic2Nyb2xsV2lkdGgiLCJjbGllbnRXaWR0aCIsIm9uIiwibGVmdCIsInNjcm9sbExlZnQiLCJ0b3AiLCJzY3JvbGxUb3AiLCJhZGRDbGFzcyIsImRpc2FibGVTY3JvbGxMb2NrRm4iLCJyZXNldFBvcyIsInJlbW92ZUNsYXNzIiwicGFyZW50Tm9kZSIsInJlbW92ZUNoaWxkIiwic2Nyb2xsVG8iLCJvZmYiLCJlbCIsImlubmVySFRNTCIsIm9mZnNldFdpZHRoIiwicmVxdWVzdEFuaW1hdGlvbkZyYW1lRm4iLCJjYWxsYmFjayIsImZuIiwicmVxdWVzdEFuaW1hdGlvbkZyYW1lIiwic2V0VGltZW91dCIsIm1vZHVsZSIsImV4cG9ydHMiLCJjbGFzc05hbWVzIiwiZGlzYWJsZVNjcm9sbExvY2siLCJlbmFibGVTY3JvbGxMb2NrIiwibG9hZFN0eWxlIiwicmFpc2VFcnJvciIsInN1cHBvcnRzUG9pbnRlckV2ZW50cyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7O0FBR0EsSUFBSUEsU0FBU0MsUUFBUSxXQUFSLENBQWI7QUFBQSxJQUNJQyxTQUFTRCxRQUFRLFVBQVIsQ0FEYjtBQUFBLElBRUlFLGFBQWEsQ0FGakI7QUFBQSxJQUdJQyxnQkFBZ0IsaUJBSHBCO0FBQUEsSUFJSUMsYUFKSjtBQUFBLElBS0lDLGFBTEo7QUFBQSxJQU1JQyxrQkFOSjtBQUFBLElBT0lDLGVBUEo7QUFBQSxJQVFJQyxzQkFSSjs7QUFXQUYscUJBQXFCLDRCQUFTRyxFQUFULEVBQWE7QUFDaEM7QUFDQSxNQUFJLENBQUNBLEdBQUdDLE1BQUgsQ0FBVUMsT0FBZixFQUF3QkYsR0FBR0csd0JBQUg7QUFDekIsQ0FIRDs7QUFNQTs7O0FBR0EsU0FBU0MsS0FBVCxHQUFpQjtBQUNmLE1BQUlDLE1BQU1DLE1BQVY7O0FBRUEsTUFBSWhCLE9BQU9pQixLQUFQLElBQWdCLE9BQU9GLElBQUlHLE9BQVgsS0FBdUIsV0FBM0MsRUFBd0Q7QUFDdEQsUUFBSTtBQUNGSCxVQUFJRyxPQUFKLENBQVlDLEdBQVosQ0FBZ0JDLEtBQWhCLENBQXNCTCxJQUFJRyxPQUExQixFQUFtQ0csU0FBbkM7QUFDRCxLQUZELENBRUUsT0FBT0MsQ0FBUCxFQUFVO0FBQ1YsVUFBSUMsSUFBSUMsTUFBTUMsU0FBTixDQUFnQkMsS0FBaEIsQ0FBc0JDLElBQXRCLENBQTJCTixTQUEzQixDQUFSO0FBQ0FOLFVBQUlHLE9BQUosQ0FBWUMsR0FBWixDQUFnQkksRUFBRUssSUFBRixDQUFPLElBQVAsQ0FBaEI7QUFDRDtBQUNGO0FBQ0Y7O0FBR0Q7Ozs7QUFJQSxTQUFTQyxXQUFULENBQXFCQyxPQUFyQixFQUE4QjtBQUM1QixNQUFJQyxNQUFNQyxRQUFWO0FBQUEsTUFDSUMsSUFESjs7QUFHQTtBQUNBQSxTQUFPRixJQUFJRSxJQUFKLElBQ0xGLElBQUlHLG9CQUFKLENBQXlCLE1BQXpCLEVBQWlDLENBQWpDLENBREssSUFFTEgsSUFBSUksZUFGTjs7QUFJQSxNQUFJWixJQUFJUSxJQUFJSyxhQUFKLENBQWtCLE9BQWxCLENBQVI7QUFDQWIsSUFBRWMsSUFBRixHQUFTLFVBQVQ7O0FBRUEsTUFBSWQsRUFBRWUsVUFBTixFQUFrQmYsRUFBRWUsVUFBRixDQUFhUixPQUFiLEdBQXVCQSxPQUF2QixDQUFsQixLQUNLUCxFQUFFZ0IsV0FBRixDQUFjUixJQUFJUyxjQUFKLENBQW1CVixPQUFuQixDQUFkOztBQUVMO0FBQ0FHLE9BQUtRLFlBQUwsQ0FBa0JsQixDQUFsQixFQUFxQlUsS0FBS1MsVUFBMUI7O0FBRUEsU0FBT25CLENBQVA7QUFDRDs7QUFHRDs7OztBQUlBLFNBQVNvQixZQUFULENBQXNCQyxHQUF0QixFQUEyQkMsVUFBM0IsRUFBdUM7QUFDckMsTUFBSUEsVUFBSixFQUFnQjtBQUNkLFFBQUksT0FBTzNCLE9BQVAsS0FBbUIsV0FBdkIsRUFBb0NBLFFBQVE0QixJQUFSLENBQWEsa0JBQWtCRixHQUEvQjtBQUNyQyxHQUZELE1BRU87QUFDTCxVQUFNLElBQUlHLEtBQUosQ0FBVSxVQUFVSCxHQUFwQixDQUFOO0FBQ0Q7QUFDRjs7QUFHRDs7Ozs7O0FBTUEsU0FBU0ksWUFBVCxDQUFzQkMsT0FBdEIsRUFBK0I7QUFDN0IsTUFBSUMsS0FBSyxFQUFUO0FBQ0EsT0FBSyxJQUFJQyxDQUFULElBQWNGLE9BQWQsRUFBdUI7QUFDckJDLFVBQU9ELFFBQVFFLENBQVIsQ0FBRCxHQUFlQSxJQUFJLEdBQW5CLEdBQXlCLEVBQS9CO0FBQ0Q7QUFDRCxTQUFPRCxHQUFHRSxJQUFILEVBQVA7QUFDRDs7QUFHRDs7O0FBR0EsU0FBU0MsdUJBQVQsR0FBbUM7QUFDakM7QUFDQSxNQUFJNUMsMkJBQTJCNkMsU0FBL0IsRUFBMEMsT0FBTzdDLHNCQUFQOztBQUUxQyxNQUFJOEMsVUFBVXZCLFNBQVNJLGFBQVQsQ0FBdUIsR0FBdkIsQ0FBZDtBQUNBbUIsVUFBUUMsS0FBUixDQUFjMUIsT0FBZCxHQUF3QixxQkFBeEI7QUFDQXJCLDJCQUEwQjhDLFFBQVFDLEtBQVIsQ0FBY0MsYUFBZCxLQUFnQyxNQUExRDtBQUNBLFNBQU9oRCxzQkFBUDtBQUNEOztBQUdEOzs7OztBQUtBLFNBQVNpRCxVQUFULENBQW9CQyxRQUFwQixFQUE4QkMsUUFBOUIsRUFBd0M7QUFDdEMsU0FBTyxZQUFXO0FBQUNELGFBQVNDLFFBQVQsRUFBbUJ4QyxLQUFuQixDQUF5QnVDLFFBQXpCLEVBQW1DdEMsU0FBbkM7QUFBK0MsR0FBbEU7QUFDRDs7QUFHRDs7Ozs7Ozs7QUFRQSxTQUFTd0MsZUFBVCxDQUF5Qk4sT0FBekIsRUFBa0NPLFNBQWxDLEVBQTZDQyxPQUE3QyxFQUFzREMsVUFBdEQsRUFBa0VDLElBQWxFLEVBQXdFO0FBQ3RFLE1BQUl2RCxLQUFLc0IsU0FBU2tDLFdBQVQsQ0FBcUIsWUFBckIsQ0FBVDtBQUFBLE1BQ0lILFVBQVdBLFlBQVlULFNBQWIsR0FBMEJTLE9BQTFCLEdBQW9DLElBRGxEO0FBQUEsTUFFS0MsYUFBY0EsZUFBZVYsU0FBaEIsR0FBNkJVLFVBQTdCLEdBQTBDLElBRjVEO0FBQUEsTUFHS0csQ0FITDs7QUFLQXpELEtBQUcwRCxTQUFILENBQWFOLFNBQWIsRUFBd0JDLE9BQXhCLEVBQWlDQyxVQUFqQzs7QUFFQTtBQUNBLE1BQUlDLElBQUosRUFBVSxLQUFLRSxDQUFMLElBQVVGLElBQVY7QUFBZ0J2RCxPQUFHeUQsQ0FBSCxJQUFRRixLQUFLRSxDQUFMLENBQVI7QUFBaEIsR0FUNEQsQ0FXdEU7QUFDQSxNQUFJWixPQUFKLEVBQWFBLFFBQVFjLGFBQVIsQ0FBc0IzRCxFQUF0Qjs7QUFFYixTQUFPQSxFQUFQO0FBQ0Q7O0FBR0Q7OztBQUdBLFNBQVM0RCxrQkFBVCxHQUE4QjtBQUM1QjtBQUNBbkUsZ0JBQWMsQ0FBZDs7QUFFQTtBQUNBLE1BQUlBLGVBQWUsQ0FBbkIsRUFBc0I7QUFDcEIsUUFBSTRCLE1BQU1DLFFBQVY7QUFBQSxRQUNJakIsTUFBTUMsTUFEVjtBQUFBLFFBRUl1RCxTQUFTeEMsSUFBSUksZUFGakI7QUFBQSxRQUdJcUMsU0FBU3pDLElBQUkwQyxJQUhqQjtBQUFBLFFBSUlDLGlCQUFpQkMsbUJBSnJCO0FBQUEsUUFLSUMsUUFMSjtBQUFBLFFBTUlDLE1BTko7QUFBQSxRQU9JQyxDQVBKOztBQVNBO0FBQ0FGLGVBQVcsQ0FBQyxpQkFBRCxDQUFYOztBQUVBLFFBQUlGLGNBQUosRUFBb0I7QUFDbEI7QUFDQSxVQUFJSCxPQUFPUSxZQUFQLEdBQXNCUixPQUFPUyxZQUFqQyxFQUErQztBQUM3Q0YsWUFBSUcsU0FBUy9FLE9BQU9nRixHQUFQLENBQVdWLE1BQVgsRUFBbUIsZUFBbkIsQ0FBVCxJQUFnREUsY0FBcEQ7QUFDQUUsaUJBQVNPLElBQVQsQ0FBYyxtQkFBbUJMLENBQW5CLEdBQXVCLElBQXJDO0FBQ0Q7O0FBRUQ7QUFDQSxVQUFJUCxPQUFPYSxXQUFQLEdBQXFCYixPQUFPYyxXQUFoQyxFQUE2QztBQUMzQ1AsWUFBSUcsU0FBUy9FLE9BQU9nRixHQUFQLENBQVdWLE1BQVgsRUFBbUIsZ0JBQW5CLENBQVQsSUFBaURFLGNBQXJEO0FBQ0FFLGlCQUFTTyxJQUFULENBQWMsb0JBQW9CTCxDQUFwQixHQUF3QixJQUF0QztBQUNEO0FBQ0Y7O0FBRUQ7QUFDQUQsYUFBUyxNQUFNekUsYUFBTixHQUFzQixHQUEvQjtBQUNBeUUsY0FBVUQsU0FBU2hELElBQVQsQ0FBYyxjQUFkLElBQWdDLGVBQTFDO0FBQ0F0QixvQkFBZ0J1QixZQUFZZ0QsTUFBWixDQUFoQjs7QUFFQTtBQUNBM0UsV0FBT29GLEVBQVAsQ0FBVXZFLEdBQVYsRUFBZSxRQUFmLEVBQXlCUixrQkFBekIsRUFBNkMsSUFBN0M7O0FBRUE7QUFDQUYsb0JBQWdCLEVBQUNrRixNQUFNckYsT0FBT3NGLFVBQVAsQ0FBa0J6RSxHQUFsQixDQUFQLEVBQStCMEUsS0FBS3ZGLE9BQU93RixTQUFQLENBQWlCM0UsR0FBakIsQ0FBcEMsRUFBaEI7QUFDQWIsV0FBT3lGLFFBQVAsQ0FBZ0JuQixNQUFoQixFQUF3QnBFLGFBQXhCO0FBQ0Q7QUFDRjs7QUFHRDs7OztBQUlBLFNBQVN3RixtQkFBVCxDQUE2QkMsUUFBN0IsRUFBdUM7QUFDckM7QUFDQSxNQUFJMUYsZUFBZSxDQUFuQixFQUFzQjs7QUFFdEI7QUFDQUEsZ0JBQWMsQ0FBZDs7QUFFQTtBQUNBLE1BQUlBLGVBQWUsQ0FBbkIsRUFBc0I7QUFDcEI7QUFDQUQsV0FBTzRGLFdBQVAsQ0FBbUI5RCxTQUFTeUMsSUFBNUIsRUFBa0NyRSxhQUFsQztBQUNBRSxrQkFBY3lGLFVBQWQsQ0FBeUJDLFdBQXpCLENBQXFDMUYsYUFBckM7O0FBRUE7QUFDQSxRQUFJdUYsUUFBSixFQUFjN0UsT0FBT2lGLFFBQVAsQ0FBZ0I1RixjQUFja0YsSUFBOUIsRUFBb0NsRixjQUFjb0YsR0FBbEQ7O0FBRWQ7QUFDQXZGLFdBQU9nRyxHQUFQLENBQVdsRixNQUFYLEVBQW1CLFFBQW5CLEVBQTZCVCxrQkFBN0IsRUFBaUQsSUFBakQ7QUFDRDtBQUNGOztBQUVEOzs7QUFHQSxJQUFJb0Usb0JBQW9CLFNBQXBCQSxpQkFBb0IsR0FBVztBQUNqQztBQUNBLE1BQUluRSxvQkFBb0I4QyxTQUF4QixFQUFtQyxPQUFPOUMsZUFBUDs7QUFFbkM7QUFDQSxNQUFJdUIsTUFBTUMsUUFBVjtBQUFBLE1BQ0l3QyxTQUFTekMsSUFBSTBDLElBRGpCO0FBQUEsTUFFSTBCLEtBQUtwRSxJQUFJSyxhQUFKLENBQWtCLEtBQWxCLENBRlQ7O0FBSUErRCxLQUFHQyxTQUFILEdBQWUsMERBQ2IsNkRBRGEsR0FFYiw2QkFGRjtBQUdBRCxPQUFLQSxHQUFHekQsVUFBUjtBQUNBOEIsU0FBT2pDLFdBQVAsQ0FBbUI0RCxFQUFuQjtBQUNBM0Ysb0JBQWtCMkYsR0FBR0UsV0FBSCxHQUFpQkYsR0FBR2QsV0FBdEM7QUFDQWIsU0FBT3dCLFdBQVAsQ0FBbUJHLEVBQW5COztBQUVBLFNBQU8zRixlQUFQO0FBQ0QsQ0FsQkQ7O0FBcUJBOzs7O0FBSUEsU0FBUzhGLHVCQUFULENBQWlDQyxRQUFqQyxFQUEyQztBQUN6QyxNQUFJQyxLQUFLeEYsT0FBT3lGLHFCQUFoQjtBQUNBLE1BQUlELEVBQUosRUFBUUEsR0FBR0QsUUFBSCxFQUFSLEtBQ0tHLFdBQVdILFFBQVgsRUFBcUIsQ0FBckI7QUFDTjs7QUFHRDs7O0FBR0FJLE9BQU9DLE9BQVAsR0FBaUI7QUFDZjtBQUNBTCxZQUFVN0MsVUFGSzs7QUFJZjtBQUNBbUQsY0FBWTdELFlBTEc7O0FBT2Y7QUFDQThELHFCQUFtQmxCLG1CQVJKOztBQVVmO0FBQ0F2QixpQkFBZVIsZUFYQTs7QUFhZjtBQUNBa0Qsb0JBQWtCekMsa0JBZEg7O0FBZ0JmO0FBQ0FuRCxPQUFLTCxLQWpCVTs7QUFtQmY7QUFDQWtHLGFBQVduRixXQXBCSTs7QUFzQmY7QUFDQW9GLGNBQVl0RSxZQXZCRzs7QUF5QmY7QUFDQThELHlCQUF1QkgsdUJBMUJSOztBQTRCZjtBQUNBWSx5QkFBdUI3RDtBQTdCUixDQUFqQiIsImZpbGUiOiJ1dGlsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgQ1NTL0pTIHV0aWxpdGllcyBtb2R1bGVcbiAqIEBtb2R1bGUgbGliL3V0aWxcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cblxudmFyIGNvbmZpZyA9IHJlcXVpcmUoJy4uL2NvbmZpZycpLFxuICAgIGpxTGl0ZSA9IHJlcXVpcmUoJy4vanFMaXRlJyksXG4gICAgc2Nyb2xsTG9jayA9IDAsXG4gICAgc2Nyb2xsTG9ja0NscyA9ICdtdWktc2Nyb2xsLWxvY2snLFxuICAgIHNjcm9sbExvY2tQb3MsXG4gICAgc2Nyb2xsU3R5bGVFbCxcbiAgICBzY3JvbGxFdmVudEhhbmRsZXIsXG4gICAgX3Njcm9sbEJhcldpZHRoLFxuICAgIF9zdXBwb3J0c1BvaW50ZXJFdmVudHM7XG5cblxuc2Nyb2xsRXZlbnRIYW5kbGVyID0gZnVuY3Rpb24oZXYpIHtcbiAgLy8gc3RvcCBwcm9wYWdhdGlvbiBvbiB3aW5kb3cgc2Nyb2xsIGV2ZW50c1xuICBpZiAoIWV2LnRhcmdldC50YWdOYW1lKSBldi5zdG9wSW1tZWRpYXRlUHJvcGFnYXRpb24oKTtcbn1cblxuXG4vKipcbiAqIExvZ2dpbmcgZnVuY3Rpb25cbiAqL1xuZnVuY3Rpb24gbG9nRm4oKSB7XG4gIHZhciB3aW4gPSB3aW5kb3c7XG4gIFxuICBpZiAoY29uZmlnLmRlYnVnICYmIHR5cGVvZiB3aW4uY29uc29sZSAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgIHRyeSB7XG4gICAgICB3aW4uY29uc29sZS5sb2cuYXBwbHkod2luLmNvbnNvbGUsIGFyZ3VtZW50cyk7XG4gICAgfSBjYXRjaCAoYSkge1xuICAgICAgdmFyIGUgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpO1xuICAgICAgd2luLmNvbnNvbGUubG9nKGUuam9pbihcIlxcblwiKSk7XG4gICAgfVxuICB9XG59XG5cblxuLyoqXG4gKiBMb2FkIENTUyB0ZXh0IGluIG5ldyBzdHlsZXNoZWV0XG4gKiBAcGFyYW0ge3N0cmluZ30gY3NzVGV4dCAtIFRoZSBjc3MgdGV4dC5cbiAqL1xuZnVuY3Rpb24gbG9hZFN0eWxlRm4oY3NzVGV4dCkge1xuICB2YXIgZG9jID0gZG9jdW1lbnQsXG4gICAgICBoZWFkO1xuICBcbiAgLy8gY29waWVkIGZyb20galF1ZXJ5IFxuICBoZWFkID0gZG9jLmhlYWQgfHxcbiAgICBkb2MuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2hlYWQnKVswXSB8fFxuICAgIGRvYy5kb2N1bWVudEVsZW1lbnQ7XG4gIFxuICB2YXIgZSA9IGRvYy5jcmVhdGVFbGVtZW50KCdzdHlsZScpO1xuICBlLnR5cGUgPSAndGV4dC9jc3MnO1xuICBcbiAgaWYgKGUuc3R5bGVTaGVldCkgZS5zdHlsZVNoZWV0LmNzc1RleHQgPSBjc3NUZXh0O1xuICBlbHNlIGUuYXBwZW5kQ2hpbGQoZG9jLmNyZWF0ZVRleHROb2RlKGNzc1RleHQpKTtcbiAgXG4gIC8vIGFkZCB0byBkb2N1bWVudFxuICBoZWFkLmluc2VydEJlZm9yZShlLCBoZWFkLmZpcnN0Q2hpbGQpO1xuICBcbiAgcmV0dXJuIGU7XG59XG5cblxuLyoqXG4gKiBSYWlzZSBhbiBlcnJvclxuICogQHBhcmFtIHtzdHJpbmd9IG1zZyAtIFRoZSBlcnJvciBtZXNzYWdlLlxuICovXG5mdW5jdGlvbiByYWlzZUVycm9yRm4obXNnLCB1c2VDb25zb2xlKSB7XG4gIGlmICh1c2VDb25zb2xlKSB7XG4gICAgaWYgKHR5cGVvZiBjb25zb2xlICE9PSAndW5kZWZpbmVkJykgY29uc29sZS53YXJuKCdNVUkgV2FybmluZzogJyArIG1zZyk7XG4gIH0gZWxzZSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdNVUk6ICcgKyBtc2cpO1xuICB9XG59XG5cblxuLyoqXG4gKiBDb252ZXJ0IENsYXNzbmFtZSBvYmplY3QsIHdpdGggY2xhc3MgYXMga2V5IGFuZCB0cnVlL2ZhbHNlIGFzIHZhbHVlLCB0byBhblxuICogY2xhc3Mgc3RyaW5nLlxuICogQHBhcmFtICB7T2JqZWN0fSBjbGFzc2VzIFRoZSBjbGFzc2VzXG4gKiBAcmV0dXJuIHtTdHJpbmd9ICAgICAgICAgY2xhc3Mgc3RyaW5nXG4gKi9cbmZ1bmN0aW9uIGNsYXNzTmFtZXNGbihjbGFzc2VzKSB7XG4gIHZhciBjcyA9ICcnO1xuICBmb3IgKHZhciBpIGluIGNsYXNzZXMpIHtcbiAgICBjcyArPSAoY2xhc3Nlc1tpXSkgPyBpICsgJyAnIDogJyc7XG4gIH1cbiAgcmV0dXJuIGNzLnRyaW0oKTtcbn1cblxuXG4vKipcbiAqIENoZWNrIGlmIGNsaWVudCBzdXBwb3J0cyBwb2ludGVyIGV2ZW50cy5cbiAqL1xuZnVuY3Rpb24gc3VwcG9ydHNQb2ludGVyRXZlbnRzRm4oKSB7XG4gIC8vIGNoZWNrIGNhY2hlXG4gIGlmIChfc3VwcG9ydHNQb2ludGVyRXZlbnRzICE9PSB1bmRlZmluZWQpIHJldHVybiBfc3VwcG9ydHNQb2ludGVyRXZlbnRzO1xuICBcbiAgdmFyIGVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCd4Jyk7XG4gIGVsZW1lbnQuc3R5bGUuY3NzVGV4dCA9ICdwb2ludGVyLWV2ZW50czphdXRvJztcbiAgX3N1cHBvcnRzUG9pbnRlckV2ZW50cyA9IChlbGVtZW50LnN0eWxlLnBvaW50ZXJFdmVudHMgPT09ICdhdXRvJyk7XG4gIHJldHVybiBfc3VwcG9ydHNQb2ludGVyRXZlbnRzO1xufVxuXG5cbi8qKlxuICogQ3JlYXRlIGNhbGxiYWNrIGNsb3N1cmUuXG4gKiBAcGFyYW0ge09iamVjdH0gaW5zdGFuY2UgLSBUaGUgb2JqZWN0IGluc3RhbmNlLlxuICogQHBhcmFtIHtTdHJpbmd9IGZ1bmNOYW1lIC0gVGhlIG5hbWUgb2YgdGhlIGNhbGxiYWNrIGZ1bmN0aW9uLlxuICovXG5mdW5jdGlvbiBjYWxsYmFja0ZuKGluc3RhbmNlLCBmdW5jTmFtZSkge1xuICByZXR1cm4gZnVuY3Rpb24oKSB7aW5zdGFuY2VbZnVuY05hbWVdLmFwcGx5KGluc3RhbmNlLCBhcmd1bWVudHMpO307XG59XG5cblxuLyoqXG4gKiBEaXNwYXRjaCBldmVudC5cbiAqIEBwYXJhbSB7RWxlbWVudH0gZWxlbWVudCAtIFRoZSBET00gZWxlbWVudC5cbiAqIEBwYXJhbSB7U3RyaW5nfSBldmVudFR5cGUgLSBUaGUgZXZlbnQgdHlwZS5cbiAqIEBwYXJhbSB7Qm9vbGVhbn0gYnViYmxlcz10cnVlIC0gSWYgdHJ1ZSwgZXZlbnQgYnViYmxlcy5cbiAqIEBwYXJhbSB7Qm9vbGVhbn0gY2FuY2VsYWJsZT10cnVlID0gSWYgdHJ1ZSwgZXZlbnQgaXMgY2FuY2VsYWJsZVxuICogQHBhcmFtIHtPYmplY3R9IFtkYXRhXSAtIERhdGEgdG8gYWRkIHRvIGV2ZW50IG9iamVjdFxuICovXG5mdW5jdGlvbiBkaXNwYXRjaEV2ZW50Rm4oZWxlbWVudCwgZXZlbnRUeXBlLCBidWJibGVzLCBjYW5jZWxhYmxlLCBkYXRhKSB7XG4gIHZhciBldiA9IGRvY3VtZW50LmNyZWF0ZUV2ZW50KCdIVE1MRXZlbnRzJyksXG4gICAgICBidWJibGVzID0gKGJ1YmJsZXMgIT09IHVuZGVmaW5lZCkgPyBidWJibGVzIDogdHJ1ZSxcbiAgICAgICBjYW5jZWxhYmxlID0gKGNhbmNlbGFibGUgIT09IHVuZGVmaW5lZCkgPyBjYW5jZWxhYmxlIDogdHJ1ZSxcbiAgICAgICBrO1xuXG4gIGV2LmluaXRFdmVudChldmVudFR5cGUsIGJ1YmJsZXMsIGNhbmNlbGFibGUpO1xuICBcbiAgLy8gYWRkIGRhdGEgdG8gZXZlbnQgb2JqZWN0XG4gIGlmIChkYXRhKSBmb3IgKGsgaW4gZGF0YSkgZXZba10gPSBkYXRhW2tdO1xuICBcbiAgLy8gZGlzcGF0Y2hcbiAgaWYgKGVsZW1lbnQpIGVsZW1lbnQuZGlzcGF0Y2hFdmVudChldik7XG4gIFxuICByZXR1cm4gZXY7XG59XG5cblxuLyoqXG4gKiBUdXJuIG9uIHdpbmRvdyBzY3JvbGwgbG9jay5cbiAqL1xuZnVuY3Rpb24gZW5hYmxlU2Nyb2xsTG9ja0ZuKCkge1xuICAvLyBpbmNyZW1lbnQgY291bnRlclxuICBzY3JvbGxMb2NrICs9IDE7XG4gIFxuICAvLyBhZGQgbG9ja1xuICBpZiAoc2Nyb2xsTG9jayA9PT0gMSkge1xuICAgIHZhciBkb2MgPSBkb2N1bWVudCxcbiAgICAgICAgd2luID0gd2luZG93LFxuICAgICAgICBodG1sRWwgPSBkb2MuZG9jdW1lbnRFbGVtZW50LFxuICAgICAgICBib2R5RWwgPSBkb2MuYm9keSxcbiAgICAgICAgc2Nyb2xsQmFyV2lkdGggPSBnZXRTY3JvbGxCYXJXaWR0aCgpLFxuICAgICAgICBjc3NQcm9wcyxcbiAgICAgICAgY3NzU3RyLFxuICAgICAgICB4O1xuXG4gICAgLy8gZGVmaW5lIHNjcm9sbCBsb2NrIGNsYXNzIGR5bmFtaWNhbGx5XG4gICAgY3NzUHJvcHMgPSBbJ292ZXJmbG93OmhpZGRlbiddO1xuXG4gICAgaWYgKHNjcm9sbEJhcldpZHRoKSB7XG4gICAgICAvLyBzY3JvbGxiYXIteVxuICAgICAgaWYgKGh0bWxFbC5zY3JvbGxIZWlnaHQgPiBodG1sRWwuY2xpZW50SGVpZ2h0KSB7XG4gICAgICAgIHggPSBwYXJzZUludChqcUxpdGUuY3NzKGJvZHlFbCwgJ3BhZGRpbmctcmlnaHQnKSkgKyBzY3JvbGxCYXJXaWR0aDtcbiAgICAgICAgY3NzUHJvcHMucHVzaCgncGFkZGluZy1yaWdodDonICsgeCArICdweCcpO1xuICAgICAgfVxuICAgIFxuICAgICAgLy8gc2Nyb2xsYmFyLXhcbiAgICAgIGlmIChodG1sRWwuc2Nyb2xsV2lkdGggPiBodG1sRWwuY2xpZW50V2lkdGgpIHtcbiAgICAgICAgeCA9IHBhcnNlSW50KGpxTGl0ZS5jc3MoYm9keUVsLCAncGFkZGluZy1ib3R0b20nKSkgKyBzY3JvbGxCYXJXaWR0aDtcbiAgICAgICAgY3NzUHJvcHMucHVzaCgncGFkZGluZy1ib3R0b206JyArIHggKyAncHgnKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBkZWZpbmUgY3NzIGNsYXNzIGR5bmFtaWNhbGx5XG4gICAgY3NzU3RyID0gJy4nICsgc2Nyb2xsTG9ja0NscyArICd7JztcbiAgICBjc3NTdHIgKz0gY3NzUHJvcHMuam9pbignICFpbXBvcnRhbnQ7JykgKyAnICFpbXBvcnRhbnQ7fSc7XG4gICAgc2Nyb2xsU3R5bGVFbCA9IGxvYWRTdHlsZUZuKGNzc1N0cik7XG5cbiAgICAvLyBjYW5jZWwgJ3Njcm9sbCcgZXZlbnQgbGlzdGVuZXIgY2FsbGJhY2tzXG4gICAganFMaXRlLm9uKHdpbiwgJ3Njcm9sbCcsIHNjcm9sbEV2ZW50SGFuZGxlciwgdHJ1ZSk7XG5cbiAgICAvLyBhZGQgc2Nyb2xsIGxvY2tcbiAgICBzY3JvbGxMb2NrUG9zID0ge2xlZnQ6IGpxTGl0ZS5zY3JvbGxMZWZ0KHdpbiksIHRvcDoganFMaXRlLnNjcm9sbFRvcCh3aW4pfTtcbiAgICBqcUxpdGUuYWRkQ2xhc3MoYm9keUVsLCBzY3JvbGxMb2NrQ2xzKTtcbiAgfVxufVxuXG5cbi8qKlxuICogVHVybiBvZmYgd2luZG93IHNjcm9sbCBsb2NrLlxuICogQHBhcmFtIHtCb29sZWFufSByZXNldFBvcyAtIFJlc2V0IHNjcm9sbCBwb3NpdGlvbiB0byBvcmlnaW5hbCB2YWx1ZS5cbiAqL1xuZnVuY3Rpb24gZGlzYWJsZVNjcm9sbExvY2tGbihyZXNldFBvcykge1xuICAvLyBpZ25vcmVcbiAgaWYgKHNjcm9sbExvY2sgPT09IDApIHJldHVybjtcblxuICAvLyBkZWNyZW1lbnQgY291bnRlclxuICBzY3JvbGxMb2NrIC09IDE7XG5cbiAgLy8gcmVtb3ZlIGxvY2sgXG4gIGlmIChzY3JvbGxMb2NrID09PSAwKSB7XG4gICAgLy8gcmVtb3ZlIHNjcm9sbCBsb2NrIGFuZCBkZWxldGUgc3R5bGUgZWxlbWVudFxuICAgIGpxTGl0ZS5yZW1vdmVDbGFzcyhkb2N1bWVudC5ib2R5LCBzY3JvbGxMb2NrQ2xzKTtcbiAgICBzY3JvbGxTdHlsZUVsLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoc2Nyb2xsU3R5bGVFbCk7XG5cbiAgICAvLyByZXN0b3JlIHNjcm9sbCBwb3NpdGlvblxuICAgIGlmIChyZXNldFBvcykgd2luZG93LnNjcm9sbFRvKHNjcm9sbExvY2tQb3MubGVmdCwgc2Nyb2xsTG9ja1Bvcy50b3ApO1xuXG4gICAgLy8gcmVzdG9yZSBzY3JvbGwgZXZlbnQgbGlzdGVuZXJzXG4gICAganFMaXRlLm9mZih3aW5kb3csICdzY3JvbGwnLCBzY3JvbGxFdmVudEhhbmRsZXIsIHRydWUpO1xuICB9XG59XG5cbi8qKlxuICogUmV0dXJuIHNjcm9sbCBiYXIgd2lkdGguXG4gKi9cbnZhciBnZXRTY3JvbGxCYXJXaWR0aCA9IGZ1bmN0aW9uKCkge1xuICAvLyBjaGVjayBjYWNoZVxuICBpZiAoX3Njcm9sbEJhcldpZHRoICE9PSB1bmRlZmluZWQpIHJldHVybiBfc2Nyb2xsQmFyV2lkdGg7XG4gIFxuICAvLyBjYWxjdWxhdGUgc2Nyb2xsIGJhciB3aWR0aFxuICB2YXIgZG9jID0gZG9jdW1lbnQsXG4gICAgICBib2R5RWwgPSBkb2MuYm9keSxcbiAgICAgIGVsID0gZG9jLmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuXG4gIGVsLmlubmVySFRNTCA9ICc8ZGl2IHN0eWxlPVwid2lkdGg6NTBweDtoZWlnaHQ6NTBweDtwb3NpdGlvbjphYnNvbHV0ZTsnICsgXG4gICAgJ2xlZnQ6LTUwcHg7dG9wOi01MHB4O292ZXJmbG93OmF1dG87XCI+PGRpdiBzdHlsZT1cIndpZHRoOjFweDsnICsgXG4gICAgJ2hlaWdodDoxMDBweDtcIj48L2Rpdj48L2Rpdj4nO1xuICBlbCA9IGVsLmZpcnN0Q2hpbGQ7XG4gIGJvZHlFbC5hcHBlbmRDaGlsZChlbCk7XG4gIF9zY3JvbGxCYXJXaWR0aCA9IGVsLm9mZnNldFdpZHRoIC0gZWwuY2xpZW50V2lkdGg7XG4gIGJvZHlFbC5yZW1vdmVDaGlsZChlbCk7XG5cbiAgcmV0dXJuIF9zY3JvbGxCYXJXaWR0aDtcbn1cblxuXG4vKipcbiAqIHJlcXVlc3RBbmltYXRpb25GcmFtZSBwb2x5ZmlsbGVkXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBjYWxsYmFjayAtIFRoZSBjYWxsYmFjayBmdW5jdGlvblxuICovXG5mdW5jdGlvbiByZXF1ZXN0QW5pbWF0aW9uRnJhbWVGbihjYWxsYmFjaykge1xuICB2YXIgZm4gPSB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lO1xuICBpZiAoZm4pIGZuKGNhbGxiYWNrKTtcbiAgZWxzZSBzZXRUaW1lb3V0KGNhbGxiYWNrLCAwKTtcbn1cblxuXG4vKipcbiAqIERlZmluZSB0aGUgbW9kdWxlIEFQSVxuICovXG5tb2R1bGUuZXhwb3J0cyA9IHtcbiAgLyoqIENyZWF0ZSBjYWxsYmFjayBjbG9zdXJlcyAqL1xuICBjYWxsYmFjazogY2FsbGJhY2tGbixcbiAgXG4gIC8qKiBDbGFzc25hbWVzIG9iamVjdCB0byBzdHJpbmcgKi9cbiAgY2xhc3NOYW1lczogY2xhc3NOYW1lc0ZuLFxuXG4gIC8qKiBEaXNhYmxlIHNjcm9sbCBsb2NrICovXG4gIGRpc2FibGVTY3JvbGxMb2NrOiBkaXNhYmxlU2Nyb2xsTG9ja0ZuLFxuXG4gIC8qKiBEaXNwYXRjaCBldmVudCAqL1xuICBkaXNwYXRjaEV2ZW50OiBkaXNwYXRjaEV2ZW50Rm4sXG4gIFxuICAvKiogRW5hYmxlIHNjcm9sbCBsb2NrICovXG4gIGVuYWJsZVNjcm9sbExvY2s6IGVuYWJsZVNjcm9sbExvY2tGbixcblxuICAvKiogTG9nIG1lc3NhZ2VzIHRvIHRoZSBjb25zb2xlIHdoZW4gZGVidWcgaXMgdHVybmVkIG9uICovXG4gIGxvZzogbG9nRm4sXG5cbiAgLyoqIExvYWQgQ1NTIHRleHQgYXMgbmV3IHN0eWxlc2hlZXQgKi9cbiAgbG9hZFN0eWxlOiBsb2FkU3R5bGVGbixcblxuICAvKiogUmFpc2UgTVVJIGVycm9yICovXG4gIHJhaXNlRXJyb3I6IHJhaXNlRXJyb3JGbixcblxuICAvKiogUmVxdWVzdCBhbmltYXRpb24gZnJhbWUgKi9cbiAgcmVxdWVzdEFuaW1hdGlvbkZyYW1lOiByZXF1ZXN0QW5pbWF0aW9uRnJhbWVGbixcblxuICAvKiogU3VwcG9ydCBQb2ludGVyIEV2ZW50cyBjaGVjayAqL1xuICBzdXBwb3J0c1BvaW50ZXJFdmVudHM6IHN1cHBvcnRzUG9pbnRlckV2ZW50c0ZuXG59O1xuIl19 },{"../config":4,"./jqLite":6}],8:[function(require,module,exports){ /** * MUI React helpers * @module react/_helpers */ 'use strict'; var controlledMessage = 'You provided a `value` prop to a form field ' + 'without an `OnChange` handler. Please see React documentation on ' + 'controlled components'; /** Module export */ module.exports = { controlledMessage: controlledMessage }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIl9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbImNvbnRyb2xsZWRNZXNzYWdlIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7O0FBR0EsSUFBTUEsb0JBQW9CLGlEQUN4QixtRUFEd0IsR0FFeEIsdUJBRkY7O0FBS0E7QUFDQUMsT0FBT0MsT0FBUCxHQUFpQixFQUFFRixvQ0FBRixFQUFqQiIsImZpbGUiOiJfaGVscGVycy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IGhlbHBlcnNcbiAqIEBtb2R1bGUgcmVhY3QvX2hlbHBlcnNcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cblxuY29uc3QgY29udHJvbGxlZE1lc3NhZ2UgPSAnWW91IHByb3ZpZGVkIGEgYHZhbHVlYCBwcm9wIHRvIGEgZm9ybSBmaWVsZCAnICtcbiAgJ3dpdGhvdXQgYW4gYE9uQ2hhbmdlYCBoYW5kbGVyLiBQbGVhc2Ugc2VlIFJlYWN0IGRvY3VtZW50YXRpb24gb24gJyArXG4gICdjb250cm9sbGVkIGNvbXBvbmVudHMnO1xuXG5cbi8qKiBNb2R1bGUgZXhwb3J0ICovXG5tb2R1bGUuZXhwb3J0cyA9IHsgY29udHJvbGxlZE1lc3NhZ2UgfTtcbiJdfQ== },{}],9:[function(require,module,exports){ /** * MUI React button module * @module react/button */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var btnClass = 'mui-btn', btnAttrs = { color: 1, variant: 1, size: 1 }; /** * Button element * @class */ var Button = function (_React$Component) { babelHelpers.inherits(Button, _React$Component); function Button(props) { babelHelpers.classCallCheck(this, Button); var _this = babelHelpers.possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props)); _this.state = { rippleStyle: {}, rippleIsVisible: false }; var cb = util.callback; _this.onMouseDownCB = cb(_this, 'onMouseDown'); _this.onMouseUpCB = cb(_this, 'onMouseUp'); _this.onMouseLeaveCB = cb(_this, 'onMouseLeave'); _this.onTouchStartCB = cb(_this, 'onTouchStart'); _this.onTouchEndCB = cb(_this, 'onTouchEnd'); return _this; } babelHelpers.createClass(Button, [{ key: 'componentDidMount', value: function componentDidMount() { // disable MUI js var el = this.buttonElRef; el._muiDropdown = true; el._muiRipple = true; } }, { key: 'onMouseDown', value: function onMouseDown(ev) { this.showRipple(ev); // execute callback var fn = this.props.onMouseDown; fn && fn(ev); } }, { key: 'onMouseUp', value: function onMouseUp(ev) { this.hideRipple(ev); // execute callback var fn = this.props.onMouseUp; fn && fn(ev); } }, { key: 'onMouseLeave', value: function onMouseLeave(ev) { this.hideRipple(ev); // execute callback var fn = this.props.onMouseLeave; fn && fn(ev); } }, { key: 'onTouchStart', value: function onTouchStart(ev) { this.showRipple(ev); // execute callback var fn = this.props.onTouchStart; fn && fn(ev); } }, { key: 'onTouchEnd', value: function onTouchEnd(ev) { this.hideRipple(ev); // execute callback var fn = this.props.onTouchEnd; fn && fn(ev); } }, { key: 'showRipple', value: function showRipple(ev) { var buttonEl = this.buttonElRef; // de-dupe touch events if ('ontouchstart' in buttonEl && ev.type === 'mousedown') return; // get (x, y) position of click var offset = jqLite.offset(this.buttonElRef), clickEv = void 0; if (ev.type === 'touchstart' && ev.touches) clickEv = ev.touches[0];else clickEv = ev; // calculate radius var radius = Math.sqrt(offset.width * offset.width + offset.height * offset.height); var diameterPx = radius * 2 + 'px'; // add ripple to state this.setState({ rippleStyle: { top: Math.round(clickEv.pageY - offset.top - radius) + 'px', left: Math.round(clickEv.pageX - offset.left - radius) + 'px', width: diameterPx, height: diameterPx }, rippleIsVisible: true }); } }, { key: 'hideRipple', value: function hideRipple(ev) { this.setState({ rippleIsVisible: false }); } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps, prevState) { var state = this.state, rippleEl = this.rippleElRef; // show ripple if (state.rippleIsVisible && !prevState.rippleIsVisible) { jqLite.removeClass(rippleEl, 'mui--is-animating'); jqLite.addClass(rippleEl, 'mui--is-visible'); util.requestAnimationFrame(function () { jqLite.addClass(rippleEl, 'mui--is-animating'); }); } // hide ripple if (!state.rippleIsVisible && prevState.rippleIsVisible) { // allow a repaint to occur before removing class so animation shows for // tap events util.requestAnimationFrame(function () { jqLite.removeClass(rippleEl, 'mui--is-visible'); }); } } }, { key: 'render', value: function render() { var _this2 = this; var cls = btnClass, k = void 0, v = void 0; var _props = this.props, color = _props.color, size = _props.size, variant = _props.variant, reactProps = babelHelpers.objectWithoutProperties(_props, ['color', 'size', 'variant']); // button attributes for (k in btnAttrs) { v = this.props[k]; if (v !== 'default') cls += ' ' + btnClass + '--' + v; } return _react2.default.createElement( 'button', babelHelpers.extends({}, reactProps, { ref: function ref(el) { _this2.buttonElRef = el; }, className: cls + ' ' + this.props.className, onMouseUp: this.onMouseUpCB, onMouseDown: this.onMouseDownCB, onMouseLeave: this.onMouseLeaveCB, onTouchStart: this.onTouchStartCB, onTouchEnd: this.onTouchEndCB }), this.props.children, _react2.default.createElement( 'span', { className: 'mui-btn__ripple-container' }, _react2.default.createElement('span', { ref: function ref(el) { _this2.rippleElRef = el; }, className: 'mui-ripple', style: this.state.rippleStyle }) ) ); } }]); return Button; }(_react2.default.Component); /** Define module API */ Button.defaultProps = { className: '', color: 'default', size: 'default', variant: 'default' }; exports.default = Button; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRvbi5qc3giXSwibmFtZXMiOlsianFMaXRlIiwidXRpbCIsImJ0bkNsYXNzIiwiYnRuQXR0cnMiLCJjb2xvciIsInZhcmlhbnQiLCJzaXplIiwiQnV0dG9uIiwicHJvcHMiLCJzdGF0ZSIsInJpcHBsZVN0eWxlIiwicmlwcGxlSXNWaXNpYmxlIiwiY2IiLCJjYWxsYmFjayIsIm9uTW91c2VEb3duQ0IiLCJvbk1vdXNlVXBDQiIsIm9uTW91c2VMZWF2ZUNCIiwib25Ub3VjaFN0YXJ0Q0IiLCJvblRvdWNoRW5kQ0IiLCJlbCIsImJ1dHRvbkVsUmVmIiwiX211aURyb3Bkb3duIiwiX211aVJpcHBsZSIsImV2Iiwic2hvd1JpcHBsZSIsImZuIiwib25Nb3VzZURvd24iLCJoaWRlUmlwcGxlIiwib25Nb3VzZVVwIiwib25Nb3VzZUxlYXZlIiwib25Ub3VjaFN0YXJ0Iiwib25Ub3VjaEVuZCIsImJ1dHRvbkVsIiwidHlwZSIsIm9mZnNldCIsImNsaWNrRXYiLCJ0b3VjaGVzIiwicmFkaXVzIiwiTWF0aCIsInNxcnQiLCJ3aWR0aCIsImhlaWdodCIsImRpYW1ldGVyUHgiLCJzZXRTdGF0ZSIsInRvcCIsInJvdW5kIiwicGFnZVkiLCJsZWZ0IiwicGFnZVgiLCJwcmV2UHJvcHMiLCJwcmV2U3RhdGUiLCJyaXBwbGVFbCIsInJpcHBsZUVsUmVmIiwicmVtb3ZlQ2xhc3MiLCJhZGRDbGFzcyIsInJlcXVlc3RBbmltYXRpb25GcmFtZSIsImNscyIsImsiLCJ2IiwicmVhY3RQcm9wcyIsImNsYXNzTmFtZSIsImNoaWxkcmVuIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFFQTs7SUFBWUEsTTs7QUFDWjs7SUFBWUMsSTs7O0FBR1osSUFBTUMsV0FBVyxTQUFqQjtBQUFBLElBQ0VDLFdBQVcsRUFBRUMsT0FBTyxDQUFULEVBQVlDLFNBQVMsQ0FBckIsRUFBd0JDLE1BQU0sQ0FBOUIsRUFEYjs7QUFJQTs7Ozs7SUFJTUMsTTs7O0FBQ0osa0JBQVlDLEtBQVosRUFBbUI7QUFBQTs7QUFBQSw0SEFDWEEsS0FEVzs7QUFBQSxVQVVuQkMsS0FWbUIsR0FVWDtBQUNOQyxtQkFBYSxFQURQO0FBRU5DLHVCQUFpQjtBQUZYLEtBVlc7O0FBRWpCLFFBQUlDLEtBQUtYLEtBQUtZLFFBQWQ7QUFDQSxVQUFLQyxhQUFMLEdBQXFCRixVQUFTLGFBQVQsQ0FBckI7QUFDQSxVQUFLRyxXQUFMLEdBQW1CSCxVQUFTLFdBQVQsQ0FBbkI7QUFDQSxVQUFLSSxjQUFMLEdBQXNCSixVQUFTLGNBQVQsQ0FBdEI7QUFDQSxVQUFLSyxjQUFMLEdBQXNCTCxVQUFTLGNBQVQsQ0FBdEI7QUFDQSxVQUFLTSxZQUFMLEdBQW9CTixVQUFTLFlBQVQsQ0FBcEI7QUFQaUI7QUFRbEI7Ozs7d0NBY21CO0FBQ2xCO0FBQ0EsVUFBSU8sS0FBSyxLQUFLQyxXQUFkO0FBQ0FELFNBQUdFLFlBQUgsR0FBa0IsSUFBbEI7QUFDQUYsU0FBR0csVUFBSCxHQUFnQixJQUFoQjtBQUNEOzs7Z0NBRVdDLEUsRUFBSTtBQUNkLFdBQUtDLFVBQUwsQ0FBZ0JELEVBQWhCOztBQUVBO0FBQ0EsVUFBTUUsS0FBSyxLQUFLakIsS0FBTCxDQUFXa0IsV0FBdEI7QUFDQUQsWUFBTUEsR0FBR0YsRUFBSCxDQUFOO0FBQ0Q7Ozs4QkFFU0EsRSxFQUFJO0FBQ1osV0FBS0ksVUFBTCxDQUFnQkosRUFBaEI7O0FBRUE7QUFDQSxVQUFNRSxLQUFLLEtBQUtqQixLQUFMLENBQVdvQixTQUF0QjtBQUNBSCxZQUFNQSxHQUFHRixFQUFILENBQU47QUFDRDs7O2lDQUVZQSxFLEVBQUk7QUFDZixXQUFLSSxVQUFMLENBQWdCSixFQUFoQjs7QUFFQTtBQUNBLFVBQU1FLEtBQUssS0FBS2pCLEtBQUwsQ0FBV3FCLFlBQXRCO0FBQ0FKLFlBQU1BLEdBQUdGLEVBQUgsQ0FBTjtBQUNEOzs7aUNBRVlBLEUsRUFBSTtBQUNmLFdBQUtDLFVBQUwsQ0FBZ0JELEVBQWhCOztBQUVBO0FBQ0EsVUFBTUUsS0FBSyxLQUFLakIsS0FBTCxDQUFXc0IsWUFBdEI7QUFDQUwsWUFBTUEsR0FBR0YsRUFBSCxDQUFOO0FBQ0Q7OzsrQkFFVUEsRSxFQUFJO0FBQ2IsV0FBS0ksVUFBTCxDQUFnQkosRUFBaEI7O0FBRUE7QUFDQSxVQUFNRSxLQUFLLEtBQUtqQixLQUFMLENBQVd1QixVQUF0QjtBQUNBTixZQUFNQSxHQUFHRixFQUFILENBQU47QUFDRDs7OytCQUVVQSxFLEVBQUk7QUFDYixVQUFJUyxXQUFXLEtBQUtaLFdBQXBCOztBQUVBO0FBQ0EsVUFBSSxrQkFBa0JZLFFBQWxCLElBQThCVCxHQUFHVSxJQUFILEtBQVksV0FBOUMsRUFBMkQ7O0FBRTNEO0FBQ0EsVUFBSUMsU0FBU2xDLE9BQU9rQyxNQUFQLENBQWMsS0FBS2QsV0FBbkIsQ0FBYjtBQUFBLFVBQ0VlLGdCQURGOztBQUdBLFVBQUlaLEdBQUdVLElBQUgsS0FBWSxZQUFaLElBQTRCVixHQUFHYSxPQUFuQyxFQUE0Q0QsVUFBVVosR0FBR2EsT0FBSCxDQUFXLENBQVgsQ0FBVixDQUE1QyxLQUNLRCxVQUFVWixFQUFWOztBQUVMO0FBQ0EsVUFBSWMsU0FBU0MsS0FBS0MsSUFBTCxDQUFVTCxPQUFPTSxLQUFQLEdBQWVOLE9BQU9NLEtBQXRCLEdBQ3JCTixPQUFPTyxNQUFQLEdBQWdCUCxPQUFPTyxNQURaLENBQWI7O0FBR0EsVUFBSUMsYUFBYUwsU0FBUyxDQUFULEdBQWEsSUFBOUI7O0FBRUE7QUFDQSxXQUFLTSxRQUFMLENBQWM7QUFDWmpDLHFCQUFhO0FBQ1hrQyxlQUFLTixLQUFLTyxLQUFMLENBQVdWLFFBQVFXLEtBQVIsR0FBZ0JaLE9BQU9VLEdBQXZCLEdBQTZCUCxNQUF4QyxJQUFrRCxJQUQ1QztBQUVYVSxnQkFBTVQsS0FBS08sS0FBTCxDQUFXVixRQUFRYSxLQUFSLEdBQWdCZCxPQUFPYSxJQUF2QixHQUE4QlYsTUFBekMsSUFBbUQsSUFGOUM7QUFHWEcsaUJBQU9FLFVBSEk7QUFJWEQsa0JBQVFDO0FBSkcsU0FERDtBQU9aL0IseUJBQWlCO0FBUEwsT0FBZDtBQVNEOzs7K0JBRVVZLEUsRUFBSTtBQUNiLFdBQUtvQixRQUFMLENBQWMsRUFBRWhDLGlCQUFpQixLQUFuQixFQUFkO0FBQ0Q7Ozt1Q0FFa0JzQyxTLEVBQVdDLFMsRUFBVztBQUN2QyxVQUFJekMsUUFBUSxLQUFLQSxLQUFqQjtBQUFBLFVBQ0UwQyxXQUFXLEtBQUtDLFdBRGxCOztBQUdBO0FBQ0EsVUFBSTNDLE1BQU1FLGVBQU4sSUFBeUIsQ0FBQ3VDLFVBQVV2QyxlQUF4QyxFQUF5RDtBQUN2RFgsZUFBT3FELFdBQVAsQ0FBbUJGLFFBQW5CLEVBQTZCLG1CQUE3QjtBQUNBbkQsZUFBT3NELFFBQVAsQ0FBZ0JILFFBQWhCLEVBQTBCLGlCQUExQjs7QUFFQWxELGFBQUtzRCxxQkFBTCxDQUEyQixZQUFNO0FBQy9CdkQsaUJBQU9zRCxRQUFQLENBQWdCSCxRQUFoQixFQUEwQixtQkFBMUI7QUFDRCxTQUZEO0FBR0Q7O0FBRUQ7QUFDQSxVQUFJLENBQUMxQyxNQUFNRSxlQUFQLElBQTBCdUMsVUFBVXZDLGVBQXhDLEVBQXlEO0FBQ3ZEO0FBQ0E7QUFDQVYsYUFBS3NELHFCQUFMLENBQTJCLFlBQU07QUFDL0J2RCxpQkFBT3FELFdBQVAsQ0FBbUJGLFFBQW5CLEVBQTZCLGlCQUE3QjtBQUNELFNBRkQ7QUFHRDtBQUNGOzs7NkJBRVE7QUFBQTs7QUFDUCxVQUFJSyxNQUFNdEQsUUFBVjtBQUFBLFVBQ0V1RCxVQURGO0FBQUEsVUFFRUMsVUFGRjs7QUFETyxtQkFLeUMsS0FBS2xELEtBTDlDO0FBQUEsVUFLQ0osS0FMRCxVQUtDQSxLQUxEO0FBQUEsVUFLUUUsSUFMUixVQUtRQSxJQUxSO0FBQUEsVUFLY0QsT0FMZCxVQUtjQSxPQUxkO0FBQUEsVUFLMEJzRCxVQUwxQjs7QUFPUDs7QUFDQSxXQUFLRixDQUFMLElBQVV0RCxRQUFWLEVBQW9CO0FBQ2xCdUQsWUFBSSxLQUFLbEQsS0FBTCxDQUFXaUQsQ0FBWCxDQUFKO0FBQ0EsWUFBSUMsTUFBTSxTQUFWLEVBQXFCRixPQUFPLE1BQU10RCxRQUFOLEdBQWlCLElBQWpCLEdBQXdCd0QsQ0FBL0I7QUFDdEI7O0FBRUQsYUFDRTtBQUFBO0FBQUEsaUNBQ09DLFVBRFA7QUFFRSxlQUFLLGlCQUFNO0FBQUUsbUJBQUt2QyxXQUFMLEdBQW1CRCxFQUFuQjtBQUF1QixXQUZ0QztBQUdFLHFCQUFXcUMsTUFBTSxHQUFOLEdBQVksS0FBS2hELEtBQUwsQ0FBV29ELFNBSHBDO0FBSUUscUJBQVcsS0FBSzdDLFdBSmxCO0FBS0UsdUJBQWEsS0FBS0QsYUFMcEI7QUFNRSx3QkFBYyxLQUFLRSxjQU5yQjtBQU9FLHdCQUFjLEtBQUtDLGNBUHJCO0FBUUUsc0JBQVksS0FBS0M7QUFSbkI7QUFVRyxhQUFLVixLQUFMLENBQVdxRCxRQVZkO0FBV0U7QUFBQTtBQUFBLFlBQU0sV0FBVSwyQkFBaEI7QUFDRTtBQUNFLGlCQUFLLGlCQUFNO0FBQUUscUJBQUtULFdBQUwsR0FBbUJqQyxFQUFuQjtBQUF1QixhQUR0QztBQUVFLHVCQUFVLFlBRlo7QUFHRSxtQkFBTyxLQUFLVixLQUFMLENBQVdDO0FBSHBCO0FBREY7QUFYRixPQURGO0FBc0JEOzs7RUFwS2tCLGdCQUFNb0QsUzs7QUF3SzNCOzs7QUF4S012RCxNLENBZ0JHd0QsWSxHQUFlO0FBQ3BCSCxhQUFXLEVBRFM7QUFFcEJ4RCxTQUFPLFNBRmE7QUFHcEJFLFFBQU0sU0FIYztBQUlwQkQsV0FBUztBQUpXLEM7a0JBeUpURSxNIiwiZmlsZSI6ImJ1dHRvbi5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCBidXR0b24gbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L2J1dHRvblxuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0ICogYXMganFMaXRlIGZyb20gJy4uL2pzL2xpYi9qcUxpdGUnO1xuaW1wb3J0ICogYXMgdXRpbCBmcm9tICcuLi9qcy9saWIvdXRpbCc7XG5cblxuY29uc3QgYnRuQ2xhc3MgPSAnbXVpLWJ0bicsXG4gIGJ0bkF0dHJzID0geyBjb2xvcjogMSwgdmFyaWFudDogMSwgc2l6ZTogMSB9O1xuXG5cbi8qKlxuICogQnV0dG9uIGVsZW1lbnRcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBCdXR0b24gZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgICBsZXQgY2IgPSB1dGlsLmNhbGxiYWNrO1xuICAgIHRoaXMub25Nb3VzZURvd25DQiA9IGNiKHRoaXMsICdvbk1vdXNlRG93bicpO1xuICAgIHRoaXMub25Nb3VzZVVwQ0IgPSBjYih0aGlzLCAnb25Nb3VzZVVwJyk7XG4gICAgdGhpcy5vbk1vdXNlTGVhdmVDQiA9IGNiKHRoaXMsICdvbk1vdXNlTGVhdmUnKTtcbiAgICB0aGlzLm9uVG91Y2hTdGFydENCID0gY2IodGhpcywgJ29uVG91Y2hTdGFydCcpO1xuICAgIHRoaXMub25Ub3VjaEVuZENCID0gY2IodGhpcywgJ29uVG91Y2hFbmQnKTtcbiAgfVxuXG4gIHN0YXRlID0ge1xuICAgIHJpcHBsZVN0eWxlOiB7fSxcbiAgICByaXBwbGVJc1Zpc2libGU6IGZhbHNlXG4gIH07XG5cbiAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICBjbGFzc05hbWU6ICcnLFxuICAgIGNvbG9yOiAnZGVmYXVsdCcsXG4gICAgc2l6ZTogJ2RlZmF1bHQnLFxuICAgIHZhcmlhbnQ6ICdkZWZhdWx0J1xuICB9O1xuXG4gIGNvbXBvbmVudERpZE1vdW50KCkge1xuICAgIC8vIGRpc2FibGUgTVVJIGpzXG4gICAgbGV0IGVsID0gdGhpcy5idXR0b25FbFJlZjtcbiAgICBlbC5fbXVpRHJvcGRvd24gPSB0cnVlO1xuICAgIGVsLl9tdWlSaXBwbGUgPSB0cnVlO1xuICB9XG5cbiAgb25Nb3VzZURvd24oZXYpIHtcbiAgICB0aGlzLnNob3dSaXBwbGUoZXYpO1xuXG4gICAgLy8gZXhlY3V0ZSBjYWxsYmFja1xuICAgIGNvbnN0IGZuID0gdGhpcy5wcm9wcy5vbk1vdXNlRG93bjtcbiAgICBmbiAmJiBmbihldik7XG4gIH1cblxuICBvbk1vdXNlVXAoZXYpIHtcbiAgICB0aGlzLmhpZGVSaXBwbGUoZXYpO1xuXG4gICAgLy8gZXhlY3V0ZSBjYWxsYmFja1xuICAgIGNvbnN0IGZuID0gdGhpcy5wcm9wcy5vbk1vdXNlVXA7XG4gICAgZm4gJiYgZm4oZXYpO1xuICB9XG5cbiAgb25Nb3VzZUxlYXZlKGV2KSB7XG4gICAgdGhpcy5oaWRlUmlwcGxlKGV2KTtcblxuICAgIC8vIGV4ZWN1dGUgY2FsbGJhY2tcbiAgICBjb25zdCBmbiA9IHRoaXMucHJvcHMub25Nb3VzZUxlYXZlO1xuICAgIGZuICYmIGZuKGV2KTtcbiAgfVxuXG4gIG9uVG91Y2hTdGFydChldikge1xuICAgIHRoaXMuc2hvd1JpcHBsZShldik7XG5cbiAgICAvLyBleGVjdXRlIGNhbGxiYWNrXG4gICAgY29uc3QgZm4gPSB0aGlzLnByb3BzLm9uVG91Y2hTdGFydDtcbiAgICBmbiAmJiBmbihldik7XG4gIH1cblxuICBvblRvdWNoRW5kKGV2KSB7XG4gICAgdGhpcy5oaWRlUmlwcGxlKGV2KTtcblxuICAgIC8vIGV4ZWN1dGUgY2FsbGJhY2tcbiAgICBjb25zdCBmbiA9IHRoaXMucHJvcHMub25Ub3VjaEVuZDtcbiAgICBmbiAmJiBmbihldik7XG4gIH1cblxuICBzaG93UmlwcGxlKGV2KSB7XG4gICAgbGV0IGJ1dHRvbkVsID0gdGhpcy5idXR0b25FbFJlZjtcblxuICAgIC8vIGRlLWR1cGUgdG91Y2ggZXZlbnRzXG4gICAgaWYgKCdvbnRvdWNoc3RhcnQnIGluIGJ1dHRvbkVsICYmIGV2LnR5cGUgPT09ICdtb3VzZWRvd24nKSByZXR1cm47XG5cbiAgICAvLyBnZXQgKHgsIHkpIHBvc2l0aW9uIG9mIGNsaWNrXG4gICAgbGV0IG9mZnNldCA9IGpxTGl0ZS5vZmZzZXQodGhpcy5idXR0b25FbFJlZiksXG4gICAgICBjbGlja0V2O1xuXG4gICAgaWYgKGV2LnR5cGUgPT09ICd0b3VjaHN0YXJ0JyAmJiBldi50b3VjaGVzKSBjbGlja0V2ID0gZXYudG91Y2hlc1swXTtcbiAgICBlbHNlIGNsaWNrRXYgPSBldjtcblxuICAgIC8vIGNhbGN1bGF0ZSByYWRpdXNcbiAgICBsZXQgcmFkaXVzID0gTWF0aC5zcXJ0KG9mZnNldC53aWR0aCAqIG9mZnNldC53aWR0aCArXG4gICAgICBvZmZzZXQuaGVpZ2h0ICogb2Zmc2V0LmhlaWdodCk7XG5cbiAgICBsZXQgZGlhbWV0ZXJQeCA9IHJhZGl1cyAqIDIgKyAncHgnO1xuXG4gICAgLy8gYWRkIHJpcHBsZSB0byBzdGF0ZVxuICAgIHRoaXMuc2V0U3RhdGUoe1xuICAgICAgcmlwcGxlU3R5bGU6IHtcbiAgICAgICAgdG9wOiBNYXRoLnJvdW5kKGNsaWNrRXYucGFnZVkgLSBvZmZzZXQudG9wIC0gcmFkaXVzKSArICdweCcsXG4gICAgICAgIGxlZnQ6IE1hdGgucm91bmQoY2xpY2tFdi5wYWdlWCAtIG9mZnNldC5sZWZ0IC0gcmFkaXVzKSArICdweCcsXG4gICAgICAgIHdpZHRoOiBkaWFtZXRlclB4LFxuICAgICAgICBoZWlnaHQ6IGRpYW1ldGVyUHhcbiAgICAgIH0sXG4gICAgICByaXBwbGVJc1Zpc2libGU6IHRydWVcbiAgICB9KTtcbiAgfVxuXG4gIGhpZGVSaXBwbGUoZXYpIHtcbiAgICB0aGlzLnNldFN0YXRlKHsgcmlwcGxlSXNWaXNpYmxlOiBmYWxzZSB9KTtcbiAgfVxuXG4gIGNvbXBvbmVudERpZFVwZGF0ZShwcmV2UHJvcHMsIHByZXZTdGF0ZSkge1xuICAgIGxldCBzdGF0ZSA9IHRoaXMuc3RhdGUsXG4gICAgICByaXBwbGVFbCA9IHRoaXMucmlwcGxlRWxSZWY7XG5cbiAgICAvLyBzaG93IHJpcHBsZVxuICAgIGlmIChzdGF0ZS5yaXBwbGVJc1Zpc2libGUgJiYgIXByZXZTdGF0ZS5yaXBwbGVJc1Zpc2libGUpIHtcbiAgICAgIGpxTGl0ZS5yZW1vdmVDbGFzcyhyaXBwbGVFbCwgJ211aS0taXMtYW5pbWF0aW5nJyk7XG4gICAgICBqcUxpdGUuYWRkQ2xhc3MocmlwcGxlRWwsICdtdWktLWlzLXZpc2libGUnKTtcblxuICAgICAgdXRpbC5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoKCkgPT4ge1xuICAgICAgICBqcUxpdGUuYWRkQ2xhc3MocmlwcGxlRWwsICdtdWktLWlzLWFuaW1hdGluZycpO1xuICAgICAgfSk7XG4gICAgfVxuXG4gICAgLy8gaGlkZSByaXBwbGVcbiAgICBpZiAoIXN0YXRlLnJpcHBsZUlzVmlzaWJsZSAmJiBwcmV2U3RhdGUucmlwcGxlSXNWaXNpYmxlKSB7XG4gICAgICAvLyBhbGxvdyBhIHJlcGFpbnQgdG8gb2NjdXIgYmVmb3JlIHJlbW92aW5nIGNsYXNzIHNvIGFuaW1hdGlvbiBzaG93cyBmb3JcbiAgICAgIC8vIHRhcCBldmVudHNcbiAgICAgIHV0aWwucmVxdWVzdEFuaW1hdGlvbkZyYW1lKCgpID0+IHtcbiAgICAgICAganFMaXRlLnJlbW92ZUNsYXNzKHJpcHBsZUVsLCAnbXVpLS1pcy12aXNpYmxlJyk7XG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuICByZW5kZXIoKSB7XG4gICAgbGV0IGNscyA9IGJ0bkNsYXNzLFxuICAgICAgayxcbiAgICAgIHY7XG5cbiAgICBjb25zdCB7IGNvbG9yLCBzaXplLCB2YXJpYW50LCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgLy8gYnV0dG9uIGF0dHJpYnV0ZXNcbiAgICBmb3IgKGsgaW4gYnRuQXR0cnMpIHtcbiAgICAgIHYgPSB0aGlzLnByb3BzW2tdO1xuICAgICAgaWYgKHYgIT09ICdkZWZhdWx0JykgY2xzICs9ICcgJyArIGJ0bkNsYXNzICsgJy0tJyArIHY7XG4gICAgfVxuXG4gICAgcmV0dXJuIChcbiAgICAgIDxidXR0b25cbiAgICAgICAgeyAuLi5yZWFjdFByb3BzIH1cbiAgICAgICAgcmVmPXtlbCA9PiB7IHRoaXMuYnV0dG9uRWxSZWYgPSBlbCB9fVxuICAgICAgICBjbGFzc05hbWU9e2NscyArICcgJyArIHRoaXMucHJvcHMuY2xhc3NOYW1lfVxuICAgICAgICBvbk1vdXNlVXA9e3RoaXMub25Nb3VzZVVwQ0J9XG4gICAgICAgIG9uTW91c2VEb3duPXt0aGlzLm9uTW91c2VEb3duQ0J9XG4gICAgICAgIG9uTW91c2VMZWF2ZT17dGhpcy5vbk1vdXNlTGVhdmVDQn1cbiAgICAgICAgb25Ub3VjaFN0YXJ0PXt0aGlzLm9uVG91Y2hTdGFydENCfVxuICAgICAgICBvblRvdWNoRW5kPXt0aGlzLm9uVG91Y2hFbmRDQn1cbiAgICAgID5cbiAgICAgICAge3RoaXMucHJvcHMuY2hpbGRyZW59XG4gICAgICAgIDxzcGFuIGNsYXNzTmFtZT1cIm11aS1idG5fX3JpcHBsZS1jb250YWluZXJcIj5cbiAgICAgICAgICA8c3BhblxuICAgICAgICAgICAgcmVmPXtlbCA9PiB7IHRoaXMucmlwcGxlRWxSZWYgPSBlbCB9fVxuICAgICAgICAgICAgY2xhc3NOYW1lPVwibXVpLXJpcHBsZVwiXG4gICAgICAgICAgICBzdHlsZT17dGhpcy5zdGF0ZS5yaXBwbGVTdHlsZX1cbiAgICAgICAgICA+XG4gICAgICAgICAgPC9zcGFuPlxuICAgICAgICA8L3NwYW4+XG4gICAgICA8L2J1dHRvbj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBCdXR0b247XG4iXX0= },{"../js/lib/jqLite":6,"../js/lib/util":7,"react":"1n8/MK"}],10:[function(require,module,exports){ /** * MUI React Caret Module * @module react/caret */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Caret constructor * @class */ var Caret = function (_React$Component) { babelHelpers.inherits(Caret, _React$Component); function Caret() { babelHelpers.classCallCheck(this, Caret); return babelHelpers.possibleConstructorReturn(this, (Caret.__proto__ || Object.getPrototypeOf(Caret)).apply(this, arguments)); } babelHelpers.createClass(Caret, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, reactProps = babelHelpers.objectWithoutProperties(_props, ['children']); return _react2.default.createElement('span', babelHelpers.extends({}, reactProps, { className: 'mui-caret ' + this.props.className })); } }]); return Caret; }(_react2.default.Component); /** Define module API */ Caret.defaultProps = { className: '' }; exports.default = Caret; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhcmV0LmpzeCJdLCJuYW1lcyI6WyJDYXJldCIsInByb3BzIiwiY2hpbGRyZW4iLCJyZWFjdFByb3BzIiwiY2xhc3NOYW1lIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFHQTs7OztJQUlNQSxLOzs7Ozs7Ozs7OzZCQUtLO0FBQUEsbUJBQzZCLEtBQUtDLEtBRGxDO0FBQUEsVUFDQ0MsUUFERCxVQUNDQSxRQUREO0FBQUEsVUFDY0MsVUFEZDs7O0FBR1AsYUFDRSwrREFDT0EsVUFEUDtBQUVFLG1CQUFXLGVBQWUsS0FBS0YsS0FBTCxDQUFXRztBQUZ2QyxTQURGO0FBT0Q7OztFQWZpQixnQkFBTUMsUzs7QUFtQjFCOzs7QUFuQk1MLEssQ0FDR00sWSxHQUFlO0FBQ3BCRixhQUFXO0FBRFMsQztrQkFtQlRKLEsiLCJmaWxlIjoiY2FyZXQuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgQ2FyZXQgTW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L2NhcmV0XG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5cbi8qKlxuICogQ2FyZXQgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBDYXJldCBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgY2xhc3NOYW1lOiAnJ1xuICB9O1xuXG4gIHJlbmRlcigpIHtcbiAgICBjb25zdCB7IGNoaWxkcmVuLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxzcGFuXG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1jYXJldCAnICsgdGhpcy5wcm9wcy5jbGFzc05hbWV9XG4gICAgICA+XG4gICAgICA8L3NwYW4+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgQ2FyZXQ7XG4iXX0= },{"react":"1n8/MK"}],11:[function(require,module,exports){ /** * MUI React tabs module * @module react/tabs */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Tab constructor * @class */ var Tab = function (_React$Component) { babelHelpers.inherits(Tab, _React$Component); function Tab() { babelHelpers.classCallCheck(this, Tab); return babelHelpers.possibleConstructorReturn(this, (Tab.__proto__ || Object.getPrototypeOf(Tab)).apply(this, arguments)); } babelHelpers.createClass(Tab, [{ key: 'render', value: function render() { return null; } }]); return Tab; }(_react2.default.Component); /** Define module API */ Tab.defaultProps = { value: null, label: '', onActive: null }; exports.default = Tab; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhYi5qc3giXSwibmFtZXMiOlsiVGFiIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwidmFsdWUiLCJsYWJlbCIsIm9uQWN0aXZlIl0sIm1hcHBpbmdzIjoiQUFBQTs7OztBQUlBO0FBQ0E7O0FBRUE7Ozs7OztBQUVBOzs7O0FBR0E7Ozs7SUFJTUEsRzs7Ozs7Ozs7Ozs2QkFPSztBQUNQLGFBQU8sSUFBUDtBQUNEOzs7RUFUZSxnQkFBTUMsUzs7QUFheEI7OztBQWJNRCxHLENBQ0dFLFksR0FBZTtBQUNwQkMsU0FBTyxJQURhO0FBRXBCQyxTQUFPLEVBRmE7QUFHcEJDLFlBQVU7QUFIVSxDO2tCQWFUTCxHIiwiZmlsZSI6InRhYi5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCB0YWJzIG1vZHVsZVxuICogQG1vZHVsZSByZWFjdC90YWJzXG4gKi9cbi8qIGpzaGludCBxdW90bWFyazpmYWxzZSAqL1xuLy8ganNjczpkaXNhYmxlIHZhbGlkYXRlUXVvdGVNYXJrc1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBUYWIgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBUYWIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIHZhbHVlOiBudWxsLFxuICAgIGxhYmVsOiAnJyxcbiAgICBvbkFjdGl2ZTogbnVsbFxuICB9O1xuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gbnVsbDtcbiAgfTtcbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IFRhYjtcbiJdfQ== },{"react":"1n8/MK"}],12:[function(require,module,exports){ /** * MUI React TextInput Component * @module react/text-field */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextField = undefined; var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Input constructor * @class */ var Input = function (_React$Component) { babelHelpers.inherits(Input, _React$Component); function Input(props) { babelHelpers.classCallCheck(this, Input); var _this = babelHelpers.possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).call(this, props)); var value = props.value; var innerValue = value || props.defaultValue; if (innerValue === undefined) innerValue = ''; _this.state = { innerValue: innerValue, isTouched: false, isPristine: true }; // warn if value defined but onChange is not if (value !== undefined && !props.onChange) { util.raiseError(_helpers.controlledMessage, true); } var cb = util.callback; _this.onBlurCB = cb(_this, 'onBlur'); _this.onChangeCB = cb(_this, 'onChange'); return _this; } babelHelpers.createClass(Input, [{ key: 'componentDidMount', value: function componentDidMount() { // disable MUI js this.inputElRef._muiTextfield = true; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { // update innerValue when new value is received to handle programmatic // changes to input box if ('value' in nextProps) this.setState({ innerValue: nextProps.value }); } }, { key: 'onBlur', value: function onBlur(ev) { // ignore if event is a window blur if (document.activeElement !== this.inputElRef) { this.setState({ isTouched: true }); } // execute callback var fn = this.props.onBlur; fn && fn(ev); } }, { key: 'onChange', value: function onChange(ev) { this.setState({ innerValue: ev.target.value, isPristine: false }); // execute callback var fn = this.props.onChange; fn && fn(ev); } }, { key: 'triggerFocus', value: function triggerFocus() { // hack to enable IE10 pointer-events shim this.inputElRef.focus(); } }, { key: 'render', value: function render() { var _this2 = this; var cls = {}, isNotEmpty = Boolean(this.state.innerValue.toString()), inputEl = void 0; var _props = this.props, hint = _props.hint, invalid = _props.invalid, rows = _props.rows, type = _props.type, reactProps = babelHelpers.objectWithoutProperties(_props, ['hint', 'invalid', 'rows', 'type']); cls['mui--is-touched'] = this.state.isTouched; cls['mui--is-untouched'] = !this.state.isTouched; cls['mui--is-pristine'] = this.state.isPristine; cls['mui--is-dirty'] = !this.state.isPristine; cls['mui--is-empty'] = !isNotEmpty; cls['mui--is-not-empty'] = isNotEmpty; cls['mui--is-invalid'] = invalid; cls = util.classNames(cls); if (type === 'textarea') { inputEl = _react2.default.createElement('textarea', babelHelpers.extends({}, reactProps, { ref: function ref(el) { _this2.inputElRef = el; }, className: cls, rows: rows, placeholder: hint, onBlur: this.onBlurCB, onChange: this.onChangeCB })); } else { inputEl = _react2.default.createElement('input', babelHelpers.extends({}, reactProps, { ref: function ref(el) { _this2.inputElRef = el; }, className: cls, type: type, placeholder: this.props.hint, onBlur: this.onBlurCB, onChange: this.onChangeCB })); } return inputEl; } }]); return Input; }(_react2.default.Component); /** * Label constructor * @class */ Input.defaultProps = { hint: null, invalid: false, rows: 2 }; var Label = function (_React$Component2) { babelHelpers.inherits(Label, _React$Component2); function Label() { var _ref; var _temp, _this3, _ret; babelHelpers.classCallCheck(this, Label); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this3 = babelHelpers.possibleConstructorReturn(this, (_ref = Label.__proto__ || Object.getPrototypeOf(Label)).call.apply(_ref, [this].concat(args))), _this3), _this3.state = { style: {} }, _temp), babelHelpers.possibleConstructorReturn(_this3, _ret); } babelHelpers.createClass(Label, [{ key: 'componentDidMount', value: function componentDidMount() { var _this4 = this; this.styleTimer = setTimeout(function () { var s = '.15s ease-out'; var style = void 0; style = { transition: s, WebkitTransition: s, MozTransition: s, OTransition: s, msTransform: s }; _this4.setState({ style: style }); }, 150); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // clear timer clearTimeout(this.styleTimer); } }, { key: 'render', value: function render() { return _react2.default.createElement( 'label', { style: this.state.style, onClick: this.props.onClick }, this.props.text ); } }]); return Label; }(_react2.default.Component); /** * TextField constructor * @class */ Label.defaultProps = { text: '', onClick: null }; var TextField = function (_React$Component3) { babelHelpers.inherits(TextField, _React$Component3); function TextField(props) { babelHelpers.classCallCheck(this, TextField); var _this5 = babelHelpers.possibleConstructorReturn(this, (TextField.__proto__ || Object.getPrototypeOf(TextField)).call(this, props)); _this5.onClickCB = util.callback(_this5, 'onClick'); return _this5; } babelHelpers.createClass(TextField, [{ key: 'onClick', value: function onClick(ev) { // pointer-events shim if (util.supportsPointerEvents() === false) { ev.target.style.cursor = 'text'; this.inputElRef.triggerFocus(); } } }, { key: 'render', value: function render() { var _this6 = this; var cls = {}, labelEl = void 0; var _props2 = this.props, children = _props2.children, className = _props2.className, style = _props2.style, label = _props2.label, floatingLabel = _props2.floatingLabel, other = babelHelpers.objectWithoutProperties(_props2, ['children', 'className', 'style', 'label', 'floatingLabel']); var type = jqLite.type(label); if (type === 'string' && label.length || type === 'object') { labelEl = _react2.default.createElement(Label, { text: label, onClick: this.onClickCB }); } cls['mui-textfield'] = true; cls['mui-textfield--float-label'] = floatingLabel; cls = util.classNames(cls); return _react2.default.createElement( 'div', { className: cls + ' ' + className, style: style }, _react2.default.createElement(Input, babelHelpers.extends({ ref: function ref(el) { _this6.inputElRef = el; } }, other)), labelEl ); } }]); return TextField; }(_react2.default.Component); /** Define module API */ TextField.defaultProps = { className: '', label: null, floatingLabel: false }; exports.TextField = TextField; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRleHQtZmllbGQuanN4Il0sIm5hbWVzIjpbImpxTGl0ZSIsInV0aWwiLCJJbnB1dCIsInByb3BzIiwidmFsdWUiLCJpbm5lclZhbHVlIiwiZGVmYXVsdFZhbHVlIiwidW5kZWZpbmVkIiwic3RhdGUiLCJpc1RvdWNoZWQiLCJpc1ByaXN0aW5lIiwib25DaGFuZ2UiLCJyYWlzZUVycm9yIiwiY2IiLCJjYWxsYmFjayIsIm9uQmx1ckNCIiwib25DaGFuZ2VDQiIsImlucHV0RWxSZWYiLCJfbXVpVGV4dGZpZWxkIiwibmV4dFByb3BzIiwic2V0U3RhdGUiLCJldiIsImRvY3VtZW50IiwiYWN0aXZlRWxlbWVudCIsImZuIiwib25CbHVyIiwidGFyZ2V0IiwiZm9jdXMiLCJjbHMiLCJpc05vdEVtcHR5IiwiQm9vbGVhbiIsInRvU3RyaW5nIiwiaW5wdXRFbCIsImhpbnQiLCJpbnZhbGlkIiwicm93cyIsInR5cGUiLCJyZWFjdFByb3BzIiwiY2xhc3NOYW1lcyIsImVsIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwiTGFiZWwiLCJzdHlsZSIsInN0eWxlVGltZXIiLCJzZXRUaW1lb3V0IiwicyIsInRyYW5zaXRpb24iLCJXZWJraXRUcmFuc2l0aW9uIiwiTW96VHJhbnNpdGlvbiIsIk9UcmFuc2l0aW9uIiwibXNUcmFuc2Zvcm0iLCJjbGVhclRpbWVvdXQiLCJvbkNsaWNrIiwidGV4dCIsIlRleHRGaWVsZCIsIm9uQ2xpY2tDQiIsInN1cHBvcnRzUG9pbnRlckV2ZW50cyIsImN1cnNvciIsInRyaWdnZXJGb2N1cyIsImxhYmVsRWwiLCJjaGlsZHJlbiIsImNsYXNzTmFtZSIsImxhYmVsIiwiZmxvYXRpbmdMYWJlbCIsIm90aGVyIiwibGVuZ3RoIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7OztBQUVBOzs7O0FBRUE7O0lBQVlBLE07O0FBQ1o7O0lBQVlDLEk7O0FBQ1o7O0FBR0E7Ozs7SUFJTUMsSzs7O0FBQ0osaUJBQVlDLEtBQVosRUFBbUI7QUFBQTs7QUFBQSwwSEFDWEEsS0FEVzs7QUFHakIsUUFBSUMsUUFBUUQsTUFBTUMsS0FBbEI7QUFDQSxRQUFJQyxhQUFhRCxTQUFTRCxNQUFNRyxZQUFoQzs7QUFFQSxRQUFJRCxlQUFlRSxTQUFuQixFQUE4QkYsYUFBYSxFQUFiOztBQUU5QixVQUFLRyxLQUFMLEdBQWE7QUFDWEgsa0JBQVlBLFVBREQ7QUFFWEksaUJBQVcsS0FGQTtBQUdYQyxrQkFBWTtBQUhELEtBQWI7O0FBTUE7QUFDQSxRQUFJTixVQUFVRyxTQUFWLElBQXVCLENBQUNKLE1BQU1RLFFBQWxDLEVBQTRDO0FBQzFDVixXQUFLVyxVQUFMLDZCQUFtQyxJQUFuQztBQUNEOztBQUVELFFBQUlDLEtBQUtaLEtBQUthLFFBQWQ7QUFDQSxVQUFLQyxRQUFMLEdBQWdCRixVQUFTLFFBQVQsQ0FBaEI7QUFDQSxVQUFLRyxVQUFMLEdBQWtCSCxVQUFTLFVBQVQsQ0FBbEI7QUFyQmlCO0FBc0JsQjs7Ozt3Q0FRbUI7QUFDbEI7QUFDQSxXQUFLSSxVQUFMLENBQWdCQyxhQUFoQixHQUFnQyxJQUFoQztBQUNEOzs7OENBRXlCQyxTLEVBQVc7QUFDbkM7QUFDQTtBQUNBLFVBQUksV0FBV0EsU0FBZixFQUEwQixLQUFLQyxRQUFMLENBQWMsRUFBRWYsWUFBWWMsVUFBVWYsS0FBeEIsRUFBZDtBQUMzQjs7OzJCQUVNaUIsRSxFQUFJO0FBQ1Q7QUFDQSxVQUFJQyxTQUFTQyxhQUFULEtBQTJCLEtBQUtOLFVBQXBDLEVBQWdEO0FBQzlDLGFBQUtHLFFBQUwsQ0FBYyxFQUFFWCxXQUFXLElBQWIsRUFBZDtBQUNEOztBQUVEO0FBQ0EsVUFBSWUsS0FBSyxLQUFLckIsS0FBTCxDQUFXc0IsTUFBcEI7QUFDQUQsWUFBTUEsR0FBR0gsRUFBSCxDQUFOO0FBQ0Q7Ozs2QkFFUUEsRSxFQUFJO0FBQ1gsV0FBS0QsUUFBTCxDQUFjO0FBQ1pmLG9CQUFZZ0IsR0FBR0ssTUFBSCxDQUFVdEIsS0FEVjtBQUVaTSxvQkFBWTtBQUZBLE9BQWQ7O0FBS0E7QUFDQSxVQUFJYyxLQUFLLEtBQUtyQixLQUFMLENBQVdRLFFBQXBCO0FBQ0FhLFlBQU1BLEdBQUdILEVBQUgsQ0FBTjtBQUNEOzs7bUNBRWM7QUFDYjtBQUNBLFdBQUtKLFVBQUwsQ0FBZ0JVLEtBQWhCO0FBQ0Q7Ozs2QkFFUTtBQUFBOztBQUNQLFVBQUlDLE1BQU0sRUFBVjtBQUFBLFVBQ0VDLGFBQWFDLFFBQVEsS0FBS3RCLEtBQUwsQ0FBV0gsVUFBWCxDQUFzQjBCLFFBQXRCLEVBQVIsQ0FEZjtBQUFBLFVBRUVDLGdCQUZGOztBQURPLG1CQUs4QyxLQUFLN0IsS0FMbkQ7QUFBQSxVQUtDOEIsSUFMRCxVQUtDQSxJQUxEO0FBQUEsVUFLT0MsT0FMUCxVQUtPQSxPQUxQO0FBQUEsVUFLZ0JDLElBTGhCLFVBS2dCQSxJQUxoQjtBQUFBLFVBS3NCQyxJQUx0QixVQUtzQkEsSUFMdEI7QUFBQSxVQUsrQkMsVUFML0I7OztBQU9QVCxVQUFJLGlCQUFKLElBQXlCLEtBQUtwQixLQUFMLENBQVdDLFNBQXBDO0FBQ0FtQixVQUFJLG1CQUFKLElBQTJCLENBQUMsS0FBS3BCLEtBQUwsQ0FBV0MsU0FBdkM7QUFDQW1CLFVBQUksa0JBQUosSUFBMEIsS0FBS3BCLEtBQUwsQ0FBV0UsVUFBckM7QUFDQWtCLFVBQUksZUFBSixJQUF1QixDQUFDLEtBQUtwQixLQUFMLENBQVdFLFVBQW5DO0FBQ0FrQixVQUFJLGVBQUosSUFBdUIsQ0FBQ0MsVUFBeEI7QUFDQUQsVUFBSSxtQkFBSixJQUEyQkMsVUFBM0I7QUFDQUQsVUFBSSxpQkFBSixJQUF5Qk0sT0FBekI7O0FBRUFOLFlBQU0zQixLQUFLcUMsVUFBTCxDQUFnQlYsR0FBaEIsQ0FBTjs7QUFFQSxVQUFJUSxTQUFTLFVBQWIsRUFBeUI7QUFDdkJKLGtCQUNFLG1FQUNPSyxVQURQO0FBRUUsZUFBSyxpQkFBTTtBQUFFLG1CQUFLcEIsVUFBTCxHQUFrQnNCLEVBQWxCO0FBQXNCLFdBRnJDO0FBR0UscUJBQVdYLEdBSGI7QUFJRSxnQkFBTU8sSUFKUjtBQUtFLHVCQUFhRixJQUxmO0FBTUUsa0JBQVEsS0FBS2xCLFFBTmY7QUFPRSxvQkFBVSxLQUFLQztBQVBqQixXQURGO0FBV0QsT0FaRCxNQVlPO0FBQ0xnQixrQkFDRSxnRUFDT0ssVUFEUDtBQUVFLGVBQUssaUJBQU07QUFBRSxtQkFBS3BCLFVBQUwsR0FBa0JzQixFQUFsQjtBQUFzQixXQUZyQztBQUdFLHFCQUFXWCxHQUhiO0FBSUUsZ0JBQU1RLElBSlI7QUFLRSx1QkFBYSxLQUFLakMsS0FBTCxDQUFXOEIsSUFMMUI7QUFNRSxrQkFBUSxLQUFLbEIsUUFOZjtBQU9FLG9CQUFVLEtBQUtDO0FBUGpCLFdBREY7QUFXRDs7QUFFRCxhQUFPZ0IsT0FBUDtBQUNEOzs7RUFqSGlCLGdCQUFNUSxTOztBQXFIMUI7Ozs7OztBQXJITXRDLEssQ0F5Qkd1QyxZLEdBQWU7QUFDcEJSLFFBQU0sSUFEYztBQUVwQkMsV0FBUyxLQUZXO0FBR3BCQyxRQUFNO0FBSGMsQzs7SUFnR2xCTyxLOzs7Ozs7Ozs7Ozs7OzttTUFDSmxDLEssR0FBUTtBQUNObUMsYUFBTztBQURELEs7Ozs7O3dDQVNZO0FBQUE7O0FBQ2xCLFdBQUtDLFVBQUwsR0FBa0JDLFdBQVcsWUFBTTtBQUNqQyxZQUFNQyxJQUFJLGVBQVY7QUFDQSxZQUFJSCxjQUFKOztBQUVBQSxnQkFBUTtBQUNOSSxzQkFBWUQsQ0FETjtBQUVORSw0QkFBa0JGLENBRlo7QUFHTkcseUJBQWVILENBSFQ7QUFJTkksdUJBQWFKLENBSlA7QUFLTkssdUJBQWFMO0FBTFAsU0FBUjs7QUFRQSxlQUFLMUIsUUFBTCxDQUFjLEVBQUV1QixZQUFGLEVBQWQ7QUFDRCxPQWJpQixFQWFmLEdBYmUsQ0FBbEI7QUFjRDs7OzJDQUVzQjtBQUNyQjtBQUNBUyxtQkFBYSxLQUFLUixVQUFsQjtBQUNEOzs7NkJBRVE7QUFDUCxhQUNFO0FBQUE7QUFBQTtBQUNFLGlCQUFPLEtBQUtwQyxLQUFMLENBQVdtQyxLQURwQjtBQUVFLG1CQUFTLEtBQUt4QyxLQUFMLENBQVdrRDtBQUZ0QjtBQUlHLGFBQUtsRCxLQUFMLENBQVdtRDtBQUpkLE9BREY7QUFRRDs7O0VBekNpQixnQkFBTWQsUzs7QUE2QzFCOzs7Ozs7QUE3Q01FLEssQ0FLR0QsWSxHQUFlO0FBQ3BCYSxRQUFNLEVBRGM7QUFFcEJELFdBQVM7QUFGVyxDOztJQTRDbEJFLFM7OztBQUNKLHFCQUFZcEQsS0FBWixFQUFtQjtBQUFBOztBQUFBLG1JQUNYQSxLQURXOztBQUdqQixXQUFLcUQsU0FBTCxHQUFpQnZELEtBQUthLFFBQUwsU0FBb0IsU0FBcEIsQ0FBakI7QUFIaUI7QUFJbEI7Ozs7NEJBUU9PLEUsRUFBSTtBQUNWO0FBQ0EsVUFBSXBCLEtBQUt3RCxxQkFBTCxPQUFpQyxLQUFyQyxFQUE0QztBQUMxQ3BDLFdBQUdLLE1BQUgsQ0FBVWlCLEtBQVYsQ0FBZ0JlLE1BQWhCLEdBQXlCLE1BQXpCO0FBQ0EsYUFBS3pDLFVBQUwsQ0FBZ0IwQyxZQUFoQjtBQUNEO0FBQ0Y7Ozs2QkFFUTtBQUFBOztBQUNQLFVBQUkvQixNQUFNLEVBQVY7QUFBQSxVQUNFZ0MsZ0JBREY7O0FBRE8sb0JBS1EsS0FBS3pELEtBTGI7QUFBQSxVQUlDMEQsUUFKRCxXQUlDQSxRQUpEO0FBQUEsVUFJV0MsU0FKWCxXQUlXQSxTQUpYO0FBQUEsVUFJc0JuQixLQUp0QixXQUlzQkEsS0FKdEI7QUFBQSxVQUk2Qm9CLEtBSjdCLFdBSTZCQSxLQUo3QjtBQUFBLFVBSW9DQyxhQUpwQyxXQUlvQ0EsYUFKcEM7QUFBQSxVQUtGQyxLQUxFOzs7QUFPUCxVQUFNN0IsT0FBT3BDLE9BQU9vQyxJQUFQLENBQVkyQixLQUFaLENBQWI7O0FBRUEsVUFBSzNCLFNBQVMsUUFBVCxJQUFxQjJCLE1BQU1HLE1BQTVCLElBQXVDOUIsU0FBUyxRQUFwRCxFQUE4RDtBQUM1RHdCLGtCQUFVLDhCQUFDLEtBQUQsSUFBTyxNQUFNRyxLQUFiLEVBQW9CLFNBQVMsS0FBS1AsU0FBbEMsR0FBVjtBQUNEOztBQUVENUIsVUFBSSxlQUFKLElBQXVCLElBQXZCO0FBQ0FBLFVBQUksNEJBQUosSUFBb0NvQyxhQUFwQztBQUNBcEMsWUFBTTNCLEtBQUtxQyxVQUFMLENBQWdCVixHQUFoQixDQUFOOztBQUVBLGFBQ0U7QUFBQTtBQUFBO0FBQ0UscUJBQVdBLE1BQU0sR0FBTixHQUFZa0MsU0FEekI7QUFFRSxpQkFBT25CO0FBRlQ7QUFJRSxzQ0FBQyxLQUFELHlCQUFPLEtBQUssaUJBQU07QUFBRSxtQkFBSzFCLFVBQUwsR0FBa0JzQixFQUFsQjtBQUFzQixXQUExQyxJQUFpRDBCLEtBQWpELEVBSkY7QUFLR0w7QUFMSCxPQURGO0FBU0Q7OztFQS9DcUIsZ0JBQU1wQixTOztBQW9EOUI7OztBQXBETWUsUyxDQU9HZCxZLEdBQWU7QUFDcEJxQixhQUFXLEVBRFM7QUFFcEJDLFNBQU8sSUFGYTtBQUdwQkMsaUJBQWU7QUFISyxDO1FBOENmVCxTLEdBQUFBLFMiLCJmaWxlIjoidGV4dC1maWVsZC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCBUZXh0SW5wdXQgQ29tcG9uZW50XG4gKiBAbW9kdWxlIHJlYWN0L3RleHQtZmllbGRcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCAqIGFzIGpxTGl0ZSBmcm9tICcuLi9qcy9saWIvanFMaXRlJztcbmltcG9ydCAqIGFzIHV0aWwgZnJvbSAnLi4vanMvbGliL3V0aWwnO1xuaW1wb3J0IHsgY29udHJvbGxlZE1lc3NhZ2UgfSBmcm9tICcuL19oZWxwZXJzJztcblxuXG4vKipcbiAqIElucHV0IGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgSW5wdXQgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcblxuICAgIGxldCB2YWx1ZSA9IHByb3BzLnZhbHVlO1xuICAgIGxldCBpbm5lclZhbHVlID0gdmFsdWUgfHwgcHJvcHMuZGVmYXVsdFZhbHVlO1xuXG4gICAgaWYgKGlubmVyVmFsdWUgPT09IHVuZGVmaW5lZCkgaW5uZXJWYWx1ZSA9ICcnO1xuXG4gICAgdGhpcy5zdGF0ZSA9IHtcbiAgICAgIGlubmVyVmFsdWU6IGlubmVyVmFsdWUsXG4gICAgICBpc1RvdWNoZWQ6IGZhbHNlLFxuICAgICAgaXNQcmlzdGluZTogdHJ1ZVxuICAgIH07XG5cbiAgICAvLyB3YXJuIGlmIHZhbHVlIGRlZmluZWQgYnV0IG9uQ2hhbmdlIGlzIG5vdFxuICAgIGlmICh2YWx1ZSAhPT0gdW5kZWZpbmVkICYmICFwcm9wcy5vbkNoYW5nZSkge1xuICAgICAgdXRpbC5yYWlzZUVycm9yKGNvbnRyb2xsZWRNZXNzYWdlLCB0cnVlKTtcbiAgICB9XG5cbiAgICBsZXQgY2IgPSB1dGlsLmNhbGxiYWNrO1xuICAgIHRoaXMub25CbHVyQ0IgPSBjYih0aGlzLCAnb25CbHVyJyk7XG4gICAgdGhpcy5vbkNoYW5nZUNCID0gY2IodGhpcywgJ29uQ2hhbmdlJyk7XG4gIH1cblxuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGhpbnQ6IG51bGwsXG4gICAgaW52YWxpZDogZmFsc2UsXG4gICAgcm93czogMlxuICB9O1xuXG4gIGNvbXBvbmVudERpZE1vdW50KCkge1xuICAgIC8vIGRpc2FibGUgTVVJIGpzXG4gICAgdGhpcy5pbnB1dEVsUmVmLl9tdWlUZXh0ZmllbGQgPSB0cnVlO1xuICB9XG5cbiAgY29tcG9uZW50V2lsbFJlY2VpdmVQcm9wcyhuZXh0UHJvcHMpIHtcbiAgICAvLyB1cGRhdGUgaW5uZXJWYWx1ZSB3aGVuIG5ldyB2YWx1ZSBpcyByZWNlaXZlZCB0byBoYW5kbGUgcHJvZ3JhbW1hdGljXG4gICAgLy8gY2hhbmdlcyB0byBpbnB1dCBib3hcbiAgICBpZiAoJ3ZhbHVlJyBpbiBuZXh0UHJvcHMpIHRoaXMuc2V0U3RhdGUoeyBpbm5lclZhbHVlOiBuZXh0UHJvcHMudmFsdWUgfSk7XG4gIH1cblxuICBvbkJsdXIoZXYpIHtcbiAgICAvLyBpZ25vcmUgaWYgZXZlbnQgaXMgYSB3aW5kb3cgYmx1clxuICAgIGlmIChkb2N1bWVudC5hY3RpdmVFbGVtZW50ICE9PSB0aGlzLmlucHV0RWxSZWYpIHtcbiAgICAgIHRoaXMuc2V0U3RhdGUoeyBpc1RvdWNoZWQ6IHRydWUgfSk7XG4gICAgfVxuXG4gICAgLy8gZXhlY3V0ZSBjYWxsYmFja1xuICAgIGxldCBmbiA9IHRoaXMucHJvcHMub25CbHVyO1xuICAgIGZuICYmIGZuKGV2KTtcbiAgfVxuXG4gIG9uQ2hhbmdlKGV2KSB7XG4gICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICBpbm5lclZhbHVlOiBldi50YXJnZXQudmFsdWUsXG4gICAgICBpc1ByaXN0aW5lOiBmYWxzZVxuICAgIH0pO1xuXG4gICAgLy8gZXhlY3V0ZSBjYWxsYmFja1xuICAgIGxldCBmbiA9IHRoaXMucHJvcHMub25DaGFuZ2U7XG4gICAgZm4gJiYgZm4oZXYpO1xuICB9XG5cbiAgdHJpZ2dlckZvY3VzKCkge1xuICAgIC8vIGhhY2sgdG8gZW5hYmxlIElFMTAgcG9pbnRlci1ldmVudHMgc2hpbVxuICAgIHRoaXMuaW5wdXRFbFJlZi5mb2N1cygpO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGxldCBjbHMgPSB7fSxcbiAgICAgIGlzTm90RW1wdHkgPSBCb29sZWFuKHRoaXMuc3RhdGUuaW5uZXJWYWx1ZS50b1N0cmluZygpKSxcbiAgICAgIGlucHV0RWw7XG5cbiAgICBjb25zdCB7IGhpbnQsIGludmFsaWQsIHJvd3MsIHR5cGUsIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICBjbHNbJ211aS0taXMtdG91Y2hlZCddID0gdGhpcy5zdGF0ZS5pc1RvdWNoZWQ7XG4gICAgY2xzWydtdWktLWlzLXVudG91Y2hlZCddID0gIXRoaXMuc3RhdGUuaXNUb3VjaGVkO1xuICAgIGNsc1snbXVpLS1pcy1wcmlzdGluZSddID0gdGhpcy5zdGF0ZS5pc1ByaXN0aW5lO1xuICAgIGNsc1snbXVpLS1pcy1kaXJ0eSddID0gIXRoaXMuc3RhdGUuaXNQcmlzdGluZTtcbiAgICBjbHNbJ211aS0taXMtZW1wdHknXSA9ICFpc05vdEVtcHR5O1xuICAgIGNsc1snbXVpLS1pcy1ub3QtZW1wdHknXSA9IGlzTm90RW1wdHk7XG4gICAgY2xzWydtdWktLWlzLWludmFsaWQnXSA9IGludmFsaWQ7XG5cbiAgICBjbHMgPSB1dGlsLmNsYXNzTmFtZXMoY2xzKTtcblxuICAgIGlmICh0eXBlID09PSAndGV4dGFyZWEnKSB7XG4gICAgICBpbnB1dEVsID0gKFxuICAgICAgICA8dGV4dGFyZWFcbiAgICAgICAgICB7IC4uLnJlYWN0UHJvcHMgfVxuICAgICAgICAgIHJlZj17ZWwgPT4geyB0aGlzLmlucHV0RWxSZWYgPSBlbCB9fVxuICAgICAgICAgIGNsYXNzTmFtZT17Y2xzfVxuICAgICAgICAgIHJvd3M9e3Jvd3N9XG4gICAgICAgICAgcGxhY2Vob2xkZXI9e2hpbnR9XG4gICAgICAgICAgb25CbHVyPXt0aGlzLm9uQmx1ckNCfVxuICAgICAgICAgIG9uQ2hhbmdlPXt0aGlzLm9uQ2hhbmdlQ0J9XG4gICAgICAgIC8+XG4gICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICBpbnB1dEVsID0gKFxuICAgICAgICA8aW5wdXRcbiAgICAgICAgICB7IC4uLnJlYWN0UHJvcHMgfVxuICAgICAgICAgIHJlZj17ZWwgPT4geyB0aGlzLmlucHV0RWxSZWYgPSBlbCB9fVxuICAgICAgICAgIGNsYXNzTmFtZT17Y2xzfVxuICAgICAgICAgIHR5cGU9e3R5cGV9XG4gICAgICAgICAgcGxhY2Vob2xkZXI9e3RoaXMucHJvcHMuaGludH1cbiAgICAgICAgICBvbkJsdXI9e3RoaXMub25CbHVyQ0J9XG4gICAgICAgICAgb25DaGFuZ2U9e3RoaXMub25DaGFuZ2VDQn1cbiAgICAgICAgLz5cbiAgICAgICk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGlucHV0RWw7XG4gIH1cbn1cblxuXG4vKipcbiAqIExhYmVsIGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgTGFiZWwgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0ZSA9IHtcbiAgICBzdHlsZToge31cbiAgfTtcblxuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIHRleHQ6ICcnLFxuICAgIG9uQ2xpY2s6IG51bGxcbiAgfTtcblxuICBjb21wb25lbnREaWRNb3VudCgpIHtcbiAgICB0aGlzLnN0eWxlVGltZXIgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgIGNvbnN0IHMgPSAnLjE1cyBlYXNlLW91dCc7XG4gICAgICBsZXQgc3R5bGU7XG5cbiAgICAgIHN0eWxlID0ge1xuICAgICAgICB0cmFuc2l0aW9uOiBzLFxuICAgICAgICBXZWJraXRUcmFuc2l0aW9uOiBzLFxuICAgICAgICBNb3pUcmFuc2l0aW9uOiBzLFxuICAgICAgICBPVHJhbnNpdGlvbjogcyxcbiAgICAgICAgbXNUcmFuc2Zvcm06IHNcbiAgICAgIH07XG5cbiAgICAgIHRoaXMuc2V0U3RhdGUoeyBzdHlsZSB9KTtcbiAgICB9LCAxNTApO1xuICB9XG5cbiAgY29tcG9uZW50V2lsbFVubW91bnQoKSB7XG4gICAgLy8gY2xlYXIgdGltZXJcbiAgICBjbGVhclRpbWVvdXQodGhpcy5zdHlsZVRpbWVyKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gKFxuICAgICAgPGxhYmVsXG4gICAgICAgIHN0eWxlPXt0aGlzLnN0YXRlLnN0eWxlfVxuICAgICAgICBvbkNsaWNrPXt0aGlzLnByb3BzLm9uQ2xpY2t9XG4gICAgICA+XG4gICAgICAgIHt0aGlzLnByb3BzLnRleHR9XG4gICAgICA8L2xhYmVsPlxuICAgICk7XG4gIH1cbn1cblxuXG4vKipcbiAqIFRleHRGaWVsZCBjb25zdHJ1Y3RvclxuICogQGNsYXNzXG4gKi9cbmNsYXNzIFRleHRGaWVsZCBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIGNvbnN0cnVjdG9yKHByb3BzKSB7XG4gICAgc3VwZXIocHJvcHMpO1xuXG4gICAgdGhpcy5vbkNsaWNrQ0IgPSB1dGlsLmNhbGxiYWNrKHRoaXMsICdvbkNsaWNrJyk7XG4gIH1cblxuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJycsXG4gICAgbGFiZWw6IG51bGwsXG4gICAgZmxvYXRpbmdMYWJlbDogZmFsc2VcbiAgfTtcblxuICBvbkNsaWNrKGV2KSB7XG4gICAgLy8gcG9pbnRlci1ldmVudHMgc2hpbVxuICAgIGlmICh1dGlsLnN1cHBvcnRzUG9pbnRlckV2ZW50cygpID09PSBmYWxzZSkge1xuICAgICAgZXYudGFyZ2V0LnN0eWxlLmN1cnNvciA9ICd0ZXh0JztcbiAgICAgIHRoaXMuaW5wdXRFbFJlZi50cmlnZ2VyRm9jdXMoKTtcbiAgICB9XG4gIH1cblxuICByZW5kZXIoKSB7XG4gICAgbGV0IGNscyA9IHt9LFxuICAgICAgbGFiZWxFbDtcblxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgc3R5bGUsIGxhYmVsLCBmbG9hdGluZ0xhYmVsLFxuICAgICAgLi4ub3RoZXIgfSA9IHRoaXMucHJvcHM7XG5cbiAgICBjb25zdCB0eXBlID0ganFMaXRlLnR5cGUobGFiZWwpO1xuXG4gICAgaWYgKCh0eXBlID09PSAnc3RyaW5nJyAmJiBsYWJlbC5sZW5ndGgpIHx8IHR5cGUgPT09ICdvYmplY3QnKSB7XG4gICAgICBsYWJlbEVsID0gPExhYmVsIHRleHQ9e2xhYmVsfSBvbkNsaWNrPXt0aGlzLm9uQ2xpY2tDQn0gLz47XG4gICAgfVxuXG4gICAgY2xzWydtdWktdGV4dGZpZWxkJ10gPSB0cnVlO1xuICAgIGNsc1snbXVpLXRleHRmaWVsZC0tZmxvYXQtbGFiZWwnXSA9IGZsb2F0aW5nTGFiZWw7XG4gICAgY2xzID0gdXRpbC5jbGFzc05hbWVzKGNscyk7XG5cbiAgICByZXR1cm4gKFxuICAgICAgPGRpdlxuICAgICAgICBjbGFzc05hbWU9e2NscyArICcgJyArIGNsYXNzTmFtZX1cbiAgICAgICAgc3R5bGU9e3N0eWxlfVxuICAgICAgPlxuICAgICAgICA8SW5wdXQgcmVmPXtlbCA9PiB7IHRoaXMuaW5wdXRFbFJlZiA9IGVsIH19IHsgLi4ub3RoZXIgfSAvPlxuICAgICAgICB7bGFiZWxFbH1cbiAgICAgIDwvZGl2PlxuICAgICk7XG4gIH1cbn1cblxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IHsgVGV4dEZpZWxkIH07XG4iXX0= },{"../js/lib/jqLite":6,"../js/lib/util":7,"./_helpers":8,"react":"1n8/MK"}],13:[function(require,module,exports){ module.exports = "/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:Arial,Verdana,Tahoma;font-size:14px;font-weight:400;line-height:1.429;color:rgba(0,0,0,.87);background-color:#FFF}a{color:#2196F3;text-decoration:none}a:focus,a:hover{text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}p{margin:0 0 10px}ol,ul{margin-top:0;margin-bottom:10px}hr{margin-top:20px;margin-bottom:20px;border:0;height:1px;background-color:rgba(0,0,0,.12)}strong{font-weight:700}abbr[title]{cursor:help;border-bottom:1px dotted #2196F3}h1,h2,h3{margin-top:20px;margin-bottom:10px}h4,h5,h6{margin-top:10px;margin-bottom:10px}.mui--appbar-height{height:56px}.mui--appbar-min-height,.mui-appbar{min-height:56px}.mui--appbar-line-height{line-height:56px}.mui--appbar-top{top:56px}@media (orientation:landscape) and (max-height:480px){.mui--appbar-height{height:48px}.mui--appbar-min-height,.mui-appbar{min-height:48px}.mui--appbar-line-height{line-height:48px}.mui--appbar-top{top:48px}}@media (min-width:480px){.mui--appbar-height{height:64px}.mui--appbar-min-height,.mui-appbar{min-height:64px}.mui--appbar-line-height{line-height:64px}.mui--appbar-top{top:64px}}.mui-appbar{background-color:#2196F3;color:#FFF}.mui-btn{font-weight:500;font-size:14px;line-height:18px;text-transform:uppercase;color:rgba(0,0,0,.87);background-color:#FFF;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;height:36px;padding:0 26px;margin:6px 0;border:none;border-radius:2px;cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation;background-image:none;text-align:center;line-height:36px;vertical-align:middle;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;font-family:inherit;letter-spacing:.03em;position:relative;overflow:hidden}.mui-btn:active,.mui-btn:focus,.mui-btn:hover{color:rgba(0,0,0,.87);background-color:#fff}.mui-btn[disabled]:active,.mui-btn[disabled]:focus,.mui-btn[disabled]:hover{color:rgba(0,0,0,.87);background-color:#FFF}.mui-btn.mui-btn--flat{color:rgba(0,0,0,.87);background-color:transparent}.mui-btn.mui-btn--flat:active,.mui-btn.mui-btn--flat:focus,.mui-btn.mui-btn--flat:hover{color:rgba(0,0,0,.87);background-color:#f2f2f2}.mui-btn.mui-btn--flat[disabled]:active,.mui-btn.mui-btn--flat[disabled]:focus,.mui-btn.mui-btn--flat[disabled]:hover{color:rgba(0,0,0,.87);background-color:transparent}.mui-btn:active,.mui-btn:focus,.mui-btn:hover{outline:0;text-decoration:none;color:rgba(0,0,0,.87)}.mui-btn:focus,.mui-btn:hover{-webkit-box-shadow:0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2);box-shadow:0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn:focus,.mui-btn:hover{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn:focus,.mui-btn:hover{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}.mui-btn:active:hover{-webkit-box-shadow:0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn:active:hover{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn:active:hover{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}.mui-btn.mui--is-disabled,.mui-btn:disabled{cursor:not-allowed;pointer-events:none;opacity:.6;-webkit-box-shadow:none;box-shadow:none}.mui-btn+.mui-btn{margin-left:8px}.mui-btn--flat{background-color:transparent}.mui-btn--flat:active,.mui-btn--flat:active:hover,.mui-btn--flat:focus,.mui-btn--flat:hover{-webkit-box-shadow:none;box-shadow:none;background-color:#f2f2f2}.mui-btn--fab,.mui-btn--raised{-webkit-box-shadow:0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2);box-shadow:0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn--fab,.mui-btn--raised{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn--fab,.mui-btn--raised{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}.mui-btn--fab:active,.mui-btn--raised:active{-webkit-box-shadow:0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn--fab:active,.mui-btn--raised:active{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn--fab:active,.mui-btn--raised:active{-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}.mui-btn--fab{position:relative;padding:0;width:55px;height:55px;line-height:55px;border-radius:50%;z-index:1}.mui-btn--primary{color:#FFF;background-color:#2196F3}.mui-btn--primary:active,.mui-btn--primary:focus,.mui-btn--primary:hover{color:#FFF;background-color:#39a1f4}.mui-btn--primary[disabled]:active,.mui-btn--primary[disabled]:focus,.mui-btn--primary[disabled]:hover{color:#FFF;background-color:#2196F3}.mui-btn--primary.mui-btn--flat{color:#2196F3;background-color:transparent}.mui-btn--primary.mui-btn--flat:active,.mui-btn--primary.mui-btn--flat:focus,.mui-btn--primary.mui-btn--flat:hover{color:#2196F3;background-color:#f2f2f2}.mui-btn--primary.mui-btn--flat[disabled]:active,.mui-btn--primary.mui-btn--flat[disabled]:focus,.mui-btn--primary.mui-btn--flat[disabled]:hover{color:#2196F3;background-color:transparent}.mui-btn--dark{color:#FFF;background-color:#424242}.mui-btn--dark:active,.mui-btn--dark:focus,.mui-btn--dark:hover{color:#FFF;background-color:#4f4f4f}.mui-btn--dark[disabled]:active,.mui-btn--dark[disabled]:focus,.mui-btn--dark[disabled]:hover{color:#FFF;background-color:#424242}.mui-btn--dark.mui-btn--flat{color:#424242;background-color:transparent}.mui-btn--dark.mui-btn--flat:active,.mui-btn--dark.mui-btn--flat:focus,.mui-btn--dark.mui-btn--flat:hover{color:#424242;background-color:#f2f2f2}.mui-btn--dark.mui-btn--flat[disabled]:active,.mui-btn--dark.mui-btn--flat[disabled]:focus,.mui-btn--dark.mui-btn--flat[disabled]:hover{color:#424242;background-color:transparent}.mui-btn--danger{color:#FFF;background-color:#F44336}.mui-btn--danger:active,.mui-btn--danger:focus,.mui-btn--danger:hover{color:#FFF;background-color:#f55a4e}.mui-btn--danger[disabled]:active,.mui-btn--danger[disabled]:focus,.mui-btn--danger[disabled]:hover{color:#FFF;background-color:#F44336}.mui-btn--danger.mui-btn--flat{color:#F44336;background-color:transparent}.mui-btn--danger.mui-btn--flat:active,.mui-btn--danger.mui-btn--flat:focus,.mui-btn--danger.mui-btn--flat:hover{color:#F44336;background-color:#f2f2f2}.mui-btn--danger.mui-btn--flat[disabled]:active,.mui-btn--danger.mui-btn--flat[disabled]:focus,.mui-btn--danger.mui-btn--flat[disabled]:hover{color:#F44336;background-color:transparent}.mui-btn--accent{color:#FFF;background-color:#FF4081}.mui-btn--accent:active,.mui-btn--accent:focus,.mui-btn--accent:hover{color:#FFF;background-color:#ff5a92}.mui-btn--accent[disabled]:active,.mui-btn--accent[disabled]:focus,.mui-btn--accent[disabled]:hover{color:#FFF;background-color:#FF4081}.mui-btn--accent.mui-btn--flat{color:#FF4081;background-color:transparent}.mui-btn--accent.mui-btn--flat:active,.mui-btn--accent.mui-btn--flat:focus,.mui-btn--accent.mui-btn--flat:hover{color:#FF4081;background-color:#f2f2f2}.mui-btn--accent.mui-btn--flat[disabled]:active,.mui-btn--accent.mui-btn--flat[disabled]:focus,.mui-btn--accent.mui-btn--flat[disabled]:hover{color:#FF4081;background-color:transparent}.mui-btn--small{height:30.6px;line-height:30.6px;padding:0 16px;font-size:13px}.mui-btn--large{height:54px;line-height:54px;padding:0 26px;font-size:14px}.mui-btn--fab.mui-btn--small{width:44px;height:44px;line-height:44px}.mui-btn--fab.mui-btn--large{width:75px;height:75px;line-height:75px}.mui-checkbox,.mui-radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.mui-checkbox>label,.mui-radio>label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.mui-checkbox input:disabled,.mui-radio input:disabled{cursor:not-allowed}.mui-checkbox input:focus,.mui-radio input:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.mui-checkbox--inline>label>input[type=checkbox],.mui-checkbox>label>input[type=checkbox],.mui-radio--inline>label>input[type=radio],.mui-radio>label>input[type=radio]{position:absolute;margin-left:-20px;margin-top:4px}.mui-checkbox+.mui-checkbox,.mui-radio+.mui-radio{margin-top:-5px}.mui-checkbox--inline,.mui-radio--inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.mui-checkbox--inline>input[type=checkbox],.mui-checkbox--inline>input[type=radio],.mui-checkbox--inline>label>input[type=checkbox],.mui-checkbox--inline>label>input[type=radio],.mui-radio--inline>input[type=checkbox],.mui-radio--inline>input[type=radio],.mui-radio--inline>label>input[type=checkbox],.mui-radio--inline>label>input[type=radio]{margin:4px 0 0;line-height:normal}.mui-checkbox--inline+.mui-checkbox--inline,.mui-radio--inline+.mui-radio--inline{margin-top:0;margin-left:10px}.mui-container{-webkit-box-sizing:border-box;box-sizing:border-box;margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.mui-container:after,.mui-container:before{content:\" \";display:table}.mui-container:after{clear:both}@media (min-width:544px){.mui-container{max-width:570px}}@media (min-width:768px){.mui-container{max-width:740px}}@media (min-width:992px){.mui-container{max-width:960px}}@media (min-width:1200px){.mui-container{max-width:1170px}}.mui-container-fluid{-webkit-box-sizing:border-box;box-sizing:border-box;margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.mui-container-fluid:after,.mui-container-fluid:before{content:\" \";display:table}.mui-container-fluid:after{clear:both}.mui-divider{display:block;height:1px;background-color:rgba(0,0,0,.12)}.mui--divider-top{border-top:1px solid rgba(0,0,0,.12)}.mui--divider-bottom{border-bottom:1px solid rgba(0,0,0,.12)}.mui--divider-left{border-left:1px solid rgba(0,0,0,.12)}.mui--divider-right{border-right:1px solid rgba(0,0,0,.12)}.mui-dropdown{display:inline-block;position:relative}[data-mui-toggle=dropdown]{outline:0}.mui-dropdown__menu{position:absolute;top:100%;left:0;display:none;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#FFF;border-radius:2px;z-index:1;background-clip:padding-box}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-dropdown__menu{border-top:1px solid rgba(0,0,0,.12);border-left:1px solid rgba(0,0,0,.12)}}@supports (-ms-ime-align:auto){.mui-dropdown__menu{border-top:1px solid rgba(0,0,0,.12);border-left:1px solid rgba(0,0,0,.12)}}.mui-dropdown__menu.mui--is-open{display:block}.mui-dropdown__menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.429;color:rgba(0,0,0,.87);text-decoration:none;white-space:nowrap}.mui-dropdown__menu>li>a:focus,.mui-dropdown__menu>li>a:hover{text-decoration:none;color:rgba(0,0,0,.87);background-color:#EEE}.mui-dropdown__menu>.mui--is-disabled>a,.mui-dropdown__menu>.mui--is-disabled>a:focus,.mui-dropdown__menu>.mui--is-disabled>a:hover{color:#EEE}.mui-dropdown__menu>.mui--is-disabled>a:focus,.mui-dropdown__menu>.mui--is-disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;cursor:not-allowed}.mui-dropdown__menu--right{left:auto;right:0}.mui-form legend{display:block;width:100%;padding:0;margin-bottom:10px;font-size:21px;color:rgba(0,0,0,.87);line-height:inherit;border:0}.mui-form fieldset{border:0;padding:0;margin:0 0 20px 0}@media (min-width:544px){.mui-form--inline .mui-textfield{display:inline-block;vertical-align:bottom;margin-bottom:0}.mui-form--inline .mui-checkbox,.mui-form--inline .mui-radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.mui-form--inline .mui-checkbox>label,.mui-form--inline .mui-radio>label{padding-left:0}.mui-form--inline .mui-checkbox>label>input[type=checkbox],.mui-form--inline .mui-radio>label>input[type=radio]{position:relative;margin-left:0}.mui-form--inline .mui-select{display:inline-block;vertical-align:bottom;margin-bottom:0}.mui-form--inline .mui-btn{margin-bottom:0;margin-top:0;vertical-align:bottom}}.mui-row{margin-left:-15px;margin-right:-15px}.mui-row:after,.mui-row:before{content:\" \";display:table}.mui-row:after{clear:both}.mui-col-lg-1,.mui-col-lg-10,.mui-col-lg-11,.mui-col-lg-12,.mui-col-lg-2,.mui-col-lg-3,.mui-col-lg-4,.mui-col-lg-5,.mui-col-lg-6,.mui-col-lg-7,.mui-col-lg-8,.mui-col-lg-9,.mui-col-md-1,.mui-col-md-10,.mui-col-md-11,.mui-col-md-12,.mui-col-md-2,.mui-col-md-3,.mui-col-md-4,.mui-col-md-5,.mui-col-md-6,.mui-col-md-7,.mui-col-md-8,.mui-col-md-9,.mui-col-sm-1,.mui-col-sm-10,.mui-col-sm-11,.mui-col-sm-12,.mui-col-sm-2,.mui-col-sm-3,.mui-col-sm-4,.mui-col-sm-5,.mui-col-sm-6,.mui-col-sm-7,.mui-col-sm-8,.mui-col-sm-9,.mui-col-xs-1,.mui-col-xs-10,.mui-col-xs-11,.mui-col-xs-12,.mui-col-xs-2,.mui-col-xs-3,.mui-col-xs-4,.mui-col-xs-5,.mui-col-xs-6,.mui-col-xs-7,.mui-col-xs-8,.mui-col-xs-9{-webkit-box-sizing:border-box;box-sizing:border-box;min-height:1px;padding-left:15px;padding-right:15px}.mui-col-xs-1,.mui-col-xs-10,.mui-col-xs-11,.mui-col-xs-12,.mui-col-xs-2,.mui-col-xs-3,.mui-col-xs-4,.mui-col-xs-5,.mui-col-xs-6,.mui-col-xs-7,.mui-col-xs-8,.mui-col-xs-9{float:left}.mui-col-xs-1{width:8.33333%}.mui-col-xs-2{width:16.66667%}.mui-col-xs-3{width:25%}.mui-col-xs-4{width:33.33333%}.mui-col-xs-5{width:41.66667%}.mui-col-xs-6{width:50%}.mui-col-xs-7{width:58.33333%}.mui-col-xs-8{width:66.66667%}.mui-col-xs-9{width:75%}.mui-col-xs-10{width:83.33333%}.mui-col-xs-11{width:91.66667%}.mui-col-xs-12{width:100%}.mui-col-xs-offset-0{margin-left:0}.mui-col-xs-offset-1{margin-left:8.33333%}.mui-col-xs-offset-2{margin-left:16.66667%}.mui-col-xs-offset-3{margin-left:25%}.mui-col-xs-offset-4{margin-left:33.33333%}.mui-col-xs-offset-5{margin-left:41.66667%}.mui-col-xs-offset-6{margin-left:50%}.mui-col-xs-offset-7{margin-left:58.33333%}.mui-col-xs-offset-8{margin-left:66.66667%}.mui-col-xs-offset-9{margin-left:75%}.mui-col-xs-offset-10{margin-left:83.33333%}.mui-col-xs-offset-11{margin-left:91.66667%}.mui-col-xs-offset-12{margin-left:100%}@media (min-width:544px){.mui-col-sm-1,.mui-col-sm-10,.mui-col-sm-11,.mui-col-sm-12,.mui-col-sm-2,.mui-col-sm-3,.mui-col-sm-4,.mui-col-sm-5,.mui-col-sm-6,.mui-col-sm-7,.mui-col-sm-8,.mui-col-sm-9{float:left}.mui-col-sm-1{width:8.33333%}.mui-col-sm-2{width:16.66667%}.mui-col-sm-3{width:25%}.mui-col-sm-4{width:33.33333%}.mui-col-sm-5{width:41.66667%}.mui-col-sm-6{width:50%}.mui-col-sm-7{width:58.33333%}.mui-col-sm-8{width:66.66667%}.mui-col-sm-9{width:75%}.mui-col-sm-10{width:83.33333%}.mui-col-sm-11{width:91.66667%}.mui-col-sm-12{width:100%}.mui-col-sm-offset-0{margin-left:0}.mui-col-sm-offset-1{margin-left:8.33333%}.mui-col-sm-offset-2{margin-left:16.66667%}.mui-col-sm-offset-3{margin-left:25%}.mui-col-sm-offset-4{margin-left:33.33333%}.mui-col-sm-offset-5{margin-left:41.66667%}.mui-col-sm-offset-6{margin-left:50%}.mui-col-sm-offset-7{margin-left:58.33333%}.mui-col-sm-offset-8{margin-left:66.66667%}.mui-col-sm-offset-9{margin-left:75%}.mui-col-sm-offset-10{margin-left:83.33333%}.mui-col-sm-offset-11{margin-left:91.66667%}.mui-col-sm-offset-12{margin-left:100%}}@media (min-width:768px){.mui-col-md-1,.mui-col-md-10,.mui-col-md-11,.mui-col-md-12,.mui-col-md-2,.mui-col-md-3,.mui-col-md-4,.mui-col-md-5,.mui-col-md-6,.mui-col-md-7,.mui-col-md-8,.mui-col-md-9{float:left}.mui-col-md-1{width:8.33333%}.mui-col-md-2{width:16.66667%}.mui-col-md-3{width:25%}.mui-col-md-4{width:33.33333%}.mui-col-md-5{width:41.66667%}.mui-col-md-6{width:50%}.mui-col-md-7{width:58.33333%}.mui-col-md-8{width:66.66667%}.mui-col-md-9{width:75%}.mui-col-md-10{width:83.33333%}.mui-col-md-11{width:91.66667%}.mui-col-md-12{width:100%}.mui-col-md-offset-0{margin-left:0}.mui-col-md-offset-1{margin-left:8.33333%}.mui-col-md-offset-2{margin-left:16.66667%}.mui-col-md-offset-3{margin-left:25%}.mui-col-md-offset-4{margin-left:33.33333%}.mui-col-md-offset-5{margin-left:41.66667%}.mui-col-md-offset-6{margin-left:50%}.mui-col-md-offset-7{margin-left:58.33333%}.mui-col-md-offset-8{margin-left:66.66667%}.mui-col-md-offset-9{margin-left:75%}.mui-col-md-offset-10{margin-left:83.33333%}.mui-col-md-offset-11{margin-left:91.66667%}.mui-col-md-offset-12{margin-left:100%}}@media (min-width:992px){.mui-col-lg-1,.mui-col-lg-10,.mui-col-lg-11,.mui-col-lg-12,.mui-col-lg-2,.mui-col-lg-3,.mui-col-lg-4,.mui-col-lg-5,.mui-col-lg-6,.mui-col-lg-7,.mui-col-lg-8,.mui-col-lg-9{float:left}.mui-col-lg-1{width:8.33333%}.mui-col-lg-2{width:16.66667%}.mui-col-lg-3{width:25%}.mui-col-lg-4{width:33.33333%}.mui-col-lg-5{width:41.66667%}.mui-col-lg-6{width:50%}.mui-col-lg-7{width:58.33333%}.mui-col-lg-8{width:66.66667%}.mui-col-lg-9{width:75%}.mui-col-lg-10{width:83.33333%}.mui-col-lg-11{width:91.66667%}.mui-col-lg-12{width:100%}.mui-col-lg-offset-0{margin-left:0}.mui-col-lg-offset-1{margin-left:8.33333%}.mui-col-lg-offset-2{margin-left:16.66667%}.mui-col-lg-offset-3{margin-left:25%}.mui-col-lg-offset-4{margin-left:33.33333%}.mui-col-lg-offset-5{margin-left:41.66667%}.mui-col-lg-offset-6{margin-left:50%}.mui-col-lg-offset-7{margin-left:58.33333%}.mui-col-lg-offset-8{margin-left:66.66667%}.mui-col-lg-offset-9{margin-left:75%}.mui-col-lg-offset-10{margin-left:83.33333%}.mui-col-lg-offset-11{margin-left:91.66667%}.mui-col-lg-offset-12{margin-left:100%}}@media (min-width:1200px){.mui-col-xl-1,.mui-col-xl-10,.mui-col-xl-11,.mui-col-xl-12,.mui-col-xl-2,.mui-col-xl-3,.mui-col-xl-4,.mui-col-xl-5,.mui-col-xl-6,.mui-col-xl-7,.mui-col-xl-8,.mui-col-xl-9{float:left}.mui-col-xl-1{width:8.33333%}.mui-col-xl-2{width:16.66667%}.mui-col-xl-3{width:25%}.mui-col-xl-4{width:33.33333%}.mui-col-xl-5{width:41.66667%}.mui-col-xl-6{width:50%}.mui-col-xl-7{width:58.33333%}.mui-col-xl-8{width:66.66667%}.mui-col-xl-9{width:75%}.mui-col-xl-10{width:83.33333%}.mui-col-xl-11{width:91.66667%}.mui-col-xl-12{width:100%}.mui-col-xl-offset-0{margin-left:0}.mui-col-xl-offset-1{margin-left:8.33333%}.mui-col-xl-offset-2{margin-left:16.66667%}.mui-col-xl-offset-3{margin-left:25%}.mui-col-xl-offset-4{margin-left:33.33333%}.mui-col-xl-offset-5{margin-left:41.66667%}.mui-col-xl-offset-6{margin-left:50%}.mui-col-xl-offset-7{margin-left:58.33333%}.mui-col-xl-offset-8{margin-left:66.66667%}.mui-col-xl-offset-9{margin-left:75%}.mui-col-xl-offset-10{margin-left:83.33333%}.mui-col-xl-offset-11{margin-left:91.66667%}.mui-col-xl-offset-12{margin-left:100%}}.mui-panel{padding:15px;margin-bottom:20px;border-radius:0;background-color:#FFF;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12);box-shadow:0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12)}.mui-panel:after,.mui-panel:before{content:\" \";display:table}.mui-panel:after{clear:both}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-panel{-webkit-box-shadow:0 -1px 2px 0 rgba(0,0,0,.12),-1px 0 2px 0 rgba(0,0,0,.12),0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12);box-shadow:0 -1px 2px 0 rgba(0,0,0,.12),-1px 0 2px 0 rgba(0,0,0,.12),0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12)}}@supports (-ms-ime-align:auto){.mui-panel{-webkit-box-shadow:0 -1px 2px 0 rgba(0,0,0,.12),-1px 0 2px 0 rgba(0,0,0,.12),0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12);box-shadow:0 -1px 2px 0 rgba(0,0,0,.12),-1px 0 2px 0 rgba(0,0,0,.12),0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12)}}.mui-select{display:block;padding-top:15px;margin-bottom:20px;position:relative}.mui-select:focus{outline:0}.mui-select:focus>select{height:33px;margin-bottom:-1px;border-color:#2196F3;border-width:2px}.mui-select>select{display:block;height:32px;width:100%;appearance:none;-webkit-appearance:none;-moz-appearance:none;outline:0;border:none;border-bottom:1px solid rgba(0,0,0,.26);border-radius:0;-webkit-box-shadow:none;box-shadow:none;background-color:transparent;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNiIgd2lkdGg9IjEwIj48cG9seWdvbiBwb2ludHM9IjAsMCAxMCwwIDUsNiIgc3R5bGU9ImZpbGw6cmdiYSgwLDAsMCwuMjQpOyIvPjwvc3ZnPg==);background-repeat:no-repeat;background-position:right center;cursor:pointer;color:rgba(0,0,0,.87);font-size:16px;font-family:inherit;line-height:inherit;padding:0 25px 0 0}.mui-select>select::-ms-expand{display:none}.mui-select>select:focus{outline:0;height:33px;margin-bottom:-1px;border-color:#2196F3;border-width:2px}.mui-select>select:disabled{color:rgba(0,0,0,.38);cursor:not-allowed;background-color:transparent;opacity:1}.mui-select>select:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}.mui-select>select:focus::-ms-value{background:0 0;color:rgba(0,0,0,.87)}.mui-select>label{position:absolute;top:0;display:block;width:100%;color:rgba(0,0,0,.54);font-size:12px;font-weight:400;line-height:15px;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.mui-select:focus>label,.mui-select>select:focus~label{color:#2196F3}.mui-select__menu{position:absolute;z-index:2;min-width:100%;overflow-y:auto;padding:8px 0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#FFF;font-size:16px}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-select__menu{border-left:1px solid rgba(0,0,0,.12);border-top:1px solid rgba(0,0,0,.12)}}@supports (-ms-ime-align:auto){.mui-select__menu{border-left:1px solid rgba(0,0,0,.12);border-top:1px solid rgba(0,0,0,.12)}}.mui-select__menu>div{padding:0 22px;height:42px;line-height:42px;cursor:pointer;white-space:nowrap}.mui-select__menu>div.mui--is-selected{background-color:#EEE}.mui-select__menu>div.mui--is-disabled{color:rgba(0,0,0,.38);cursor:not-allowed}.mui-select__menu>div:not(.mui-optgroup__label):not(.mui--is-disabled):hover{background-color:#E0E0E0}.mui-optgroup__option{text-indent:1em}.mui-optgroup__label{color:rgba(0,0,0,.54);font-size:.9em}.mui-table{width:100%;max-width:100%;margin-bottom:20px}.mui-table>tbody>tr>th,.mui-table>tfoot>tr>th,.mui-table>thead>tr>th{text-align:left}.mui-table>tbody>tr>td,.mui-table>tbody>tr>th,.mui-table>tfoot>tr>td,.mui-table>tfoot>tr>th,.mui-table>thead>tr>td,.mui-table>thead>tr>th{padding:10px;line-height:1.429}.mui-table>thead>tr>th{border-bottom:2px solid rgba(0,0,0,.12);font-weight:700}.mui-table>tbody+tbody{border-top:2px solid rgba(0,0,0,.12)}.mui-table.mui-table--bordered>tbody>tr>td{border-bottom:1px solid rgba(0,0,0,.12)}.mui-tabs__bar{list-style:none;padding-left:0;margin-bottom:0;background-color:transparent;white-space:nowrap;overflow-x:auto}.mui-tabs__bar>li{display:inline-block}.mui-tabs__bar>li>a{display:block;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;color:rgba(0,0,0,.87);cursor:default;height:48px;line-height:48px;padding-left:24px;padding-right:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mui-tabs__bar>li>a:hover{text-decoration:none}.mui-tabs__bar>li.mui--is-active{border-bottom:2px solid #2196F3}.mui-tabs__bar>li.mui--is-active>a{color:#2196F3}.mui-tabs__bar.mui-tabs__bar--justified{display:table;width:100%;table-layout:fixed}.mui-tabs__bar.mui-tabs__bar--justified>li{display:table-cell}.mui-tabs__bar.mui-tabs__bar--justified>li>a{text-align:center;padding-left:0;padding-right:0}.mui-tabs__pane{display:none}.mui-tabs__pane.mui--is-active{display:block}.mui-textfield{display:block;padding-top:15px;margin-bottom:20px;position:relative}.mui-textfield>label{position:absolute;top:0;display:block;width:100%;color:rgba(0,0,0,.54);font-size:12px;font-weight:400;line-height:15px;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.mui-textfield>textarea{padding-top:5px}.mui-textfield>input:focus~label,.mui-textfield>textarea:focus~label{color:#2196F3}.mui-textfield--float-label>label{position:absolute;-webkit-transform:translate(0,15px);transform:translate(0,15px);font-size:16px;line-height:32px;color:rgba(0,0,0,.26);text-overflow:clip;cursor:text;pointer-events:none}.mui-textfield--float-label>input:focus~label,.mui-textfield--float-label>textarea:focus~label{-webkit-transform:translate(0,0);transform:translate(0,0);font-size:12px;line-height:15px;text-overflow:ellipsis}.mui-textfield--float-label>input:not(:focus).mui--is-not-empty~label,.mui-textfield--float-label>input:not(:focus):not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield--float-label>input:not(:focus)[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield--float-label>textarea:not(:focus).mui--is-not-empty~label,.mui-textfield--float-label>textarea:not(:focus):not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield--float-label>textarea:not(:focus)[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label{color:rgba(0,0,0,.54);font-size:12px;line-height:15px;-webkit-transform:translate(0,0);transform:translate(0,0);text-overflow:ellipsis}.mui-textfield--wrap-label{display:table;width:100%;padding-top:0}.mui-textfield--wrap-label:not(.mui-textfield--float-label)>label{display:table-header-group;position:static;white-space:normal;overflow-x:visible}.mui-textfield>input,.mui-textfield>textarea{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;background-color:transparent;color:rgba(0,0,0,.87);border:none;border-bottom:1px solid rgba(0,0,0,.26);outline:0;width:100%;padding:0;-webkit-box-shadow:none;box-shadow:none;border-radius:0;font-size:16px;font-family:inherit;line-height:inherit;background-image:none}.mui-textfield>input:focus,.mui-textfield>textarea:focus{border-color:#2196F3;border-width:2px}.mui-textfield>input:-moz-read-only,.mui-textfield>input:disabled,.mui-textfield>textarea:-moz-read-only,.mui-textfield>textarea:disabled{cursor:not-allowed;background-color:transparent;opacity:1}.mui-textfield>input:disabled,.mui-textfield>input:read-only,.mui-textfield>textarea:disabled,.mui-textfield>textarea:read-only{cursor:not-allowed;background-color:transparent;opacity:1}.mui-textfield>input::-webkit-input-placeholder,.mui-textfield>textarea::-webkit-input-placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input:-ms-input-placeholder,.mui-textfield>textarea:-ms-input-placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input::-ms-input-placeholder,.mui-textfield>textarea::-ms-input-placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input::placeholder,.mui-textfield>textarea::placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input{height:32px}.mui-textfield>input:focus{height:33px;margin-bottom:-1px}.mui-textfield>textarea{min-height:64px}.mui-textfield>textarea[rows]:not([rows=\"2\"]):focus{margin-bottom:-1px}.mui-textfield>input:focus{height:33px;margin-bottom:-1px}.mui-textfield>input:invalid:not(:focus):not(:required),.mui-textfield>input:invalid:not(:focus):required.mui--is-empty.mui--is-touched,.mui-textfield>input:invalid:not(:focus):required.mui--is-not-empty,.mui-textfield>input:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:not(:required),.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-empty.mui--is-touched,.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-not-empty,.mui-textfield>input:not(:focus).mui--is-invalid:required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:invalid:not(:focus):not(:required),.mui-textfield>textarea:invalid:not(:focus):required.mui--is-empty.mui--is-touched,.mui-textfield>textarea:invalid:not(:focus):required.mui--is-not-empty,.mui-textfield>textarea:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:not(:focus).mui--is-invalid:not(:required),.mui-textfield>textarea:not(:focus).mui--is-invalid:required.mui--is-empty.mui--is-touched,.mui-textfield>textarea:not(:focus).mui--is-invalid:required.mui--is-not-empty,.mui-textfield>textarea:not(:focus).mui--is-invalid:required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:not(:focus).mui--is-invalid:required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty){border-color:#F44336;border-width:2px}.mui-textfield>input:invalid:not(:focus):not(:required),.mui-textfield>input:invalid:not(:focus):required.mui--is-empty.mui--is-touched,.mui-textfield>input:invalid:not(:focus):required.mui--is-not-empty,.mui-textfield>input:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:not(:required),.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-empty.mui--is-touched,.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-not-empty,.mui-textfield>input:not(:focus).mui--is-invalid:required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty){height:33px;margin-bottom:-1px}.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):not(:required)~label,.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):required.mui--is-not-empty~label,.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):not(:required)~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):required.mui--is-not-empty~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label{color:#F44336}.mui-textfield:not(.mui-textfield--float-label)>input:invalid:not(:focus):not(:required)~label,.mui-textfield:not(.mui-textfield--float-label)>input:invalid:not(:focus):required.mui--is-empty.mui--is-touched~label,.mui-textfield:not(.mui-textfield--float-label)>input:invalid:not(:focus):required.mui--is-not-empty~label,.mui-textfield:not(.mui-textfield--float-label)>textarea:invalid:not(:focus):not(:required)~label,.mui-textfield:not(.mui-textfield--float-label)>textarea:invalid:not(:focus):required.mui--is-empty.mui--is-touched~label,.mui-textfield:not(.mui-textfield--float-label)>textarea:invalid:not(:focus):required.mui--is-not-empty~label{color:#F44336}.mui-textfield.mui-textfield--float-label>.mui--is-invalid.mui--is-not-empty:not(:focus)~label{color:#F44336}.mui-textfield:not(.mui-textfield--float-label)>.mui--is-invalid:not(:focus)~label{color:#F44336}.mui--no-transition{-webkit-transition:none!important;transition:none!important}.mui--no-user-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mui-caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.mui--text-left{text-align:left!important}.mui--text-right{text-align:right!important}.mui--text-center{text-align:center!important}.mui--text-justify{text-align:justify!important}.mui--text-nowrap{white-space:nowrap!important}.mui--align-baseline{vertical-align:baseline!important}.mui--align-top{vertical-align:top!important}.mui--align-middle{vertical-align:middle!important}.mui--align-bottom{vertical-align:bottom!important}.mui--text-dark{color:rgba(0,0,0,.87)}.mui--text-dark-secondary{color:rgba(0,0,0,.54)}.mui--text-dark-hint{color:rgba(0,0,0,.38)}.mui--text-light{color:#FFF}.mui--text-light-secondary{color:rgba(255,255,255,.7)}.mui--text-light-hint{color:rgba(255,255,255,.3)}.mui--text-accent{color:rgba(255,64,129,.87)}.mui--text-accent-secondary{color:rgba(255,64,129,.54)}.mui--text-accent-hint{color:rgba(255,64,129,.38)}.mui--text-black{color:#000}.mui--text-white{color:#FFF}.mui--text-danger{color:#F44336}.mui--bg-primary{background-color:#2196F3}.mui--bg-primary-dark{background-color:#1976D2}.mui--bg-primary-light{background-color:#BBDEFB}.mui--bg-accent{background-color:#FF4081}.mui--bg-accent-dark{background-color:#F50057}.mui--bg-accent-light{background-color:#FF80AB}.mui--bg-danger{background-color:#F44336}.mui-list--unstyled{padding-left:0;list-style:none}.mui-list--inline{padding-left:0;list-style:none;margin-left:-5px}.mui-list--inline>li{display:inline-block;padding-left:5px;padding-right:5px}.mui--z1,.mui-dropdown__menu,.mui-select__menu{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.mui--z2{-webkit-box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.mui--z3{-webkit-box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}.mui--z4{-webkit-box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}.mui--z5{-webkit-box-shadow:0 19px 38px rgba(0,0,0,.3),0 15px 12px rgba(0,0,0,.22);box-shadow:0 19px 38px rgba(0,0,0,.3),0 15px 12px rgba(0,0,0,.22)}.mui--clearfix:after,.mui--clearfix:before{content:\" \";display:table}.mui--clearfix:after{clear:both}.mui--pull-right{float:right!important}.mui--pull-left{float:left!important}.mui--hide{display:none!important}.mui--show{display:block!important}.mui--invisible{visibility:hidden}.mui--overflow-hidden{overflow:hidden!important}.mui--overflow-hidden-x{overflow-x:hidden!important}.mui--overflow-hidden-y{overflow-y:hidden!important}.mui--visible-lg-block,.mui--visible-lg-inline,.mui--visible-lg-inline-block,.mui--visible-md-block,.mui--visible-md-inline,.mui--visible-md-inline-block,.mui--visible-sm-block,.mui--visible-sm-inline,.mui--visible-sm-inline-block,.mui--visible-xl-block,.mui--visible-xl-inline,.mui--visible-xl-inline-block,.mui--visible-xs-block,.mui--visible-xs-inline,.mui--visible-xs-inline-block{display:none!important}@media (max-width:543px){.mui-visible-xs{display:block!important}table.mui-visible-xs{display:table}tr.mui-visible-xs{display:table-row!important}td.mui-visible-xs,th.mui-visible-xs{display:table-cell!important}.mui--visible-xs-block{display:block!important}.mui--visible-xs-inline{display:inline!important}.mui--visible-xs-inline-block{display:inline-block!important}}@media (min-width:544px) and (max-width:767px){.mui-visible-sm{display:block!important}table.mui-visible-sm{display:table}tr.mui-visible-sm{display:table-row!important}td.mui-visible-sm,th.mui-visible-sm{display:table-cell!important}.mui--visible-sm-block{display:block!important}.mui--visible-sm-inline{display:inline!important}.mui--visible-sm-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.mui-visible-md{display:block!important}table.mui-visible-md{display:table}tr.mui-visible-md{display:table-row!important}td.mui-visible-md,th.mui-visible-md{display:table-cell!important}.mui--visible-md-block{display:block!important}.mui--visible-md-inline{display:inline!important}.mui--visible-md-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.mui-visible-lg{display:block!important}table.mui-visible-lg{display:table}tr.mui-visible-lg{display:table-row!important}td.mui-visible-lg,th.mui-visible-lg{display:table-cell!important}.mui--visible-lg-block{display:block!important}.mui--visible-lg-inline{display:inline!important}.mui--visible-lg-inline-block{display:inline-block!important}}@media (min-width:1200px){.mui-visible-xl{display:block!important}table.mui-visible-xl{display:table}tr.mui-visible-xl{display:table-row!important}td.mui-visible-xl,th.mui-visible-xl{display:table-cell!important}.mui--visible-xl-block{display:block!important}.mui--visible-xl-inline{display:inline!important}.mui--visible-xl-inline-block{display:inline-block!important}}@media (max-width:543px){.mui--hidden-xs{display:none!important}}@media (min-width:544px) and (max-width:767px){.mui--hidden-sm{display:none!important}}@media (min-width:768px) and (max-width:991px){.mui--hidden-md{display:none!important}}@media (min-width:992px) and (max-width:1199px){.mui--hidden-lg{display:none!important}}@media (min-width:1200px){.mui--hidden-xl{display:none!important}}.mui-scrlock--showbar-y{overflow-y:scroll!important}.mui-scrlock--showbar-x{overflow-x:scroll!important}#mui-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999999;background-color:rgba(0,0,0,.2);overflow:auto}.mui-btn__ripple-container{position:absolute;top:0;left:0;display:block;height:100%;width:100%;overflow:hidden;z-index:0;pointer-events:none}.mui-ripple{position:absolute;top:0;left:0;border-radius:50%;opacity:0;pointer-events:none;-webkit-transform:scale(.0001,.0001);transform:scale(.0001,.0001)}.mui-ripple.mui--is-animating{-webkit-transform:none;transform:none;-webkit-transition:width .3s cubic-bezier(0,0,.2,1),height .3s cubic-bezier(0,0,.2,1),opacity .3s cubic-bezier(0,0,.2,1),-webkit-transform .3s cubic-bezier(0,0,.2,1);transition:width .3s cubic-bezier(0,0,.2,1),height .3s cubic-bezier(0,0,.2,1),opacity .3s cubic-bezier(0,0,.2,1),-webkit-transform .3s cubic-bezier(0,0,.2,1);transition:transform .3s cubic-bezier(0,0,.2,1),width .3s cubic-bezier(0,0,.2,1),height .3s cubic-bezier(0,0,.2,1),opacity .3s cubic-bezier(0,0,.2,1);transition:transform .3s cubic-bezier(0,0,.2,1),width .3s cubic-bezier(0,0,.2,1),height .3s cubic-bezier(0,0,.2,1),opacity .3s cubic-bezier(0,0,.2,1),-webkit-transform .3s cubic-bezier(0,0,.2,1)}.mui-ripple.mui--is-visible{opacity:.3}.mui-btn .mui-ripple{background-color:#a6a6a6}.mui-btn--primary .mui-ripple{background-color:#FFF}.mui-btn--dark .mui-ripple{background-color:#FFF}.mui-btn--danger .mui-ripple{background-color:#FFF}.mui-btn--accent .mui-ripple{background-color:#FFF}.mui-btn--flat .mui-ripple{background-color:#a6a6a6}.mui--text-display4{font-weight:300;font-size:112px;line-height:112px}.mui--text-display3{font-weight:400;font-size:56px;line-height:56px}.mui--text-display2{font-weight:400;font-size:45px;line-height:48px}.mui--text-display1,h1{font-weight:400;font-size:34px;line-height:40px}.mui--text-headline,h2{font-weight:400;font-size:24px;line-height:32px}.mui--text-title,h3{font-weight:400;font-size:20px;line-height:28px}.mui--text-subhead,h4{font-weight:400;font-size:16px;line-height:24px}.mui--text-body2,h5{font-weight:500;font-size:14px;line-height:24px}.mui--text-body1{font-weight:400;font-size:14px;line-height:20px}.mui--text-caption{font-weight:400;font-size:12px;line-height:16px}.mui--text-menu{font-weight:500;font-size:13px;line-height:17px}.mui--text-button{font-weight:500;font-size:14px;line-height:18px;text-transform:uppercase}"; },{}],14:[function(require,module,exports){ module.exports=require(7) },{"../config":4,"./jqLite":6}],15:[function(require,module,exports){ /** * MUI React Appbar Module * @module react/appbar */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Appbar constructor * @class */ var Appbar = function (_React$Component) { babelHelpers.inherits(Appbar, _React$Component); function Appbar() { babelHelpers.classCallCheck(this, Appbar); return babelHelpers.possibleConstructorReturn(this, (Appbar.__proto__ || Object.getPrototypeOf(Appbar)).apply(this, arguments)); } babelHelpers.createClass(Appbar, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, reactProps = babelHelpers.objectWithoutProperties(_props, ['children']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-appbar ' + this.props.className }), children ); } }]); return Appbar; }(_react2.default.Component); /** Define module API */ Appbar.defaultProps = { className: '' }; exports.default = Appbar; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcGJhci5qc3giXSwibmFtZXMiOlsiQXBwYmFyIiwicHJvcHMiLCJjaGlsZHJlbiIsInJlYWN0UHJvcHMiLCJjbGFzc05hbWUiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQUtBOzs7Ozs7QUFFQTs7OztBQUdBOzs7O0lBSU1BLE07Ozs7Ozs7Ozs7NkJBS0s7QUFBQSxtQkFDNkIsS0FBS0MsS0FEbEM7QUFBQSxVQUNDQyxRQURELFVBQ0NBLFFBREQ7QUFBQSxVQUNjQyxVQURkOzs7QUFHUCxhQUNFO0FBQUE7QUFBQSxpQ0FDT0EsVUFEUDtBQUVFLHFCQUFXLGdCQUFnQixLQUFLRixLQUFMLENBQVdHO0FBRnhDO0FBSUdGO0FBSkgsT0FERjtBQVFEOzs7RUFoQmtCLGdCQUFNRyxTOztBQW9CM0I7OztBQXBCTUwsTSxDQUNHTSxZLEdBQWU7QUFDcEJGLGFBQVc7QUFEUyxDO2tCQW9CVEosTSIsImZpbGUiOiJhcHBiYXIuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgQXBwYmFyIE1vZHVsZVxuICogQG1vZHVsZSByZWFjdC9hcHBiYXJcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBBcHBiYXIgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBBcHBiYXIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJydcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1hcHBiYXIgJyArIHRoaXMucHJvcHMuY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBBcHBiYXI7XG4iXX0= },{"react":"1n8/MK"}],16:[function(require,module,exports){ module.exports=require(9) },{"../js/lib/jqLite":6,"../js/lib/util":7,"react":"1n8/MK"}],17:[function(require,module,exports){ module.exports=require(10) },{"react":"1n8/MK"}],18:[function(require,module,exports){ /** * MUI React checkbox module * @module react/checkbox */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Checkbox constructor * @class */ var Checkbox = function (_React$Component) { babelHelpers.inherits(Checkbox, _React$Component); function Checkbox() { babelHelpers.classCallCheck(this, Checkbox); return babelHelpers.possibleConstructorReturn(this, (Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).apply(this, arguments)); } babelHelpers.createClass(Checkbox, [{ key: 'render', value: function render() { var _this2 = this; var _props = this.props, children = _props.children, className = _props.className, label = _props.label, autoFocus = _props.autoFocus, checked = _props.checked, defaultChecked = _props.defaultChecked, defaultValue = _props.defaultValue, disabled = _props.disabled, form = _props.form, name = _props.name, required = _props.required, value = _props.value, onChange = _props.onChange, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'label', 'autoFocus', 'checked', 'defaultChecked', 'defaultValue', 'disabled', 'form', 'name', 'required', 'value', 'onChange']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-checkbox ' + className }), _react2.default.createElement( 'label', null, _react2.default.createElement('input', { ref: function ref(el) { _this2.controlEl = el; }, type: 'checkbox', autoFocus: autoFocus, checked: checked, defaultChecked: defaultChecked, defaultValue: defaultValue, disabled: disabled, form: form, name: name, required: required, value: value, onChange: onChange }), label ) ); } }]); return Checkbox; }(_react2.default.Component); /** Define module API */ Checkbox.defaultProps = { className: '', label: null }; exports.default = Checkbox; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNoZWNrYm94LmpzeCJdLCJuYW1lcyI6WyJ1dGlsIiwiQ2hlY2tib3giLCJwcm9wcyIsImNoaWxkcmVuIiwiY2xhc3NOYW1lIiwibGFiZWwiLCJhdXRvRm9jdXMiLCJjaGVja2VkIiwiZGVmYXVsdENoZWNrZWQiLCJkZWZhdWx0VmFsdWUiLCJkaXNhYmxlZCIsImZvcm0iLCJuYW1lIiwicmVxdWlyZWQiLCJ2YWx1ZSIsIm9uQ2hhbmdlIiwicmVhY3RQcm9wcyIsImNvbnRyb2xFbCIsImVsIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFFQTs7SUFBWUEsSTs7QUFDWjs7QUFJQTs7OztJQUlNQyxROzs7Ozs7Ozs7OzZCQU1LO0FBQUE7O0FBQUEsbUJBR2EsS0FBS0MsS0FIbEI7QUFBQSxVQUNDQyxRQURELFVBQ0NBLFFBREQ7QUFBQSxVQUNXQyxTQURYLFVBQ1dBLFNBRFg7QUFBQSxVQUNzQkMsS0FEdEIsVUFDc0JBLEtBRHRCO0FBQUEsVUFDNkJDLFNBRDdCLFVBQzZCQSxTQUQ3QjtBQUFBLFVBQ3dDQyxPQUR4QyxVQUN3Q0EsT0FEeEM7QUFBQSxVQUNpREMsY0FEakQsVUFDaURBLGNBRGpEO0FBQUEsVUFFTEMsWUFGSyxVQUVMQSxZQUZLO0FBQUEsVUFFU0MsUUFGVCxVQUVTQSxRQUZUO0FBQUEsVUFFbUJDLElBRm5CLFVBRW1CQSxJQUZuQjtBQUFBLFVBRXlCQyxJQUZ6QixVQUV5QkEsSUFGekI7QUFBQSxVQUUrQkMsUUFGL0IsVUFFK0JBLFFBRi9CO0FBQUEsVUFFeUNDLEtBRnpDLFVBRXlDQSxLQUZ6QztBQUFBLFVBRWdEQyxRQUZoRCxVQUVnREEsUUFGaEQ7QUFBQSxVQUdGQyxVQUhFOzs7QUFLUCxhQUNFO0FBQUE7QUFBQSxpQ0FDT0EsVUFEUDtBQUVFLHFCQUFXLGtCQUFrQlo7QUFGL0I7QUFJRTtBQUFBO0FBQUE7QUFDRTtBQUNFLGlCQUFLLGlCQUFNO0FBQUUscUJBQUthLFNBQUwsR0FBaUJDLEVBQWpCO0FBQXNCLGFBRHJDO0FBRUUsa0JBQUssVUFGUDtBQUdFLHVCQUFXWixTQUhiO0FBSUUscUJBQVNDLE9BSlg7QUFLRSw0QkFBZ0JDLGNBTGxCO0FBTUUsMEJBQWNDLFlBTmhCO0FBT0Usc0JBQVVDLFFBUFo7QUFRRSxrQkFBTUMsSUFSUjtBQVNFLGtCQUFNQyxJQVRSO0FBVUUsc0JBQVVDLFFBVlo7QUFXRSxtQkFBT0MsS0FYVDtBQVlFLHNCQUFVQztBQVpaLFlBREY7QUFlR1Y7QUFmSDtBQUpGLE9BREY7QUF3QkQ7OztFQW5Db0IsZ0JBQU1jLFM7O0FBdUM3Qjs7O0FBdkNNbEIsUSxDQUNHbUIsWSxHQUFlO0FBQ3BCaEIsYUFBVyxFQURTO0FBRXBCQyxTQUFPO0FBRmEsQztrQkF1Q1RKLFEiLCJmaWxlIjoiY2hlY2tib3guanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgY2hlY2tib3ggbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L2NoZWNrYm94XG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgKiBhcyB1dGlsIGZyb20gJy4uL2pzL2xpYi91dGlsJztcbmltcG9ydCB7IGNvbnRyb2xsZWRNZXNzYWdlIH0gZnJvbSAnLi9faGVscGVycyc7XG5pbXBvcnQgeyBnZXRSZWFjdFByb3BzIH0gZnJvbSAnLi9faGVscGVycyc7XG5cblxuLyoqXG4gKiBDaGVja2JveCBjb25zdHJ1Y3RvclxuICogQGNsYXNzXG4gKi9cbmNsYXNzIENoZWNrYm94IGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICBjbGFzc05hbWU6ICcnLFxuICAgIGxhYmVsOiBudWxsXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgbGFiZWwsIGF1dG9Gb2N1cywgY2hlY2tlZCwgZGVmYXVsdENoZWNrZWQsXG4gICAgICBkZWZhdWx0VmFsdWUsIGRpc2FibGVkLCBmb3JtLCBuYW1lLCByZXF1aXJlZCwgdmFsdWUsIG9uQ2hhbmdlLFxuICAgICAgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1jaGVja2JveCAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICByZWY9e2VsID0+IHsgdGhpcy5jb250cm9sRWwgPSBlbDsgfX1cbiAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICBhdXRvRm9jdXM9e2F1dG9Gb2N1c31cbiAgICAgICAgICAgIGNoZWNrZWQ9e2NoZWNrZWR9XG4gICAgICAgICAgICBkZWZhdWx0Q2hlY2tlZD17ZGVmYXVsdENoZWNrZWR9XG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU9e2RlZmF1bHRWYWx1ZX1cbiAgICAgICAgICAgIGRpc2FibGVkPXtkaXNhYmxlZH1cbiAgICAgICAgICAgIGZvcm09e2Zvcm19XG4gICAgICAgICAgICBuYW1lPXtuYW1lfVxuICAgICAgICAgICAgcmVxdWlyZWQ9e3JlcXVpcmVkfVxuICAgICAgICAgICAgdmFsdWU9e3ZhbHVlfVxuICAgICAgICAgICAgb25DaGFuZ2U9e29uQ2hhbmdlfVxuICAgICAgICAgIC8+XG4gICAgICAgICAge2xhYmVsfVxuICAgICAgICA8L2xhYmVsPlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgQ2hlY2tib3g7XG4iXX0= },{"../js/lib/util":7,"./_helpers":8,"react":"1n8/MK"}],19:[function(require,module,exports){ /** * MUI React Col Component * @module react/col */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var breakpoints = ['xs', 'sm', 'md', 'lg', 'xl']; /** * Col constructor * @class */ var Col = function (_React$Component) { babelHelpers.inherits(Col, _React$Component); function Col() { babelHelpers.classCallCheck(this, Col); return babelHelpers.possibleConstructorReturn(this, (Col.__proto__ || Object.getPrototypeOf(Col)).apply(this, arguments)); } babelHelpers.createClass(Col, [{ key: 'render', value: function render() { var cls = {}, i = void 0, bk = void 0, val = void 0, baseCls = void 0; var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); // add mui-col classes for (i = breakpoints.length - 1; i > -1; i--) { bk = breakpoints[i]; baseCls = 'mui-col-' + bk; // add mui-col-{bk}-{val} val = this.props[bk]; if (val) cls[baseCls + '-' + val] = true; // add mui-col-{bk}-offset-{val} val = this.props[bk + '-offset']; if (val) cls[baseCls + '-offset-' + val] = true; // remove from reactProps delete reactProps[bk]; delete reactProps[bk + '-offset']; } cls = util.classNames(cls); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: cls + ' ' + className }), children ); } }]); return Col; }(_react2.default.Component); /** Define module API */ Col.defaultProps = { className: '', xs: null, sm: null, md: null, lg: null, xl: null, 'xs-offset': null, 'sm-offset': null, 'md-offset': null, 'lg-offset': null, 'xl-offset': null }; exports.default = Col; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbC5qc3giXSwibmFtZXMiOlsidXRpbCIsImJyZWFrcG9pbnRzIiwiQ29sIiwiY2xzIiwiaSIsImJrIiwidmFsIiwiYmFzZUNscyIsInByb3BzIiwiY2hpbGRyZW4iLCJjbGFzc05hbWUiLCJyZWFjdFByb3BzIiwibGVuZ3RoIiwiY2xhc3NOYW1lcyIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyIsInhzIiwic20iLCJtZCIsImxnIiwieGwiXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQUtBOzs7Ozs7QUFFQTs7OztBQUVBOztJQUFZQSxJOzs7QUFHWixJQUFNQyxjQUFjLENBQUMsSUFBRCxFQUFPLElBQVAsRUFBYSxJQUFiLEVBQW1CLElBQW5CLEVBQXlCLElBQXpCLENBQXBCOztBQUdBOzs7OztJQUlNQyxHOzs7Ozs7Ozs7OzZCQWVLO0FBQ1AsVUFBSUMsTUFBTSxFQUFWO0FBQUEsVUFDSUMsVUFESjtBQUFBLFVBRUlDLFdBRko7QUFBQSxVQUdJQyxZQUhKO0FBQUEsVUFJSUMsZ0JBSko7O0FBRE8sbUJBT3NDLEtBQUtDLEtBUDNDO0FBQUEsVUFPREMsUUFQQyxVQU9EQSxRQVBDO0FBQUEsVUFPU0MsU0FQVCxVQU9TQSxTQVBUO0FBQUEsVUFPdUJDLFVBUHZCOztBQVNQOztBQUNBLFdBQUtQLElBQUVILFlBQVlXLE1BQVosR0FBcUIsQ0FBNUIsRUFBK0JSLElBQUksQ0FBQyxDQUFwQyxFQUF1Q0EsR0FBdkMsRUFBNEM7QUFDMUNDLGFBQUtKLFlBQVlHLENBQVosQ0FBTDtBQUNBRyxrQkFBVSxhQUFhRixFQUF2Qjs7QUFFQTtBQUNBQyxjQUFNLEtBQUtFLEtBQUwsQ0FBV0gsRUFBWCxDQUFOO0FBQ0EsWUFBSUMsR0FBSixFQUFTSCxJQUFJSSxVQUFVLEdBQVYsR0FBZ0JELEdBQXBCLElBQTJCLElBQTNCOztBQUVUO0FBQ0FBLGNBQU0sS0FBS0UsS0FBTCxDQUFXSCxLQUFLLFNBQWhCLENBQU47QUFDQSxZQUFJQyxHQUFKLEVBQVNILElBQUlJLFVBQVUsVUFBVixHQUF1QkQsR0FBM0IsSUFBa0MsSUFBbEM7O0FBRVQ7QUFDQSxlQUFPSyxXQUFXTixFQUFYLENBQVA7QUFDQSxlQUFPTSxXQUFXTixLQUFLLFNBQWhCLENBQVA7QUFDRDs7QUFFREYsWUFBTUgsS0FBS2EsVUFBTCxDQUFnQlYsR0FBaEIsQ0FBTjs7QUFFQSxhQUNFO0FBQUE7QUFBQSxpQ0FDT1EsVUFEUDtBQUVFLHFCQUFXUixNQUFNLEdBQU4sR0FBWU87QUFGekI7QUFJR0Q7QUFKSCxPQURGO0FBUUQ7OztFQXBEZSxnQkFBTUssUzs7QUF3RHhCOzs7QUF4RE1aLEcsQ0FDR2EsWSxHQUFlO0FBQ3BCTCxhQUFXLEVBRFM7QUFFcEJNLE1BQUksSUFGZ0I7QUFHcEJDLE1BQUksSUFIZ0I7QUFJcEJDLE1BQUksSUFKZ0I7QUFLcEJDLE1BQUksSUFMZ0I7QUFNcEJDLE1BQUksSUFOZ0I7QUFPcEIsZUFBYSxJQVBPO0FBUXBCLGVBQWEsSUFSTztBQVNwQixlQUFhLElBVE87QUFVcEIsZUFBYSxJQVZPO0FBV3BCLGVBQWE7QUFYTyxDO2tCQXdEVGxCLEciLCJmaWxlIjoiY29sLmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IENvbCBDb21wb25lbnRcbiAqIEBtb2R1bGUgcmVhY3QvY29sXG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgKiBhcyB1dGlsIGZyb20gJy4uL2pzL2xpYi91dGlsJztcblxuXG5jb25zdCBicmVha3BvaW50cyA9IFsneHMnLCAnc20nLCAnbWQnLCAnbGcnLCAneGwnXTtcblxuXG4vKipcbiAqIENvbCBjb25zdHJ1Y3RvclxuICogQGNsYXNzXG4gKi9cbmNsYXNzIENvbCBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgY2xhc3NOYW1lOiAnJyxcbiAgICB4czogbnVsbCxcbiAgICBzbTogbnVsbCxcbiAgICBtZDogbnVsbCxcbiAgICBsZzogbnVsbCxcbiAgICB4bDogbnVsbCxcbiAgICAneHMtb2Zmc2V0JzogbnVsbCxcbiAgICAnc20tb2Zmc2V0JzogbnVsbCxcbiAgICAnbWQtb2Zmc2V0JzogbnVsbCxcbiAgICAnbGctb2Zmc2V0JzogbnVsbCxcbiAgICAneGwtb2Zmc2V0JzogbnVsbFxuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGxldCBjbHMgPSB7fSxcbiAgICAgICAgaSxcbiAgICAgICAgYmssXG4gICAgICAgIHZhbCxcbiAgICAgICAgYmFzZUNscztcblxuICAgIGxldCB7IGNoaWxkcmVuLCBjbGFzc05hbWUsIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICAvLyBhZGQgbXVpLWNvbCBjbGFzc2VzXG4gICAgZm9yIChpPWJyZWFrcG9pbnRzLmxlbmd0aCAtIDE7IGkgPiAtMTsgaS0tKSB7XG4gICAgICBiayA9IGJyZWFrcG9pbnRzW2ldO1xuICAgICAgYmFzZUNscyA9ICdtdWktY29sLScgKyBiaztcblxuICAgICAgLy8gYWRkIG11aS1jb2wte2JrfS17dmFsfVxuICAgICAgdmFsID0gdGhpcy5wcm9wc1tia107XG4gICAgICBpZiAodmFsKSBjbHNbYmFzZUNscyArICctJyArIHZhbF0gPSB0cnVlO1xuXG4gICAgICAvLyBhZGQgbXVpLWNvbC17Ymt9LW9mZnNldC17dmFsfVxuICAgICAgdmFsID0gdGhpcy5wcm9wc1tiayArICctb2Zmc2V0J107XG4gICAgICBpZiAodmFsKSBjbHNbYmFzZUNscyArICctb2Zmc2V0LScgKyB2YWxdID0gdHJ1ZTtcblxuICAgICAgLy8gcmVtb3ZlIGZyb20gcmVhY3RQcm9wc1xuICAgICAgZGVsZXRlIHJlYWN0UHJvcHNbYmtdO1xuICAgICAgZGVsZXRlIHJlYWN0UHJvcHNbYmsgKyAnLW9mZnNldCddO1xuICAgIH1cblxuICAgIGNscyA9IHV0aWwuY2xhc3NOYW1lcyhjbHMpO1xuICAgIFxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17Y2xzICsgJyAnICsgY2xhc3NOYW1lIH1cbiAgICAgID5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgQ29sO1xuIl19 },{"../js/lib/util":7,"react":"1n8/MK"}],20:[function(require,module,exports){ /** * MUI React container module * @module react/container */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Container constructor * @class */ var Container = function (_React$Component) { babelHelpers.inherits(Container, _React$Component); function Container() { babelHelpers.classCallCheck(this, Container); return babelHelpers.possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); } babelHelpers.createClass(Container, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, fluid = _props.fluid, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'fluid']); var cls = 'mui-container'; // fluid containers if (fluid) cls += '-fluid'; return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: cls + ' ' + className }), children ); } }]); return Container; }(_react2.default.Component); /** Define module API */ Container.defaultProps = { className: '', fluid: false }; exports.default = Container; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRhaW5lci5qc3giXSwibmFtZXMiOlsiQ29udGFpbmVyIiwicHJvcHMiLCJjaGlsZHJlbiIsImNsYXNzTmFtZSIsImZsdWlkIiwicmVhY3RQcm9wcyIsImNscyIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBR0E7Ozs7SUFJTUEsUzs7Ozs7Ozs7Ozs2QkFNSztBQUFBLG1CQUMrQyxLQUFLQyxLQURwRDtBQUFBLFVBQ0NDLFFBREQsVUFDQ0EsUUFERDtBQUFBLFVBQ1dDLFNBRFgsVUFDV0EsU0FEWDtBQUFBLFVBQ3NCQyxLQUR0QixVQUNzQkEsS0FEdEI7QUFBQSxVQUNnQ0MsVUFEaEM7OztBQUdQLFVBQUlDLE1BQU0sZUFBVjs7QUFFQTtBQUNBLFVBQUlGLEtBQUosRUFBV0UsT0FBTyxRQUFQOztBQUVYLGFBQ0U7QUFBQTtBQUFBLGlDQUNPRCxVQURQO0FBRUUscUJBQVdDLE1BQU0sR0FBTixHQUFZSDtBQUZ6QjtBQUlHRDtBQUpILE9BREY7QUFRRDs7O0VBdEJxQixnQkFBTUssUzs7QUEwQjlCOzs7QUExQk1QLFMsQ0FDR1EsWSxHQUFlO0FBQ3BCTCxhQUFXLEVBRFM7QUFFcEJDLFNBQU87QUFGYSxDO2tCQTBCVEosUyIsImZpbGUiOiJjb250YWluZXIuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgY29udGFpbmVyIG1vZHVsZVxuICogQG1vZHVsZSByZWFjdC9jb250YWluZXJcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBDb250YWluZXIgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBDb250YWluZXIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJycsXG4gICAgZmx1aWQ6IGZhbHNlXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgZmx1aWQsIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICBsZXQgY2xzID0gJ211aS1jb250YWluZXInO1xuXG4gICAgLy8gZmx1aWQgY29udGFpbmVyc1xuICAgIGlmIChmbHVpZCkgY2xzICs9ICctZmx1aWQnO1xuICAgIFxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17Y2xzICsgJyAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBDb250YWluZXI7XG4iXX0= },{"react":"1n8/MK"}],21:[function(require,module,exports){ /** * MUI React divider module * @module react/divider */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Divider constructor * @class */ var Divider = function (_React$Component) { babelHelpers.inherits(Divider, _React$Component); function Divider() { babelHelpers.classCallCheck(this, Divider); return babelHelpers.possibleConstructorReturn(this, (Divider.__proto__ || Object.getPrototypeOf(Divider)).apply(this, arguments)); } babelHelpers.createClass(Divider, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); return _react2.default.createElement('div', babelHelpers.extends({}, reactProps, { className: 'mui-divider ' + className })); } }]); return Divider; }(_react2.default.Component); /** Define module API */ Divider.defaultProps = { className: '' }; exports.default = Divider; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRpdmlkZXIuanN4Il0sIm5hbWVzIjpbIkRpdmlkZXIiLCJwcm9wcyIsImNoaWxkcmVuIiwiY2xhc3NOYW1lIiwicmVhY3RQcm9wcyIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBR0E7Ozs7SUFJTUEsTzs7Ozs7Ozs7Ozs2QkFLSztBQUFBLG1CQUN3QyxLQUFLQyxLQUQ3QztBQUFBLFVBQ0NDLFFBREQsVUFDQ0EsUUFERDtBQUFBLFVBQ1dDLFNBRFgsVUFDV0EsU0FEWDtBQUFBLFVBQ3lCQyxVQUR6Qjs7O0FBR1AsYUFDRSw4REFDT0EsVUFEUDtBQUVFLG1CQUFXLGlCQUFpQkQ7QUFGOUIsU0FERjtBQU9EOzs7RUFmbUIsZ0JBQU1FLFM7O0FBbUI1Qjs7O0FBbkJNTCxPLENBQ0dNLFksR0FBZTtBQUNwQkgsYUFBVztBQURTLEM7a0JBbUJUSCxPIiwiZmlsZSI6ImRpdmlkZXIuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgZGl2aWRlciBtb2R1bGVcbiAqIEBtb2R1bGUgcmVhY3QvZGl2aWRlclxuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuXG4vKipcbiAqIERpdmlkZXIgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBEaXZpZGVyIGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICBjbGFzc05hbWU6ICcnXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1kaXZpZGVyICcgKyBjbGFzc05hbWUgfVxuICAgICAgPlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgRGl2aWRlcjtcbiJdfQ== },{"react":"1n8/MK"}],22:[function(require,module,exports){ /** * MUI React dropdowns module * @module react/dropdowns */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); /** * DropdownItem constructor * @class */ var DropdownItem = function (_React$Component) { babelHelpers.inherits(DropdownItem, _React$Component); function DropdownItem() { babelHelpers.classCallCheck(this, DropdownItem); return babelHelpers.possibleConstructorReturn(this, (DropdownItem.__proto__ || Object.getPrototypeOf(DropdownItem)).apply(this, arguments)); } babelHelpers.createClass(DropdownItem, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, link = _props.link, target = _props.target, value = _props.value, onClick = _props.onClick, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'link', 'target', 'value', 'onClick']); return _react2.default.createElement( 'li', reactProps, _react2.default.createElement( 'a', { href: link, target: target, 'data-mui-value': value, onClick: onClick }, children ) ); } }]); return DropdownItem; }(_react2.default.Component); /** Define module API */ exports.default = DropdownItem; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3Bkb3duLWl0ZW0uanN4Il0sIm5hbWVzIjpbInV0aWwiLCJEcm9wZG93bkl0ZW0iLCJwcm9wcyIsImNoaWxkcmVuIiwibGluayIsInRhcmdldCIsInZhbHVlIiwib25DbGljayIsInJlYWN0UHJvcHMiLCJDb21wb25lbnQiXSwibWFwcGluZ3MiOiJBQUFBOzs7O0FBSUE7QUFDQTs7QUFFQTs7Ozs7O0FBRUE7Ozs7QUFFQTs7SUFBWUEsSTs7QUFHWjs7OztJQUlNQyxZOzs7Ozs7Ozs7OzZCQUNLO0FBQUEsbUJBRWEsS0FBS0MsS0FGbEI7QUFBQSxVQUNDQyxRQURELFVBQ0NBLFFBREQ7QUFBQSxVQUNXQyxJQURYLFVBQ1dBLElBRFg7QUFBQSxVQUNpQkMsTUFEakIsVUFDaUJBLE1BRGpCO0FBQUEsVUFDeUJDLEtBRHpCLFVBQ3lCQSxLQUR6QjtBQUFBLFVBQ2dDQyxPQURoQyxVQUNnQ0EsT0FEaEM7QUFBQSxVQUVGQyxVQUZFOzs7QUFJUCxhQUNFO0FBQUE7QUFBU0Esa0JBQVQ7QUFDRTtBQUFBO0FBQUE7QUFDRSxrQkFBTUosSUFEUjtBQUVFLG9CQUFRQyxNQUZWO0FBR0UsOEJBQWdCQyxLQUhsQjtBQUlFLHFCQUFTQztBQUpYO0FBTUdKO0FBTkg7QUFERixPQURGO0FBWUQ7OztFQWpCd0IsZ0JBQU1NLFM7O0FBcUJqQzs7O2tCQUNlUixZIiwiZmlsZSI6ImRyb3Bkb3duLWl0ZW0uanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgZHJvcGRvd25zIG1vZHVsZVxuICogQG1vZHVsZSByZWFjdC9kcm9wZG93bnNcbiAqL1xuLyoganNoaW50IHF1b3RtYXJrOmZhbHNlICovXG4vLyBqc2NzOmRpc2FibGUgdmFsaWRhdGVRdW90ZU1hcmtzXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0ICogYXMgdXRpbCBmcm9tICcuLi9qcy9saWIvdXRpbCc7XG5cblxuLyoqXG4gKiBEcm9wZG93bkl0ZW0gY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBEcm9wZG93bkl0ZW0gZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgbGluaywgdGFyZ2V0LCB2YWx1ZSwgb25DbGljayxcbiAgICAgIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICByZXR1cm4gKFxuICAgICAgPGxpIHsgLi4ucmVhY3RQcm9wcyB9PlxuICAgICAgICA8YVxuICAgICAgICAgIGhyZWY9e2xpbmt9XG4gICAgICAgICAgdGFyZ2V0PXt0YXJnZXR9XG4gICAgICAgICAgZGF0YS1tdWktdmFsdWU9e3ZhbHVlfVxuICAgICAgICAgIG9uQ2xpY2s9e29uQ2xpY2t9XG4gICAgICAgID5cbiAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgIDwvYT5cbiAgICAgIDwvbGk+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgRHJvcGRvd25JdGVtO1xuIl19 },{"../js/lib/util":7,"react":"1n8/MK"}],23:[function(require,module,exports){ /** * MUI React dropdowns module * @module react/dropdowns */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _button = require('./button'); var _button2 = babelHelpers.interopRequireDefault(_button); var _caret = require('./caret'); var _caret2 = babelHelpers.interopRequireDefault(_caret); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var dropdownClass = 'mui-dropdown', menuClass = 'mui-dropdown__menu', openClass = 'mui--is-open', rightClass = 'mui-dropdown__menu--right'; /** * Dropdown constructor * @class */ var Dropdown = function (_React$Component) { babelHelpers.inherits(Dropdown, _React$Component); function Dropdown(props) { babelHelpers.classCallCheck(this, Dropdown); var _this = babelHelpers.possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); _this.state = { opened: false, menuTop: 0 }; var cb = util.callback; _this.selectCB = cb(_this, 'select'); _this.onClickCB = cb(_this, 'onClick'); _this.onOutsideClickCB = cb(_this, 'onOutsideClick'); return _this; } babelHelpers.createClass(Dropdown, [{ key: 'componentDidMount', value: function componentDidMount() { document.addEventListener('click', this.onOutsideClickCB); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { document.removeEventListener('click', this.onOutsideClickCB); } }, { key: 'onClick', value: function onClick(ev) { // only left clicks if (ev.button !== 0) return; // exit if toggle button is disabled if (this.props.disabled) return; if (!ev.defaultPrevented) { this.toggle(); // execute <Dropdown> onClick method var fn = this.props.onClick; fn && fn(ev); } } }, { key: 'toggle', value: function toggle() { // exit if no menu element if (!this.props.children) { return util.raiseError('Dropdown menu element not found'); } if (this.state.opened) this.close();else this.open(); } }, { key: 'open', value: function open() { // position menu element below toggle button var wrapperRect = this.wrapperElRef.getBoundingClientRect(), toggleRect = void 0; toggleRect = this.buttonElRef.buttonElRef.getBoundingClientRect(); this.setState({ opened: true, menuTop: toggleRect.top - wrapperRect.top + toggleRect.height }); } }, { key: 'close', value: function close() { this.setState({ opened: false }); } }, { key: 'select', value: function select(ev) { // onSelect callback if (this.props.onSelect && ev.target.tagName === 'A') { this.props.onSelect(ev.target.getAttribute('data-mui-value')); } // close menu if (!ev.defaultPrevented) this.close(); } }, { key: 'onOutsideClick', value: function onOutsideClick(ev) { var isClickInside = this.wrapperElRef.contains(ev.target); if (!isClickInside) this.close(); } }, { key: 'render', value: function render() { var _this2 = this; var buttonEl = void 0, menuEl = void 0, labelEl = void 0; var _props = this.props, children = _props.children, className = _props.className, color = _props.color, variant = _props.variant, size = _props.size, label = _props.label, alignMenu = _props.alignMenu, onClick = _props.onClick, onSelect = _props.onSelect, disabled = _props.disabled, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'color', 'variant', 'size', 'label', 'alignMenu', 'onClick', 'onSelect', 'disabled']); // build label if (jqLite.type(label) === 'string') { labelEl = _react2.default.createElement( 'span', null, label, ' ', _react2.default.createElement(_caret2.default, null) ); } else { labelEl = label; } buttonEl = _react2.default.createElement( _button2.default, { ref: function ref(el) { _this2.buttonElRef = el; }, type: 'button', onClick: this.onClickCB, color: color, variant: variant, size: size, disabled: disabled }, labelEl ); if (this.state.opened) { var cs = {}; cs[menuClass] = true; cs[openClass] = this.state.opened; cs[rightClass] = alignMenu === 'right'; cs = util.classNames(cs); menuEl = _react2.default.createElement( 'ul', { ref: function ref(el) { _this2.menuElRef = el; }, className: cs, style: { top: this.state.menuTop }, onClick: this.selectCB }, children ); } else { menuEl = _react2.default.createElement('div', null); } return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { ref: function ref(el) { _this2.wrapperElRef = el; }, className: dropdownClass + ' ' + className }), buttonEl, menuEl ); } }]); return Dropdown; }(_react2.default.Component); /** Define module API */ Dropdown.defaultProps = { className: '', color: 'default', variant: 'default', size: 'default', label: '', alignMenu: 'left', onClick: null, onSelect: null, disabled: false }; exports.default = Dropdown; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3Bkb3duLmpzeCJdLCJuYW1lcyI6WyJqcUxpdGUiLCJ1dGlsIiwiZHJvcGRvd25DbGFzcyIsIm1lbnVDbGFzcyIsIm9wZW5DbGFzcyIsInJpZ2h0Q2xhc3MiLCJEcm9wZG93biIsInByb3BzIiwic3RhdGUiLCJvcGVuZWQiLCJtZW51VG9wIiwiY2IiLCJjYWxsYmFjayIsInNlbGVjdENCIiwib25DbGlja0NCIiwib25PdXRzaWRlQ2xpY2tDQiIsImRvY3VtZW50IiwiYWRkRXZlbnRMaXN0ZW5lciIsInJlbW92ZUV2ZW50TGlzdGVuZXIiLCJldiIsImJ1dHRvbiIsImRpc2FibGVkIiwiZGVmYXVsdFByZXZlbnRlZCIsInRvZ2dsZSIsImZuIiwib25DbGljayIsImNoaWxkcmVuIiwicmFpc2VFcnJvciIsImNsb3NlIiwib3BlbiIsIndyYXBwZXJSZWN0Iiwid3JhcHBlckVsUmVmIiwiZ2V0Qm91bmRpbmdDbGllbnRSZWN0IiwidG9nZ2xlUmVjdCIsImJ1dHRvbkVsUmVmIiwic2V0U3RhdGUiLCJ0b3AiLCJoZWlnaHQiLCJvblNlbGVjdCIsInRhcmdldCIsInRhZ05hbWUiLCJnZXRBdHRyaWJ1dGUiLCJpc0NsaWNrSW5zaWRlIiwiY29udGFpbnMiLCJidXR0b25FbCIsIm1lbnVFbCIsImxhYmVsRWwiLCJjbGFzc05hbWUiLCJjb2xvciIsInZhcmlhbnQiLCJzaXplIiwibGFiZWwiLCJhbGlnbk1lbnUiLCJyZWFjdFByb3BzIiwidHlwZSIsImVsIiwiY3MiLCJjbGFzc05hbWVzIiwibWVudUVsUmVmIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7OztBQUlBO0FBQ0E7O0FBRUE7Ozs7OztBQUVBOzs7O0FBRUE7Ozs7QUFDQTs7OztBQUNBOztJQUFZQSxNOztBQUNaOztJQUFZQyxJOzs7QUFHWixJQUFNQyxnQkFBZ0IsY0FBdEI7QUFBQSxJQUNFQyxZQUFZLG9CQURkO0FBQUEsSUFFRUMsWUFBWSxjQUZkO0FBQUEsSUFHRUMsYUFBYSwyQkFIZjs7QUFNQTs7Ozs7SUFJTUMsUTs7O0FBQ0osb0JBQVlDLEtBQVosRUFBbUI7QUFBQTs7QUFBQSxnSUFDWEEsS0FEVzs7QUFHakIsVUFBS0MsS0FBTCxHQUFhO0FBQ1hDLGNBQVEsS0FERztBQUVYQyxlQUFTO0FBRkUsS0FBYjtBQUlBLFFBQUlDLEtBQUtWLEtBQUtXLFFBQWQ7QUFDQSxVQUFLQyxRQUFMLEdBQWdCRixVQUFTLFFBQVQsQ0FBaEI7QUFDQSxVQUFLRyxTQUFMLEdBQWlCSCxVQUFTLFNBQVQsQ0FBakI7QUFDQSxVQUFLSSxnQkFBTCxHQUF3QkosVUFBUyxnQkFBVCxDQUF4QjtBQVZpQjtBQVdsQjs7Ozt3Q0FjbUI7QUFDbEJLLGVBQVNDLGdCQUFULENBQTBCLE9BQTFCLEVBQW1DLEtBQUtGLGdCQUF4QztBQUNEOzs7MkNBRXNCO0FBQ3JCQyxlQUFTRSxtQkFBVCxDQUE2QixPQUE3QixFQUFzQyxLQUFLSCxnQkFBM0M7QUFDRDs7OzRCQUVPSSxFLEVBQUk7QUFDVjtBQUNBLFVBQUlBLEdBQUdDLE1BQUgsS0FBYyxDQUFsQixFQUFxQjs7QUFFckI7QUFDQSxVQUFJLEtBQUtiLEtBQUwsQ0FBV2MsUUFBZixFQUF5Qjs7QUFFekIsVUFBSSxDQUFDRixHQUFHRyxnQkFBUixFQUEwQjtBQUN4QixhQUFLQyxNQUFMOztBQUVBO0FBQ0EsWUFBSUMsS0FBSyxLQUFLakIsS0FBTCxDQUFXa0IsT0FBcEI7QUFDQUQsY0FBTUEsR0FBR0wsRUFBSCxDQUFOO0FBQ0Q7QUFDRjs7OzZCQUVRO0FBQ1A7QUFDQSxVQUFJLENBQUMsS0FBS1osS0FBTCxDQUFXbUIsUUFBaEIsRUFBMEI7QUFDeEIsZUFBT3pCLEtBQUswQixVQUFMLENBQWdCLGlDQUFoQixDQUFQO0FBQ0Q7O0FBRUQsVUFBSSxLQUFLbkIsS0FBTCxDQUFXQyxNQUFmLEVBQXVCLEtBQUttQixLQUFMLEdBQXZCLEtBQ0ssS0FBS0MsSUFBTDtBQUNOOzs7MkJBRU07QUFDTDtBQUNBLFVBQUlDLGNBQWMsS0FBS0MsWUFBTCxDQUFrQkMscUJBQWxCLEVBQWxCO0FBQUEsVUFDRUMsbUJBREY7O0FBR0FBLG1CQUFhLEtBQUtDLFdBQUwsQ0FBaUJBLFdBQWpCLENBQTZCRixxQkFBN0IsRUFBYjs7QUFFQSxXQUFLRyxRQUFMLENBQWM7QUFDWjFCLGdCQUFRLElBREk7QUFFWkMsaUJBQVN1QixXQUFXRyxHQUFYLEdBQWlCTixZQUFZTSxHQUE3QixHQUFtQ0gsV0FBV0k7QUFGM0MsT0FBZDtBQUlEOzs7NEJBRU87QUFDTixXQUFLRixRQUFMLENBQWMsRUFBRTFCLFFBQVEsS0FBVixFQUFkO0FBQ0Q7OzsyQkFFTVUsRSxFQUFJO0FBQ1Q7QUFDQSxVQUFJLEtBQUtaLEtBQUwsQ0FBVytCLFFBQVgsSUFBdUJuQixHQUFHb0IsTUFBSCxDQUFVQyxPQUFWLEtBQXNCLEdBQWpELEVBQXNEO0FBQ3BELGFBQUtqQyxLQUFMLENBQVcrQixRQUFYLENBQW9CbkIsR0FBR29CLE1BQUgsQ0FBVUUsWUFBVixDQUF1QixnQkFBdkIsQ0FBcEI7QUFDRDs7QUFFRDtBQUNBLFVBQUksQ0FBQ3RCLEdBQUdHLGdCQUFSLEVBQTBCLEtBQUtNLEtBQUw7QUFDM0I7OzttQ0FFY1QsRSxFQUFJO0FBQ2pCLFVBQUl1QixnQkFBZ0IsS0FBS1gsWUFBTCxDQUFrQlksUUFBbEIsQ0FBMkJ4QixHQUFHb0IsTUFBOUIsQ0FBcEI7QUFDQSxVQUFJLENBQUNHLGFBQUwsRUFBb0IsS0FBS2QsS0FBTDtBQUNyQjs7OzZCQUVRO0FBQUE7O0FBQ1AsVUFBSWdCLGlCQUFKO0FBQUEsVUFDRUMsZUFERjtBQUFBLFVBRUVDLGdCQUZGOztBQURPLG1CQU0wQyxLQUFLdkMsS0FOL0M7QUFBQSxVQUtDbUIsUUFMRCxVQUtDQSxRQUxEO0FBQUEsVUFLV3FCLFNBTFgsVUFLV0EsU0FMWDtBQUFBLFVBS3NCQyxLQUx0QixVQUtzQkEsS0FMdEI7QUFBQSxVQUs2QkMsT0FMN0IsVUFLNkJBLE9BTDdCO0FBQUEsVUFLc0NDLElBTHRDLFVBS3NDQSxJQUx0QztBQUFBLFVBSzRDQyxLQUw1QyxVQUs0Q0EsS0FMNUM7QUFBQSxVQUttREMsU0FMbkQsVUFLbURBLFNBTG5EO0FBQUEsVUFNTDNCLE9BTkssVUFNTEEsT0FOSztBQUFBLFVBTUlhLFFBTkosVUFNSUEsUUFOSjtBQUFBLFVBTWNqQixRQU5kLFVBTWNBLFFBTmQ7QUFBQSxVQU0yQmdDLFVBTjNCOztBQVFQOztBQUNBLFVBQUlyRCxPQUFPc0QsSUFBUCxDQUFZSCxLQUFaLE1BQXVCLFFBQTNCLEVBQXFDO0FBQ25DTCxrQkFBVTtBQUFBO0FBQUE7QUFBT0ssZUFBUDtBQUFBO0FBQWM7QUFBZCxTQUFWO0FBQ0QsT0FGRCxNQUVPO0FBQ0xMLGtCQUFVSyxLQUFWO0FBQ0Q7O0FBRURQLGlCQUNFO0FBQUE7QUFBQTtBQUNFLGVBQUssaUJBQU07QUFBRSxtQkFBS1YsV0FBTCxHQUFtQnFCLEVBQW5CO0FBQXVCLFdBRHRDO0FBRUUsZ0JBQUssUUFGUDtBQUdFLG1CQUFTLEtBQUt6QyxTQUhoQjtBQUlFLGlCQUFPa0MsS0FKVDtBQUtFLG1CQUFTQyxPQUxYO0FBTUUsZ0JBQU1DLElBTlI7QUFPRSxvQkFBVTdCO0FBUFo7QUFTR3lCO0FBVEgsT0FERjs7QUFjQSxVQUFJLEtBQUt0QyxLQUFMLENBQVdDLE1BQWYsRUFBdUI7QUFDckIsWUFBSStDLEtBQUssRUFBVDs7QUFFQUEsV0FBR3JELFNBQUgsSUFBZ0IsSUFBaEI7QUFDQXFELFdBQUdwRCxTQUFILElBQWdCLEtBQUtJLEtBQUwsQ0FBV0MsTUFBM0I7QUFDQStDLFdBQUduRCxVQUFILElBQWtCK0MsY0FBYyxPQUFoQztBQUNBSSxhQUFLdkQsS0FBS3dELFVBQUwsQ0FBZ0JELEVBQWhCLENBQUw7O0FBRUFYLGlCQUNFO0FBQUE7QUFBQTtBQUNFLGlCQUFLLGlCQUFNO0FBQUUscUJBQUthLFNBQUwsR0FBaUJILEVBQWpCO0FBQXFCLGFBRHBDO0FBRUUsdUJBQVdDLEVBRmI7QUFHRSxtQkFBTyxFQUFFcEIsS0FBSyxLQUFLNUIsS0FBTCxDQUFXRSxPQUFsQixFQUhUO0FBSUUscUJBQVMsS0FBS0c7QUFKaEI7QUFNR2E7QUFOSCxTQURGO0FBVUQsT0FsQkQsTUFrQk87QUFDTG1CLGlCQUFTLDBDQUFUO0FBQ0Q7O0FBRUQsYUFDRTtBQUFBO0FBQUEsaUNBQ09RLFVBRFA7QUFFRSxlQUFLLGlCQUFNO0FBQUUsbUJBQUt0QixZQUFMLEdBQW9Cd0IsRUFBcEI7QUFBd0IsV0FGdkM7QUFHRSxxQkFBV3JELGdCQUFnQixHQUFoQixHQUFzQjZDO0FBSG5DO0FBS0dILGdCQUxIO0FBTUdDO0FBTkgsT0FERjtBQVVEOzs7RUF6Sm9CLGdCQUFNYyxTOztBQTZKN0I7OztBQTdKTXJELFEsQ0FjR3NELFksR0FBZTtBQUNwQmIsYUFBVyxFQURTO0FBRXBCQyxTQUFPLFNBRmE7QUFHcEJDLFdBQVMsU0FIVztBQUlwQkMsUUFBTSxTQUpjO0FBS3BCQyxTQUFPLEVBTGE7QUFNcEJDLGFBQVcsTUFOUztBQU9wQjNCLFdBQVMsSUFQVztBQVFwQmEsWUFBVSxJQVJVO0FBU3BCakIsWUFBVTtBQVRVLEM7a0JBZ0pUZixRIiwiZmlsZSI6ImRyb3Bkb3duLmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IGRyb3Bkb3ducyBtb2R1bGVcbiAqIEBtb2R1bGUgcmVhY3QvZHJvcGRvd25zXG4gKi9cbi8qIGpzaGludCBxdW90bWFyazpmYWxzZSAqL1xuLy8ganNjczpkaXNhYmxlIHZhbGlkYXRlUXVvdGVNYXJrc1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCBCdXR0b24gZnJvbSAnLi9idXR0b24nO1xuaW1wb3J0IENhcmV0IGZyb20gJy4vY2FyZXQnO1xuaW1wb3J0ICogYXMganFMaXRlIGZyb20gJy4uL2pzL2xpYi9qcUxpdGUnO1xuaW1wb3J0ICogYXMgdXRpbCBmcm9tICcuLi9qcy9saWIvdXRpbCc7XG5cblxuY29uc3QgZHJvcGRvd25DbGFzcyA9ICdtdWktZHJvcGRvd24nLFxuICBtZW51Q2xhc3MgPSAnbXVpLWRyb3Bkb3duX19tZW51JyxcbiAgb3BlbkNsYXNzID0gJ211aS0taXMtb3BlbicsXG4gIHJpZ2h0Q2xhc3MgPSAnbXVpLWRyb3Bkb3duX19tZW51LS1yaWdodCc7XG5cblxuLyoqXG4gKiBEcm9wZG93biBjb25zdHJ1Y3RvclxuICogQGNsYXNzXG4gKi9cbmNsYXNzIERyb3Bkb3duIGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgY29uc3RydWN0b3IocHJvcHMpIHtcbiAgICBzdXBlcihwcm9wcyk7XG5cbiAgICB0aGlzLnN0YXRlID0ge1xuICAgICAgb3BlbmVkOiBmYWxzZSxcbiAgICAgIG1lbnVUb3A6IDBcbiAgICB9XG4gICAgbGV0IGNiID0gdXRpbC5jYWxsYmFjaztcbiAgICB0aGlzLnNlbGVjdENCID0gY2IodGhpcywgJ3NlbGVjdCcpO1xuICAgIHRoaXMub25DbGlja0NCID0gY2IodGhpcywgJ29uQ2xpY2snKTtcbiAgICB0aGlzLm9uT3V0c2lkZUNsaWNrQ0IgPSBjYih0aGlzLCAnb25PdXRzaWRlQ2xpY2snKTtcbiAgfVxuXG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgY2xhc3NOYW1lOiAnJyxcbiAgICBjb2xvcjogJ2RlZmF1bHQnLFxuICAgIHZhcmlhbnQ6ICdkZWZhdWx0JyxcbiAgICBzaXplOiAnZGVmYXVsdCcsXG4gICAgbGFiZWw6ICcnLFxuICAgIGFsaWduTWVudTogJ2xlZnQnLFxuICAgIG9uQ2xpY2s6IG51bGwsXG4gICAgb25TZWxlY3Q6IG51bGwsXG4gICAgZGlzYWJsZWQ6IGZhbHNlXG4gIH07XG5cbiAgY29tcG9uZW50RGlkTW91bnQoKSB7XG4gICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCB0aGlzLm9uT3V0c2lkZUNsaWNrQ0IpO1xuICB9XG5cbiAgY29tcG9uZW50V2lsbFVubW91bnQoKSB7XG4gICAgZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignY2xpY2snLCB0aGlzLm9uT3V0c2lkZUNsaWNrQ0IpO1xuICB9XG5cbiAgb25DbGljayhldikge1xuICAgIC8vIG9ubHkgbGVmdCBjbGlja3NcbiAgICBpZiAoZXYuYnV0dG9uICE9PSAwKSByZXR1cm47XG5cbiAgICAvLyBleGl0IGlmIHRvZ2dsZSBidXR0b24gaXMgZGlzYWJsZWRcbiAgICBpZiAodGhpcy5wcm9wcy5kaXNhYmxlZCkgcmV0dXJuO1xuXG4gICAgaWYgKCFldi5kZWZhdWx0UHJldmVudGVkKSB7XG4gICAgICB0aGlzLnRvZ2dsZSgpO1xuXG4gICAgICAvLyBleGVjdXRlIDxEcm9wZG93bj4gb25DbGljayBtZXRob2RcbiAgICAgIGxldCBmbiA9IHRoaXMucHJvcHMub25DbGljaztcbiAgICAgIGZuICYmIGZuKGV2KTtcbiAgICB9XG4gIH1cblxuICB0b2dnbGUoKSB7XG4gICAgLy8gZXhpdCBpZiBubyBtZW51IGVsZW1lbnRcbiAgICBpZiAoIXRoaXMucHJvcHMuY2hpbGRyZW4pIHtcbiAgICAgIHJldHVybiB1dGlsLnJhaXNlRXJyb3IoJ0Ryb3Bkb3duIG1lbnUgZWxlbWVudCBub3QgZm91bmQnKTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5zdGF0ZS5vcGVuZWQpIHRoaXMuY2xvc2UoKTtcbiAgICBlbHNlIHRoaXMub3BlbigpO1xuICB9XG5cbiAgb3BlbigpIHtcbiAgICAvLyBwb3NpdGlvbiBtZW51IGVsZW1lbnQgYmVsb3cgdG9nZ2xlIGJ1dHRvblxuICAgIGxldCB3cmFwcGVyUmVjdCA9IHRoaXMud3JhcHBlckVsUmVmLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLFxuICAgICAgdG9nZ2xlUmVjdDtcblxuICAgIHRvZ2dsZVJlY3QgPSB0aGlzLmJ1dHRvbkVsUmVmLmJ1dHRvbkVsUmVmLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xuXG4gICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICBvcGVuZWQ6IHRydWUsXG4gICAgICBtZW51VG9wOiB0b2dnbGVSZWN0LnRvcCAtIHdyYXBwZXJSZWN0LnRvcCArIHRvZ2dsZVJlY3QuaGVpZ2h0XG4gICAgfSk7XG4gIH1cblxuICBjbG9zZSgpIHtcbiAgICB0aGlzLnNldFN0YXRlKHsgb3BlbmVkOiBmYWxzZSB9KTtcbiAgfVxuXG4gIHNlbGVjdChldikge1xuICAgIC8vIG9uU2VsZWN0IGNhbGxiYWNrXG4gICAgaWYgKHRoaXMucHJvcHMub25TZWxlY3QgJiYgZXYudGFyZ2V0LnRhZ05hbWUgPT09ICdBJykge1xuICAgICAgdGhpcy5wcm9wcy5vblNlbGVjdChldi50YXJnZXQuZ2V0QXR0cmlidXRlKCdkYXRhLW11aS12YWx1ZScpKTtcbiAgICB9XG5cbiAgICAvLyBjbG9zZSBtZW51XG4gICAgaWYgKCFldi5kZWZhdWx0UHJldmVudGVkKSB0aGlzLmNsb3NlKCk7XG4gIH1cblxuICBvbk91dHNpZGVDbGljayhldikge1xuICAgIGxldCBpc0NsaWNrSW5zaWRlID0gdGhpcy53cmFwcGVyRWxSZWYuY29udGFpbnMoZXYudGFyZ2V0KTtcbiAgICBpZiAoIWlzQ2xpY2tJbnNpZGUpIHRoaXMuY2xvc2UoKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICBsZXQgYnV0dG9uRWwsXG4gICAgICBtZW51RWwsXG4gICAgICBsYWJlbEVsO1xuXG4gICAgY29uc3QgeyBjaGlsZHJlbiwgY2xhc3NOYW1lLCBjb2xvciwgdmFyaWFudCwgc2l6ZSwgbGFiZWwsIGFsaWduTWVudSxcbiAgICAgIG9uQ2xpY2ssIG9uU2VsZWN0LCBkaXNhYmxlZCwgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIC8vIGJ1aWxkIGxhYmVsXG4gICAgaWYgKGpxTGl0ZS50eXBlKGxhYmVsKSA9PT0gJ3N0cmluZycpIHtcbiAgICAgIGxhYmVsRWwgPSA8c3Bhbj57bGFiZWx9IDxDYXJldCAvPjwvc3Bhbj47XG4gICAgfSBlbHNlIHtcbiAgICAgIGxhYmVsRWwgPSBsYWJlbDtcbiAgICB9XG5cbiAgICBidXR0b25FbCA9IChcbiAgICAgIDxCdXR0b25cbiAgICAgICAgcmVmPXtlbCA9PiB7IHRoaXMuYnV0dG9uRWxSZWYgPSBlbCB9fVxuICAgICAgICB0eXBlPVwiYnV0dG9uXCJcbiAgICAgICAgb25DbGljaz17dGhpcy5vbkNsaWNrQ0J9XG4gICAgICAgIGNvbG9yPXtjb2xvcn1cbiAgICAgICAgdmFyaWFudD17dmFyaWFudH1cbiAgICAgICAgc2l6ZT17c2l6ZX1cbiAgICAgICAgZGlzYWJsZWQ9e2Rpc2FibGVkfVxuICAgICAgPlxuICAgICAgICB7bGFiZWxFbH1cbiAgICAgIDwvQnV0dG9uPlxuICAgICk7XG5cbiAgICBpZiAodGhpcy5zdGF0ZS5vcGVuZWQpIHtcbiAgICAgIGxldCBjcyA9IHt9O1xuXG4gICAgICBjc1ttZW51Q2xhc3NdID0gdHJ1ZTtcbiAgICAgIGNzW29wZW5DbGFzc10gPSB0aGlzLnN0YXRlLm9wZW5lZDtcbiAgICAgIGNzW3JpZ2h0Q2xhc3NdID0gKGFsaWduTWVudSA9PT0gJ3JpZ2h0Jyk7XG4gICAgICBjcyA9IHV0aWwuY2xhc3NOYW1lcyhjcyk7XG5cbiAgICAgIG1lbnVFbCA9IChcbiAgICAgICAgPHVsXG4gICAgICAgICAgcmVmPXtlbCA9PiB7IHRoaXMubWVudUVsUmVmID0gZWwgfX1cbiAgICAgICAgICBjbGFzc05hbWU9e2NzfVxuICAgICAgICAgIHN0eWxlPXt7IHRvcDogdGhpcy5zdGF0ZS5tZW51VG9wIH19XG4gICAgICAgICAgb25DbGljaz17dGhpcy5zZWxlY3RDQn1cbiAgICAgICAgPlxuICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgPC91bD5cbiAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG1lbnVFbCA9IDxkaXY+PC9kaXY+O1xuICAgIH1cblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIHJlZj17ZWwgPT4geyB0aGlzLndyYXBwZXJFbFJlZiA9IGVsIH19XG4gICAgICAgIGNsYXNzTmFtZT17ZHJvcGRvd25DbGFzcyArICcgJyArIGNsYXNzTmFtZX1cbiAgICAgID5cbiAgICAgICAge2J1dHRvbkVsfVxuICAgICAgICB7bWVudUVsfVxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgRHJvcGRvd247XG4iXX0= },{"../js/lib/jqLite":6,"../js/lib/util":7,"./button":9,"./caret":10,"react":"1n8/MK"}],24:[function(require,module,exports){ /** * MUI React form module * @module react/form */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Form constructor * @class */ var Form = function (_React$Component) { babelHelpers.inherits(Form, _React$Component); function Form() { babelHelpers.classCallCheck(this, Form); return babelHelpers.possibleConstructorReturn(this, (Form.__proto__ || Object.getPrototypeOf(Form)).apply(this, arguments)); } babelHelpers.createClass(Form, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, inline = _props.inline, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'inline']); var cls = 'mui-form'; // inline form if (inline) cls += ' mui-form--inline'; return _react2.default.createElement( 'form', babelHelpers.extends({}, reactProps, { className: cls + ' ' + className }), children ); } }]); return Form; }(_react2.default.Component); /** Define module API */ Form.defaultProps = { className: '', inline: false }; exports.default = Form; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvcm0uanN4Il0sIm5hbWVzIjpbIkZvcm0iLCJwcm9wcyIsImNoaWxkcmVuIiwiY2xhc3NOYW1lIiwiaW5saW5lIiwicmVhY3RQcm9wcyIsImNscyIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBR0E7Ozs7SUFJTUEsSTs7Ozs7Ozs7Ozs2QkFNSztBQUFBLG1CQUNnRCxLQUFLQyxLQURyRDtBQUFBLFVBQ0NDLFFBREQsVUFDQ0EsUUFERDtBQUFBLFVBQ1dDLFNBRFgsVUFDV0EsU0FEWDtBQUFBLFVBQ3NCQyxNQUR0QixVQUNzQkEsTUFEdEI7QUFBQSxVQUNpQ0MsVUFEakM7O0FBRVAsVUFBSUMsTUFBTSxVQUFWOztBQUVBO0FBQ0EsVUFBSUYsTUFBSixFQUFZRSxPQUFPLG1CQUFQOztBQUVaLGFBQ0U7QUFBQTtBQUFBLGlDQUNPRCxVQURQO0FBRUUscUJBQVdDLE1BQU0sR0FBTixHQUFZSDtBQUZ6QjtBQUlHRDtBQUpILE9BREY7QUFRRDs7O0VBckJnQixnQkFBTUssUzs7QUF5QnpCOzs7QUF6Qk1QLEksQ0FDR1EsWSxHQUFlO0FBQ3BCTCxhQUFXLEVBRFM7QUFFcEJDLFVBQVE7QUFGWSxDO2tCQXlCVEosSSIsImZpbGUiOiJmb3JtLmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IGZvcm0gbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L2Zvcm1cbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBGb3JtIGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgRm9ybSBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgY2xhc3NOYW1lOiAnJyxcbiAgICBpbmxpbmU6IGZhbHNlXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgaW5saW5lLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuICAgIGxldCBjbHMgPSAnbXVpLWZvcm0nO1xuXG4gICAgLy8gaW5saW5lIGZvcm1cbiAgICBpZiAoaW5saW5lKSBjbHMgKz0gJyBtdWktZm9ybS0taW5saW5lJztcblxuICAgIHJldHVybiAoXG4gICAgICA8Zm9ybVxuICAgICAgICB7IC4uLnJlYWN0UHJvcHMgfVxuICAgICAgICBjbGFzc05hbWU9e2NscyArICcgJyArIGNsYXNzTmFtZSB9XG4gICAgICA+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvZm9ybT5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBGb3JtO1xuIl19 },{"react":"1n8/MK"}],25:[function(require,module,exports){ /** * MUI React Input Component * @module react/input */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _textField = require('./text-field'); /** * Input constructor * @class */ var Input = function (_React$Component) { babelHelpers.inherits(Input, _React$Component); function Input() { babelHelpers.classCallCheck(this, Input); return babelHelpers.possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).apply(this, arguments)); } babelHelpers.createClass(Input, [{ key: 'render', value: function render() { var _this2 = this; return _react2.default.createElement(_textField.TextField, babelHelpers.extends({}, this.props, { ref: function ref(el) { if (el && el.inputElRef) _this2.controlEl = el.inputElRef.inputElRef; } })); } }]); return Input; }(_react2.default.Component); Input.defaultProps = { type: 'text' }; exports.default = Input; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzeCJdLCJuYW1lcyI6WyJJbnB1dCIsInByb3BzIiwiZWwiLCJpbnB1dEVsUmVmIiwiY29udHJvbEVsIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwidHlwZSJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBRUE7O0FBR0E7Ozs7SUFJTUEsSzs7Ozs7Ozs7Ozs2QkFLSztBQUFBOztBQUNQLGFBQ0UsNkVBQ08sS0FBS0MsS0FEWjtBQUVFLGFBQUssaUJBQU07QUFBRSxjQUFJQyxNQUFNQSxHQUFHQyxVQUFiLEVBQXlCLE9BQUtDLFNBQUwsR0FBaUJGLEdBQUdDLFVBQUgsQ0FBY0EsVUFBL0I7QUFBNEM7QUFGcEYsU0FERjtBQU1EOzs7RUFaaUIsZ0JBQU1FLFM7O0FBQXBCTCxLLENBQ0dNLFksR0FBZTtBQUNwQkMsUUFBTTtBQURjLEM7a0JBZVRQLEsiLCJmaWxlIjoiaW5wdXQuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICogTVVJIFJlYWN0IElucHV0IENvbXBvbmVudFxuICogQG1vZHVsZSByZWFjdC9pbnB1dFxuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgVGV4dEZpZWxkIH0gZnJvbSAnLi90ZXh0LWZpZWxkJztcblxuXG4vKipcbiAqIElucHV0IGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgSW5wdXQgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIHR5cGU6ICd0ZXh0J1xuICB9O1xuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gKFxuICAgICAgPFRleHRGaWVsZFxuICAgICAgICB7IC4uLnRoaXMucHJvcHMgfVxuICAgICAgICByZWY9e2VsID0+IHsgaWYgKGVsICYmIGVsLmlucHV0RWxSZWYpIHRoaXMuY29udHJvbEVsID0gZWwuaW5wdXRFbFJlZi5pbnB1dEVsUmVmOyB9fVxuICAgICAgLz5cbiAgICApO1xuICB9XG59XG5cblxuZXhwb3J0IGRlZmF1bHQgSW5wdXQ7XG4iXX0= },{"./text-field":12,"react":"1n8/MK"}],26:[function(require,module,exports){ /** * MUI React options module * @module react/option */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _forms = require('../js/lib/forms'); var formlib = babelHelpers.interopRequireWildcard(_forms); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Option constructor * @class */ var Option = function (_React$Component) { babelHelpers.inherits(Option, _React$Component); function Option() { babelHelpers.classCallCheck(this, Option); return babelHelpers.possibleConstructorReturn(this, (Option.__proto__ || Object.getPrototypeOf(Option)).apply(this, arguments)); } babelHelpers.createClass(Option, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, label = _props.label, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'label']); return _react2.default.createElement( 'option', reactProps, label ); } }]); return Option; }(_react2.default.Component); /** Define module API */ Option.defaultProps = { className: '', label: null }; exports.default = Option; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wdGlvbi5qc3giXSwibmFtZXMiOlsiZm9ybWxpYiIsImpxTGl0ZSIsInV0aWwiLCJPcHRpb24iLCJwcm9wcyIsImNoaWxkcmVuIiwibGFiZWwiLCJyZWFjdFByb3BzIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwiY2xhc3NOYW1lIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFFQTs7SUFBWUEsTzs7QUFDWjs7SUFBWUMsTTs7QUFDWjs7SUFBWUMsSTs7QUFDWjs7QUFHQTs7OztJQUlNQyxNOzs7Ozs7Ozs7OzZCQU1LO0FBQUEsbUJBQ29DLEtBQUtDLEtBRHpDO0FBQUEsVUFDQ0MsUUFERCxVQUNDQSxRQUREO0FBQUEsVUFDV0MsS0FEWCxVQUNXQSxLQURYO0FBQUEsVUFDcUJDLFVBRHJCOzs7QUFHUCxhQUFPO0FBQUE7QUFBYUEsa0JBQWI7QUFBMkJEO0FBQTNCLE9BQVA7QUFDRDs7O0VBVmtCLGdCQUFNRSxTOztBQWMzQjs7O0FBZE1MLE0sQ0FDR00sWSxHQUFlO0FBQ3BCQyxhQUFXLEVBRFM7QUFFcEJKLFNBQU87QUFGYSxDO2tCQWNUSCxNIiwiZmlsZSI6Im9wdGlvbi5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCBvcHRpb25zIG1vZHVsZVxuICogQG1vZHVsZSByZWFjdC9vcHRpb25cbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCAqIGFzIGZvcm1saWIgZnJvbSAnLi4vanMvbGliL2Zvcm1zJztcbmltcG9ydCAqIGFzIGpxTGl0ZSBmcm9tICcuLi9qcy9saWIvanFMaXRlJztcbmltcG9ydCAqIGFzIHV0aWwgZnJvbSAnLi4vanMvbGliL3V0aWwnO1xuaW1wb3J0IHsgZ2V0UmVhY3RQcm9wcyB9IGZyb20gJy4vX2hlbHBlcnMnO1xuXG5cbi8qKlxuICogT3B0aW9uIGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgT3B0aW9uIGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICBjbGFzc05hbWU6ICcnLFxuICAgIGxhYmVsOiBudWxsXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxhYmVsLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIDxvcHRpb24geyAuLi5yZWFjdFByb3BzIH0+e2xhYmVsfTwvb3B0aW9uPjtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgT3B0aW9uO1xuIl19 },{"../js/lib/forms":5,"../js/lib/jqLite":6,"../js/lib/util":7,"./_helpers":8,"react":"1n8/MK"}],27:[function(require,module,exports){ /** * MUI React layout module * @module react/layout */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Panel constructor * @class */ var Panel = function (_React$Component) { babelHelpers.inherits(Panel, _React$Component); function Panel() { babelHelpers.classCallCheck(this, Panel); return babelHelpers.possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).apply(this, arguments)); } babelHelpers.createClass(Panel, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-panel ' + className }), children ); } }]); return Panel; }(_react2.default.Component); /** Define module API */ Panel.defaultProps = { className: '' }; exports.default = Panel; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhbmVsLmpzeCJdLCJuYW1lcyI6WyJQYW5lbCIsInByb3BzIiwiY2hpbGRyZW4iLCJjbGFzc05hbWUiLCJyZWFjdFByb3BzIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFHQTs7OztJQUlNQSxLOzs7Ozs7Ozs7OzZCQUtLO0FBQUEsbUJBQ3dDLEtBQUtDLEtBRDdDO0FBQUEsVUFDQ0MsUUFERCxVQUNDQSxRQUREO0FBQUEsVUFDV0MsU0FEWCxVQUNXQSxTQURYO0FBQUEsVUFDeUJDLFVBRHpCOzs7QUFHUCxhQUNFO0FBQUE7QUFBQSxpQ0FDT0EsVUFEUDtBQUVFLHFCQUFXLGVBQWVEO0FBRjVCO0FBSUdEO0FBSkgsT0FERjtBQVFEOzs7RUFoQmlCLGdCQUFNRyxTOztBQW9CMUI7OztBQXBCTUwsSyxDQUNHTSxZLEdBQWU7QUFDcEJILGFBQVc7QUFEUyxDO2tCQW9CVEgsSyIsImZpbGUiOiJwYW5lbC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCBsYXlvdXQgbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L2xheW91dFxuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuXG4vKipcbiAqIFBhbmVsIGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgUGFuZWwgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJydcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgY2xhc3NOYW1lLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXZcbiAgICAgICAgeyAuLi5yZWFjdFByb3BzIH1cbiAgICAgICAgY2xhc3NOYW1lPXsnbXVpLXBhbmVsICcgKyBjbGFzc05hbWV9XG4gICAgICA+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvZGl2PlxuICAgICk7XG4gIH1cbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IFBhbmVsO1xuIl19 },{"react":"1n8/MK"}],28:[function(require,module,exports){ /** * MUI React radio module * @module react/radio */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Radio constructor * @class */ var Radio = function (_React$Component) { babelHelpers.inherits(Radio, _React$Component); function Radio() { babelHelpers.classCallCheck(this, Radio); return babelHelpers.possibleConstructorReturn(this, (Radio.__proto__ || Object.getPrototypeOf(Radio)).apply(this, arguments)); } babelHelpers.createClass(Radio, [{ key: 'render', value: function render() { var _this2 = this; var _props = this.props, children = _props.children, className = _props.className, label = _props.label, autoFocus = _props.autoFocus, checked = _props.checked, defaultChecked = _props.defaultChecked, defaultValue = _props.defaultValue, disabled = _props.disabled, form = _props.form, name = _props.name, required = _props.required, value = _props.value, onChange = _props.onChange, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'label', 'autoFocus', 'checked', 'defaultChecked', 'defaultValue', 'disabled', 'form', 'name', 'required', 'value', 'onChange']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-radio ' + className }), _react2.default.createElement( 'label', null, _react2.default.createElement('input', { ref: function ref(el) { _this2.controlEl = el; }, type: 'radio', autoFocus: autoFocus, checked: checked, defaultChecked: defaultChecked, defaultValue: defaultValue, disabled: disabled, form: form, name: name, required: required, value: value, onChange: onChange }), label ) ); } }]); return Radio; }(_react2.default.Component); /** Define module API */ Radio.defaultProps = { className: '', label: null }; exports.default = Radio; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJhZGlvLmpzeCJdLCJuYW1lcyI6WyJSYWRpbyIsInByb3BzIiwiY2hpbGRyZW4iLCJjbGFzc05hbWUiLCJsYWJlbCIsImF1dG9Gb2N1cyIsImNoZWNrZWQiLCJkZWZhdWx0Q2hlY2tlZCIsImRlZmF1bHRWYWx1ZSIsImRpc2FibGVkIiwiZm9ybSIsIm5hbWUiLCJyZXF1aXJlZCIsInZhbHVlIiwib25DaGFuZ2UiLCJyZWFjdFByb3BzIiwiY29udHJvbEVsIiwiZWwiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQUtBOzs7Ozs7QUFFQTs7OztBQUdBOzs7O0lBSU1BLEs7Ozs7Ozs7Ozs7NkJBTUs7QUFBQTs7QUFBQSxtQkFJYSxLQUFLQyxLQUpsQjtBQUFBLFVBRUNDLFFBRkQsVUFFQ0EsUUFGRDtBQUFBLFVBRVdDLFNBRlgsVUFFV0EsU0FGWDtBQUFBLFVBRXNCQyxLQUZ0QixVQUVzQkEsS0FGdEI7QUFBQSxVQUU2QkMsU0FGN0IsVUFFNkJBLFNBRjdCO0FBQUEsVUFFd0NDLE9BRnhDLFVBRXdDQSxPQUZ4QztBQUFBLFVBRWlEQyxjQUZqRCxVQUVpREEsY0FGakQ7QUFBQSxVQUdMQyxZQUhLLFVBR0xBLFlBSEs7QUFBQSxVQUdTQyxRQUhULFVBR1NBLFFBSFQ7QUFBQSxVQUdtQkMsSUFIbkIsVUFHbUJBLElBSG5CO0FBQUEsVUFHeUJDLElBSHpCLFVBR3lCQSxJQUh6QjtBQUFBLFVBRytCQyxRQUgvQixVQUcrQkEsUUFIL0I7QUFBQSxVQUd5Q0MsS0FIekMsVUFHeUNBLEtBSHpDO0FBQUEsVUFHZ0RDLFFBSGhELFVBR2dEQSxRQUhoRDtBQUFBLFVBSUZDLFVBSkU7OztBQU1QLGFBQ0U7QUFBQTtBQUFBLGlDQUNPQSxVQURQO0FBRUUscUJBQVcsZUFBZVo7QUFGNUI7QUFJRTtBQUFBO0FBQUE7QUFDRTtBQUNFLGlCQUFLLGlCQUFNO0FBQUUscUJBQUthLFNBQUwsR0FBaUJDLEVBQWpCO0FBQXNCLGFBRHJDO0FBRUUsa0JBQUssT0FGUDtBQUdFLHVCQUFXWixTQUhiO0FBSUUscUJBQVNDLE9BSlg7QUFLRSw0QkFBZ0JDLGNBTGxCO0FBTUUsMEJBQWNDLFlBTmhCO0FBT0Usc0JBQVVDLFFBUFo7QUFRRSxrQkFBTUMsSUFSUjtBQVNFLGtCQUFNQyxJQVRSO0FBVUUsc0JBQVVDLFFBVlo7QUFXRSxtQkFBT0MsS0FYVDtBQVlFLHNCQUFVQztBQVpaLFlBREY7QUFlR1Y7QUFmSDtBQUpGLE9BREY7QUF3QkQ7OztFQXBDaUIsZ0JBQU1jLFM7O0FBd0MxQjs7O0FBeENNbEIsSyxDQUNHbUIsWSxHQUFlO0FBQ3BCaEIsYUFBVyxFQURTO0FBRXBCQyxTQUFPO0FBRmEsQztrQkF3Q1RKLEsiLCJmaWxlIjoicmFkaW8uanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgcmFkaW8gbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L3JhZGlvXG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5cbi8qKlxuICogUmFkaW8gY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBSYWRpbyBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgY2xhc3NOYW1lOiAnJyxcbiAgICBsYWJlbDogbnVsbFxuICB9O1xuXG4gIHJlbmRlcigpIHtcblxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgbGFiZWwsIGF1dG9Gb2N1cywgY2hlY2tlZCwgZGVmYXVsdENoZWNrZWQsXG4gICAgICBkZWZhdWx0VmFsdWUsIGRpc2FibGVkLCBmb3JtLCBuYW1lLCByZXF1aXJlZCwgdmFsdWUsIG9uQ2hhbmdlLFxuICAgICAgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1yYWRpbyAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICByZWY9e2VsID0+IHsgdGhpcy5jb250cm9sRWwgPSBlbDsgfX1cbiAgICAgICAgICAgIHR5cGU9XCJyYWRpb1wiXG4gICAgICAgICAgICBhdXRvRm9jdXM9e2F1dG9Gb2N1c31cbiAgICAgICAgICAgIGNoZWNrZWQ9e2NoZWNrZWR9XG4gICAgICAgICAgICBkZWZhdWx0Q2hlY2tlZD17ZGVmYXVsdENoZWNrZWR9XG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU9e2RlZmF1bHRWYWx1ZX1cbiAgICAgICAgICAgIGRpc2FibGVkPXtkaXNhYmxlZH1cbiAgICAgICAgICAgIGZvcm09e2Zvcm19XG4gICAgICAgICAgICBuYW1lPXtuYW1lfVxuICAgICAgICAgICAgcmVxdWlyZWQ9e3JlcXVpcmVkfVxuICAgICAgICAgICAgdmFsdWU9e3ZhbHVlfVxuICAgICAgICAgICAgb25DaGFuZ2U9e29uQ2hhbmdlfVxuICAgICAgICAgIC8+XG4gICAgICAgICAge2xhYmVsfVxuICAgICAgICA8L2xhYmVsPlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgUmFkaW87XG4iXX0= },{"react":"1n8/MK"}],29:[function(require,module,exports){ /** * MUI React Row Component * @module react/row */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var breakpoints = ['xs', 'sm', 'md', 'lg']; /** * Row constructor * @class */ var Row = function (_React$Component) { babelHelpers.inherits(Row, _React$Component); function Row() { babelHelpers.classCallCheck(this, Row); return babelHelpers.possibleConstructorReturn(this, (Row.__proto__ || Object.getPrototypeOf(Row)).apply(this, arguments)); } babelHelpers.createClass(Row, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-row ' + className }), children ); } }]); return Row; }(_react2.default.Component); /** Define module API */ Row.defaultProps = { className: '' }; exports.default = Row; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvdy5qc3giXSwibmFtZXMiOlsidXRpbCIsImJyZWFrcG9pbnRzIiwiUm93IiwicHJvcHMiLCJjaGlsZHJlbiIsImNsYXNzTmFtZSIsInJlYWN0UHJvcHMiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQUtBOzs7Ozs7QUFFQTs7OztBQUVBOztJQUFZQSxJOzs7QUFHWixJQUFNQyxjQUFjLENBQUMsSUFBRCxFQUFPLElBQVAsRUFBYSxJQUFiLEVBQW1CLElBQW5CLENBQXBCOztBQUdBOzs7OztJQUlNQyxHOzs7Ozs7Ozs7OzZCQUtLO0FBQUEsbUJBQ3dDLEtBQUtDLEtBRDdDO0FBQUEsVUFDQ0MsUUFERCxVQUNDQSxRQUREO0FBQUEsVUFDV0MsU0FEWCxVQUNXQSxTQURYO0FBQUEsVUFDeUJDLFVBRHpCOzs7QUFHUCxhQUNFO0FBQUE7QUFBQSxpQ0FDT0EsVUFEUDtBQUVFLHFCQUFXLGFBQWFEO0FBRjFCO0FBSUdEO0FBSkgsT0FERjtBQVFEOzs7RUFoQmUsZ0JBQU1HLFM7O0FBb0J4Qjs7O0FBcEJNTCxHLENBQ0dNLFksR0FBZTtBQUNwQkgsYUFBVztBQURTLEM7a0JBb0JUSCxHIiwiZmlsZSI6InJvdy5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCBSb3cgQ29tcG9uZW50XG4gKiBAbW9kdWxlIHJlYWN0L3Jvd1xuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0ICogYXMgdXRpbCBmcm9tICcuLi9qcy9saWIvdXRpbCc7XG5cblxuY29uc3QgYnJlYWtwb2ludHMgPSBbJ3hzJywgJ3NtJywgJ21kJywgJ2xnJ107XG5cblxuLyoqXG4gKiBSb3cgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBSb3cgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJydcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgY2xhc3NOYW1lLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXZcbiAgICAgICAgeyAuLi5yZWFjdFByb3BzIH1cbiAgICAgICAgY2xhc3NOYW1lPXsnbXVpLXJvdyAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBSb3c7XG4iXX0= },{"../js/lib/util":7,"react":"1n8/MK"}],30:[function(require,module,exports){ /** * MUI React select module * @module react/select */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _forms = require('../js/lib/forms'); var formlib = babelHelpers.interopRequireWildcard(_forms); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Select constructor * @class */ var Select = function (_React$Component) { babelHelpers.inherits(Select, _React$Component); function Select(props) { babelHelpers.classCallCheck(this, Select); // warn if value defined but onChange is not var _this = babelHelpers.possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props)); _this.state = { showMenu: false }; if (props.readOnly === false && props.value !== undefined && props.onChange === null) { util.raiseError(_helpers.controlledMessage, true); } _this.state.value = props.value; // bind callback function var cb = util.callback; _this.onInnerChangeCB = cb(_this, 'onInnerChange'); _this.onInnerMouseDownCB = cb(_this, 'onInnerMouseDown'); _this.onOuterClickCB = cb(_this, 'onOuterClick'); _this.onOuterKeyDownCB = cb(_this, 'onOuterKeyDown'); _this.hideMenuCB = cb(_this, 'hideMenu'); _this.onMenuChangeCB = cb(_this, 'onMenuChange'); return _this; } babelHelpers.createClass(Select, [{ key: 'componentDidMount', value: function componentDidMount() { // disable MUI CSS/JS this.controlEl._muiSelect = true; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { this.setState({ value: nextProps.value }); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // ensure that doc event listners have been removed jqLite.off(window, 'resize', this.hideMenuCB); jqLite.off(document, 'click', this.hideMenuCB); } }, { key: 'onInnerChange', value: function onInnerChange(ev) { var value = ev.target.value; // update state this.setState({ value: value }); } }, { key: 'onInnerMouseDown', value: function onInnerMouseDown(ev) { // only left clicks & check flag if (ev.button !== 0 || this.props.useDefault) return; // prevent built-in menu from opening ev.preventDefault(); } }, { key: 'onOuterClick', value: function onOuterClick(ev) { // only left clicks, return if <select> is disabled if (ev.button !== 0 || this.controlEl.disabled) return; // execute callback var fn = this.props.onClick; fn && fn(ev); // exit if preventDefault() was called if (ev.defaultPrevented || this.props.useDefault) return; // focus wrapper this.wrapperElRef.focus(); // open custom menu this.showMenu(); } }, { key: 'onOuterKeyDown', value: function onOuterKeyDown(ev) { // execute callback var fn = this.props.onKeyDown; fn && fn(ev); // exit if preventDevault() was called or useDefault is true if (ev.defaultPrevented || this.props.useDefault) return; if (this.state.showMenu === false) { var keyCode = ev.keyCode; // spacebar, down, up if (keyCode === 32 || keyCode === 38 || keyCode === 40) { // prevent default browser action ev.preventDefault(); // open custom menu this.showMenu(); } } } }, { key: 'showMenu', value: function showMenu() { // check useDefault flag if (this.props.useDefault) return; // add event listeners jqLite.on(window, 'resize', this.hideMenuCB); jqLite.on(document, 'click', this.hideMenuCB); // re-draw this.setState({ showMenu: true }); } }, { key: 'hideMenu', value: function hideMenu() { // remove event listeners jqLite.off(window, 'resize', this.hideMenuCB); jqLite.off(document, 'click', this.hideMenuCB); // re-draw this.setState({ showMenu: false }); // refocus this.wrapperElRef.focus(); } }, { key: 'onMenuChange', value: function onMenuChange(value) { if (this.props.readOnly) return; // update inner <select> and dispatch 'change' event this.controlEl.value = value; util.dispatchEvent(this.controlEl, 'change'); } }, { key: 'render', value: function render() { var _this2 = this; var menuElem = void 0; if (this.state.showMenu) { menuElem = _react2.default.createElement(Menu, { optionEls: this.controlEl.children, wrapperEl: this.wrapperElRef, onChange: this.onMenuChangeCB, onClose: this.hideMenuCB }); } // set tab index so user can focus wrapper element var tabIndexWrapper = '-1', tabIndexInner = '0'; if (this.props.useDefault === false) { tabIndexWrapper = '0'; tabIndexInner = '-1'; } var _props = this.props, children = _props.children, className = _props.className, style = _props.style, label = _props.label, defaultValue = _props.defaultValue, readOnly = _props.readOnly, useDefault = _props.useDefault, name = _props.name, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'style', 'label', 'defaultValue', 'readOnly', 'useDefault', 'name']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { ref: function ref(el) { _this2.wrapperElRef = el; }, tabIndex: tabIndexWrapper, style: style, className: 'mui-select ' + className, onClick: this.onOuterClickCB, onKeyDown: this.onOuterKeyDownCB }), _react2.default.createElement( 'select', { ref: function ref(el) { _this2.controlEl = el; }, name: name, tabIndex: tabIndexInner, value: this.state.value, defaultValue: defaultValue, readOnly: this.props.readOnly, onChange: this.onInnerChangeCB, onMouseDown: this.onInnerMouseDownCB, required: this.props.required }, children ), _react2.default.createElement( 'label', null, label ), menuElem ); } }]); return Select; }(_react2.default.Component); /** * Menu constructor * @class */ Select.defaultProps = { className: '', name: '', readOnly: false, useDefault: typeof document !== 'undefined' && 'ontouchstart' in document.documentElement ? true : false, onChange: null, onClick: null, onKeyDown: null }; var Menu = function (_React$Component2) { babelHelpers.inherits(Menu, _React$Component2); function Menu(props) { babelHelpers.classCallCheck(this, Menu); var _this3 = babelHelpers.possibleConstructorReturn(this, (Menu.__proto__ || Object.getPrototypeOf(Menu)).call(this, props)); _this3.state = { origIndex: null, currentIndex: null }; _this3.onKeyDownCB = util.callback(_this3, 'onKeyDown'); _this3.onKeyPressCB = util.callback(_this3, 'onKeyPress'); _this3.q = ''; _this3.qTimeout = null; return _this3; } babelHelpers.createClass(Menu, [{ key: 'componentWillMount', value: function componentWillMount() { var optionEls = this.props.optionEls, m = optionEls.length, selectedPos = 0, i = void 0; // get current selected position for (i = m - 1; i > -1; i--) { if (optionEls[i].selected) selectedPos = i; }this.setState({ origIndex: selectedPos, currentIndex: selectedPos }); } }, { key: 'componentDidMount', value: function componentDidMount() { // prevent scrolling util.enableScrollLock(); var menuEl = this.wrapperElRef; // set position var props = formlib.getMenuPositionalCSS(this.props.wrapperEl, menuEl, this.state.currentIndex); jqLite.css(menuEl, props); jqLite.scrollTop(menuEl, props.scrollTop); // attach keydown handler jqLite.on(document, 'keydown', this.onKeyDownCB); jqLite.on(document, 'keypress', this.onKeyPressCB); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // remove scroll lock util.disableScrollLock(true); // remove keydown handler jqLite.off(document, 'keydown', this.onKeyDownCB); jqLite.off(document, 'keypress', this.onKeyPressCB); } }, { key: 'onClick', value: function onClick(pos, ev) { // don't allow events to bubble ev.stopPropagation(); this.selectAndDestroy(pos); } }, { key: 'onKeyDown', value: function onKeyDown(ev) { var keyCode = ev.keyCode; // tab if (keyCode === 9) return this.destroy(); // escape | up | down | enter if (keyCode === 27 || keyCode === 40 || keyCode === 38 || keyCode === 13) { ev.preventDefault(); } if (keyCode === 27) this.destroy();else if (keyCode === 40) this.increment();else if (keyCode === 38) this.decrement();else if (keyCode === 13) this.selectAndDestroy(); } }, { key: 'onKeyPress', value: function onKeyPress(ev) { // handle query timer var self = this; clearTimeout(this.qTimeout); this.q += ev.key; this.qTimeout = setTimeout(function () { self.q = ''; }, 300); // select first match alphabetically var prefixRegex = new RegExp('^' + this.q, 'i'), optionEls = this.props.optionEls, m = optionEls.length, i = void 0; for (i = 0; i < m; i++) { // select item if code matches if (prefixRegex.test(optionEls[i].innerText)) { this.setState({ currentIndex: i }); break; } } } }, { key: 'increment', value: function increment() { if (this.state.currentIndex === this.props.optionEls.length - 1) return; this.setState({ currentIndex: this.state.currentIndex + 1 }); } }, { key: 'decrement', value: function decrement() { if (this.state.currentIndex === 0) return; this.setState({ currentIndex: this.state.currentIndex - 1 }); } }, { key: 'selectAndDestroy', value: function selectAndDestroy(pos) { pos = pos === undefined ? this.state.currentIndex : pos; // handle onChange if (pos !== this.state.origIndex) { this.props.onChange(this.props.optionEls[pos].value); } // close menu this.destroy(); } }, { key: 'destroy', value: function destroy() { this.props.onClose(); } }, { key: 'render', value: function render() { var _this4 = this; var menuItems = [], optionEls = this.props.optionEls, m = optionEls.length, optionEl = void 0, cls = void 0, i = void 0; // define menu items for (i = 0; i < m; i++) { cls = i === this.state.currentIndex ? 'mui--is-selected ' : ''; // add custom css class from <Option> component cls += optionEls[i].className; menuItems.push(_react2.default.createElement( 'div', { key: i, className: cls, onClick: this.onClick.bind(this, i) }, optionEls[i].textContent )); } return _react2.default.createElement( 'div', { ref: function ref(el) { _this4.wrapperElRef = el; }, className: 'mui-select__menu' }, menuItems ); } }]); return Menu; }(_react2.default.Component); /** Define module API */ Menu.defaultProps = { optionEls: [], wrapperEl: null, onChange: null, onClose: null }; exports.default = Select; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbGVjdC5qc3giXSwibmFtZXMiOlsiZm9ybWxpYiIsImpxTGl0ZSIsInV0aWwiLCJTZWxlY3QiLCJwcm9wcyIsInN0YXRlIiwic2hvd01lbnUiLCJyZWFkT25seSIsInZhbHVlIiwidW5kZWZpbmVkIiwib25DaGFuZ2UiLCJyYWlzZUVycm9yIiwiY2IiLCJjYWxsYmFjayIsIm9uSW5uZXJDaGFuZ2VDQiIsIm9uSW5uZXJNb3VzZURvd25DQiIsIm9uT3V0ZXJDbGlja0NCIiwib25PdXRlcktleURvd25DQiIsImhpZGVNZW51Q0IiLCJvbk1lbnVDaGFuZ2VDQiIsImNvbnRyb2xFbCIsIl9tdWlTZWxlY3QiLCJuZXh0UHJvcHMiLCJzZXRTdGF0ZSIsIm9mZiIsIndpbmRvdyIsImRvY3VtZW50IiwiZXYiLCJ0YXJnZXQiLCJidXR0b24iLCJ1c2VEZWZhdWx0IiwicHJldmVudERlZmF1bHQiLCJkaXNhYmxlZCIsImZuIiwib25DbGljayIsImRlZmF1bHRQcmV2ZW50ZWQiLCJ3cmFwcGVyRWxSZWYiLCJmb2N1cyIsIm9uS2V5RG93biIsImtleUNvZGUiLCJvbiIsImRpc3BhdGNoRXZlbnQiLCJtZW51RWxlbSIsImNoaWxkcmVuIiwidGFiSW5kZXhXcmFwcGVyIiwidGFiSW5kZXhJbm5lciIsImNsYXNzTmFtZSIsInN0eWxlIiwibGFiZWwiLCJkZWZhdWx0VmFsdWUiLCJuYW1lIiwicmVhY3RQcm9wcyIsImVsIiwicmVxdWlyZWQiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiLCJkb2N1bWVudEVsZW1lbnQiLCJNZW51Iiwib3JpZ0luZGV4IiwiY3VycmVudEluZGV4Iiwib25LZXlEb3duQ0IiLCJvbktleVByZXNzQ0IiLCJxIiwicVRpbWVvdXQiLCJvcHRpb25FbHMiLCJtIiwibGVuZ3RoIiwic2VsZWN0ZWRQb3MiLCJpIiwic2VsZWN0ZWQiLCJlbmFibGVTY3JvbGxMb2NrIiwibWVudUVsIiwiZ2V0TWVudVBvc2l0aW9uYWxDU1MiLCJ3cmFwcGVyRWwiLCJjc3MiLCJzY3JvbGxUb3AiLCJkaXNhYmxlU2Nyb2xsTG9jayIsInBvcyIsInN0b3BQcm9wYWdhdGlvbiIsInNlbGVjdEFuZERlc3Ryb3kiLCJkZXN0cm95IiwiaW5jcmVtZW50IiwiZGVjcmVtZW50Iiwic2VsZiIsImNsZWFyVGltZW91dCIsImtleSIsInNldFRpbWVvdXQiLCJwcmVmaXhSZWdleCIsIlJlZ0V4cCIsInRlc3QiLCJpbm5lclRleHQiLCJvbkNsb3NlIiwibWVudUl0ZW1zIiwib3B0aW9uRWwiLCJjbHMiLCJwdXNoIiwiYmluZCIsInRleHRDb250ZW50Il0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFFQTs7SUFBWUEsTzs7QUFDWjs7SUFBWUMsTTs7QUFDWjs7SUFBWUMsSTs7QUFDWjs7QUFHQTs7OztJQUlNQyxNOzs7QUFDSixrQkFBWUMsS0FBWixFQUFtQjtBQUFBOztBQUdqQjtBQUhpQiw0SEFDWEEsS0FEVzs7QUFBQSxVQXlCbkJDLEtBekJtQixHQXlCWDtBQUNOQyxnQkFBVTtBQURKLEtBekJXO0FBSWpCLFFBQUlGLE1BQU1HLFFBQU4sS0FBbUIsS0FBbkIsSUFDRkgsTUFBTUksS0FBTixLQUFnQkMsU0FEZCxJQUVGTCxNQUFNTSxRQUFOLEtBQW1CLElBRnJCLEVBRTJCO0FBQ3pCUixXQUFLUyxVQUFMLDZCQUFtQyxJQUFuQztBQUNEOztBQUVELFVBQUtOLEtBQUwsQ0FBV0csS0FBWCxHQUFtQkosTUFBTUksS0FBekI7O0FBRUE7QUFDQSxRQUFJSSxLQUFLVixLQUFLVyxRQUFkOztBQUVBLFVBQUtDLGVBQUwsR0FBdUJGLFVBQVMsZUFBVCxDQUF2QjtBQUNBLFVBQUtHLGtCQUFMLEdBQTBCSCxVQUFTLGtCQUFULENBQTFCOztBQUVBLFVBQUtJLGNBQUwsR0FBc0JKLFVBQVMsY0FBVCxDQUF0QjtBQUNBLFVBQUtLLGdCQUFMLEdBQXdCTCxVQUFTLGdCQUFULENBQXhCOztBQUVBLFVBQUtNLFVBQUwsR0FBa0JOLFVBQVMsVUFBVCxDQUFsQjtBQUNBLFVBQUtPLGNBQUwsR0FBc0JQLFVBQVMsY0FBVCxDQUF0QjtBQXRCaUI7QUF1QmxCOzs7O3dDQWdCbUI7QUFDbEI7QUFDQSxXQUFLUSxTQUFMLENBQWVDLFVBQWYsR0FBNEIsSUFBNUI7QUFDRDs7OzhDQUV5QkMsUyxFQUFXO0FBQ25DLFdBQUtDLFFBQUwsQ0FBYyxFQUFFZixPQUFPYyxVQUFVZCxLQUFuQixFQUFkO0FBQ0Q7OzsyQ0FFc0I7QUFDckI7QUFDQVAsYUFBT3VCLEdBQVAsQ0FBV0MsTUFBWCxFQUFtQixRQUFuQixFQUE2QixLQUFLUCxVQUFsQztBQUNBakIsYUFBT3VCLEdBQVAsQ0FBV0UsUUFBWCxFQUFxQixPQUFyQixFQUE4QixLQUFLUixVQUFuQztBQUNEOzs7a0NBRWFTLEUsRUFBSTtBQUNoQixVQUFJbkIsUUFBUW1CLEdBQUdDLE1BQUgsQ0FBVXBCLEtBQXRCOztBQUVBO0FBQ0EsV0FBS2UsUUFBTCxDQUFjLEVBQUVmLFlBQUYsRUFBZDtBQUNEOzs7cUNBRWdCbUIsRSxFQUFJO0FBQ25CO0FBQ0EsVUFBSUEsR0FBR0UsTUFBSCxLQUFjLENBQWQsSUFBbUIsS0FBS3pCLEtBQUwsQ0FBVzBCLFVBQWxDLEVBQThDOztBQUU5QztBQUNBSCxTQUFHSSxjQUFIO0FBQ0Q7OztpQ0FFWUosRSxFQUFJO0FBQ2Y7QUFDQSxVQUFJQSxHQUFHRSxNQUFILEtBQWMsQ0FBZCxJQUFtQixLQUFLVCxTQUFMLENBQWVZLFFBQXRDLEVBQWdEOztBQUVoRDtBQUNBLFVBQU1DLEtBQUssS0FBSzdCLEtBQUwsQ0FBVzhCLE9BQXRCO0FBQ0FELFlBQU1BLEdBQUdOLEVBQUgsQ0FBTjs7QUFFQTtBQUNBLFVBQUlBLEdBQUdRLGdCQUFILElBQXVCLEtBQUsvQixLQUFMLENBQVcwQixVQUF0QyxFQUFrRDs7QUFFbEQ7QUFDQSxXQUFLTSxZQUFMLENBQWtCQyxLQUFsQjs7QUFFQTtBQUNBLFdBQUsvQixRQUFMO0FBQ0Q7OzttQ0FFY3FCLEUsRUFBSTtBQUNqQjtBQUNBLFVBQU1NLEtBQUssS0FBSzdCLEtBQUwsQ0FBV2tDLFNBQXRCO0FBQ0FMLFlBQU1BLEdBQUdOLEVBQUgsQ0FBTjs7QUFFQTtBQUNBLFVBQUlBLEdBQUdRLGdCQUFILElBQXVCLEtBQUsvQixLQUFMLENBQVcwQixVQUF0QyxFQUFrRDs7QUFFbEQsVUFBSSxLQUFLekIsS0FBTCxDQUFXQyxRQUFYLEtBQXdCLEtBQTVCLEVBQW1DO0FBQ2pDLFlBQUlpQyxVQUFVWixHQUFHWSxPQUFqQjs7QUFFQTtBQUNBLFlBQUlBLFlBQVksRUFBWixJQUFrQkEsWUFBWSxFQUE5QixJQUFvQ0EsWUFBWSxFQUFwRCxFQUF3RDtBQUN0RDtBQUNBWixhQUFHSSxjQUFIOztBQUVBO0FBQ0EsZUFBS3pCLFFBQUw7QUFDRDtBQUNGO0FBQ0Y7OzsrQkFFVTtBQUNUO0FBQ0EsVUFBSSxLQUFLRixLQUFMLENBQVcwQixVQUFmLEVBQTJCOztBQUUzQjtBQUNBN0IsYUFBT3VDLEVBQVAsQ0FBVWYsTUFBVixFQUFrQixRQUFsQixFQUE0QixLQUFLUCxVQUFqQztBQUNBakIsYUFBT3VDLEVBQVAsQ0FBVWQsUUFBVixFQUFvQixPQUFwQixFQUE2QixLQUFLUixVQUFsQzs7QUFFQTtBQUNBLFdBQUtLLFFBQUwsQ0FBYyxFQUFFakIsVUFBVSxJQUFaLEVBQWQ7QUFDRDs7OytCQUVVO0FBQ1Q7QUFDQUwsYUFBT3VCLEdBQVAsQ0FBV0MsTUFBWCxFQUFtQixRQUFuQixFQUE2QixLQUFLUCxVQUFsQztBQUNBakIsYUFBT3VCLEdBQVAsQ0FBV0UsUUFBWCxFQUFxQixPQUFyQixFQUE4QixLQUFLUixVQUFuQzs7QUFFQTtBQUNBLFdBQUtLLFFBQUwsQ0FBYyxFQUFFakIsVUFBVSxLQUFaLEVBQWQ7O0FBRUE7QUFDQSxXQUFLOEIsWUFBTCxDQUFrQkMsS0FBbEI7QUFDRDs7O2lDQUVZN0IsSyxFQUFPO0FBQ2xCLFVBQUksS0FBS0osS0FBTCxDQUFXRyxRQUFmLEVBQXlCOztBQUV6QjtBQUNBLFdBQUthLFNBQUwsQ0FBZVosS0FBZixHQUF1QkEsS0FBdkI7QUFDQU4sV0FBS3VDLGFBQUwsQ0FBbUIsS0FBS3JCLFNBQXhCLEVBQW1DLFFBQW5DO0FBQ0Q7Ozs2QkFFUTtBQUFBOztBQUNQLFVBQUlzQixpQkFBSjs7QUFFQSxVQUFJLEtBQUtyQyxLQUFMLENBQVdDLFFBQWYsRUFBeUI7QUFDdkJvQyxtQkFDRSw4QkFBQyxJQUFEO0FBQ0UscUJBQVcsS0FBS3RCLFNBQUwsQ0FBZXVCLFFBRDVCO0FBRUUscUJBQVcsS0FBS1AsWUFGbEI7QUFHRSxvQkFBVSxLQUFLakIsY0FIakI7QUFJRSxtQkFBUyxLQUFLRDtBQUpoQixVQURGO0FBUUQ7O0FBRUQ7QUFDQSxVQUFJMEIsa0JBQWtCLElBQXRCO0FBQUEsVUFDRUMsZ0JBQWdCLEdBRGxCOztBQUdBLFVBQUksS0FBS3pDLEtBQUwsQ0FBVzBCLFVBQVgsS0FBMEIsS0FBOUIsRUFBcUM7QUFDbkNjLDBCQUFrQixHQUFsQjtBQUNBQyx3QkFBZ0IsSUFBaEI7QUFDRDs7QUFyQk0sbUJBd0IrQixLQUFLekMsS0F4QnBDO0FBQUEsVUF1QkN1QyxRQXZCRCxVQXVCQ0EsUUF2QkQ7QUFBQSxVQXVCV0csU0F2QlgsVUF1QldBLFNBdkJYO0FBQUEsVUF1QnNCQyxLQXZCdEIsVUF1QnNCQSxLQXZCdEI7QUFBQSxVQXVCNkJDLEtBdkI3QixVQXVCNkJBLEtBdkI3QjtBQUFBLFVBdUJvQ0MsWUF2QnBDLFVBdUJvQ0EsWUF2QnBDO0FBQUEsVUF1QmtEMUMsUUF2QmxELFVBdUJrREEsUUF2QmxEO0FBQUEsVUF3Qkx1QixVQXhCSyxVQXdCTEEsVUF4Qks7QUFBQSxVQXdCT29CLElBeEJQLFVBd0JPQSxJQXhCUDtBQUFBLFVBd0JnQkMsVUF4QmhCOzs7QUEwQlAsYUFDRTtBQUFBO0FBQUEsaUNBQ09BLFVBRFA7QUFFRSxlQUFLLGlCQUFNO0FBQUUsbUJBQUtmLFlBQUwsR0FBb0JnQixFQUFwQjtBQUF3QixXQUZ2QztBQUdFLG9CQUFVUixlQUhaO0FBSUUsaUJBQU9HLEtBSlQ7QUFLRSxxQkFBVyxnQkFBZ0JELFNBTDdCO0FBTUUsbUJBQVMsS0FBSzlCLGNBTmhCO0FBT0UscUJBQVcsS0FBS0M7QUFQbEI7QUFTRTtBQUFBO0FBQUE7QUFDRSxpQkFBSyxpQkFBTTtBQUFFLHFCQUFLRyxTQUFMLEdBQWlCZ0MsRUFBakI7QUFBc0IsYUFEckM7QUFFRSxrQkFBTUYsSUFGUjtBQUdFLHNCQUFVTCxhQUhaO0FBSUUsbUJBQU8sS0FBS3hDLEtBQUwsQ0FBV0csS0FKcEI7QUFLRSwwQkFBY3lDLFlBTGhCO0FBTUUsc0JBQVUsS0FBSzdDLEtBQUwsQ0FBV0csUUFOdkI7QUFPRSxzQkFBVSxLQUFLTyxlQVBqQjtBQVFFLHlCQUFhLEtBQUtDLGtCQVJwQjtBQVNFLHNCQUFVLEtBQUtYLEtBQUwsQ0FBV2lEO0FBVHZCO0FBV0dWO0FBWEgsU0FURjtBQXNCRTtBQUFBO0FBQUE7QUFBUUs7QUFBUixTQXRCRjtBQXVCR047QUF2QkgsT0FERjtBQTJCRDs7O0VBbk1rQixnQkFBTVksUzs7QUF1TTNCOzs7Ozs7QUF2TU1uRCxNLENBOEJHb0QsWSxHQUFlO0FBQ3BCVCxhQUFXLEVBRFM7QUFFcEJJLFFBQU0sRUFGYztBQUdwQjNDLFlBQVUsS0FIVTtBQUlwQnVCLGNBQWEsT0FBT0osUUFBUCxLQUFvQixXQUFwQixJQUFtQyxrQkFBa0JBLFNBQVM4QixlQUEvRCxHQUFrRixJQUFsRixHQUF5RixLQUpqRjtBQUtwQjlDLFlBQVUsSUFMVTtBQU1wQndCLFdBQVMsSUFOVztBQU9wQkksYUFBVztBQVBTLEM7O0lBNktsQm1CLEk7OztBQUNKLGdCQUFZckQsS0FBWixFQUFtQjtBQUFBOztBQUFBLHlIQUNYQSxLQURXOztBQUFBLFdBU25CQyxLQVRtQixHQVNYO0FBQ05xRCxpQkFBVyxJQURMO0FBRU5DLG9CQUFjO0FBRlIsS0FUVzs7O0FBR2pCLFdBQUtDLFdBQUwsR0FBbUIxRCxLQUFLVyxRQUFMLFNBQW9CLFdBQXBCLENBQW5CO0FBQ0EsV0FBS2dELFlBQUwsR0FBb0IzRCxLQUFLVyxRQUFMLFNBQW9CLFlBQXBCLENBQXBCO0FBQ0EsV0FBS2lELENBQUwsR0FBUyxFQUFUO0FBQ0EsV0FBS0MsUUFBTCxHQUFnQixJQUFoQjtBQU5pQjtBQU9sQjs7Ozt5Q0Fjb0I7QUFDbkIsVUFBSUMsWUFBWSxLQUFLNUQsS0FBTCxDQUFXNEQsU0FBM0I7QUFBQSxVQUNFQyxJQUFJRCxVQUFVRSxNQURoQjtBQUFBLFVBRUVDLGNBQWMsQ0FGaEI7QUFBQSxVQUdFQyxVQUhGOztBQUtBO0FBQ0EsV0FBS0EsSUFBSUgsSUFBSSxDQUFiLEVBQWdCRyxJQUFJLENBQUMsQ0FBckIsRUFBd0JBLEdBQXhCO0FBQTZCLFlBQUlKLFVBQVVJLENBQVYsRUFBYUMsUUFBakIsRUFBMkJGLGNBQWNDLENBQWQ7QUFBeEQsT0FDQSxLQUFLN0MsUUFBTCxDQUFjLEVBQUVtQyxXQUFXUyxXQUFiLEVBQTBCUixjQUFjUSxXQUF4QyxFQUFkO0FBQ0Q7Ozt3Q0FFbUI7QUFDbEI7QUFDQWpFLFdBQUtvRSxnQkFBTDs7QUFFQSxVQUFJQyxTQUFTLEtBQUtuQyxZQUFsQjs7QUFFQTtBQUNBLFVBQUloQyxRQUFRSixRQUFRd0Usb0JBQVIsQ0FDVixLQUFLcEUsS0FBTCxDQUFXcUUsU0FERCxFQUVWRixNQUZVLEVBR1YsS0FBS2xFLEtBQUwsQ0FBV3NELFlBSEQsQ0FBWjs7QUFNQTFELGFBQU95RSxHQUFQLENBQVdILE1BQVgsRUFBbUJuRSxLQUFuQjtBQUNBSCxhQUFPMEUsU0FBUCxDQUFpQkosTUFBakIsRUFBeUJuRSxNQUFNdUUsU0FBL0I7O0FBRUE7QUFDQTFFLGFBQU91QyxFQUFQLENBQVVkLFFBQVYsRUFBb0IsU0FBcEIsRUFBK0IsS0FBS2tDLFdBQXBDO0FBQ0EzRCxhQUFPdUMsRUFBUCxDQUFVZCxRQUFWLEVBQW9CLFVBQXBCLEVBQWdDLEtBQUttQyxZQUFyQztBQUNEOzs7MkNBRXNCO0FBQ3JCO0FBQ0EzRCxXQUFLMEUsaUJBQUwsQ0FBdUIsSUFBdkI7O0FBRUE7QUFDQTNFLGFBQU91QixHQUFQLENBQVdFLFFBQVgsRUFBcUIsU0FBckIsRUFBZ0MsS0FBS2tDLFdBQXJDO0FBQ0EzRCxhQUFPdUIsR0FBUCxDQUFXRSxRQUFYLEVBQXFCLFVBQXJCLEVBQWlDLEtBQUttQyxZQUF0QztBQUNEOzs7NEJBRU9nQixHLEVBQUtsRCxFLEVBQUk7QUFDZjtBQUNBQSxTQUFHbUQsZUFBSDtBQUNBLFdBQUtDLGdCQUFMLENBQXNCRixHQUF0QjtBQUNEOzs7OEJBRVNsRCxFLEVBQUk7QUFDWixVQUFJWSxVQUFVWixHQUFHWSxPQUFqQjs7QUFFQTtBQUNBLFVBQUlBLFlBQVksQ0FBaEIsRUFBbUIsT0FBTyxLQUFLeUMsT0FBTCxFQUFQOztBQUVuQjtBQUNBLFVBQUl6QyxZQUFZLEVBQVosSUFBa0JBLFlBQVksRUFBOUIsSUFBb0NBLFlBQVksRUFBaEQsSUFBc0RBLFlBQVksRUFBdEUsRUFBMEU7QUFDeEVaLFdBQUdJLGNBQUg7QUFDRDs7QUFFRCxVQUFJUSxZQUFZLEVBQWhCLEVBQW9CLEtBQUt5QyxPQUFMLEdBQXBCLEtBQ0ssSUFBSXpDLFlBQVksRUFBaEIsRUFBb0IsS0FBSzBDLFNBQUwsR0FBcEIsS0FDQSxJQUFJMUMsWUFBWSxFQUFoQixFQUFvQixLQUFLMkMsU0FBTCxHQUFwQixLQUNBLElBQUkzQyxZQUFZLEVBQWhCLEVBQW9CLEtBQUt3QyxnQkFBTDtBQUMxQjs7OytCQUVVcEQsRSxFQUFJO0FBQ2I7QUFDQSxVQUFJd0QsT0FBTyxJQUFYO0FBQ0FDLG1CQUFhLEtBQUtyQixRQUFsQjtBQUNBLFdBQUtELENBQUwsSUFBVW5DLEdBQUcwRCxHQUFiO0FBQ0EsV0FBS3RCLFFBQUwsR0FBZ0J1QixXQUFXLFlBQVk7QUFBRUgsYUFBS3JCLENBQUwsR0FBUyxFQUFUO0FBQWMsT0FBdkMsRUFBeUMsR0FBekMsQ0FBaEI7O0FBRUE7QUFDQSxVQUFJeUIsY0FBYyxJQUFJQyxNQUFKLENBQVcsTUFBTSxLQUFLMUIsQ0FBdEIsRUFBeUIsR0FBekIsQ0FBbEI7QUFBQSxVQUNFRSxZQUFZLEtBQUs1RCxLQUFMLENBQVc0RCxTQUR6QjtBQUFBLFVBRUVDLElBQUlELFVBQVVFLE1BRmhCO0FBQUEsVUFHRUUsVUFIRjs7QUFLQSxXQUFLQSxJQUFJLENBQVQsRUFBWUEsSUFBSUgsQ0FBaEIsRUFBbUJHLEdBQW5CLEVBQXdCO0FBQ3RCO0FBQ0EsWUFBSW1CLFlBQVlFLElBQVosQ0FBaUJ6QixVQUFVSSxDQUFWLEVBQWFzQixTQUE5QixDQUFKLEVBQThDO0FBQzVDLGVBQUtuRSxRQUFMLENBQWMsRUFBRW9DLGNBQWNTLENBQWhCLEVBQWQ7QUFDQTtBQUNEO0FBQ0Y7QUFDRjs7O2dDQUVXO0FBQ1YsVUFBSSxLQUFLL0QsS0FBTCxDQUFXc0QsWUFBWCxLQUE0QixLQUFLdkQsS0FBTCxDQUFXNEQsU0FBWCxDQUFxQkUsTUFBckIsR0FBOEIsQ0FBOUQsRUFBaUU7QUFDakUsV0FBSzNDLFFBQUwsQ0FBYyxFQUFFb0MsY0FBYyxLQUFLdEQsS0FBTCxDQUFXc0QsWUFBWCxHQUEwQixDQUExQyxFQUFkO0FBQ0Q7OztnQ0FFVztBQUNWLFVBQUksS0FBS3RELEtBQUwsQ0FBV3NELFlBQVgsS0FBNEIsQ0FBaEMsRUFBbUM7QUFDbkMsV0FBS3BDLFFBQUwsQ0FBYyxFQUFFb0MsY0FBYyxLQUFLdEQsS0FBTCxDQUFXc0QsWUFBWCxHQUEwQixDQUExQyxFQUFkO0FBQ0Q7OztxQ0FFZ0JrQixHLEVBQUs7QUFDcEJBLFlBQU9BLFFBQVFwRSxTQUFULEdBQXNCLEtBQUtKLEtBQUwsQ0FBV3NELFlBQWpDLEdBQWdEa0IsR0FBdEQ7O0FBRUE7QUFDQSxVQUFJQSxRQUFRLEtBQUt4RSxLQUFMLENBQVdxRCxTQUF2QixFQUFrQztBQUNoQyxhQUFLdEQsS0FBTCxDQUFXTSxRQUFYLENBQW9CLEtBQUtOLEtBQUwsQ0FBVzRELFNBQVgsQ0FBcUJhLEdBQXJCLEVBQTBCckUsS0FBOUM7QUFDRDs7QUFFRDtBQUNBLFdBQUt3RSxPQUFMO0FBQ0Q7Ozs4QkFFUztBQUNSLFdBQUs1RSxLQUFMLENBQVd1RixPQUFYO0FBQ0Q7Ozs2QkFFUTtBQUFBOztBQUNQLFVBQUlDLFlBQVksRUFBaEI7QUFBQSxVQUNFNUIsWUFBWSxLQUFLNUQsS0FBTCxDQUFXNEQsU0FEekI7QUFBQSxVQUVFQyxJQUFJRCxVQUFVRSxNQUZoQjtBQUFBLFVBR0UyQixpQkFIRjtBQUFBLFVBSUVDLFlBSkY7QUFBQSxVQUtFMUIsVUFMRjs7QUFPQTtBQUNBLFdBQUtBLElBQUksQ0FBVCxFQUFZQSxJQUFJSCxDQUFoQixFQUFtQkcsR0FBbkIsRUFBd0I7QUFDdEIwQixjQUFPMUIsTUFBTSxLQUFLL0QsS0FBTCxDQUFXc0QsWUFBbEIsR0FBa0MsbUJBQWxDLEdBQXdELEVBQTlEOztBQUVBO0FBQ0FtQyxlQUFPOUIsVUFBVUksQ0FBVixFQUFhdEIsU0FBcEI7O0FBRUE4QyxrQkFBVUcsSUFBVixDQUNFO0FBQUE7QUFBQTtBQUNFLGlCQUFLM0IsQ0FEUDtBQUVFLHVCQUFXMEIsR0FGYjtBQUdFLHFCQUFTLEtBQUs1RCxPQUFMLENBQWE4RCxJQUFiLENBQWtCLElBQWxCLEVBQXdCNUIsQ0FBeEI7QUFIWDtBQUtHSixvQkFBVUksQ0FBVixFQUFhNkI7QUFMaEIsU0FERjtBQVNEOztBQUVELGFBQU87QUFBQTtBQUFBLFVBQUssS0FBSyxpQkFBTTtBQUFFLG1CQUFLN0QsWUFBTCxHQUFvQmdCLEVBQXBCO0FBQXdCLFdBQTFDLEVBQTRDLFdBQVUsa0JBQXREO0FBQTBFd0M7QUFBMUUsT0FBUDtBQUNEOzs7RUFqS2dCLGdCQUFNdEMsUzs7QUFxS3pCOzs7QUFyS01HLEksQ0FlR0YsWSxHQUFlO0FBQ3BCUyxhQUFXLEVBRFM7QUFFcEJTLGFBQVcsSUFGUztBQUdwQi9ELFlBQVUsSUFIVTtBQUlwQmlGLFdBQVM7QUFKVyxDO2tCQXVKVHhGLE0iLCJmaWxlIjoic2VsZWN0LmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IHNlbGVjdCBtb2R1bGVcbiAqIEBtb2R1bGUgcmVhY3Qvc2VsZWN0XG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgKiBhcyBmb3JtbGliIGZyb20gJy4uL2pzL2xpYi9mb3Jtcyc7XG5pbXBvcnQgKiBhcyBqcUxpdGUgZnJvbSAnLi4vanMvbGliL2pxTGl0ZSc7XG5pbXBvcnQgKiBhcyB1dGlsIGZyb20gJy4uL2pzL2xpYi91dGlsJztcbmltcG9ydCB7IGNvbnRyb2xsZWRNZXNzYWdlIH0gZnJvbSAnLi9faGVscGVycyc7XG5cblxuLyoqXG4gKiBTZWxlY3QgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBTZWxlY3QgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcblxuICAgIC8vIHdhcm4gaWYgdmFsdWUgZGVmaW5lZCBidXQgb25DaGFuZ2UgaXMgbm90XG4gICAgaWYgKHByb3BzLnJlYWRPbmx5ID09PSBmYWxzZSAmJlxuICAgICAgcHJvcHMudmFsdWUgIT09IHVuZGVmaW5lZCAmJlxuICAgICAgcHJvcHMub25DaGFuZ2UgPT09IG51bGwpIHtcbiAgICAgIHV0aWwucmFpc2VFcnJvcihjb250cm9sbGVkTWVzc2FnZSwgdHJ1ZSk7XG4gICAgfVxuXG4gICAgdGhpcy5zdGF0ZS52YWx1ZSA9IHByb3BzLnZhbHVlO1xuXG4gICAgLy8gYmluZCBjYWxsYmFjayBmdW5jdGlvblxuICAgIGxldCBjYiA9IHV0aWwuY2FsbGJhY2s7XG5cbiAgICB0aGlzLm9uSW5uZXJDaGFuZ2VDQiA9IGNiKHRoaXMsICdvbklubmVyQ2hhbmdlJyk7XG4gICAgdGhpcy5vbklubmVyTW91c2VEb3duQ0IgPSBjYih0aGlzLCAnb25Jbm5lck1vdXNlRG93bicpO1xuXG4gICAgdGhpcy5vbk91dGVyQ2xpY2tDQiA9IGNiKHRoaXMsICdvbk91dGVyQ2xpY2snKTtcbiAgICB0aGlzLm9uT3V0ZXJLZXlEb3duQ0IgPSBjYih0aGlzLCAnb25PdXRlcktleURvd24nKTtcblxuICAgIHRoaXMuaGlkZU1lbnVDQiA9IGNiKHRoaXMsICdoaWRlTWVudScpO1xuICAgIHRoaXMub25NZW51Q2hhbmdlQ0IgPSBjYih0aGlzLCAnb25NZW51Q2hhbmdlJyk7XG4gIH1cblxuICBzdGF0ZSA9IHtcbiAgICBzaG93TWVudTogZmFsc2VcbiAgfTtcblxuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJycsXG4gICAgbmFtZTogJycsXG4gICAgcmVhZE9ubHk6IGZhbHNlLFxuICAgIHVzZURlZmF1bHQ6ICh0eXBlb2YgZG9jdW1lbnQgIT09ICd1bmRlZmluZWQnICYmICdvbnRvdWNoc3RhcnQnIGluIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCkgPyB0cnVlIDogZmFsc2UsXG4gICAgb25DaGFuZ2U6IG51bGwsXG4gICAgb25DbGljazogbnVsbCxcbiAgICBvbktleURvd246IG51bGxcbiAgfTtcblxuICBjb21wb25lbnREaWRNb3VudCgpIHtcbiAgICAvLyBkaXNhYmxlIE1VSSBDU1MvSlNcbiAgICB0aGlzLmNvbnRyb2xFbC5fbXVpU2VsZWN0ID0gdHJ1ZTtcbiAgfVxuXG4gIGNvbXBvbmVudFdpbGxSZWNlaXZlUHJvcHMobmV4dFByb3BzKSB7XG4gICAgdGhpcy5zZXRTdGF0ZSh7IHZhbHVlOiBuZXh0UHJvcHMudmFsdWUgfSk7XG4gIH1cblxuICBjb21wb25lbnRXaWxsVW5tb3VudCgpIHtcbiAgICAvLyBlbnN1cmUgdGhhdCBkb2MgZXZlbnQgbGlzdG5lcnMgaGF2ZSBiZWVuIHJlbW92ZWRcbiAgICBqcUxpdGUub2ZmKHdpbmRvdywgJ3Jlc2l6ZScsIHRoaXMuaGlkZU1lbnVDQik7XG4gICAganFMaXRlLm9mZihkb2N1bWVudCwgJ2NsaWNrJywgdGhpcy5oaWRlTWVudUNCKTtcbiAgfVxuXG4gIG9uSW5uZXJDaGFuZ2UoZXYpIHtcbiAgICBsZXQgdmFsdWUgPSBldi50YXJnZXQudmFsdWU7XG5cbiAgICAvLyB1cGRhdGUgc3RhdGVcbiAgICB0aGlzLnNldFN0YXRlKHsgdmFsdWUgfSk7XG4gIH1cblxuICBvbklubmVyTW91c2VEb3duKGV2KSB7XG4gICAgLy8gb25seSBsZWZ0IGNsaWNrcyAmIGNoZWNrIGZsYWdcbiAgICBpZiAoZXYuYnV0dG9uICE9PSAwIHx8IHRoaXMucHJvcHMudXNlRGVmYXVsdCkgcmV0dXJuO1xuXG4gICAgLy8gcHJldmVudCBidWlsdC1pbiBtZW51IGZyb20gb3BlbmluZ1xuICAgIGV2LnByZXZlbnREZWZhdWx0KCk7XG4gIH1cblxuICBvbk91dGVyQ2xpY2soZXYpIHtcbiAgICAvLyBvbmx5IGxlZnQgY2xpY2tzLCByZXR1cm4gaWYgPHNlbGVjdD4gaXMgZGlzYWJsZWRcbiAgICBpZiAoZXYuYnV0dG9uICE9PSAwIHx8IHRoaXMuY29udHJvbEVsLmRpc2FibGVkKSByZXR1cm47XG5cbiAgICAvLyBleGVjdXRlIGNhbGxiYWNrXG4gICAgY29uc3QgZm4gPSB0aGlzLnByb3BzLm9uQ2xpY2s7XG4gICAgZm4gJiYgZm4oZXYpO1xuXG4gICAgLy8gZXhpdCBpZiBwcmV2ZW50RGVmYXVsdCgpIHdhcyBjYWxsZWRcbiAgICBpZiAoZXYuZGVmYXVsdFByZXZlbnRlZCB8fCB0aGlzLnByb3BzLnVzZURlZmF1bHQpIHJldHVybjtcblxuICAgIC8vIGZvY3VzIHdyYXBwZXJcbiAgICB0aGlzLndyYXBwZXJFbFJlZi5mb2N1cygpO1xuXG4gICAgLy8gb3BlbiBjdXN0b20gbWVudVxuICAgIHRoaXMuc2hvd01lbnUoKTtcbiAgfVxuXG4gIG9uT3V0ZXJLZXlEb3duKGV2KSB7XG4gICAgLy8gZXhlY3V0ZSBjYWxsYmFja1xuICAgIGNvbnN0IGZuID0gdGhpcy5wcm9wcy5vbktleURvd247XG4gICAgZm4gJiYgZm4oZXYpO1xuXG4gICAgLy8gZXhpdCBpZiBwcmV2ZW50RGV2YXVsdCgpIHdhcyBjYWxsZWQgb3IgdXNlRGVmYXVsdCBpcyB0cnVlXG4gICAgaWYgKGV2LmRlZmF1bHRQcmV2ZW50ZWQgfHwgdGhpcy5wcm9wcy51c2VEZWZhdWx0KSByZXR1cm47XG5cbiAgICBpZiAodGhpcy5zdGF0ZS5zaG93TWVudSA9PT0gZmFsc2UpIHtcbiAgICAgIGxldCBrZXlDb2RlID0gZXYua2V5Q29kZTtcblxuICAgICAgLy8gc3BhY2ViYXIsIGRvd24sIHVwXG4gICAgICBpZiAoa2V5Q29kZSA9PT0gMzIgfHwga2V5Q29kZSA9PT0gMzggfHwga2V5Q29kZSA9PT0gNDApIHtcbiAgICAgICAgLy8gcHJldmVudCBkZWZhdWx0IGJyb3dzZXIgYWN0aW9uXG4gICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7XG5cbiAgICAgICAgLy8gb3BlbiBjdXN0b20gbWVudVxuICAgICAgICB0aGlzLnNob3dNZW51KCk7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgc2hvd01lbnUoKSB7XG4gICAgLy8gY2hlY2sgdXNlRGVmYXVsdCBmbGFnXG4gICAgaWYgKHRoaXMucHJvcHMudXNlRGVmYXVsdCkgcmV0dXJuO1xuXG4gICAgLy8gYWRkIGV2ZW50IGxpc3RlbmVyc1xuICAgIGpxTGl0ZS5vbih3aW5kb3csICdyZXNpemUnLCB0aGlzLmhpZGVNZW51Q0IpO1xuICAgIGpxTGl0ZS5vbihkb2N1bWVudCwgJ2NsaWNrJywgdGhpcy5oaWRlTWVudUNCKTtcblxuICAgIC8vIHJlLWRyYXdcbiAgICB0aGlzLnNldFN0YXRlKHsgc2hvd01lbnU6IHRydWUgfSk7XG4gIH1cblxuICBoaWRlTWVudSgpIHtcbiAgICAvLyByZW1vdmUgZXZlbnQgbGlzdGVuZXJzXG4gICAganFMaXRlLm9mZih3aW5kb3csICdyZXNpemUnLCB0aGlzLmhpZGVNZW51Q0IpO1xuICAgIGpxTGl0ZS5vZmYoZG9jdW1lbnQsICdjbGljaycsIHRoaXMuaGlkZU1lbnVDQik7XG5cbiAgICAvLyByZS1kcmF3XG4gICAgdGhpcy5zZXRTdGF0ZSh7IHNob3dNZW51OiBmYWxzZSB9KTtcblxuICAgIC8vIHJlZm9jdXNcbiAgICB0aGlzLndyYXBwZXJFbFJlZi5mb2N1cygpO1xuICB9XG5cbiAgb25NZW51Q2hhbmdlKHZhbHVlKSB7XG4gICAgaWYgKHRoaXMucHJvcHMucmVhZE9ubHkpIHJldHVybjtcblxuICAgIC8vIHVwZGF0ZSBpbm5lciA8c2VsZWN0PiBhbmQgZGlzcGF0Y2ggJ2NoYW5nZScgZXZlbnRcbiAgICB0aGlzLmNvbnRyb2xFbC52YWx1ZSA9IHZhbHVlO1xuICAgIHV0aWwuZGlzcGF0Y2hFdmVudCh0aGlzLmNvbnRyb2xFbCwgJ2NoYW5nZScpO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGxldCBtZW51RWxlbTtcblxuICAgIGlmICh0aGlzLnN0YXRlLnNob3dNZW51KSB7XG4gICAgICBtZW51RWxlbSA9IChcbiAgICAgICAgPE1lbnVcbiAgICAgICAgICBvcHRpb25FbHM9e3RoaXMuY29udHJvbEVsLmNoaWxkcmVufVxuICAgICAgICAgIHdyYXBwZXJFbD17dGhpcy53cmFwcGVyRWxSZWZ9XG4gICAgICAgICAgb25DaGFuZ2U9e3RoaXMub25NZW51Q2hhbmdlQ0J9XG4gICAgICAgICAgb25DbG9zZT17dGhpcy5oaWRlTWVudUNCfVxuICAgICAgICAvPlxuICAgICAgKTtcbiAgICB9XG5cbiAgICAvLyBzZXQgdGFiIGluZGV4IHNvIHVzZXIgY2FuIGZvY3VzIHdyYXBwZXIgZWxlbWVudFxuICAgIGxldCB0YWJJbmRleFdyYXBwZXIgPSAnLTEnLFxuICAgICAgdGFiSW5kZXhJbm5lciA9ICcwJztcblxuICAgIGlmICh0aGlzLnByb3BzLnVzZURlZmF1bHQgPT09IGZhbHNlKSB7XG4gICAgICB0YWJJbmRleFdyYXBwZXIgPSAnMCc7XG4gICAgICB0YWJJbmRleElubmVyID0gJy0xJztcbiAgICB9XG5cbiAgICBjb25zdCB7IGNoaWxkcmVuLCBjbGFzc05hbWUsIHN0eWxlLCBsYWJlbCwgZGVmYXVsdFZhbHVlLCByZWFkT25seSxcbiAgICAgIHVzZURlZmF1bHQsIG5hbWUsIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICByZXR1cm4gKFxuICAgICAgPGRpdlxuICAgICAgICB7IC4uLnJlYWN0UHJvcHMgfVxuICAgICAgICByZWY9e2VsID0+IHsgdGhpcy53cmFwcGVyRWxSZWYgPSBlbCB9fVxuICAgICAgICB0YWJJbmRleD17dGFiSW5kZXhXcmFwcGVyfVxuICAgICAgICBzdHlsZT17c3R5bGV9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1zZWxlY3QgJyArIGNsYXNzTmFtZX1cbiAgICAgICAgb25DbGljaz17dGhpcy5vbk91dGVyQ2xpY2tDQn1cbiAgICAgICAgb25LZXlEb3duPXt0aGlzLm9uT3V0ZXJLZXlEb3duQ0J9XG4gICAgICA+XG4gICAgICAgIDxzZWxlY3RcbiAgICAgICAgICByZWY9e2VsID0+IHsgdGhpcy5jb250cm9sRWwgPSBlbDsgfX1cbiAgICAgICAgICBuYW1lPXtuYW1lfVxuICAgICAgICAgIHRhYkluZGV4PXt0YWJJbmRleElubmVyfVxuICAgICAgICAgIHZhbHVlPXt0aGlzLnN0YXRlLnZhbHVlfVxuICAgICAgICAgIGRlZmF1bHRWYWx1ZT17ZGVmYXVsdFZhbHVlfVxuICAgICAgICAgIHJlYWRPbmx5PXt0aGlzLnByb3BzLnJlYWRPbmx5fVxuICAgICAgICAgIG9uQ2hhbmdlPXt0aGlzLm9uSW5uZXJDaGFuZ2VDQn1cbiAgICAgICAgICBvbk1vdXNlRG93bj17dGhpcy5vbklubmVyTW91c2VEb3duQ0J9XG4gICAgICAgICAgcmVxdWlyZWQ9e3RoaXMucHJvcHMucmVxdWlyZWR9XG4gICAgICAgID5cbiAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgIDwvc2VsZWN0PlxuICAgICAgICA8bGFiZWw+e2xhYmVsfTwvbGFiZWw+XG4gICAgICAgIHttZW51RWxlbX1cbiAgICAgIDwvZGl2PlxuICAgICk7XG4gIH1cbn1cblxuXG4vKipcbiAqIE1lbnUgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBNZW51IGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgY29uc3RydWN0b3IocHJvcHMpIHtcbiAgICBzdXBlcihwcm9wcyk7XG5cbiAgICB0aGlzLm9uS2V5RG93bkNCID0gdXRpbC5jYWxsYmFjayh0aGlzLCAnb25LZXlEb3duJyk7XG4gICAgdGhpcy5vbktleVByZXNzQ0IgPSB1dGlsLmNhbGxiYWNrKHRoaXMsICdvbktleVByZXNzJyk7XG4gICAgdGhpcy5xID0gJyc7XG4gICAgdGhpcy5xVGltZW91dCA9IG51bGw7XG4gIH1cblxuICBzdGF0ZSA9IHtcbiAgICBvcmlnSW5kZXg6IG51bGwsXG4gICAgY3VycmVudEluZGV4OiBudWxsXG4gIH07XG5cbiAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICBvcHRpb25FbHM6IFtdLFxuICAgIHdyYXBwZXJFbDogbnVsbCxcbiAgICBvbkNoYW5nZTogbnVsbCxcbiAgICBvbkNsb3NlOiBudWxsXG4gIH07XG5cbiAgY29tcG9uZW50V2lsbE1vdW50KCkge1xuICAgIGxldCBvcHRpb25FbHMgPSB0aGlzLnByb3BzLm9wdGlvbkVscyxcbiAgICAgIG0gPSBvcHRpb25FbHMubGVuZ3RoLFxuICAgICAgc2VsZWN0ZWRQb3MgPSAwLFxuICAgICAgaTtcblxuICAgIC8vIGdldCBjdXJyZW50IHNlbGVjdGVkIHBvc2l0aW9uXG4gICAgZm9yIChpID0gbSAtIDE7IGkgPiAtMTsgaS0tKSBpZiAob3B0aW9uRWxzW2ldLnNlbGVjdGVkKSBzZWxlY3RlZFBvcyA9IGk7XG4gICAgdGhpcy5zZXRTdGF0ZSh7IG9yaWdJbmRleDogc2VsZWN0ZWRQb3MsIGN1cnJlbnRJbmRleDogc2VsZWN0ZWRQb3MgfSk7XG4gIH1cblxuICBjb21wb25lbnREaWRNb3VudCgpIHtcbiAgICAvLyBwcmV2ZW50IHNjcm9sbGluZ1xuICAgIHV0aWwuZW5hYmxlU2Nyb2xsTG9jaygpO1xuXG4gICAgbGV0IG1lbnVFbCA9IHRoaXMud3JhcHBlckVsUmVmO1xuXG4gICAgLy8gc2V0IHBvc2l0aW9uXG4gICAgbGV0IHByb3BzID0gZm9ybWxpYi5nZXRNZW51UG9zaXRpb25hbENTUyhcbiAgICAgIHRoaXMucHJvcHMud3JhcHBlckVsLFxuICAgICAgbWVudUVsLFxuICAgICAgdGhpcy5zdGF0ZS5jdXJyZW50SW5kZXhcbiAgICApO1xuXG4gICAganFMaXRlLmNzcyhtZW51RWwsIHByb3BzKTtcbiAgICBqcUxpdGUuc2Nyb2xsVG9wKG1lbnVFbCwgcHJvcHMuc2Nyb2xsVG9wKTtcblxuICAgIC8vIGF0dGFjaCBrZXlkb3duIGhhbmRsZXJcbiAgICBqcUxpdGUub24oZG9jdW1lbnQsICdrZXlkb3duJywgdGhpcy5vbktleURvd25DQik7XG4gICAganFMaXRlLm9uKGRvY3VtZW50LCAna2V5cHJlc3MnLCB0aGlzLm9uS2V5UHJlc3NDQik7XG4gIH1cblxuICBjb21wb25lbnRXaWxsVW5tb3VudCgpIHtcbiAgICAvLyByZW1vdmUgc2Nyb2xsIGxvY2tcbiAgICB1dGlsLmRpc2FibGVTY3JvbGxMb2NrKHRydWUpO1xuXG4gICAgLy8gcmVtb3ZlIGtleWRvd24gaGFuZGxlclxuICAgIGpxTGl0ZS5vZmYoZG9jdW1lbnQsICdrZXlkb3duJywgdGhpcy5vbktleURvd25DQik7XG4gICAganFMaXRlLm9mZihkb2N1bWVudCwgJ2tleXByZXNzJywgdGhpcy5vbktleVByZXNzQ0IpO1xuICB9XG5cbiAgb25DbGljayhwb3MsIGV2KSB7XG4gICAgLy8gZG9uJ3QgYWxsb3cgZXZlbnRzIHRvIGJ1YmJsZVxuICAgIGV2LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgIHRoaXMuc2VsZWN0QW5kRGVzdHJveShwb3MpO1xuICB9XG5cbiAgb25LZXlEb3duKGV2KSB7XG4gICAgbGV0IGtleUNvZGUgPSBldi5rZXlDb2RlO1xuXG4gICAgLy8gdGFiXG4gICAgaWYgKGtleUNvZGUgPT09IDkpIHJldHVybiB0aGlzLmRlc3Ryb3koKTtcblxuICAgIC8vIGVzY2FwZSB8IHVwIHwgZG93biB8IGVudGVyXG4gICAgaWYgKGtleUNvZGUgPT09IDI3IHx8IGtleUNvZGUgPT09IDQwIHx8IGtleUNvZGUgPT09IDM4IHx8IGtleUNvZGUgPT09IDEzKSB7XG4gICAgICBldi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgIH1cblxuICAgIGlmIChrZXlDb2RlID09PSAyNykgdGhpcy5kZXN0cm95KCk7XG4gICAgZWxzZSBpZiAoa2V5Q29kZSA9PT0gNDApIHRoaXMuaW5jcmVtZW50KCk7XG4gICAgZWxzZSBpZiAoa2V5Q29kZSA9PT0gMzgpIHRoaXMuZGVjcmVtZW50KCk7XG4gICAgZWxzZSBpZiAoa2V5Q29kZSA9PT0gMTMpIHRoaXMuc2VsZWN0QW5kRGVzdHJveSgpO1xuICB9XG5cbiAgb25LZXlQcmVzcyhldikge1xuICAgIC8vIGhhbmRsZSBxdWVyeSB0aW1lclxuICAgIGxldCBzZWxmID0gdGhpcztcbiAgICBjbGVhclRpbWVvdXQodGhpcy5xVGltZW91dCk7XG4gICAgdGhpcy5xICs9IGV2LmtleTtcbiAgICB0aGlzLnFUaW1lb3V0ID0gc2V0VGltZW91dChmdW5jdGlvbiAoKSB7IHNlbGYucSA9ICcnOyB9LCAzMDApO1xuXG4gICAgLy8gc2VsZWN0IGZpcnN0IG1hdGNoIGFscGhhYmV0aWNhbGx5XG4gICAgbGV0IHByZWZpeFJlZ2V4ID0gbmV3IFJlZ0V4cCgnXicgKyB0aGlzLnEsICdpJyksXG4gICAgICBvcHRpb25FbHMgPSB0aGlzLnByb3BzLm9wdGlvbkVscyxcbiAgICAgIG0gPSBvcHRpb25FbHMubGVuZ3RoLFxuICAgICAgaTtcblxuICAgIGZvciAoaSA9IDA7IGkgPCBtOyBpKyspIHtcbiAgICAgIC8vIHNlbGVjdCBpdGVtIGlmIGNvZGUgbWF0Y2hlc1xuICAgICAgaWYgKHByZWZpeFJlZ2V4LnRlc3Qob3B0aW9uRWxzW2ldLmlubmVyVGV4dCkpIHtcbiAgICAgICAgdGhpcy5zZXRTdGF0ZSh7IGN1cnJlbnRJbmRleDogaSB9KTtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgaW5jcmVtZW50KCkge1xuICAgIGlmICh0aGlzLnN0YXRlLmN1cnJlbnRJbmRleCA9PT0gdGhpcy5wcm9wcy5vcHRpb25FbHMubGVuZ3RoIC0gMSkgcmV0dXJuO1xuICAgIHRoaXMuc2V0U3RhdGUoeyBjdXJyZW50SW5kZXg6IHRoaXMuc3RhdGUuY3VycmVudEluZGV4ICsgMSB9KTtcbiAgfVxuXG4gIGRlY3JlbWVudCgpIHtcbiAgICBpZiAodGhpcy5zdGF0ZS5jdXJyZW50SW5kZXggPT09IDApIHJldHVybjtcbiAgICB0aGlzLnNldFN0YXRlKHsgY3VycmVudEluZGV4OiB0aGlzLnN0YXRlLmN1cnJlbnRJbmRleCAtIDEgfSk7XG4gIH1cblxuICBzZWxlY3RBbmREZXN0cm95KHBvcykge1xuICAgIHBvcyA9IChwb3MgPT09IHVuZGVmaW5lZCkgPyB0aGlzLnN0YXRlLmN1cnJlbnRJbmRleCA6IHBvcztcblxuICAgIC8vIGhhbmRsZSBvbkNoYW5nZVxuICAgIGlmIChwb3MgIT09IHRoaXMuc3RhdGUub3JpZ0luZGV4KSB7XG4gICAgICB0aGlzLnByb3BzLm9uQ2hhbmdlKHRoaXMucHJvcHMub3B0aW9uRWxzW3Bvc10udmFsdWUpO1xuICAgIH1cblxuICAgIC8vIGNsb3NlIG1lbnVcbiAgICB0aGlzLmRlc3Ryb3koKTtcbiAgfVxuXG4gIGRlc3Ryb3koKSB7XG4gICAgdGhpcy5wcm9wcy5vbkNsb3NlKCk7XG4gIH1cblxuICByZW5kZXIoKSB7XG4gICAgbGV0IG1lbnVJdGVtcyA9IFtdLFxuICAgICAgb3B0aW9uRWxzID0gdGhpcy5wcm9wcy5vcHRpb25FbHMsXG4gICAgICBtID0gb3B0aW9uRWxzLmxlbmd0aCxcbiAgICAgIG9wdGlvbkVsLFxuICAgICAgY2xzLFxuICAgICAgaTtcblxuICAgIC8vIGRlZmluZSBtZW51IGl0ZW1zXG4gICAgZm9yIChpID0gMDsgaSA8IG07IGkrKykge1xuICAgICAgY2xzID0gKGkgPT09IHRoaXMuc3RhdGUuY3VycmVudEluZGV4KSA/ICdtdWktLWlzLXNlbGVjdGVkICcgOiAnJztcblxuICAgICAgLy8gYWRkIGN1c3RvbSBjc3MgY2xhc3MgZnJvbSA8T3B0aW9uPiBjb21wb25lbnRcbiAgICAgIGNscyArPSBvcHRpb25FbHNbaV0uY2xhc3NOYW1lO1xuXG4gICAgICBtZW51SXRlbXMucHVzaChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIGtleT17aX1cbiAgICAgICAgICBjbGFzc05hbWU9e2Nsc31cbiAgICAgICAgICBvbkNsaWNrPXt0aGlzLm9uQ2xpY2suYmluZCh0aGlzLCBpKX1cbiAgICAgICAgPlxuICAgICAgICAgIHtvcHRpb25FbHNbaV0udGV4dENvbnRlbnR9XG4gICAgICAgIDwvZGl2PlxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gPGRpdiByZWY9e2VsID0+IHsgdGhpcy53cmFwcGVyRWxSZWYgPSBlbCB9fSBjbGFzc05hbWU9XCJtdWktc2VsZWN0X19tZW51XCI+e21lbnVJdGVtc308L2Rpdj47XG4gIH1cbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IFNlbGVjdDtcbiJdfQ== },{"../js/lib/forms":5,"../js/lib/jqLite":6,"../js/lib/util":7,"./_helpers":8,"react":"1n8/MK"}],31:[function(require,module,exports){ module.exports=require(11) },{"react":"1n8/MK"}],32:[function(require,module,exports){ (function (process){ /** * MUI React tabs module * @module react/tabs */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _tab = require('./tab'); var _tab2 = babelHelpers.interopRequireDefault(_tab); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var tabsBarClass = 'mui-tabs__bar', tabsBarJustifiedClass = 'mui-tabs__bar--justified', tabsPaneClass = 'mui-tabs__pane', isActiveClass = 'mui--is-active'; /** * Tabs constructor * @class */ var Tabs = function (_React$Component) { babelHelpers.inherits(Tabs, _React$Component); function Tabs(props) { babelHelpers.classCallCheck(this, Tabs); /* * The following code exists only to warn about deprecating props.initialSelectedIndex in favor of props.defaultSelectedIndex. * It can be removed once support for props.initialSelectedIndex is officially dropped. */ var defaultSelectedIndex = void 0; if (typeof props.initialSelectedIndex === 'number') { defaultSelectedIndex = props.initialSelectedIndex; if (console && process && process.env && process.NODE_ENV !== 'production') { console.warn('MUICSS DEPRECATION WARNING: ' + 'property "initialSelectedIndex" on the muicss Tabs component is deprecated in favor of "defaultSelectedIndex". ' + 'It will be removed in a future release.'); } } else { defaultSelectedIndex = props.defaultSelectedIndex; } /* * End deprecation warning */ var _this = babelHelpers.possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); _this.state = { currentSelectedIndex: typeof props.selectedIndex === 'number' ? props.selectedIndex : defaultSelectedIndex }; return _this; } babelHelpers.createClass(Tabs, [{ key: 'onClick', value: function onClick(i, tab, ev) { if (typeof this.props.selectedIndex === 'number' && i !== this.props.selectedIndex || i !== this.state.currentSelectedIndex) { this.setState({ currentSelectedIndex: i }); // onActive callback if (tab.props.onActive) tab.props.onActive(tab); // onChange callback if (this.props.onChange) { this.props.onChange(i, tab.props.value, tab, ev); } } } }, { key: 'render', value: function render() { var _props = this.props, children = _props.children, defaultSelectedIndex = _props.defaultSelectedIndex, initialSelectedIndex = _props.initialSelectedIndex, justified = _props.justified, selectedIndex = _props.selectedIndex, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'defaultSelectedIndex', 'initialSelectedIndex', 'justified', 'selectedIndex']); var tabs = _react2.default.Children.toArray(children); var tabEls = [], paneEls = [], m = tabs.length, currentSelectedIndex = (typeof selectedIndex === 'number' ? selectedIndex : this.state.currentSelectedIndex) % m, isActive = void 0, item = void 0, cls = void 0, i = void 0; for (i = 0; i < m; i++) { item = tabs[i]; // only accept MUITab elements if (item.type !== _tab2.default) util.raiseError('Expecting MUITab React Element'); isActive = i === currentSelectedIndex ? true : false; // tab element tabEls.push(_react2.default.createElement( 'li', { key: i, className: isActive ? isActiveClass : '' }, _react2.default.createElement( 'a', { onClick: this.onClick.bind(this, i, item) }, item.props.label ) )); // pane element cls = tabsPaneClass + ' '; if (isActive) cls += isActiveClass; paneEls.push(_react2.default.createElement( 'div', { key: i, className: cls }, item.props.children )); } cls = tabsBarClass; if (justified) cls += ' ' + tabsBarJustifiedClass; return _react2.default.createElement( 'div', reactProps, _react2.default.createElement( 'ul', { className: cls }, tabEls ), paneEls ); } }]); return Tabs; }(_react2.default.Component); /** Define module API */ Tabs.defaultProps = { className: '', defaultSelectedIndex: 0, /* * @deprecated */ initialSelectedIndex: null, justified: false, onChange: null, selectedIndex: null }; exports.default = Tabs; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhYnMuanN4Il0sIm5hbWVzIjpbInV0aWwiLCJ0YWJzQmFyQ2xhc3MiLCJ0YWJzQmFySnVzdGlmaWVkQ2xhc3MiLCJ0YWJzUGFuZUNsYXNzIiwiaXNBY3RpdmVDbGFzcyIsIlRhYnMiLCJwcm9wcyIsImRlZmF1bHRTZWxlY3RlZEluZGV4IiwiaW5pdGlhbFNlbGVjdGVkSW5kZXgiLCJjb25zb2xlIiwicHJvY2VzcyIsImVudiIsIk5PREVfRU5WIiwid2FybiIsInN0YXRlIiwiY3VycmVudFNlbGVjdGVkSW5kZXgiLCJzZWxlY3RlZEluZGV4IiwiaSIsInRhYiIsImV2Iiwic2V0U3RhdGUiLCJvbkFjdGl2ZSIsIm9uQ2hhbmdlIiwidmFsdWUiLCJjaGlsZHJlbiIsImp1c3RpZmllZCIsInJlYWN0UHJvcHMiLCJ0YWJzIiwiQ2hpbGRyZW4iLCJ0b0FycmF5IiwidGFiRWxzIiwicGFuZUVscyIsIm0iLCJsZW5ndGgiLCJpc0FjdGl2ZSIsIml0ZW0iLCJjbHMiLCJ0eXBlIiwicmFpc2VFcnJvciIsInB1c2giLCJvbkNsaWNrIiwiYmluZCIsImxhYmVsIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwiY2xhc3NOYW1lIl0sIm1hcHBpbmdzIjoiQUFBQTs7OztBQUlBO0FBQ0E7O0FBRUE7Ozs7OztBQUVBOzs7O0FBRUE7Ozs7QUFDQTs7SUFBWUEsSTs7O0FBR1osSUFBTUMsZUFBZSxlQUFyQjtBQUFBLElBQ01DLHdCQUF3QiwwQkFEOUI7QUFBQSxJQUVNQyxnQkFBZ0IsZ0JBRnRCO0FBQUEsSUFHTUMsZ0JBQWdCLGdCQUh0Qjs7QUFNQTs7Ozs7SUFJTUMsSTs7O0FBQ0osZ0JBQVlDLEtBQVosRUFBbUI7QUFBQTs7QUFDakI7Ozs7QUFJQSxRQUFJQyw2QkFBSjtBQUNBLFFBQUksT0FBT0QsTUFBTUUsb0JBQWIsS0FBc0MsUUFBMUMsRUFBb0Q7QUFDbERELDZCQUF1QkQsTUFBTUUsb0JBQTdCO0FBQ0EsVUFBSUMsV0FBV0MsT0FBWCxJQUFzQkEsUUFBUUMsR0FBOUIsSUFBcUNELFFBQVFFLFFBQVIsS0FBcUIsWUFBOUQsRUFBNEU7QUFDMUVILGdCQUFRSSxJQUFSLENBQ0UsaUNBQ0UsaUhBREYsR0FFRSx5Q0FISjtBQUtEO0FBQ0YsS0FURCxNQVVLO0FBQ0hOLDZCQUF1QkQsTUFBTUMsb0JBQTdCO0FBQ0Q7QUFDRDs7OztBQW5CaUIsd0hBc0JYRCxLQXRCVzs7QUF1QmpCLFVBQUtRLEtBQUwsR0FBYSxFQUFDQyxzQkFBc0IsT0FBT1QsTUFBTVUsYUFBYixLQUErQixRQUEvQixHQUEwQ1YsTUFBTVUsYUFBaEQsR0FBZ0VULG9CQUF2RixFQUFiO0FBdkJpQjtBQXdCbEI7Ozs7NEJBY09VLEMsRUFBR0MsRyxFQUFLQyxFLEVBQUk7QUFDbEIsVUFBSyxPQUFPLEtBQUtiLEtBQUwsQ0FBV1UsYUFBbEIsS0FBb0MsUUFBcEMsSUFBZ0RDLE1BQU0sS0FBS1gsS0FBTCxDQUFXVSxhQUFsRSxJQUFvRkMsTUFBTSxLQUFLSCxLQUFMLENBQVdDLG9CQUF6RyxFQUErSDtBQUM3SCxhQUFLSyxRQUFMLENBQWMsRUFBQ0wsc0JBQXNCRSxDQUF2QixFQUFkOztBQUVBO0FBQ0EsWUFBSUMsSUFBSVosS0FBSixDQUFVZSxRQUFkLEVBQXdCSCxJQUFJWixLQUFKLENBQVVlLFFBQVYsQ0FBbUJILEdBQW5COztBQUV4QjtBQUNBLFlBQUksS0FBS1osS0FBTCxDQUFXZ0IsUUFBZixFQUF5QjtBQUN2QixlQUFLaEIsS0FBTCxDQUFXZ0IsUUFBWCxDQUFvQkwsQ0FBcEIsRUFBdUJDLElBQUlaLEtBQUosQ0FBVWlCLEtBQWpDLEVBQXdDTCxHQUF4QyxFQUE2Q0MsRUFBN0M7QUFDRDtBQUNGO0FBQ0Y7Ozs2QkFFUTtBQUFBLG1CQUVhLEtBQUtiLEtBRmxCO0FBQUEsVUFDQ2tCLFFBREQsVUFDQ0EsUUFERDtBQUFBLFVBQ1dqQixvQkFEWCxVQUNXQSxvQkFEWDtBQUFBLFVBQ2lDQyxvQkFEakMsVUFDaUNBLG9CQURqQztBQUFBLFVBQ3VEaUIsU0FEdkQsVUFDdURBLFNBRHZEO0FBQUEsVUFDa0VULGFBRGxFLFVBQ2tFQSxhQURsRTtBQUFBLFVBRUZVLFVBRkU7OztBQUlQLFVBQUlDLE9BQU8sZ0JBQU1DLFFBQU4sQ0FBZUMsT0FBZixDQUF1QkwsUUFBdkIsQ0FBWDtBQUNBLFVBQUlNLFNBQVMsRUFBYjtBQUFBLFVBQ0lDLFVBQVUsRUFEZDtBQUFBLFVBRUlDLElBQUlMLEtBQUtNLE1BRmI7QUFBQSxVQUdJbEIsdUJBQXVCLENBQUMsT0FBT0MsYUFBUCxLQUF5QixRQUF6QixHQUFvQ0EsYUFBcEMsR0FBb0QsS0FBS0YsS0FBTCxDQUFXQyxvQkFBaEUsSUFBd0ZpQixDQUhuSDtBQUFBLFVBSUlFLGlCQUpKO0FBQUEsVUFLSUMsYUFMSjtBQUFBLFVBTUlDLFlBTko7QUFBQSxVQU9JbkIsVUFQSjs7QUFTQSxXQUFLQSxJQUFFLENBQVAsRUFBVUEsSUFBSWUsQ0FBZCxFQUFpQmYsR0FBakIsRUFBc0I7QUFDcEJrQixlQUFPUixLQUFLVixDQUFMLENBQVA7O0FBRUE7QUFDQSxZQUFJa0IsS0FBS0UsSUFBTCxrQkFBSixFQUF1QnJDLEtBQUtzQyxVQUFMLENBQWdCLGdDQUFoQjs7QUFFdkJKLG1CQUFZakIsTUFBTUYsb0JBQVAsR0FBK0IsSUFBL0IsR0FBc0MsS0FBakQ7O0FBRUE7QUFDQWUsZUFBT1MsSUFBUCxDQUNFO0FBQUE7QUFBQSxZQUFJLEtBQUt0QixDQUFULEVBQVksV0FBWWlCLFFBQUQsR0FBYTlCLGFBQWIsR0FBNkIsRUFBcEQ7QUFDRTtBQUFBO0FBQUEsY0FBRyxTQUFTLEtBQUtvQyxPQUFMLENBQWFDLElBQWIsQ0FBa0IsSUFBbEIsRUFBd0J4QixDQUF4QixFQUEyQmtCLElBQTNCLENBQVo7QUFDR0EsaUJBQUs3QixLQUFMLENBQVdvQztBQURkO0FBREYsU0FERjs7QUFRQTtBQUNBTixjQUFNakMsZ0JBQWdCLEdBQXRCO0FBQ0EsWUFBSStCLFFBQUosRUFBY0UsT0FBT2hDLGFBQVA7O0FBRWQyQixnQkFBUVEsSUFBUixDQUNFO0FBQUE7QUFBQSxZQUFLLEtBQUt0QixDQUFWLEVBQWEsV0FBV21CLEdBQXhCO0FBQ0dELGVBQUs3QixLQUFMLENBQVdrQjtBQURkLFNBREY7QUFLRDs7QUFFRFksWUFBTW5DLFlBQU47QUFDQSxVQUFJd0IsU0FBSixFQUFlVyxPQUFPLE1BQU1sQyxxQkFBYjs7QUFFZixhQUNFO0FBQUE7QUFBVXdCLGtCQUFWO0FBQ0U7QUFBQTtBQUFBLFlBQUksV0FBV1UsR0FBZjtBQUNHTjtBQURILFNBREY7QUFJR0M7QUFKSCxPQURGO0FBUUQ7OztFQTFHZ0IsZ0JBQU1ZLFM7O0FBOEd6Qjs7O0FBOUdNdEMsSSxDQTJCR3VDLFksR0FBZTtBQUNwQkMsYUFBVyxFQURTO0FBRXBCdEMsd0JBQXNCLENBRkY7QUFHcEI7OztBQUdBQyx3QkFBc0IsSUFORjtBQU9wQmlCLGFBQVcsS0FQUztBQVFwQkgsWUFBVSxJQVJVO0FBU3BCTixpQkFBZTtBQVRLLEM7a0JBb0ZUWCxJIiwiZmlsZSI6InRhYnMuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgdGFicyBtb2R1bGVcbiAqIEBtb2R1bGUgcmVhY3QvdGFic1xuICovXG4vKiBqc2hpbnQgcXVvdG1hcms6ZmFsc2UgKi9cbi8vIGpzY3M6ZGlzYWJsZSB2YWxpZGF0ZVF1b3RlTWFya3NcblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgVGFiIGZyb20gJy4vdGFiJztcbmltcG9ydCAqIGFzIHV0aWwgZnJvbSAnLi4vanMvbGliL3V0aWwnO1xuXG5cbmNvbnN0IHRhYnNCYXJDbGFzcyA9ICdtdWktdGFic19fYmFyJyxcbiAgICAgIHRhYnNCYXJKdXN0aWZpZWRDbGFzcyA9ICdtdWktdGFic19fYmFyLS1qdXN0aWZpZWQnLFxuICAgICAgdGFic1BhbmVDbGFzcyA9ICdtdWktdGFic19fcGFuZScsXG4gICAgICBpc0FjdGl2ZUNsYXNzID0gJ211aS0taXMtYWN0aXZlJztcblxuXG4vKipcbiAqIFRhYnMgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBUYWJzIGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgY29uc3RydWN0b3IocHJvcHMpIHtcbiAgICAvKlxuICAgICAqIFRoZSBmb2xsb3dpbmcgY29kZSBleGlzdHMgb25seSB0byB3YXJuIGFib3V0IGRlcHJlY2F0aW5nIHByb3BzLmluaXRpYWxTZWxlY3RlZEluZGV4IGluIGZhdm9yIG9mIHByb3BzLmRlZmF1bHRTZWxlY3RlZEluZGV4LlxuICAgICAqIEl0IGNhbiBiZSByZW1vdmVkIG9uY2Ugc3VwcG9ydCBmb3IgcHJvcHMuaW5pdGlhbFNlbGVjdGVkSW5kZXggaXMgb2ZmaWNpYWxseSBkcm9wcGVkLlxuICAgICAqL1xuICAgIGxldCBkZWZhdWx0U2VsZWN0ZWRJbmRleDtcbiAgICBpZiAodHlwZW9mIHByb3BzLmluaXRpYWxTZWxlY3RlZEluZGV4ID09PSAnbnVtYmVyJykge1xuICAgICAgZGVmYXVsdFNlbGVjdGVkSW5kZXggPSBwcm9wcy5pbml0aWFsU2VsZWN0ZWRJbmRleDtcbiAgICAgIGlmIChjb25zb2xlICYmIHByb2Nlc3MgJiYgcHJvY2Vzcy5lbnYgJiYgcHJvY2Vzcy5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAnTVVJQ1NTIERFUFJFQ0FUSU9OIFdBUk5JTkc6ICdcbiAgICAgICAgICArICdwcm9wZXJ0eSBcImluaXRpYWxTZWxlY3RlZEluZGV4XCIgb24gdGhlIG11aWNzcyBUYWJzIGNvbXBvbmVudCBpcyBkZXByZWNhdGVkIGluIGZhdm9yIG9mIFwiZGVmYXVsdFNlbGVjdGVkSW5kZXhcIi4gJ1xuICAgICAgICAgICsgJ0l0IHdpbGwgYmUgcmVtb3ZlZCBpbiBhIGZ1dHVyZSByZWxlYXNlLidcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICBkZWZhdWx0U2VsZWN0ZWRJbmRleCA9IHByb3BzLmRlZmF1bHRTZWxlY3RlZEluZGV4O1xuICAgIH1cbiAgICAvKlxuICAgICAqIEVuZCBkZXByZWNhdGlvbiB3YXJuaW5nXG4gICAgICovXG4gICAgc3VwZXIocHJvcHMpO1xuICAgIHRoaXMuc3RhdGUgPSB7Y3VycmVudFNlbGVjdGVkSW5kZXg6IHR5cGVvZiBwcm9wcy5zZWxlY3RlZEluZGV4ID09PSAnbnVtYmVyJyA/IHByb3BzLnNlbGVjdGVkSW5kZXggOiBkZWZhdWx0U2VsZWN0ZWRJbmRleH07XG4gIH1cblxuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJycsXG4gICAgZGVmYXVsdFNlbGVjdGVkSW5kZXg6IDAsXG4gICAgLypcbiAgICAgKiBAZGVwcmVjYXRlZFxuICAgICAqL1xuICAgIGluaXRpYWxTZWxlY3RlZEluZGV4OiBudWxsLFxuICAgIGp1c3RpZmllZDogZmFsc2UsXG4gICAgb25DaGFuZ2U6IG51bGwsXG4gICAgc2VsZWN0ZWRJbmRleDogbnVsbFxuICB9O1xuXG4gIG9uQ2xpY2soaSwgdGFiLCBldikge1xuICAgIGlmICgodHlwZW9mIHRoaXMucHJvcHMuc2VsZWN0ZWRJbmRleCA9PT0gJ251bWJlcicgJiYgaSAhPT0gdGhpcy5wcm9wcy5zZWxlY3RlZEluZGV4KSB8fCBpICE9PSB0aGlzLnN0YXRlLmN1cnJlbnRTZWxlY3RlZEluZGV4KSB7XG4gICAgICB0aGlzLnNldFN0YXRlKHtjdXJyZW50U2VsZWN0ZWRJbmRleDogaX0pO1xuXG4gICAgICAvLyBvbkFjdGl2ZSBjYWxsYmFja1xuICAgICAgaWYgKHRhYi5wcm9wcy5vbkFjdGl2ZSkgdGFiLnByb3BzLm9uQWN0aXZlKHRhYik7XG5cbiAgICAgIC8vIG9uQ2hhbmdlIGNhbGxiYWNrXG4gICAgICBpZiAodGhpcy5wcm9wcy5vbkNoYW5nZSkge1xuICAgICAgICB0aGlzLnByb3BzLm9uQ2hhbmdlKGksIHRhYi5wcm9wcy52YWx1ZSwgdGFiLCBldik7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGRlZmF1bHRTZWxlY3RlZEluZGV4LCBpbml0aWFsU2VsZWN0ZWRJbmRleCwganVzdGlmaWVkLCBzZWxlY3RlZEluZGV4LFxuICAgICAgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIGxldCB0YWJzID0gUmVhY3QuQ2hpbGRyZW4udG9BcnJheShjaGlsZHJlbik7XG4gICAgbGV0IHRhYkVscyA9IFtdLFxuICAgICAgICBwYW5lRWxzID0gW10sXG4gICAgICAgIG0gPSB0YWJzLmxlbmd0aCxcbiAgICAgICAgY3VycmVudFNlbGVjdGVkSW5kZXggPSAodHlwZW9mIHNlbGVjdGVkSW5kZXggPT09ICdudW1iZXInID8gc2VsZWN0ZWRJbmRleCA6IHRoaXMuc3RhdGUuY3VycmVudFNlbGVjdGVkSW5kZXgpICUgbSxcbiAgICAgICAgaXNBY3RpdmUsXG4gICAgICAgIGl0ZW0sXG4gICAgICAgIGNscyxcbiAgICAgICAgaTtcblxuICAgIGZvciAoaT0wOyBpIDwgbTsgaSsrKSB7XG4gICAgICBpdGVtID0gdGFic1tpXTtcblxuICAgICAgLy8gb25seSBhY2NlcHQgTVVJVGFiIGVsZW1lbnRzXG4gICAgICBpZiAoaXRlbS50eXBlICE9PSBUYWIpIHV0aWwucmFpc2VFcnJvcignRXhwZWN0aW5nIE1VSVRhYiBSZWFjdCBFbGVtZW50Jyk7XG5cbiAgICAgIGlzQWN0aXZlID0gKGkgPT09IGN1cnJlbnRTZWxlY3RlZEluZGV4KSA/IHRydWUgOiBmYWxzZTtcblxuICAgICAgLy8gdGFiIGVsZW1lbnRcbiAgICAgIHRhYkVscy5wdXNoKFxuICAgICAgICA8bGkga2V5PXtpfSBjbGFzc05hbWU9eyhpc0FjdGl2ZSkgPyBpc0FjdGl2ZUNsYXNzIDogJyd9PlxuICAgICAgICAgIDxhIG9uQ2xpY2s9e3RoaXMub25DbGljay5iaW5kKHRoaXMsIGksIGl0ZW0pfT5cbiAgICAgICAgICAgIHtpdGVtLnByb3BzLmxhYmVsfVxuICAgICAgICAgIDwvYT5cbiAgICAgICAgPC9saT5cbiAgICAgICk7XG5cbiAgICAgIC8vIHBhbmUgZWxlbWVudFxuICAgICAgY2xzID0gdGFic1BhbmVDbGFzcyArICcgJztcbiAgICAgIGlmIChpc0FjdGl2ZSkgY2xzICs9IGlzQWN0aXZlQ2xhc3M7XG5cbiAgICAgIHBhbmVFbHMucHVzaChcbiAgICAgICAgPGRpdiBrZXk9e2l9IGNsYXNzTmFtZT17Y2xzfT5cbiAgICAgICAgICB7aXRlbS5wcm9wcy5jaGlsZHJlbn1cbiAgICAgICAgPC9kaXY+XG4gICAgICApO1xuICAgIH1cblxuICAgIGNscyA9IHRhYnNCYXJDbGFzcztcbiAgICBpZiAoanVzdGlmaWVkKSBjbHMgKz0gJyAnICsgdGFic0Jhckp1c3RpZmllZENsYXNzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXYgeyAuLi5yZWFjdFByb3BzIH0+XG4gICAgICAgIDx1bCBjbGFzc05hbWU9e2Nsc30+XG4gICAgICAgICAge3RhYkVsc31cbiAgICAgICAgPC91bD5cbiAgICAgICAge3BhbmVFbHN9XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBUYWJzO1xuIl19 }).call(this,require("rh2vBp")) },{"../js/lib/util":7,"./tab":11,"react":"1n8/MK","rh2vBp":1}],33:[function(require,module,exports){ /** * MUI React Textarea Component * @module react/textarea */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _textField = require('./text-field'); /** * Textarea constructor * @class */ var Textarea = function (_React$Component) { babelHelpers.inherits(Textarea, _React$Component); function Textarea() { babelHelpers.classCallCheck(this, Textarea); return babelHelpers.possibleConstructorReturn(this, (Textarea.__proto__ || Object.getPrototypeOf(Textarea)).apply(this, arguments)); } babelHelpers.createClass(Textarea, [{ key: 'render', value: function render() { var _this2 = this; return _react2.default.createElement(_textField.TextField, babelHelpers.extends({}, this.props, { ref: function ref(el) { if (el && el.inputElRef) _this2.controlEl = el.inputElRef.inputElRef; } })); } }]); return Textarea; }(_react2.default.Component); Textarea.defaultProps = { type: 'textarea' }; exports.default = Textarea; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRleHRhcmVhLmpzeCJdLCJuYW1lcyI6WyJUZXh0YXJlYSIsInByb3BzIiwiZWwiLCJpbnB1dEVsUmVmIiwiY29udHJvbEVsIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwidHlwZSJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBRUE7O0FBR0E7Ozs7SUFJTUEsUTs7Ozs7Ozs7Ozs2QkFLSztBQUFBOztBQUNQLGFBQ0UsNkVBQ08sS0FBS0MsS0FEWjtBQUVFLGFBQUssaUJBQU07QUFBRSxjQUFJQyxNQUFNQSxHQUFHQyxVQUFiLEVBQXlCLE9BQUtDLFNBQUwsR0FBaUJGLEdBQUdDLFVBQUgsQ0FBY0EsVUFBL0I7QUFBNEM7QUFGcEYsU0FERjtBQU1EOzs7RUFab0IsZ0JBQU1FLFM7O0FBQXZCTCxRLENBQ0dNLFksR0FBZTtBQUNwQkMsUUFBTTtBQURjLEM7a0JBZVRQLFEiLCJmaWxlIjoidGV4dGFyZWEuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgVGV4dGFyZWEgQ29tcG9uZW50XG4gKiBAbW9kdWxlIHJlYWN0L3RleHRhcmVhXG4gKi9cblxuJ3VzZSBzdHJpY3QnO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgeyBUZXh0RmllbGQgfSBmcm9tICcuL3RleHQtZmllbGQnO1xuXG5cbi8qKlxuICogVGV4dGFyZWEgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBUZXh0YXJlYSBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgdHlwZTogJ3RleHRhcmVhJ1xuICB9O1xuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gKFxuICAgICAgPFRleHRGaWVsZFxuICAgICAgICB7IC4uLnRoaXMucHJvcHMgfVxuICAgICAgICByZWY9e2VsID0+IHsgaWYgKGVsICYmIGVsLmlucHV0RWxSZWYpIHRoaXMuY29udHJvbEVsID0gZWwuaW5wdXRFbFJlZi5pbnB1dEVsUmVmOyB9fVxuICAgICAgLz5cbiAgICApO1xuICB9XG59XG5cblxuZXhwb3J0IGRlZmF1bHQgVGV4dGFyZWE7XG4iXX0= },{"./text-field":12,"react":"1n8/MK"}]},{},[3])
src/TextNoteEditor.js
OCMC-Translation-Projects/ioc-liturgical-react
import React from 'react'; import PropTypes from 'prop-types'; import FontAwesome from 'react-fontawesome'; import DeleteButton from './helpers/DeleteButton'; import RichEditor from './modules/RichEditor'; import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table'; import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css'; import { get, has } from 'lodash'; import { Accordion , Button , Col , ControlLabel , Glyphicon , Grid , FormControl , FormGroup , HelpBlock , Panel , Row , Tab , Tabs , Well } from 'react-bootstrap'; import GenericModalNewEntryForm from './modules/GenericModalNewEntryForm'; import Server from './helpers/Server'; import Spinner from './helpers/Spinner'; import MessageIcons from './helpers/MessageIcons'; import ResourceSelector from './modules/ReactSelector'; import EditableSelector from './modules/EditableSelector'; import FormattedTextNote from './FormattedTextNote'; import IdManager from './helpers/IdManager'; import BibleRefSelector from './helpers/BibleRefSelector'; import OntologyRefSelector from './helpers/OntologyRefSelector'; import WorkflowForm from './helpers/WorkflowForm'; import CompareDocs from './modules/CompareDocs'; import axios from "axios/index"; import UiSchemas from "./classes/UiSchemas"; import * as Labels from "../es/Labels"; /** * Note: The form properties need to be remapped in the server: * biblicalScope needs to be renamed biblicalHeading * biblicalLemma needs to be renamed biblicalSubHeading * liturgicalScope needs to be renamed liturgicalHeading * liturgicalLemma needs to be renamed liturgicalSubHeadingA * In the code below, some renaming of the client-side properties has occurred. * So, selectedLiturgicalHeadingId =~ form.liturgicalGreekId * selectedLiturgicalSubHeadingId =~ form.liturgicalTranslationId * * The bottom line is that there is some changes to be make both client and server side. */ class TextNoteEditor extends React.Component { constructor(props) { super(props); let created = false; if (props.form && props.form.noteType) { created = true; } let labels = props.session.labels; let labelTopics = props.session.labelTopics; let thisClassLabels = labels[labelTopics.TextNoteEditor]; let messages = labels[labelTopics.messages] let initialMessage = messages.initial; let textIdParts = IdManager.getParts(props.textId); let editorId = "tinymce-" + (new Date).getTime(); let tags = []; let selectedTag = ""; let selectedBiblicalIdParts = [ {key: "domain", label: "*"}, {key: "topic", label: ""}, {key: "key", label: ""} ] ; let selectedType = ""; let selectedTypeLabel = ""; let selectedBiblicalGreekId = ""; let selectedBiblicalLibrary = ""; let selectedBiblicalBook = ""; let selectedBiblicalChapter = ""; let selectedBiblicalVerse = ""; let citeBible = ""; let selectedBiblicalTranslationId = ""; let selectedLiturgicalSubHeadingId = ""; let selectedLiturgicalHeadingId = ""; let selectedRow = ""; if (props.form) { selectedTypeLabel = props.form.noteType; if (props.form.tags) { selectedTag = props.form.tags[0]; let j = props.form.tags.length; for (let i=0; i < j; i++) { tags.push({value: props.form.tags[i], label: props.form.tags[i]}); } } if (props.form.biblicalGreekId) { let biblicalIdParts = IdManager.getParts(props.form.biblicalGreekId); selectedBiblicalIdParts = [ {key: "domain", label: "*"}, {key: "topic", label: biblicalIdParts.topic}, {key: "key", label: biblicalIdParts.key} ]; selectedBiblicalGreekId = props.form.biblicalGreekId; selectedBiblicalLibrary = biblicalIdParts.library; selectedBiblicalBook = biblicalIdParts.book; selectedBiblicalChapter = biblicalIdParts.chapter; selectedBiblicalVerse = biblicalIdParts.verse; let citeBook = biblicalIdParts.book; let citeChapter = biblicalIdParts.chapter.substring(1,biblicalIdParts.chapter.length); try { citeChapter = parseInt(citeChapter); } catch (err) { citeChapter = biblicalIdParts.chapter; } let citeVerse = 0; try { citeVerse = parseInt(biblicalIdParts.verse); } catch (err) { citeVerse = biblicalIdParts.verse; } citeBible = citeBook + " " + citeChapter + ":" + citeVerse; } if (props.form.biblicalTranslationId) { selectedBiblicalTranslationId = props.form.biblicalTranslationId; } if (props.form.liturgicalGreekId) { selectedLiturgicalHeadingId = props.form.liturgicalGreekId; } else { selectedLiturgicalHeadingId = props.textId; } if (props.form.liturgicalTranslationId) { selectedLiturgicalSubHeadingId = props.form.liturgicalTranslationId; } else { selectedLiturgicalSubHeadingId = "gr_gr_cog~" + textIdParts.topic + "~" + textIdParts.key; } if (props.form.noteType) { selectedType = props.form.noteType; selectedTypeLabel = this.getLabel(props.form.noteType); } if (props.form.followsNoteId) { selectedRow = props.form.followsNoteId; } } let notesList = []; if (props.notesList && props.form) { notesList = props.notesList; } notesList = notesList.filter(function(el) { return el.id !== props.form.id; }); let bibliographyDropdown = []; if (props.session && props.session.dropdowns) { bibliographyDropdown = props.session.dropdowns.schemaEditorDropdown.filter((row) => { return row.value.startsWith("BibEntry"); }); } this.state = { labels: { thisClass: thisClassLabels , buttons: labels[labelTopics.button] , messages: messages , resultsTableLabels: labels[labelTopics.resultsTable] , search: labels[labelTopics.search] } , messageIcons: MessageIcons.getMessageIcons() , messageIcon: MessageIcons.getMessageIcons().info , message: initialMessage , bibliographyDropdown: bibliographyDropdown , notesList: notesList , textIdParts: textIdParts , form: props.form , created: created , editor: null , editorId: editorId , note: "" , scopeBiblical: "" , scopeLiturgical: textIdParts.key , lemmaBiblical: "" , lemmaLiturgical: "" , title: "" , liturgicalText: props.liturgicalText , liturgicalLibraries: undefined , biblicalLibraries: undefined , selectedNoteLibrary: props.session.userInfo.domain , selectedType: selectedType , selectedTypeLabel: selectedTypeLabel , bibleRef: "" , selectedBiblicalGreekId: selectedBiblicalGreekId , selectedBiblicalIdParts: selectedBiblicalIdParts , selectedBiblicalLibrary: selectedBiblicalLibrary , selectedBiblicalBook: selectedBiblicalBook , selectedBiblicalChapter: selectedBiblicalChapter , selectedBiblicalVerse: selectedBiblicalVerse , citeBible: citeBible , selectedBiblicalTranslationId: selectedBiblicalTranslationId , selectedLiturgicalSubHeadingId: selectedLiturgicalSubHeadingId , selectedLiturgicalHeadingId: selectedLiturgicalHeadingId , greekBibleId: "" , selectedLiturgicalIdParts: [ {key: "domain", label: "*"}, {key: "topic", label: textIdParts.topic}, {key: "key", label: textIdParts.key} ] , showBibleView: (props.form && props.form.biblicalGreekId) ? true : false , ontologyRefType: "" , ontologyRefEntityId: "" , ontologyRefEntityName: "" , showOntologyView: false , workflow: { visibility: "PERSONAL" , status: "EDITING" , assignedTo: props.session.userInfo.username , statusIcon: "edit" , visibilityIcon: "lock" } , buttonSubmitDisabled: true , selectedTag: selectedTag , tags: tags , formIsValid: true , suggestions:[{ text: 'No abbreviations or Suggestions entries available.' , value: 'ignore' , url: 'cite' } , ] , predecessorNote: "" , options: { sizePerPage: 30 , sizePerPageList: [5, 15, 30] , onSizePerPageList: this.onSizePerPageList , hideSizePerPage: true , paginationShowsTotal: true } , selectRow: { mode: 'checkbox' // or radio , hideSelectColumn: false , clickToSelect: false , onSelect: this.handlePredecessorChange , className: "App-row-select" , selected: [selectedRow] } , filter: { type: 'RegexFilter', delay: 100 } }; this.createMarkup = this.createMarkup.bind(this); this.fetchBibleText = this.fetchBibleText.bind(this); this.fetchSuggestions = this.fetchSuggestions.bind(this); this.getBibleRefRow = this.getBibleRefRow.bind(this); this.getBiblicalGreekLibraryRow = this.getBiblicalGreekLibraryRow.bind(this); this.getBiblicalLemmaRow = this.getBiblicalLemmaRow.bind(this); this.getBiblicalScopeRow = this.getBiblicalScopeRow.bind(this); this.getBiblicalTranslationLibraryRow = this.getBiblicalTranslationLibraryRow.bind(this); this.getButtonRow = this.getButtonRow.bind(this); this.getEditor = this.getEditor.bind(this); this.getFormattedHeaderRow = this.getFormattedHeaderRow.bind(this); this.getFormattedView = this.getFormattedView.bind(this); this.getModalNewBiblioForm = this.getModalNewBiblioForm.bind(this); this.getSettingsWell = this.getSettingsWell.bind(this); this.getIdsWell = this.getIdsWell.bind(this); this.getNoteOrderingRow = this.getNoteOrderingRow.bind(this); this.getOrderWell = this.getOrderWell.bind(this); this.getLabel = this.getLabel.bind(this); this.getLiturgicalHeadingLibraryRow = this.getLiturgicalHeadingLibraryRow.bind(this); this.getLiturgicalLemmaRow = this.getLiturgicalLemmaRow.bind(this); this.getLiturgicalScopeRow = this.getLiturgicalScopeRow.bind(this); this.getLiturgicalSubHeadingLibraryRow = this.getLiturgicalSubHeadingLibraryRow.bind(this); this.getLiturgicalView = this.getLiturgicalView.bind(this); this.getNoteIdRow = this.getNoteIdRow.bind(this); this.getNoteLibraryRow = this.getNoteLibraryRow.bind(this); this.getNoteTypeRow = this.getNoteTypeRow.bind(this); this.getOntologyLabel = this.getOntologyLabel.bind(this); this.getOntologyRefRow = this.getOntologyRefRow.bind(this); this.getRevisionsPanel = this.getRevisionsPanel.bind(this); this.getTabs = this.getTabs.bind(this); this.getTagsRow = this.getTagsRow.bind(this); this.getTimestamp = this.getTimestamp.bind(this); this.getTitleRow = this.getTitleRow.bind(this); this.getWorkflowPanel = this.getWorkflowPanel.bind(this); this.handleAddButtonClick = this.handleAddButtonClick.bind(this); this.handleBibleRefChange = this.handleBibleRefChange.bind(this); this.handleBiblicalGreekLibraryChange = this.handleBiblicalGreekLibraryChange.bind(this); this.handleBiblicalIdSelection = this.handleBiblicalIdSelection.bind(this); this.handleBiblicalLemmaChange = this.handleBiblicalLemmaChange.bind(this); this.handleBiblicalScopeChange = this.handleBiblicalScopeChange.bind(this); this.handleBiblicalTranslationLibraryChange = this.handleBiblicalTranslationLibraryChange.bind(this); this.handleCloseModalAddBiblio = this.handleCloseModalAddBiblio.bind(this); this.handleDeleteCallback = this.handleDeleteCallback.bind(this); this.handleEditableListCallback = this.handleEditableListCallback.bind(this); this.handleEditorChange = this.handleEditorChange.bind(this); this.handleFetchBibleTextCallback = this.handleFetchBibleTextCallback.bind(this); this.handleFetchSuggestionsCallback = this.handleFetchSuggestionsCallback.bind(this); this.handleLibrariesCallback = this.handleLibrariesCallback.bind(this); this.handleLiturgicalHeadingLibraryChange = this.handleLiturgicalHeadingLibraryChange.bind(this); this.handleLiturgicalIdSelection = this.handleLiturgicalIdSelection.bind(this); this.handleLiturgicalLemmaChange = this.handleLiturgicalLemmaChange.bind(this); this.handleLiturgicalScopeChange = this.handleLiturgicalScopeChange.bind(this); this.handleLiturgicalSubHeadingLibraryChange = this.handleLiturgicalSubHeadingLibraryChange.bind(this); this.handleNoteLibraryChange = this.handleNoteLibraryChange.bind(this); this.handleNoteTypeChange = this.handleNoteTypeChange.bind(this); this.handleOntologyRefChange = this.handleOntologyRefChange.bind(this); this.handlePredecessorChange = this.handlePredecessorChange.bind(this); this.handleTitleChange = this.handleTitleChange.bind(this); this.handleWorkflowCallback = this.handleWorkflowCallback.bind(this); this.mapTagsToObjectList = this.mapTagsToObjectList.bind(this); this.noteFormatter = this.noteFormatter.bind(this); this.onSubmit = this.onSubmit.bind(this); this.settingsValid = this.settingsValid.bind(this); this.submitPost = this.submitPost.bind(this); this.submitPut = this.submitPut.bind(this); this.validateForm = this.validateForm.bind(this); }; componentWillMount = () => { this.fetchSuggestions(); }; componentDidMount = () => { }; componentWillReceiveProps = (nextProps) => { let labels = nextProps.session.labels; let labelTopics = nextProps.session.labelTopics; let thisClassLabels = labels[labelTopics.TextNoteEditor]; let messages = labels[labelTopics.messages] let textIdParts = IdManager.getParts(nextProps.textId); let formIsValid = false; let created = false; if (this.state.created) { created = true; } else { if (nextProps.form && nextProps.form.noteType) { created = true; } } let form = {}; let tags = []; let selectedTag = ""; let selectedType = get(this.state, "selectedType", ""); let selectedTypeLabel = get(this.state, "selectedTypeLabel", ""); if (nextProps.form && nextProps.form.noteType) { form = nextProps.form; selectedType = form.noteType; selectedTypeLabel = this.getLabel(form.noteType); } else if (nextProps.session && nextProps.session.uiSchemas && nextProps.session.uiSchemas.getForm ) { let uiSchemas = {}; uiSchemas = new UiSchemas( nextProps.session.uiSchemas.formsDropdown , nextProps.session.uiSchemas.formsSchemas , nextProps.session.uiSchemas.forms ); form = JSON.parse(JSON.stringify(uiSchemas.getForm("TextualNote:1.1"))); form.liturgicalScope = textIdParts.key; form.library = nextProps.session.userInfo.domain; let key = this.getTimestamp(); form.key = key; form.topic = "gr_gr_cog" + "~" + textIdParts.topic + "~" + textIdParts.key; form.id = form.library + "~" + form.topic + "~" + key; form.liturgicalGreekId = nextProps.textId; form.liturgicalTranslationId = form.topic; form.noteTitle = " "; formIsValid = true; selectedTag = form.tags[0]; selectedType = form.noteType; selectedTypeLabel = this.getLabel(form.noteType); let j = form.tags.length; for (let i=0; i < j; i++) { tags.push({value: form.tags[i], label: form.tags[i]}); } } let notesList = []; if (nextProps.notesList && nextProps.form) { notesList = nextProps.notesList; } notesList = notesList.filter(function(el) { return ! el.id === nextProps.form.id; }); let bibliographyDropdown = []; if (nextProps.session && nextProps.session.dropdowns) { bibliographyDropdown = nextProps.session.dropdowns.schemaEditorDropdown.filter((row) => { return row.value.startsWith("BibEntry"); }); } this.setState((prevState, props) => { return { labels: { thisClass: thisClassLabels , buttons: labels[labelTopics.button] , messages: messages , resultsTableLabels: labels[labelTopics.resultsTable] , search: labels[labelTopics.search] } , message: get("message", this.state.message, messages.initial) , note: form.valueFormatted , bibliographyDropdown: bibliographyDropdown , notesList: notesList , form: form , formIsValid: formIsValid , selectedTypeLabel: selectedTypeLabel , tags: tags , selectedTag: selectedTag , selectedType: selectedType , predecessorNote: get(this.state,"predecessorNote", "") , created: created } }); }; settingsValid = () => { let valid = false; if (this.state.form.noteType) { if (this.state.form.noteType === "REF_TO_BIBLE" || this.state.form.noteType === "CHECK_YOUR_BIBLE") { valid = ( this.state.form.liturgicalScope.length > 0 && this.state.form.liturgicalLemma.length > 0 // && this.state.form.noteTitle.length > 0 && this.state.form.biblicalScope.length > 0 && this.state.form.biblicalLemma.length > 0 && this.state.form.biblicalGreekId.length > 0 ); } else if (this.state.form.noteType.startsWith("REF_TO")) { valid = ( this.state.form.liturgicalScope.length > 0 && this.state.form.liturgicalLemma.length > 0 && this.state.form.ontologicalEntityId.length > 0 ); } else if (this.state.form.noteType === "UNIT") { valid = ( this.state.form.liturgicalScope.length > 0 // && this.state.form.noteTitle.length > 0 ); } else { valid = ( this.state.form.liturgicalScope.length > 0 && this.state.form.liturgicalLemma.length > 0 // && this.state.form.noteTitle.length > 0 ); } } return valid; }; validateForm = () => { let message = this.state.labels.thisClass.requiredMsg; let messageIcon = MessageIcons.getMessageIcons().warning; let formIsValid = false; let noteValid = this.state.form.valueFormatted.length > 0; if (this.settingsValid() && noteValid) { formIsValid = true; message = this.state.labels.messages.ok; messageIcon = MessageIcons.getMessageIcons().info; } this.setState({ formIsValid: formIsValid , message: message , messageIcon: messageIcon }); }; handleAddButtonClick = () => { this.setState({showModalAddBiblio: true}); }; getModalNewBiblioForm = () => { return ( <GenericModalNewEntryForm session={this.props.session} restPath={Server.getDbServerDocsApi()} onClose={this.handleCloseModalAddBiblio} schemaTypes={this.state.bibliographyDropdown} title={this.state.labels.thisClass.createTitle} /> ) }; getTimestamp = () => { let date = new Date(); let month = (date.getMonth()+1).toString().padStart(2,"0"); let day = date.getDate().toString().padStart(2,"0"); let hour = date.getHours().toString().padStart(2,"0"); let minute = date.getMinutes().toString().padStart(2,"0"); let second = date.getSeconds().toString().padStart(2,"0"); let timestamp = date.getFullYear() + "." + month + "." + day + ".T" + hour + "." + minute + "." + second ; return timestamp; }; handleEditorChange = (plain, html) => { let form = this.state.form; form.value = plain; form.valueFormatted = html; this.setState({form: form}, this.validateForm); }; handleCloseModalAddBiblio = () => { this.setState({showModalAddBiblio: false}); }; onSubmit = () => { if (this.state.created) { this.submitPut(); } else { this.submitPost(); } }; submitPost = () => { let formData = this.state.form; if (! formData.liturgicalTranslationId) { formData.liturgicalTranslationId = this.props.noteIdTopic; } this.setState({ message: this.state.labels.messages.creating , messageIcon: this.state.messageIcons.info }); let config = { auth: { username: this.props.session.userInfo.username , password: this.props.session.userInfo.password } }; let path = this.props.session.restServer + Server.getDbServerNotesApi() ; axios.post( path , formData , config ) .then(response => { this.setState({ message: this.state.labels.messages.created , form: formData , created: true }); if (this.props.onSubmit) { this.props.onSubmit(formData); } }) .catch( (error) => { let message = error.message; let messageIcon = this.state.messageIcons.error; this.setState( { message: message , messageIcon: messageIcon }); }); }; submitPut = () => { let formData = this.state.form; if (! formData.liturgicalTranslationId) { formData.liturgicalTranslationId = this.props.noteIdTopic; } this.setState({ message: this.state.labels.messages.updating , messageIcon: this.state.messageIcons.info }); let config = { auth: { username: this.props.session.userInfo.username , password: this.props.session.userInfo.password } }; let path = this.props.session.restServer + Server.getDbServerNotesApi() + "/" + formData.library + "/" + formData.topic + "/" + formData.key ; axios.put( path , formData , config ) .then(response => { let message = this.state.labels.messages.updated; this.setState({ message: message , form: formData }); if (this.props.onSubmit) { this.props.onSubmit(formData); } }) .catch( (error) => { let message = Labels.getHttpMessage( this.props.session.languageCode , error.response.status , error.response.statusText ); let messageIcon = this.state.messageIcons.error; this.setState( { data: message, message: message, messageIcon: messageIcon }); }); }; fetchSuggestions = () => { let parms = "t=" + encodeURIComponent(this.state.topic) + "&l=" + encodeURIComponent(this.state.libraries) ; this.setState({ message: this.state.labels.messages.retrieving }, Server.restGetSuggestions( this.props.session.restServer , this.props.session.userInfo.username , this.props.session.userInfo.password , this.props.session.userInfo.domain , this.handleFetchSuggestionsCallback ) ); }; fetchBibleText = () => { let parms = "t=" + encodeURIComponent(this.state.topic) + "&l=" + encodeURIComponent(this.state.libraries) ; this.setState({ message: this.state.labels.messages.retrieving }, Server.getViewForTopic( this.props.session.restServer , this.props.session.userInfo.username , this.props.session.userInfo.password , parms , this.handleFetchCallback ) ); }; handleWorkflowCallback = ( visibility, status, assignedTo ) => { if (visibility && status) { let statusIcon = "check"; let visibilityIcon = "globe"; switch (visibility) { case ("PERSONAL"): { visibilityIcon = "lock"; // user-secret break; } case ("PRIVATE"): { visibilityIcon = "share-alt"; break; } default: { } } switch (status) { case ("EDITING"): { statusIcon = "edit"; break; } case ("REVIEWING"): { statusIcon = "eye-open"; break; } default: { } } let form = this.state.form; form.status = status; form.visibility = visibility; form.assignedToUser = assignedTo; this.setState( { form: form , workflow: { visibilityIcon: visibilityIcon , statusIcon: statusIcon } } ); } }; handleFetchSuggestionsCallback = (restCallResult) => { if (restCallResult) { let abbreviations = []; let bibliography = []; if (restCallResult.data.values.length > 1) { bibliography = restCallResult.data.values[1]["bibliography"]; } if (restCallResult.data.values.length > 0) { abbreviations = restCallResult.data.values[0]["abbreviations"]; } let suggestAbr = abbreviations.map((o) => { return {text: o.key + " - " + o.value , value: o.key, url: o.id} ; }); let suggestBib = bibliography.map((o) => { let author = ""; let date = ""; if (has(o, "author")) { author = o.author; } else if (has(o, "editor")) { author = o.editor; } if (has(o, "date")) { date = o.date; } else if (has(o, "year")) { date = o.year; } let result = o.key + " - "; if (author.length > 0) { result += author; } if (date.length > 0) { result += " (" + date + "). "; } result += o.title; // TODO: currently in OWL, the hyperlink for citation does not work. // Probably you need to do something with url: o.id below, e.g. // prepend with /data return {text: result , value: o.key, url: o.id} ; }); this.setState({ abbreviations: abbreviations , bibliography: bibliography , suggestAbbreviations: suggestAbr , suggestBibliography: suggestBib , suggestions: suggestBib , message: this.state.labels.messages.ok }); } }; handleFetchBibleTextCallback = (restCallResult) => { if (restCallResult) { let data = restCallResult.data.values[0]; let about = data.about; let templateKeys = data.templateKeys; let libraryKeys = data.libraryKeys; let libraryKeyValues = data.libraryKeyValues; this.setState({ dataFetched: true , about: about , libraryKeyValues: libraryKeyValues , libraryKeys: libraryKeys , templateKeys: templateKeys , message: this.state.labels.messages.found + " " + templateKeys.length + " " + this.state.labels.messages.docs , messageIcon: restCallResult.messageIcon , resultCount: templateKeys.length }, this.setTableData); } }; handleEditableListCallback = (value, values) => { let form = this.state.form; form.tags = values.map(function(item) { return item['label'].trim(); }); this.setState({form: form, selectedTag: value, tags: values}); }; handleBiblicalScopeChange = (e) => { let form = this.state.form; form.biblicalScope = e.target.value; this.setState({form: form}, this.validateForm); }; handleLiturgicalScopeChange = (e) => { let form = this.state.form; form.liturgicalScope = e.target.value; this.setState({form: form}, this.validateForm); }; handleNoteTypeChange = (selection) => { let form = this.state.form; form.noteType = selection["value"]; form.biblicalGreekId = ""; form.biblicalLemma = ""; form.biblicalScope = ""; form.biblicalTranslationId = ""; form.ontologicalEntityId = ""; // For all note types, we use gr_gr_cog as the library of the form.topic ID. // But, a translator's note is for a specific translation. So we will use the // library from the translation. if (selection["value"] === "TRANSLATORS_NOTE") { let textIdParts = IdManager.getParts(this.props.textId); form.topic = textIdParts.library + "~" + textIdParts.topic + "~" + textIdParts.key; form.id = form.library + "~" + form.topic + "~" + form.key; form.liturgicalGreekId = form.topic; } this.setState({ form , selectedTypeLabel: selection["label"] , selectedBiblicalIdParts: [ {key: "domain", label: "*"}, {key: "topic", label: ""}, {key: "key", label: ""} ] , showBibleView: false , ontologyRefType: "" , ontologyRefName: "" , showOntologyView: false }, this.validateForm); }; handleBibleRefChange = (book, chapter, verse, citeBible) => { let form = this.state.form; let showBibleView = false; if (book.length > 0 && chapter.length > 0 && verse.length > 0) { showBibleView = true; form.biblicalScope = citeBible; let library = ""; if (this.state.selectedBiblicalLibrary) { library = this.state.selectedBiblicalLibrary; } form.biblicalGreekId = library + "~" + book + "~" + chapter + ":" + verse; } this.setState( { selectedBiblicalIdParts: [ {key: "domain", label: "*"}, {key: "topic", label: book}, {key: "key", label: chapter + ":" + verse} ] , showBibleView , form: form , selectedBiblicalBook: book , selectedBiblicalChapter: chapter , selectedBiblicalVerse: verse , citeBible: citeBible }, this.validateForm ); }; handleOntologyRefChange = (entityId, entityName) => { let showOntologyView = false; if (entityId.length > 0) { showOntologyView = true; } let form = this.state.form; form.ontologicalEntityId = entityId; form.noteTitle = entityName; this.setState( { form: form , ontologyRefEntityName: entityName , showOntologyView: showOntologyView , title: entityName }, this.validateForm ); }; handleBiblicalLemmaChange = (e) => { let form = this.state.form; form.biblicalLemma = e.target.value; this.setState({form: form}, this.validateForm); }; handleLiturgicalLemmaChange = (e) => { let form = this.state.form; form.liturgicalLemma = e.target.value; this.setState({form: form}, this.validateForm); }; handleTitleChange = (e) => { let form = this.state.form; form.noteTitle = e.target.value; this.setState({form: form}, this.validateForm); }; getBibleRefRow = () => { if (this.state.form.noteType && (this.state.form.noteType === "REF_TO_BIBLE" || this.state.form.noteType === "CHECK_YOUR_BIBLE" )) { return ( <BibleRefSelector session={this.props.session} callback={this.handleBibleRefChange} book={this.state.selectedBiblicalBook} chapter={this.state.selectedBiblicalChapter} verse={this.state.selectedBiblicalVerse} /> ); } else { return (<span className="App App-no-display"></span>); } }; getOntologyRefRow = () => { if (this.state.form.noteType && this.state.form.noteType.startsWith("REF_TO") && this.state.form.noteType !== ("REF_TO_BIBLE" && this.state.form.noteType !== "CHECK_YOUR_BIBLE" ) ) { let type = this.getOntologyLabel(this.state.form.noteType); return ( <Row className="App show-grid App-Ontology-Ref-Selector-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.refersTo}:</ControlLabel> </Col> <Col xs={9} md={9}> <div className={"App App-Ontology-Ref-Selector-Entity"}> <OntologyRefSelector session={this.props.session} type={type} callback={this.handleOntologyRefChange} initialValue={this.state.form.ontologicalEntityId} /> </div> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; getOntologyLabel = (type) => { try { let label = type.split("_")[2]; return label.charAt(0) + label.slice(1).toLowerCase(); } catch (err) { return type; } }; getLiturgicalView = () => { return ( <Accordion> <Panel header={this.state.labels.thisClass.viewLiturgicalText} eventKey="TextNoteEditor"> <CompareDocs session={this.props.session} handleRowSelect={this.handleLiturgicalIdSelection} title={"Liturgical Texts"} docType={"Liturgical"} selectedIdParts={this.state.selectedLiturgicalIdParts} labels={this.state.labels.search} librariesInfoCallback={this.handleLibrariesCallback} /> </Panel> </Accordion> ); }; handleLiturgicalIdSelection = (row) => { // let form = this.state.form; // let id = row["id"]; // if (id.startsWith("gr_")) { // if (form.selected) // form.liturgicalGreekId = id; // this.setState({ form: form, selectedLiturgicalHeadingId: id }) // } else { // form.liturgicalTranslationId = id; // this.setState({ form: form, selectedLiturgicalSubHeadingId: id }) // } }; handleBiblicalIdSelection = (row) => { // let id = row["id"]; // let form = this.state.form; // let biblicalIdParts = IdManager.getParts(id); // // if (id.startsWith("gr_")) { // form.biblicalGreekId = id; // this.setState({ // form: form // , selectedBiblicalGreekId: id // , selectedBiblicalLibrary: biblicalIdParts.library // }) // } else { // form.biblicalTranslationId = id; // this.setState({ form: form, selectedBiblicalTranslationId: id }) // } }; handleLibrariesCallback = ( type, id , libraries ) => { if (libraries) { let form = this.state.form; let librariesDropdown = libraries.map((row) => { return {label: row.library , value: row.id} ; }); let greekDropdown = libraries.filter((row) => { return row.library.startsWith("gr_"); }).map((row) => { return {label: row.library , value: row.id} ; }); let translationDropdown = libraries.filter((row) => { return ! row.library.startsWith("gr_"); }).map((row) => { return {label: row.library , value: row.id} ; }); if (type === "Biblical") { let biblicalIdParts = IdManager.getParts(id); let selectedBiblicalLibrary = biblicalIdParts.library; form.biblicalGreekId = id; this.setState({ form: form , biblicalLibraries: { greekBibleId: id , libraries: libraries , greekDropdown: greekDropdown , translationDropdown: translationDropdown } , selectedBiblicalGreekId: id , selectedBiblicalLibrary: selectedBiblicalLibrary }); } else { // form.liturgicalGreekId = id; this.setState({ form: form , liturgicalLibraries: { greekBibleId: id , libraries: libraries , greekDropdown: greekDropdown , translationDropdown: translationDropdown , librariesDropdown: librariesDropdown } , selectedLiturgicalSubHeadingId: id }); } } }; getBiblicalView = () => { if (this.state.showBibleView) { return ( <Accordion> <Panel header={this.state.labels.thisClass.viewBiblicalText + ": " + this.state.citeBible} eventKey="TextNoteEditor"> <CompareDocs session={this.props.session} handleRowSelect={this.handleBiblicalIdSelection} librariesInfoCallback={this.handleLibrariesCallback} title={"Biblical Texts"} docType={"Biblical"} selectedIdParts={this.state.selectedBiblicalIdParts} labels={this.state.labels.search} /> </Panel> </Accordion> ); } else { return (<span className="App App-no-display"></span>); } }; getLiturgicalScopeRow = () => { return ( <Row className="App show-grid App-Text-Note-Editor-Scope-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.liturgicalScope}:</ControlLabel> </Col> <Col xs={9} md={9}> <FormControl id={"fxLiturgicalScope"} className={"App App-Text-Note-Editor-Scope"} type="text" value={this.state.form.liturgicalScope} placeholder={this.state.labels.thisClass.liturgicalScope} onChange={this.handleLiturgicalScopeChange} /> </Col> </Row> ); }; getLiturgicalLemmaRow = () => { if (this.state.form.noteType === "UNIT") { return (<span className="App App-no-display"></span>); } else { return ( <Row className="App show-grid App-Text-Note-Editor-Lemma-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.liturgicalLemma}:</ControlLabel> </Col> <Col xs={9} md={9}> <FormControl id={"fcLiturgicalLemma"} className={"App App-Text-Note-Editor-Lemma"} type="text" value={this.state.form.liturgicalLemma} placeholder={this.state.labels.thisClass.liturgicalLemma} onChange={this.handleLiturgicalLemmaChange} /> </Col> </Row> ); } }; handleNoteLibraryChange = ( selection ) => { let form = this.state.form; form.library = selection["value"]; this.setState({form: form}, this.validateForm); }; handlePredecessorChange = ( selection ) => { let form = this.state.form; let predecessorId = selection["id"]; form.followsNoteId = predecessorId; let selectRow = this.state.selectRow; selectRow["selected"] = [predecessorId]; this.setState({ predecessorNote: predecessorId , form: form , selectRow: selectRow }); }; getNoteLibraryRow = () => { if ( this.props.session.userInfo.domains.author && this.state.form && this.state.form.library && this.state.form.library.length < 1 ) { return ( <Row className="App show-grid App-Text-Note-Editor-Library-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.noteLibrary}:</ControlLabel> </Col> <Col xs={9} md={9}> <ResourceSelector title={""} initialValue={this.props.session.userInfo.domain} resources={this.props.session.userInfo.domains.author} changeHandler={this.handleNoteLibraryChange} multiSelect={false} /> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; getNoteIdRow = () => { if (this.state.form && this.state.form.id ) { return ( <Row className="App show-grid App-Text-Note-Editor-Library-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.id}:</ControlLabel> </Col> <Col xs={9} md={9}> <ControlLabel>{this.state.form.id}</ControlLabel> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; noteFormatter = (cell, row, formatExtraData) => { if (row && row["type"]) { return ( <FormattedTextNote session={formatExtraData} note={row["valueFormatted"]} type={row["type"]} title={row["title"]} scopeLiturgical={row["liturgicalScope"]} lemmaLiturgical={row["liturgicalLemma"]} scopeBiblical={row["biblicalScope"]} lemmaBiblical={row["biblicalLemma"]} /> ); } }; getNoteOrderingRow = () => { if ( this.props.notesList && this.state.labels.resultsTableLabels ) { return ( <Row className="App show-grid App-Text-Note-Editor-Order-Row"> <Col xs={12} md={12}> <BootstrapTable ref="theOrderTable" data={this.state.notesList} exportCSV={ false } trClassName={"App-data-tr"} striped hover pagination options={ this.state.options } selectRow={ this.state.selectRow } > <TableHeaderColumn isKey dataField='id' dataSort={ true } export={ true } hidden >ID </TableHeaderColumn> <TableHeaderColumn dataField='type' dataSort={ true } tdClassname="tdType" filter={this.state.filter} >{this.state.labels.resultsTableLabels.headerType} </TableHeaderColumn> <TableHeaderColumn dataField='liturgicalLemma' dataSort={ true } tdClassname="tdType" hidden >{this.state.labels.resultsTableLabels.headerLemma} </TableHeaderColumn> <TableHeaderColumn dataField='liturgicalScope' dataSort={ true } tdClassname="tdType" hidden >{this.state.labels.resultsTableLabels.headerScope} </TableHeaderColumn> <TableHeaderColumn dataField='valueFormatted' dataSort={ true } width={"85%"} filter={this.state.filter} dataFormat={ this.noteFormatter } formatExtraData={this.props.session} >{this.state.labels.resultsTableLabels.headerNote} </TableHeaderColumn> </BootstrapTable> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; handleBiblicalTranslationLibraryChange = ( selection ) => { let form = this.state.form; form.biblicalTranslationId = selection["value"]; this.setState({form: form}, this.validateForm); }; getBiblicalTranslationLibraryRow = () => { if (this.state.form.noteType && (this.state.form.noteType === "REF_TO_BIBLE" || this.state.form.noteType === "CHECK_YOUR_BIBLE") && this.state.biblicalLibraries ) { return ( <Row className="App show-grid App-Text-Note-Editor-Library-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.biblicalTranslationLibrary}:</ControlLabel> </Col> <Col xs={9} md={9}> <ResourceSelector title={""} initialValue={this.state.form.biblicalTranslationId} resources={this.state.biblicalLibraries.translationDropdown} changeHandler={this.handleBiblicalTranslationLibraryChange} multiSelect={false} /> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; handleLiturgicalHeadingLibraryChange = ( selection ) => { let form = this.state.form; form.liturgicalGreekId = selection["value"]; let textIdParts = IdManager.getParts(selection["value"]); this.setState({ form: form , textIdParts: textIdParts , selectedLiturgicalHeadingId: selection["value"] }, this.validateForm); }; getLiturgicalHeadingLibraryRow = () => { if (this.state.liturgicalLibraries) { return ( <Row className="App show-grid App-Text-Note-Editor-Library-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.liturgicalHeadingLibrary}:</ControlLabel> </Col> <Col xs={9} md={9}> <ResourceSelector title={""} initialValue={this.state.form.liturgicalGreekId} resources={this.state.liturgicalLibraries.librariesDropdown} changeHandler={this.handleLiturgicalHeadingLibraryChange} multiSelect={false} /> </Col> </Row> ); } else { return ( <div> <Spinner message={this.state.labels.messages.retrieving}/> </div> ); } }; handleBiblicalGreekLibraryChange = ( selection ) => { let form = this.state.form; form.biblicalGreekId = selection["value"]; this.setState({ form: form , selectedBiblicalGreekId: selection["value"] }, this.validateForm); }; getBiblicalGreekLibraryRow = () => { if (this.state.form.noteType && (this.state.form.noteType === "REF_TO_BIBLE" || this.state.form.noteType === "CHECK_YOUR_BIBLE" )) { if (this.state.biblicalLibraries) { return ( <Row className="App show-grid App-Text-Note-Editor-Library-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.biblicalGreekLibrary}:</ControlLabel> </Col> <Col xs={9} md={9}> <ResourceSelector title={""} initialValue={this.state.selectedBiblicalGreekId} resources={this.state.biblicalLibraries.greekDropdown} changeHandler={this.handleBiblicalGreekLibraryChange} multiSelect={false} /> </Col> </Row> ); } else { return ( <div> <Spinner message={this.state.labels.messages.retrieving}/> </div> ); } } else { return (<span className="App App-no-display"></span>); } }; handleLiturgicalSubHeadingLibraryChange = ( selection ) => { let form = this.state.form; form.liturgicalTranslationId = selection["value"]; this.setState({form: form, selectedLiturgicalSubHeadingId: selection["value"]}, this.validateForm); }; getLiturgicalSubHeadingLibraryRow = () => { if (this.state.liturgicalLibraries && this.state.liturgicalLibraries.librariesDropdown) { return ( <Row className="App show-grid App-Text-Note-Editor-Library-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.liturgicalSubHeadingLibrary}:</ControlLabel> </Col> <Col xs={9} md={9}> <ResourceSelector title={""} initialValue={this.state.form.liturgicalTranslationId} resources={this.state.liturgicalLibraries.librariesDropdown} changeHandler={this.handleLiturgicalSubHeadingLibraryChange} multiSelect={false} /> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; getTitleRow = () => { if (this.state.form.noteType && this.state.form.noteType.startsWith("REF_TO") && this.state.form.noteType !== "REF_TO_BIBLE" && this.state.form.noteType !== "CHECK_YOUR_BIBLE" ) { return (<span className="App App-no-display"></span>); } else { return ( <Row className="App show-grid App-Text-Note-Editor-Title-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.title}:</ControlLabel> </Col> <Col xs={9} md={9}> <FormControl id={"fxEditorTitle"} className={"App App-Text-Note-Editor-Title"} type="text" value={this.state.form.noteTitle} placeholder={this.state.labels.thisClass.title} onChange={this.handleTitleChange} /> </Col> </Row> ); } }; getBiblicalScopeRow = () => { if (this.state.form.noteType && (this.state.form.noteType === "REF_TO_BIBLE" || this.state.form.noteType === "CHECK_YOUR_BIBLE" ) ) { return ( <Row className="App show-grid App-Text-Note-Editor-Scope-Biblical-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.biblicalScope}:</ControlLabel> </Col> <Col xs={9} md={9}> <FormControl id={"fxEditorBiblicalScope"} className={"App App-Text-Note-Editor-Scope"} type="text" value={this.state.form.biblicalScope} placeholder={this.state.labels.thisClass.biblicalScope} onChange={this.handleBiblicalScopeChange} /> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; getBiblicalLemmaRow = () => { if (this.state.form.noteType && (this.state.form.noteType === "REF_TO_BIBLE" || this.state.form.noteType === "CHECK_YOUR_BIBLE") ) { return ( <Row className="App show-grid App-Text-Note-Editor-Lemma-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.biblicalLemma}:</ControlLabel> </Col> <Col xs={9} md={9}> <FormControl id={"fcBibLemma"} className={"App App-Text-Note-Editor-Lemma"} type="text" value={this.state.form.biblicalLemma} placeholder={this.state.labels.thisClass.biblicalLemma} onChange={this.handleBiblicalLemmaChange} /> </Col> </Row> ); } else { return (<span className="App App-no-display"></span>); } }; getNoteTypeRow = () => { let dropdowns = this.props.session.dropdowns.noteTypesDropdown; if (this.props.session.userInfo.domain === "en_us_epentiuc") { dropdowns = this.props.session.dropdowns.noteTypesBilDropdown; } return ( <Row className="App show-grid App-Text-Note-Editor-Type-Row"> <Col xs={3} md={3}> <ControlLabel>{this.state.labels.thisClass.type}:</ControlLabel> </Col> <Col xs={9} md={9}> <div className={"App App-Text-Note-Type-Selector"}> <ResourceSelector title={""} initialValue={this.state.form.noteType} resources={dropdowns} changeHandler={this.handleNoteTypeChange} multiSelect={false} /> </div> </Col> </Row> ); }; handleDeleteCallback = (result) => { this.props.deleteCallback(); }; getButtonRow = () => { let submitButtonDisabled = true; if (this.state.formIsValid) { submitButtonDisabled = false; } return ( <Row className="App show-grid App-Text-Note-Editor-Button-Row"> <Col xs={10} md={10}> <Button className="App App-Button" bsStyle="primary" disabled={submitButtonDisabled} onClick={this.onSubmit} > {this.state.labels.buttons.save} </Button> <span className="App App-Text-Editor-Workflow-Glyph"> <Glyphicon glyph={this.state.workflow.statusIcon}/> <FontAwesome name={this.state.workflow.visibilityIcon}/> </span> {this.props.session && this.props.form && this.props.form.noteType && <DeleteButton session={this.props.session} idLibrary={this.state.form.library} idTopic={this.state.form.topic} idKey={this.state.form.key} onDelete={this.handleDeleteCallback} /> } </Col> <Col xs={2} md={2}> <Button className="App-Add-Biblio-Button" bsStyle="primary" onClick={this.handleAddButtonClick}> <Glyphicon glyph={"book"}/> </Button> </Col> </Row> ); }; mapTagsToObjectList = (tags) => { let list = []; let j = tags.length; for (let i=0; i < j; i++) { let v = tags[i]; list.push({value: v, label: v}); } return list; }; getTagsRow = () => { return ( <Well className="App App-Text-Note-Editor-Button-Row"> <EditableSelector session={this.props.session} initialValue={this.state.selectedTag} options={this.state.tags} changeHandler={this.handleEditableListCallback} title={""} multiSelect={false}/> </Well> ); }; getRevisionsPanel = () => { return ( <Well> revisions will appear here </Well> ); }; getWorkflowPanel = () => { return ( <WorkflowForm session={this.props.session} callback={this.handleWorkflowCallback} library={this.state.form.library} status={this.state.form.status} visibility={this.state.form.visibility} /> ); }; getLabel = (type) => { let label = ""; let targetValue = type; if ( this.props.session && this.props.session.dropdowns ) { if (! type) { targetValue = this.props.form.noteType; } let j = this.props.session.dropdowns.noteTypesDropdown.length; for (let i=0; i < j; i++) { let o = this.props.session.dropdowns.noteTypesDropdown[i]; if (o.value === targetValue) { label = o.label; break; } } } return label; }; getFormattedHeaderRow = () => { return ( <Well> <div className="App App-Text-Note-formatted"> <div className="App App-Text-Note-Type"> <Glyphicon className="App App-Text-Note-Type-Glyph" glyph={"screenshot"}/> <span className="App App-Text-Note-Type-As-Heading">{this.state.selectedTypeLabel}</span> <Glyphicon className="App App-Text-Note-Type-Glyph" glyph={"screenshot"}/> </div> {this.getFormattedView()} </div> </Well> ); }; getFormattedView = () => { return ( <FormattedTextNote session={this.props.session} note={this.state.form.valueFormatted} type={this.state.form.noteType} title={this.state.form.noteTitle} scopeLiturgical={this.state.form.liturgicalScope} lemmaLiturgical={this.state.form.liturgicalLemma} lemmaBiblical={this.state.form.biblicalLemma} scopeBiblical={this.state.form.biblicalScope} ontologyRefEntityName={this.state.ontologyRefEntityName} /> ); }; createMarkup() { return {__html: this.state.form.valueFormatted}; }; getIdsWell = () => { return ( <Well> <ControlLabel>{this.state.labels.thisClass.dbIds}</ControlLabel> <Grid> {this.getNoteLibraryRow()} {this.getLiturgicalHeadingLibraryRow()} {this.getLiturgicalSubHeadingLibraryRow()} {this.getBiblicalGreekLibraryRow()} {this.getBiblicalTranslationLibraryRow()} {this.getNoteIdRow()} </Grid> </Well> ); }; getOrderWell = () => { return ( <Well> <ControlLabel>{this.state.labels.thisClass.selectPredecessor}:</ControlLabel> <Grid> {this.getNoteOrderingRow()} </Grid> </Well> ); }; getSettingsWell = () => { return ( <Well> <Grid> {this.getNoteTypeRow()} {this.getLiturgicalScopeRow()} {this.getLiturgicalLemmaRow()} {/*{this.getTitleRow()}*/} {this.getBibleRefRow()} {this.getBiblicalScopeRow()} {this.getBiblicalLemmaRow()} {this.getOntologyRefRow()} </Grid> </Well> ); }; getTabs = () => { if (this.state.form) { return ( <Well> <Tabs id="App-Text-Node-Editor-Tabs" defaultActiveKey={"heading"} animation={false}> <Tab eventKey={"heading"} title={ this.state.labels.thisClass.settings}> {this.getSettingsWell()} </Tab> <Tab eventKey={"formattedheading"} title={this.state.labels.thisClass.viewFormattedNote}> {this.getFormattedHeaderRow()} </Tab> <Tab eventKey={"idsheading"} title={this.state.labels.thisClass.ids}> {this.getIdsWell()} </Tab> <Tab eventKey={"revisions"} title={this.state.labels.thisClass.revisions}> {this.getRevisionsPanel()} </Tab> <Tab eventKey={"tags"} title={this.state.labels.thisClass.tags}> {this.getTagsRow()} </Tab> <Tab eventKey={"workflow"} title={this.state.labels.thisClass.workflow}> {this.getWorkflowPanel()} </Tab> </Tabs> </Well> ); } else { return ( <div> <Spinner message={this.state.labels.messages.retrieving}/> </div> ); } }; getEditor = () => { if (this.state.form) { return ( <RichEditor session={this.props.session} handleEditorChange={this.handleEditorChange} content={this.state.form.valueFormatted} suggestions={this.state.suggestions} /> ); } else { return ( <div> <Spinner message={this.state.labels.messages.retrieving}/> </div> ); } }; render() { return ( <div className="App App-Text-Note-Editor"> {this.state.showModalAddBiblio && this.getModalNewBiblioForm()} {this.getLiturgicalView()} {this.getBiblicalView()} <form> <FormGroup > <Well> <Grid> <Row className="App show-grid"> <Col xs={12} md={12}> <ControlLabel> {this.state.labels.thisClass.note}: {this.state.selectedTypeLabel}. </ControlLabel> </Col> </Row> <Row className="App show-grid App-Text-Note-Editor-Row"> <Col xs={12} md={12}> {this.getEditor()} </Col> </Row> {this.getButtonRow()} <HelpBlock> <div><span className="App App-message"><FontAwesome name={this.state.messageIcon}/> {this.state.message}</span> </div> </HelpBlock> </Grid> </Well> </FormGroup> </form> {this.getTabs()} </div> ) } } TextNoteEditor.propTypes = { session: PropTypes.object.isRequired , onEditorChange: PropTypes.func.isRequired , textId: PropTypes.string.isRequired , form: PropTypes.object , notesList: PropTypes.array , deleteCallback: PropTypes.func.isRequired }; // set default values for props here TextNoteEditor.defaultProps = { }; export default TextNoteEditor;
src/svg-icons/social/domain.js
ArcanisCz/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let SocialDomain = (props) => ( <SvgIcon {...props}> <path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"/> </SvgIcon> ); SocialDomain = pure(SocialDomain); SocialDomain.displayName = 'SocialDomain'; SocialDomain.muiName = 'SvgIcon'; export default SocialDomain;
src/components/Navbar/Navbar.js
sulibautista/live-poll
/* * React.js Starter Kit * Copyright (c) 2014 Konstantin Tarkus (@koistya), KriaSoft LLC. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; // eslint-disable-line no-unused-vars class Navbar { render() { return ( <div className="navbar-top" role="navigation"> <div className="container"> <a className="navbar-brand row" href="/"> <img src={require('./logo-small.png')} width="38" height="38" alt="React" /> <span>React.js Starter Kit</span> </a> </div> </div> ); } } export default Navbar;
modules/__tests__/serverRendering-test.js
cold-brew-coding/react-router
/*eslint-env mocha */ /*eslint react/prop-types: 0*/ import expect from 'expect' import React from 'react' import createLocation from 'history/lib/createLocation' import RoutingContext from '../RoutingContext' import match from '../match' import Link from '../Link' describe('server rendering', function () { let App, Dashboard, About, RedirectRoute, AboutRoute, DashboardRoute, routes beforeEach(function () { App = React.createClass({ render() { return ( <div className="App"> <h1>App</h1> <Link to="/about" activeClassName="about-is-active">About</Link>{' '} <Link to="/dashboard" activeClassName="dashboard-is-active">Dashboard</Link> <div> {this.props.children} </div> </div> ) } }) Dashboard = React.createClass({ render() { return ( <div className="Dashboard"> <h1>The Dashboard</h1> </div> ) } }) About = React.createClass({ render() { return ( <div className="About"> <h1>About</h1> </div> ) } }) DashboardRoute = { path: '/dashboard', component: Dashboard } AboutRoute = { path: '/about', component: About } RedirectRoute = { path: '/company', onEnter (nextState, replaceState) { replaceState(null, '/about') } } routes = { path: '/', component: App, childRoutes: [ DashboardRoute, AboutRoute, RedirectRoute ] } }) it('works', function (done) { const location = createLocation('/dashboard') match({ routes, location }, function (error, redirectLocation, renderProps) { const string = React.renderToString( <RoutingContext {...renderProps} /> ) expect(string).toMatch(/The Dashboard/) done() }) }) it('renders active Links as active', function (done) { const location = createLocation('/about') match({ routes, location }, function (error, redirectLocation, renderProps) { const string = React.renderToString( <RoutingContext {...renderProps} /> ) expect(string).toMatch(/about-is-active/) //expect(string).toNotMatch(/dashboard-is-active/) TODO add toNotMatch to expect done() }) }) it('sends the redirect location', function (done) { const location = createLocation('/company') match({ routes, location }, function (error, redirectLocation) { expect(redirectLocation).toExist() expect(redirectLocation.pathname).toEqual('/about') expect(redirectLocation.search).toEqual('') expect(redirectLocation.state).toEqual(null) expect(redirectLocation.action).toEqual('REPLACE') done() }) }) it('sends null values when no routes match', function (done) { const location = createLocation('/no-match') match({ routes, location }, function (error, redirectLocation, state) { expect(error).toBe(null) expect(redirectLocation).toBe(null) expect(state).toBe(null) done() }) }) })
modules/experimental/AsyncProps.js
sleexyz/react-router
import React from 'react'; function shallowEqual(a, b) { var ka = 0; var kb = 0; for (let key in a) { if (a.hasOwnProperty(key) && a[key] !== b[key]) return false; ka++; } for (let key in b) if (b.hasOwnProperty(key)) kb++; return ka === kb; } var AsyncProps = React.createClass({ statics: { createElement (Component, state) { return Component.loadProps ? <AsyncProps Component={Component} routing={state}/> : <Component {...state}/>; } }, getInitialState() { return { propsAreLoading: false, propsAreLoadingLong: false, asyncProps: null, previousRoutingState: null }; }, componentDidMount() { this.load(this.props); }, componentWillReceiveProps(nextProps) { var needToLoad = !shallowEqual( nextProps.routing.routeParams, this.props.routing.routeParams ); if (needToLoad) { var routerTransitioned = nextProps.routing.location !== this.props.routing.location; var keepPreviousRoutingState = this.state.propsAreLoadingLong && routerTransitioned; if (keepPreviousRoutingState) { this.load(nextProps); } else { this.setState({ previousRoutingState: this.props.routing }, () => this.load(nextProps)); } } }, /* * Could make this method much better, right now AsyncProps doesn't render its * children until it fetches data, causing a "waterfall" effect, when instead * it could look at the branch of components from it down to the end and load * up the props for all of them in parallel, waterfall will do for now... */ load(props) { var lastLoadTime = this._lastLoadTime = Date.now(); var { params } = props.routing; var { Component } = this.props; this.setState({ propsAreLoading: true }, () => { var longLoadTimer = setTimeout(() => { this.setState({ propsAreLoadingLong: true }); }, 300); // TODO: handle `error`s Component.loadProps(params, (error, asyncProps) => { clearTimeout(longLoadTimer); // if the router transitions between now and when the callback runs we will // ignore it to prevent setting state w/ the wrong data (earlier calls to // load that call back later than later calls to load) if (this._lastLoadTime !== lastLoadTime || !this.isMounted()) return; this.setState({ propsAreLoading: false, propsAreLoadingLong: false, asyncProps: asyncProps, previousRoutingState: null }); }); }); }, render() { var { Component } = this.props; var { asyncProps, propsAreLoading, propsAreLoadingLong } = this.state; var routing = this.state.previousRoutingState || this.props.routing; if (this.state.asyncProps === null) return Component.Loader ? <Component.Loader {...routing}/> : null; return <Component onPropsDidChange={() => this.load(this.props) } propsAreLoading={propsAreLoading} propsAreLoadingLong={propsAreLoadingLong} {...routing} {...asyncProps} />; } }); export default AsyncProps;
examples/relay-api/server.js
chenkie/node-auth0
var express = require('express'); var graphqlHttp = require('express-graphql'); var schema = require('./schema/schema'); var jwt = require('express-jwt'); var dotenv = require('dotenv'); // The server is just a simple Express app var app = express() dotenv.load(); var authenticate = jwt({ secret: new Buffer(process.env.AUTH0_CLIENT_SECRET, 'base64'), audience: process.env.AUTH0_CLIENT_ID }); // We respond to all GraphQL requests from `/graphql` using the // `express-graphql` middleware, which we pass our schema to. app.use('/graphql', authenticate, graphqlHttp({schema: schema})); // The rest of the routes are just for serving static files app.use('/relay', express.static('./node_modules/react-relay/dist')); app.use('/', express.static('./public')) app.listen(3000, function() { console.log('Listening on 3000...') });
src/index.js
touqeerkhan11/react-portal-example
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import Demo from './Demo'; import registerServiceWorker from './registerServiceWorker'; ReactDOM.render(<Demo />, document.getElementById('root')); registerServiceWorker();
assets/kit/jquery/jquery.min.js
neverlg/lb
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){ return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m}); //# sourceMappingURL=jquery.min.map
node_modules/rx/dist/rx.compat.js
JoachimHarris/JoachimHarris.github.io
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'function': true, 'object': true }; function checkGlobal(value) { return (value && value.Object === Object) ? value : null; } var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); var freeSelf = checkGlobal(objectTypes[typeof self] && self); var freeWindow = checkGlobal(objectTypes[typeof window] && window); var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; var thisGlobal = checkGlobal(objectTypes[typeof this] && this); var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); var Rx = { internals: {}, config: { Promise: root.Promise }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, identity = Rx.helpers.identity = function (x) { return x; }, defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()), defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { return typeof value == 'function' || false; }; // fallback for older versions of Chrome and Safari if (isFn(/x/)) { isFn = function(value) { return typeof value == 'function' && toString.call(value) == '[object Function]'; }; } return isFn; }()); function cloneArray(arr) { var len = arr.length, a = new Array(len); for(var i = 0; i < len; i++) { a[i] = arr[i]; } return a; } var errorObj = {e: {}}; function tryCatcherGen(tryCatchTarget) { return function tryCatcher() { try { return tryCatchTarget.apply(this, arguments); } catch (e) { errorObj.e = e; return errorObj; } }; } var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } return tryCatcherGen(fn); }; function thrower(e) { throw e; } Rx.config.longStackSupport = false; var hasStacks = false, stacks = tryCatch(function () { throw new Error(); })(); hasStacks = !!stacks.e && !!stacks.e.stack; // All code after this point will be filtered from stack traces reported by RxJS var rStartingLine = captureLine(), rFileName; var STACK_JUMP_SEPARATOR = 'From previous event:'; function makeStackTraceLong(error, observable) { // If possible, transform the error stack trace by removing Node and RxJS // cruft, then concatenating with the stack trace of `observable`. if (hasStacks && observable.stack && typeof error === 'object' && error !== null && error.stack && error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 ) { var stacks = []; for (var o = observable; !!o; o = o.source) { if (o.stack) { stacks.unshift(o.stack); } } stacks.unshift(error.stack); var concatedStacks = stacks.join('\n' + STACK_JUMP_SEPARATOR + '\n'); error.stack = filterStackString(concatedStacks); } } function filterStackString(stackString) { var lines = stackString.split('\n'), desiredLines = []; for (var i = 0, len = lines.length; i < len; i++) { var line = lines[i]; if (!isInternalFrame(line) && !isNodeFrame(line) && line) { desiredLines.push(line); } } return desiredLines.join('\n'); } function isInternalFrame(stackLine) { var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine); if (!fileNameAndLineNumber) { return false; } var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1]; return fileName === rFileName && lineNumber >= rStartingLine && lineNumber <= rEndingLine; } function isNodeFrame(stackLine) { return stackLine.indexOf('(module.js:') !== -1 || stackLine.indexOf('(node.js:') !== -1; } function captureLine() { if (!hasStacks) { return; } try { throw new Error(); } catch (e) { var lines = e.stack.split('\n'); var firstLine = lines[0].indexOf('@') > 0 ? lines[1] : lines[2]; var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); if (!fileNameAndLineNumber) { return; } rFileName = fileNameAndLineNumber[0]; return fileNameAndLineNumber[1]; } } function getFileNameAndLineNumber(stackLine) { // Named functions: 'at functionName (filename:lineNumber:columnNumber)' var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); if (attempt1) { return [attempt1[1], Number(attempt1[2])]; } // Anonymous functions: 'at filename:lineNumber:columnNumber' var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); if (attempt2) { return [attempt2[1], Number(attempt2[2])]; } // Firefox style: 'function@filename:lineNumber or @filename:lineNumber' var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); if (attempt3) { return [attempt3[1], Number(attempt3[2])]; } } // Utilities var toString = Object.prototype.toString; var arrayClass = '[object Array]', funcClass = '[object Function]', stringClass = '[object String]'; if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { var T, k; if (this == null) { throw new TypeError(' this is null or not defined'); } var O = Object(this); var len = O.length >>> 0; if (typeof callback !== 'function') { throw new TypeError(callback + ' is not a function'); } if (arguments.length > 1) { T = thisArg; } k = 0; while (k < len) { var kValue; if (k in O) { kValue = O[k]; callback.call(T, kValue, k, O); } k++; } }; } var boxedString = Object('a'), splitString = boxedString[0] !== 'a' || !(0 in boxedString); if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { var object = Object(this), self = splitString && toString.call(this) === stringClass ? this.split('') : object, length = self.length >>> 0, thisp = arguments[1]; if (toString.call(fun) !== funcClass) { throw new TypeError(fun + ' is not a function'); } for (var i = 0; i < length; i++) { if (i in self && !fun.call(thisp, self[i], i, object)) { return false; } } return true; }; } if (!Array.prototype.map) { Array.prototype.map = function map(fun /*, thisp*/) { var object = Object(this), self = splitString && toString.call(this) === stringClass ? this.split('') : object, length = self.length >>> 0, result = new Array(length), thisp = arguments[1]; if (toString.call(fun) !== funcClass) { throw new TypeError(fun + ' is not a function'); } for (var i = 0; i < length; i++) { if (i in self) { result[i] = fun.call(thisp, self[i], i, object); } } return result; }; } if (!Array.prototype.filter) { Array.prototype.filter = function (predicate) { var results = [], item, t = new Object(this); for (var i = 0, len = t.length >>> 0; i < len; i++) { item = t[i]; if (i in t && predicate.call(arguments[1], item, i, t)) { results.push(item); } } return results; }; } if (!Array.isArray) { Array.isArray = function (arg) { return toString.call(arg) === arrayClass; }; } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf(searchElement) { var t = Object(this); var len = t.length >>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (n !== n) { n = 0; } else if (n !== 0 && n !== Infinity && n !== -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; }; } // Fix for Tessel if (!Object.prototype.propertyIsEnumerable) { Object.prototype.propertyIsEnumerable = function (key) { for (var k in this) { if (k === key) { return true; } } return false; }; } if (!Object.keys) { Object.keys = (function() { 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'); return function(obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); } if (typeof Object.create !== 'function') { // Production steps of ECMA-262, Edition 5, 15.2.3.5 // Reference: http://es5.github.io/#x15.2.3.5 Object.create = (function() { function Temp() {} var hasOwn = Object.prototype.hasOwnProperty; return function (O) { if (typeof O !== 'object') { throw new TypeError('Object prototype may only be an Object or null'); } Temp.prototype = O; var obj = new Temp(); Temp.prototype = null; if (arguments.length > 1) { // Object.defineProperties does ToObject on its first argument. var Properties = Object(arguments[1]); for (var prop in Properties) { if (hasOwn.call(Properties, prop)) { obj[prop] = Properties[prop]; } } } // 5. Return obj return obj; }; })(); } root.Element && root.Element.prototype.attachEvent && !root.Element.prototype.addEventListener && (function () { function addMethod(name, fn) { Window.prototype[name] = HTMLDocument.prototype[name] = Element.prototype[name] = fn; } addMethod('addEventListener', function (type, listener) { var target = this; var listeners = target._c1_listeners = target._c1_listeners || {}; var typeListeners = listeners[type] = listeners[type] || []; target.attachEvent('on' + type, typeListeners.event = function (e) { e || (e = root.event); var documentElement = target.document && target.document.documentElement || target.documentElement || { scrollLeft: 0, scrollTop: 0 }; e.currentTarget = target; e.pageX = e.clientX + documentElement.scrollLeft; e.pageY = e.clientY + documentElement.scrollTop; e.preventDefault = function () { e.bubbledKeyCode = e.keyCode; if (e.ctrlKey) { try { e.keyCode = 0; } catch (e) { } } e.defaultPrevented = true; e.returnValue = false; e.modified = true; e.returnValue = false; }; e.stopImmediatePropagation = function () { immediatePropagation = false; e.cancelBubble = true; }; e.stopPropagation = function () { e.cancelBubble = true; }; e.relatedTarget = e.fromElement || null; e.target = e.srcElement || target; e.timeStamp = +new Date(); // Normalize key events switch(e.type) { case 'keypress': var c = ('charCode' in e ? e.charCode : e.keyCode); if (c === 10) { c = 0; e.keyCode = 13; } else if (c === 13 || c === 27) { c = 0; } else if (c === 3) { c = 99; } e.charCode = c; e.keyChar = e.charCode ? String.fromCharCode(e.charCode) : ''; break; } var copiedEvent = {}; for (var prop in e) { copiedEvent[prop] = e[prop]; } for (var i = 0, typeListenersCache = [].concat(typeListeners), typeListenerCache, immediatePropagation = true; immediatePropagation && (typeListenerCache = typeListenersCache[i]); ++i) { for (var ii = 0, typeListener; typeListener = typeListeners[ii]; ++ii) { if (typeListener === typeListenerCache) { typeListener.call(target, copiedEvent); break; } } } }); typeListeners.push(listener); }); addMethod('removeEventListener', function (type, listener) { var target = this; var listeners = target._c1_listeners = target._c1_listeners || {}; var typeListeners = listeners[type] = listeners[type] || []; for (var i = typeListeners.length - 1, typeListener; typeListener = typeListeners[i]; --i) { if (typeListener === listener) { typeListeners.splice(i, 1); break; } } !typeListeners.length && typeListeners.event && target.detachEvent('on' + type, typeListeners.event); }); addMethod('dispatchEvent', function (e) { var target = this; var type = e.type; var listeners = target._c1_listeners = target._c1_listeners || {}; var typeListeners = listeners[type] = listeners[type] || []; try { return target.fireEvent('on' + type, e); } catch (err) { return typeListeners.event && typeListeners.event(e); } }); function ready() { if (ready.interval && document.body) { ready.interval = clearInterval(ready.interval); document.dispatchEvent(new CustomEvent('DOMContentLoaded')); } } ready.interval = setInterval(ready, 1); root.addEventListener('load', ready); }()); (!root.CustomEvent || typeof root.CustomEvent === 'object') && (function() { function CustomEvent (type, params) { var event; params = params || { bubbles: false, cancelable: false, detail: undefined }; try { if (document.createEvent) { event = document.createEvent('CustomEvent'); event.initCustomEvent(type, params.bubbles, params.cancelable, params.detail); } else if (document.createEventObject) { event = document.createEventObject(); } } catch (error) { event = document.createEvent('Event'); event.initEvent(type, params.bubbles, params.cancelable); event.detail = params.detail; } return event; } root.CustomEvent && (CustomEvent.prototype = root.CustomEvent.prototype); root.CustomEvent = CustomEvent; }()); var EmptyError = Rx.EmptyError = function() { this.message = 'Sequence contains no elements.'; Error.call(this); }; EmptyError.prototype = Object.create(Error.prototype); EmptyError.prototype.name = 'EmptyError'; var ObjectDisposedError = Rx.ObjectDisposedError = function() { this.message = 'Object has been disposed'; Error.call(this); }; ObjectDisposedError.prototype = Object.create(Error.prototype); ObjectDisposedError.prototype.name = 'ObjectDisposedError'; var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () { this.message = 'Argument out of range'; Error.call(this); }; ArgumentOutOfRangeError.prototype = Object.create(Error.prototype); ArgumentOutOfRangeError.prototype.name = 'ArgumentOutOfRangeError'; var NotSupportedError = Rx.NotSupportedError = function (message) { this.message = message || 'This operation is not supported'; Error.call(this); }; NotSupportedError.prototype = Object.create(Error.prototype); NotSupportedError.prototype.name = 'NotSupportedError'; var NotImplementedError = Rx.NotImplementedError = function (message) { this.message = message || 'This operation is not implemented'; Error.call(this); }; NotImplementedError.prototype = Object.create(Error.prototype); NotImplementedError.prototype.name = 'NotImplementedError'; var notImplemented = Rx.helpers.notImplemented = function () { throw new NotImplementedError(); }; var notSupported = Rx.helpers.notSupported = function () { throw new NotSupportedError(); }; // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; var isIterable = Rx.helpers.isIterable = function (o) { return o && o[$iterator$] !== undefined; }; var isArrayLike = Rx.helpers.isArrayLike = function (o) { return o && o.length !== undefined; }; Rx.helpers.iterator = $iterator$; var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) { if (typeof thisArg === 'undefined') { return func; } switch(argCount) { case 0: return function() { return func.call(thisArg) }; case 1: return function(arg) { return func.call(thisArg, arg); }; case 2: return function(value, index) { return func.call(thisArg, value, index); }; case 3: return function(value, index, collection) { return func.call(thisArg, value, index, collection); }; } return function() { return func.apply(thisArg, arguments); }; }; /** Used to determine if values are of the language type Object */ var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], dontEnumsLength = dontEnums.length; var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, objToString = objectProto.toString, MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; var keys = Object.keys || (function() { var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function(obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); function equalObjects(object, other, equalFunc, isLoose, stackA, stackB) { var objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; if (objLength !== othLength && !isLoose) { return false; } var index = objLength, key; while (index--) { key = objProps[index]; if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { return false; } } var skipCtor = isLoose; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key], result; if (!(result === undefined ? equalFunc(objValue, othValue, isLoose, stackA, stackB) : result)) { return false; } skipCtor || (skipCtor = key === 'constructor'); } if (!skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor !== othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor === 'function' && objCtor instanceof objCtor && typeof othCtor === 'function' && othCtor instanceof othCtor)) { return false; } } return true; } function equalByTag(object, other, tag) { switch (tag) { case boolTag: case dateTag: return +object === +other; case errorTag: return object.name === other.name && object.message === other.message; case numberTag: return (object !== +object) ? other !== +other : object === +other; case regexpTag: case stringTag: return object === (other + ''); } return false; } var isObject = Rx.internals.isObject = function(value) { var type = typeof value; return !!value && (type === 'object' || type === 'function'); }; function isObjectLike(value) { return !!value && typeof value === 'object'; } function isLength(value) { return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; } var isHostObject = (function() { try { Object({ 'toString': 0 } + ''); } catch(e) { return function() { return false; }; } return function(value) { return typeof value.toString !== 'function' && typeof (value + '') === 'string'; }; }()); function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; } var isArray = Array.isArray || function(value) { return isObjectLike(value) && isLength(value.length) && objToString.call(value) === arrayTag; }; function arraySome (array, predicate) { var index = -1, length = array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } function equalArrays(array, other, equalFunc, isLoose, stackA, stackB) { var index = -1, arrLength = array.length, othLength = other.length; if (arrLength !== othLength && !(isLoose && othLength > arrLength)) { return false; } // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index], result; if (result !== undefined) { if (result) { continue; } return false; } // Recursively compare arrays (susceptible to call stack limits). if (isLoose) { if (!arraySome(other, function(othValue) { return arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB); })) { return false; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB))) { return false; } } return true; } function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; if (!objIsArr) { objTag = objToString.call(object); if (objTag === argsTag) { objTag = objectTag; } else if (objTag !== objectTag) { objIsArr = isTypedArray(object); } } if (!othIsArr) { othTag = objToString.call(other); if (othTag === argsTag) { othTag = objectTag; } } var objIsObj = objTag === objectTag && !isHostObject(object), othIsObj = othTag === objectTag && !isHostObject(other), isSameTag = objTag === othTag; if (isSameTag && !(objIsArr || objIsObj)) { return equalByTag(object, other, objTag); } if (!isLoose) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, isLoose, stackA, stackB); } } if (!isSameTag) { return false; } // Assume cyclic values are equal. // For more information on detecting circular references see https://es5.github.io/#JO. stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] === object) { return stackB[length] === other; } } // Add `object` and `other` to the stack of traversed objects. stackA.push(object); stackB.push(other); var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, isLoose, stackA, stackB); stackA.pop(); stackB.pop(); return result; } function baseIsEqual(value, other, isLoose, stackA, stackB) { if (value === other) { return true; } if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, baseIsEqual, isLoose, stackA, stackB); } var isEqual = Rx.internals.isEqual = function (value, other) { return baseIsEqual(value, other); }; var hasProp = {}.hasOwnProperty, slice = Array.prototype.slice; var inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; var addProperties = Rx.internals.addProperties = function (obj) { for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); } for (var idx = 0, ln = sources.length; idx < ln; idx++) { var source = sources[idx]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new BinaryDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { var args = [], i, len; if (Array.isArray(arguments[0])) { args = arguments[0]; } else { len = arguments.length; args = new Array(len); for(i = 0; i < len; i++) { args[i] = arguments[i]; } } this.disposables = args; this.isDisposed = false; this.length = args.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var len = this.disposables.length, currentDisposables = new Array(len); for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; } this.disposables = []; this.length = 0; for (i = 0; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Provides a set of static methods for creating Disposables. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; /** * Validates whether the given object is a disposable * @param {Object} Object to test whether it has a dispose method * @returns {Boolean} true if a disposable object, else false. */ var isDisposable = Disposable.isDisposable = function (d) { return d && isFunction(d.dispose); }; var checkDisposed = Disposable.checkDisposed = function (disposable) { if (disposable.isDisposed) { throw new ObjectDisposedError(); } }; var disposableFixup = Disposable._fixup = function (result) { return isDisposable(result) ? result : disposableEmpty; }; // Single assignment var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () { this.isDisposed = false; this.current = null; }; SingleAssignmentDisposable.prototype.getDisposable = function () { return this.current; }; SingleAssignmentDisposable.prototype.setDisposable = function (value) { if (this.current) { throw new Error('Disposable has already been assigned'); } var shouldDispose = this.isDisposed; !shouldDispose && (this.current = value); shouldDispose && value && value.dispose(); }; SingleAssignmentDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var old = this.current; this.current = null; old && old.dispose(); } }; // Multiple assignment disposable var SerialDisposable = Rx.SerialDisposable = function () { this.isDisposed = false; this.current = null; }; SerialDisposable.prototype.getDisposable = function () { return this.current; }; SerialDisposable.prototype.setDisposable = function (value) { var shouldDispose = this.isDisposed; if (!shouldDispose) { var old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; SerialDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var old = this.current; this.current = null; } old && old.dispose(); }; var BinaryDisposable = Rx.BinaryDisposable = function (first, second) { this._first = first; this._second = second; this.isDisposed = false; }; BinaryDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var old1 = this._first; this._first = null; old1 && old1.dispose(); var old2 = this._second; this._second = null; old2 && old2.dispose(); } }; var NAryDisposable = Rx.NAryDisposable = function (disposables) { this._disposables = disposables; this.isDisposed = false; }; NAryDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; for (var i = 0, len = this._disposables.length; i < len; i++) { this._disposables[i].dispose(); } this._disposables.length = 0; } }; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed && !this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed && !this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } function scheduleItem(s, self) { if (!self.isDisposed) { self.isDisposed = true; self.disposable.dispose(); } } ScheduledDisposable.prototype.dispose = function () { this.scheduler.schedule(this, scheduleItem); }; var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); }; ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return disposableFixup(this.action(this.scheduler, this.state)); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler() { } /** Determines whether the given object is a scheduler */ Scheduler.isScheduler = function (s) { return s instanceof Scheduler; }; var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (state, action) { throw new NotImplementedError(); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleFuture = function (state, dueTime, action) { var dt = dueTime; dt instanceof Date && (dt = dt - this.now()); dt = Scheduler.normalize(dt); if (dt === 0) { return this.schedule(state, action); } return this._scheduleFuture(state, dt, action); }; schedulerProto._scheduleFuture = function (state, dueTime, action) { throw new NotImplementedError(); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** Gets the current time according to the local machine's system clock. */ Scheduler.prototype.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair[0], action = pair[1], group = new CompositeDisposable(); action(state, innerAction); return group; function innerAction(state2) { var isAdded = false, isDone = false; var d = scheduler.schedule(state2, scheduleWork); if (!isDone) { group.add(d); isAdded = true; } function scheduleWork(_, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } action(state3, innerAction); return disposableEmpty; } } } function invokeRecDate(scheduler, pair) { var state = pair[0], action = pair[1], group = new CompositeDisposable(); action(state, innerAction); return group; function innerAction(state2, dueTime1) { var isAdded = false, isDone = false; var d = scheduler.scheduleFuture(state2, dueTime1, scheduleWork); if (!isDone) { group.add(d); isAdded = true; } function scheduleWork(_, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } action(state3, innerAction); return disposableEmpty; } } } /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (state, action) { return this.schedule([state, action], invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative or absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number | Date} dueTime Relative or absolute time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveFuture = function (state, dueTime, action) { return this.scheduleFuture([state, action], dueTime, invokeRecDate); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodic = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); } period = normalizeTime(period); var s = state, id = root.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { root.clearInterval(id); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchError = schedulerProto['catch'] = function (handler) { return new CatchScheduler(this, handler); }; }(Scheduler.prototype)); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function createTick(self) { return function tick(command, recurse) { recurse(0, self._period); var state = tryCatch(self._action)(self._state); if (state === errorObj) { self._cancel.dispose(); thrower(state.e); } self._state = state; }; } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveFuture(0, this._period, createTick(this))); return d; }; return SchedulePeriodicRecursive; }()); /** Gets a scheduler that schedules work immediately on the current thread. */ var ImmediateScheduler = (function (__super__) { inherits(ImmediateScheduler, __super__); function ImmediateScheduler() { __super__.call(this); } ImmediateScheduler.prototype.schedule = function (state, action) { return disposableFixup(action(this, state)); }; return ImmediateScheduler; }(Scheduler)); var immediateScheduler = Scheduler.immediate = new ImmediateScheduler(); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var CurrentThreadScheduler = (function (__super__) { var queue; function runTrampoline () { while (queue.length > 0) { var item = queue.dequeue(); !item.isCancelled() && item.invoke(); } } inherits(CurrentThreadScheduler, __super__); function CurrentThreadScheduler() { __super__.call(this); } CurrentThreadScheduler.prototype.schedule = function (state, action) { var si = new ScheduledItem(this, state, action, this.now()); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); var result = tryCatch(runTrampoline)(); queue = null; if (result === errorObj) { thrower(result.e); } } else { queue.enqueue(si); } return si.disposable; }; CurrentThreadScheduler.prototype.scheduleRequired = function () { return !queue; }; return CurrentThreadScheduler; }(Scheduler)); var currentThreadScheduler = Scheduler.currentThread = new CurrentThreadScheduler(); var scheduleMethod, clearMethod; var localTimer = (function () { var localSetTimeout, localClearTimeout = noop; if (!!root.setTimeout) { localSetTimeout = root.setTimeout; localClearTimeout = root.clearTimeout; } else if (!!root.WScript) { localSetTimeout = function (fn, time) { root.WScript.Sleep(time); fn(); }; } else { throw new NotSupportedError(); } return { setTimeout: localSetTimeout, clearTimeout: localClearTimeout }; }()); var localSetTimeout = localTimer.setTimeout, localClearTimeout = localTimer.clearTimeout; (function () { var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false; clearMethod = function (handle) { delete tasksByHandle[handle]; }; function runTask(handle) { if (currentlyRunning) { localSetTimeout(function () { runTask(handle); }, 0); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunning = true; var result = tryCatch(task)(); clearMethod(handle); currentlyRunning = false; if (result === errorObj) { thrower(result.e); } } } } var reNative = new RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('', '*'); root.onmessage = oldHandler; return isAsync; } // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout if (isFunction(setImmediate)) { scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; setImmediate(function () { runTask(id); }); return id; }; } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; process.nextTick(function () { runTask(id); }); return id; }; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(); var onGlobalPostMessage = function (event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { runTask(event.data.substring(MSG_PREFIX.length)); } }; root.addEventListener('message', onGlobalPostMessage, false); scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; root.postMessage(MSG_PREFIX + id, '*'); return id; }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(); channel.port1.onmessage = function (e) { runTask(e.data); }; scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; channel.port2.postMessage(id); return id; }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); var id = nextHandle++; tasksByHandle[id] = action; scriptElement.onreadystatechange = function () { runTask(id); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); return id; }; } else { scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; localSetTimeout(function () { runTask(id); }, 0); return id; }; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var DefaultScheduler = (function (__super__) { inherits(DefaultScheduler, __super__); function DefaultScheduler() { __super__.call(this); } function scheduleAction(disposable, action, scheduler, state) { return function schedule() { disposable.setDisposable(Disposable._fixup(action(scheduler, state))); }; } function ClearDisposable(id) { this._id = id; this.isDisposed = false; } ClearDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; clearMethod(this._id); } }; function LocalClearDisposable(id) { this._id = id; this.isDisposed = false; } LocalClearDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; localClearTimeout(this._id); } }; DefaultScheduler.prototype.schedule = function (state, action) { var disposable = new SingleAssignmentDisposable(), id = scheduleMethod(scheduleAction(disposable, action, this, state)); return new BinaryDisposable(disposable, new ClearDisposable(id)); }; DefaultScheduler.prototype._scheduleFuture = function (state, dueTime, action) { if (dueTime === 0) { return this.schedule(state, action); } var disposable = new SingleAssignmentDisposable(), id = localSetTimeout(scheduleAction(disposable, action, this, state), dueTime); return new BinaryDisposable(disposable, new LocalClearDisposable(id)); }; function scheduleLongRunning(state, action, disposable) { return function () { action(state, disposable); }; } DefaultScheduler.prototype.scheduleLongRunning = function (state, action) { var disposable = disposableCreate(noop); scheduleMethod(scheduleLongRunning(state, action, disposable)); return disposable; }; return DefaultScheduler; }(Scheduler)); var defaultScheduler = Scheduler['default'] = Scheduler.async = new DefaultScheduler(); var CatchScheduler = (function (__super__) { inherits(CatchScheduler, __super__); function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; __super__.call(this); } CatchScheduler.prototype.schedule = function (state, action) { return this._scheduler.schedule(state, this._wrap(action)); }; CatchScheduler.prototype._scheduleFuture = function (state, dueTime, action) { return this._scheduler.schedule(state, dueTime, this._wrap(action)); }; CatchScheduler.prototype.now = function () { return this._scheduler.now(); }; CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { var res = tryCatch(action)(parent._getRecursiveWrapper(self), state); if (res === errorObj) { if (!parent._handler(res.e)) { thrower(res.e); } return disposableEmpty; } return disposableFixup(res); }; }; CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; CatchScheduler.prototype.schedulePeriodic = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodic(state, period, function (state1) { if (failed) { return null; } var res = tryCatch(action)(state1); if (res === errorObj) { failed = true; if (!self._handler(res.e)) { thrower(res.e); } d.dispose(); return null; } return res; })); return d; }; return CatchScheduler; }(Scheduler)); function IndexedItem(id, value) { this.id = id; this.value = value; } IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); c === 0 && (c = this.id - other.id); return c; }; var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { +index || (index = 0); if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; this.items[this.length] = undefined; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification() { } Notification.prototype._accept = function (onNext, onError, onCompleted) { throw new NotImplementedError(); }; Notification.prototype._acceptObserver = function (onNext, onError, onCompleted) { throw new NotImplementedError(); }; /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * @param {Function | Observer} observerOrOnNext Function to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Function to invoke for an OnError notification. * @param {Function} onCompleted Function to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObserver(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var self = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (o) { return scheduler.schedule(self, function (_, notification) { notification._acceptObserver(o); notification.kind === 'N' && o.onCompleted(); }); }); }; return Notification; })(); var OnNextNotification = (function (__super__) { inherits(OnNextNotification, __super__); function OnNextNotification(value) { this.value = value; this.kind = 'N'; } OnNextNotification.prototype._accept = function (onNext) { return onNext(this.value); }; OnNextNotification.prototype._acceptObserver = function (o) { return o.onNext(this.value); }; OnNextNotification.prototype.toString = function () { return 'OnNext(' + this.value + ')'; }; return OnNextNotification; }(Notification)); var OnErrorNotification = (function (__super__) { inherits(OnErrorNotification, __super__); function OnErrorNotification(error) { this.error = error; this.kind = 'E'; } OnErrorNotification.prototype._accept = function (onNext, onError) { return onError(this.error); }; OnErrorNotification.prototype._acceptObserver = function (o) { return o.onError(this.error); }; OnErrorNotification.prototype.toString = function () { return 'OnError(' + this.error + ')'; }; return OnErrorNotification; }(Notification)); var OnCompletedNotification = (function (__super__) { inherits(OnCompletedNotification, __super__); function OnCompletedNotification() { this.kind = 'C'; } OnCompletedNotification.prototype._accept = function (onNext, onError, onCompleted) { return onCompleted(); }; OnCompletedNotification.prototype._acceptObserver = function (o) { return o.onCompleted(); }; OnCompletedNotification.prototype.toString = function () { return 'OnCompleted()'; }; return OnCompletedNotification; }(Notification)); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = function (value) { return new OnNextNotification(value); }; /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = function (error) { return new OnErrorNotification(error); }; /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = function () { return new OnCompletedNotification(); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { var self = this; return new AnonymousObserver( function (x) { self.onNext(x); }, function (err) { self.onError(err); }, function () { self.onCompleted(); }); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { var cb = bindCallback(handler, thisArg, 1); return new AnonymousObserver(function (x) { return cb(notificationCreateOnNext(x)); }, function (e) { return cb(notificationCreateOnError(e)); }, function () { return cb(notificationCreateOnCompleted()); }); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.prototype.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; Observer.prototype.makeSafe = function(disposable) { return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { inherits(AbstractObserver, __super__); /** * Creates a new observer in a non-stopped state. */ function AbstractObserver() { this.isStopped = false; } // Must be implemented by other observers AbstractObserver.prototype.next = notImplemented; AbstractObserver.prototype.error = notImplemented; AbstractObserver.prototype.completed = notImplemented; /** * Notifies the observer of a new element in the sequence. * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { !this.isStopped && this.next(value); }; /** * Notifies the observer that an exception has occurred. * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { inherits(AnonymousObserver, __super__); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { __super__.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (error) { this._onError(error); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (__super__) { inherits(CheckedObserver, __super__); function CheckedObserver(observer) { __super__.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); var res = tryCatch(this._observer.onNext).call(this._observer, value); this._state = 0; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); var res = tryCatch(this._observer.onError).call(this._observer, err); this._state = 2; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); var res = tryCatch(this._observer.onCompleted).call(this._observer); this._state = 2; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { inherits(ScheduledObserver, __super__); function ScheduledObserver(scheduler, observer) { __super__.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } function enqueueNext(observer, x) { return function () { observer.onNext(x); }; } function enqueueError(observer, e) { return function () { observer.onError(e); }; } function enqueueCompleted(observer) { return function () { observer.onCompleted(); }; } ScheduledObserver.prototype.next = function (x) { this.queue.push(enqueueNext(this.observer, x)); }; ScheduledObserver.prototype.error = function (e) { this.queue.push(enqueueError(this.observer, e)); }; ScheduledObserver.prototype.completed = function () { this.queue.push(enqueueCompleted(this.observer)); }; function scheduleMethod(state, recurse) { var work; if (state.queue.length > 0) { work = state.queue.shift(); } else { state.isAcquired = false; return; } var res = tryCatch(work)(); if (res === errorObj) { state.queue = []; state.hasFaulted = true; return thrower(res.e); } recurse(state); } ScheduledObserver.prototype.ensureActive = function () { var isOwner = false; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } isOwner && this.disposable.setDisposable(this.scheduler.scheduleRecursive(this, scheduleMethod)); }; ScheduledObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); var ObserveOnObserver = (function (__super__) { inherits(ObserveOnObserver, __super__); function ObserveOnObserver(scheduler, observer, cancel) { __super__.call(this, scheduler, observer); this._cancel = cancel; } ObserveOnObserver.prototype.next = function (value) { __super__.prototype.next.call(this, value); this.ensureActive(); }; ObserveOnObserver.prototype.error = function (e) { __super__.prototype.error.call(this, e); this.ensureActive(); }; ObserveOnObserver.prototype.completed = function () { __super__.prototype.completed.call(this); this.ensureActive(); }; ObserveOnObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this._cancel && this._cancel.dispose(); this._cancel = null; }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function makeSubscribe(self, subscribe) { return function (o) { var oldOnError = o.onError; o.onError = function (e) { makeStackTraceLong(e, self); oldOnError.call(o, e); }; return subscribe.call(self, o); }; } function Observable() { if (Rx.config.longStackSupport && hasStacks) { var oldSubscribe = this._subscribe; var e = tryCatch(thrower)(new Error()).e; this.stack = e.stack.substring(e.stack.indexOf('\n') + 1); this._subscribe = makeSubscribe(this, oldSubscribe); } } observableProto = Observable.prototype; /** * Determines whether the given object is an Observable * @param {Any} An object to determine whether it is an Observable * @returns {Boolean} true if an Observable, else false. */ Observable.isObservable = function (o) { return o && isFunction(o.subscribe); }; /** * Subscribes an o to the observable sequence. * @param {Mixed} [oOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribe = observableProto.forEach = function (oOrOnNext, onError, onCompleted) { return this._subscribe(typeof oOrOnNext === 'object' ? oOrOnNext : observerCreate(oOrOnNext, onError, onCompleted)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onNext The function to invoke on each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnNext = function (onNext, thisArg) { return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext)); }; /** * Subscribes to an exceptional condition in the sequence with an optional "this" argument. * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnError = function (onError, thisArg) { return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted)); }; return Observable; })(); var ObservableBase = Rx.ObservableBase = (function (__super__) { inherits(ObservableBase, __super__); function fixSubscriber(subscriber) { return subscriber && isFunction(subscriber.dispose) ? subscriber : isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; } function setDisposable(s, state) { var ado = state[0], self = state[1]; var sub = tryCatch(self.subscribeCore).call(self, ado); if (sub === errorObj && !ado.fail(errorObj.e)) { thrower(errorObj.e); } ado.setDisposable(fixSubscriber(sub)); } function ObservableBase() { __super__.call(this); } ObservableBase.prototype._subscribe = function (o) { var ado = new AutoDetachObserver(o), state = [ado, this]; if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(state, setDisposable); } else { setDisposable(null, state); } return ado; }; ObservableBase.prototype.subscribeCore = notImplemented; return ObservableBase; }(Observable)); var FlatMapObservable = Rx.FlatMapObservable = (function(__super__) { inherits(FlatMapObservable, __super__); function FlatMapObservable(source, selector, resultSelector, thisArg) { this.resultSelector = isFunction(resultSelector) ? resultSelector : null; this.selector = bindCallback(isFunction(selector) ? selector : function() { return selector; }, thisArg, 3); this.source = source; __super__.call(this); } FlatMapObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new InnerObserver(o, this.selector, this.resultSelector, this)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(observer, selector, resultSelector, source) { this.i = 0; this.selector = selector; this.resultSelector = resultSelector; this.source = source; this.o = observer; AbstractObserver.call(this); } InnerObserver.prototype._wrapResult = function(result, x, i) { return this.resultSelector ? result.map(function(y, i2) { return this.resultSelector(x, y, i, i2); }, this) : result; }; InnerObserver.prototype.next = function(x) { var i = this.i++; var result = tryCatch(this.selector)(x, i, this.source); if (result === errorObj) { return this.o.onError(result.e); } isPromise(result) && (result = observableFromPromise(result)); (isArrayLike(result) || isIterable(result)) && (result = Observable.from(result)); this.o.onNext(this._wrapResult(result, x, i)); }; InnerObserver.prototype.error = function(e) { this.o.onError(e); }; InnerObserver.prototype.completed = function() { this.o.onCompleted(); }; return FlatMapObservable; }(ObservableBase)); var Enumerable = Rx.internals.Enumerable = function () { }; function IsDisposedDisposable(state) { this._s = state; this.isDisposed = false; } IsDisposedDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; this._s.isDisposed = true; } }; var ConcatEnumerableObservable = (function(__super__) { inherits(ConcatEnumerableObservable, __super__); function ConcatEnumerableObservable(sources) { this.sources = sources; __super__.call(this); } function scheduleMethod(state, recurse) { if (state.isDisposed) { return; } var currentItem = tryCatch(state.e.next).call(state.e); if (currentItem === errorObj) { return state.o.onError(currentItem.e); } if (currentItem.done) { return state.o.onCompleted(); } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); } ConcatEnumerableObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(); var state = { isDisposed: false, o: o, subscription: subscription, e: this.sources[$iterator$]() }; var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); }; function InnerObserver(state, recurse) { this._state = state; this._recurse = recurse; AbstractObserver.call(this); } inherits(InnerObserver, AbstractObserver); InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this._state.o.onError(e); }; InnerObserver.prototype.completed = function () { this._recurse(this._state); }; return ConcatEnumerableObservable; }(ObservableBase)); Enumerable.prototype.concat = function () { return new ConcatEnumerableObservable(this); }; var CatchErrorObservable = (function(__super__) { function CatchErrorObservable(sources) { this.sources = sources; __super__.call(this); } inherits(CatchErrorObservable, __super__); function scheduleMethod(state, recurse) { if (state.isDisposed) { return; } var currentItem = tryCatch(state.e.next).call(state.e); if (currentItem === errorObj) { return state.o.onError(currentItem.e); } if (currentItem.done) { return state.lastError !== null ? state.o.onError(state.lastError) : state.o.onCompleted(); } var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); } CatchErrorObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(); var state = { isDisposed: false, e: this.sources[$iterator$](), subscription: subscription, lastError: null, o: o }; var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); }; function InnerObserver(state, recurse) { this._state = state; this._recurse = recurse; AbstractObserver.call(this); } inherits(InnerObserver, AbstractObserver); InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this._state.lastError = e; this._recurse(this._state); }; InnerObserver.prototype.completed = function () { this._state.o.onCompleted(); }; return CatchErrorObservable; }(ObservableBase)); Enumerable.prototype.catchError = function () { return new CatchErrorObservable(this); }; var RepeatEnumerable = (function (__super__) { inherits(RepeatEnumerable, __super__); function RepeatEnumerable(v, c) { this.v = v; this.c = c == null ? -1 : c; } RepeatEnumerable.prototype[$iterator$] = function () { return new RepeatEnumerator(this); }; function RepeatEnumerator(p) { this.v = p.v; this.l = p.c; } RepeatEnumerator.prototype.next = function () { if (this.l === 0) { return doneEnumerator; } if (this.l > 0) { this.l--; } return { done: false, value: this.v }; }; return RepeatEnumerable; }(Enumerable)); var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { return new RepeatEnumerable(value, repeatCount); }; var OfEnumerable = (function(__super__) { inherits(OfEnumerable, __super__); function OfEnumerable(s, fn, thisArg) { this.s = s; this.fn = fn ? bindCallback(fn, thisArg, 3) : null; } OfEnumerable.prototype[$iterator$] = function () { return new OfEnumerator(this); }; function OfEnumerator(p) { this.i = -1; this.s = p.s; this.l = this.s.length; this.fn = p.fn; } OfEnumerator.prototype.next = function () { return ++this.i < this.l ? { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } : doneEnumerator; }; return OfEnumerable; }(Enumerable)); var enumerableOf = Enumerable.of = function (source, selector, thisArg) { return new OfEnumerable(source, selector, thisArg); }; var ObserveOnObservable = (function (__super__) { inherits(ObserveOnObservable, __super__); function ObserveOnObservable(source, s) { this.source = source; this._s = s; __super__.call(this); } ObserveOnObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ObserveOnObserver(this._s, o)); }; return ObserveOnObservable; }(ObservableBase)); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { return new ObserveOnObservable(this, scheduler); }; var SubscribeOnObservable = (function (__super__) { inherits(SubscribeOnObservable, __super__); function SubscribeOnObservable(source, s) { this.source = source; this._s = s; __super__.call(this); } function scheduleMethod(scheduler, state) { var source = state[0], d = state[1], o = state[2]; d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(o))); } SubscribeOnObservable.prototype.subscribeCore = function (o) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(this._s.schedule([this.source, d, o], scheduleMethod)); return d; }; return SubscribeOnObservable; }(ObservableBase)); /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { return new SubscribeOnObservable(this, scheduler); }; var FromPromiseObservable = (function(__super__) { inherits(FromPromiseObservable, __super__); function FromPromiseObservable(p, s) { this._p = p; this._s = s; __super__.call(this); } function scheduleNext(s, state) { var o = state[0], data = state[1]; o.onNext(data); o.onCompleted(); } function scheduleError(s, state) { var o = state[0], err = state[1]; o.onError(err); } FromPromiseObservable.prototype.subscribeCore = function(o) { var sad = new SingleAssignmentDisposable(), self = this, p = this._p; if (isFunction(p)) { p = tryCatch(p)(); if (p === errorObj) { o.onError(p.e); return sad; } } p .then(function (data) { sad.setDisposable(self._s.schedule([o, data], scheduleNext)); }, function (err) { sad.setDisposable(self._s.schedule([o, err], scheduleError)); }); return sad; }; return FromPromiseObservable; }(ObservableBase)); /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise, scheduler) { scheduler || (scheduler = defaultScheduler); return new FromPromiseObservable(promise, scheduler); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value; source.subscribe(function (v) { value = v; }, reject, function () { resolve(value); }); }); }; var ToArrayObservable = (function(__super__) { inherits(ToArrayObservable, __super__); function ToArrayObservable(source) { this.source = source; __super__.call(this); } ToArrayObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new InnerObserver(o)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o) { this.o = o; this.a = []; AbstractObserver.call(this); } InnerObserver.prototype.next = function (x) { this.a.push(x); }; InnerObserver.prototype.error = function (e) { this.o.onError(e); }; InnerObserver.prototype.completed = function () { this.o.onNext(this.a); this.o.onCompleted(); }; return ToArrayObservable; }(ObservableBase)); /** * Creates an array from an observable sequence. * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { return new ToArrayObservable(this); }; /** * Creates an observable sequence from a specified subscribe method implementation. * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = function (subscribe, parent) { return new AnonymousObservable(subscribe, parent); }; var Defer = (function(__super__) { inherits(Defer, __super__); function Defer(factory) { this._f = factory; __super__.call(this); } Defer.prototype.subscribeCore = function (o) { var result = tryCatch(this._f)(); if (result === errorObj) { return observableThrow(result.e).subscribe(o);} isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(o); }; return Defer; }(ObservableBase)); /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new Defer(observableFactory); }; var EmptyObservable = (function(__super__) { inherits(EmptyObservable, __super__); function EmptyObservable(scheduler) { this.scheduler = scheduler; __super__.call(this); } EmptyObservable.prototype.subscribeCore = function (observer) { var sink = new EmptySink(observer, this.scheduler); return sink.run(); }; function EmptySink(observer, scheduler) { this.observer = observer; this.scheduler = scheduler; } function scheduleItem(s, state) { state.onCompleted(); return disposableEmpty; } EmptySink.prototype.run = function () { var state = this.observer; return this.scheduler === immediateScheduler ? scheduleItem(null, state) : this.scheduler.schedule(state, scheduleItem); }; return EmptyObservable; }(ObservableBase)); var EMPTY_OBSERVABLE = new EmptyObservable(immediateScheduler); /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return scheduler === immediateScheduler ? EMPTY_OBSERVABLE : new EmptyObservable(scheduler); }; var FromObservable = (function(__super__) { inherits(FromObservable, __super__); function FromObservable(iterable, fn, scheduler) { this._iterable = iterable; this._fn = fn; this._scheduler = scheduler; __super__.call(this); } function createScheduleMethod(o, it, fn) { return function loopRecursive(i, recurse) { var next = tryCatch(it.next).call(it); if (next === errorObj) { return o.onError(next.e); } if (next.done) { return o.onCompleted(); } var result = next.value; if (isFunction(fn)) { result = tryCatch(fn)(result, i); if (result === errorObj) { return o.onError(result.e); } } o.onNext(result); recurse(i + 1); }; } FromObservable.prototype.subscribeCore = function (o) { var list = Object(this._iterable), it = getIterable(list); return this._scheduler.scheduleRecursive(0, createScheduleMethod(o, it, this._fn)); }; return FromObservable; }(ObservableBase)); var maxSafeInteger = Math.pow(2, 53) - 1; function StringIterable(s) { this._s = s; } StringIterable.prototype[$iterator$] = function () { return new StringIterator(this._s); }; function StringIterator(s) { this._s = s; this._l = s.length; this._i = 0; } StringIterator.prototype[$iterator$] = function () { return this; }; StringIterator.prototype.next = function () { return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator; }; function ArrayIterable(a) { this._a = a; } ArrayIterable.prototype[$iterator$] = function () { return new ArrayIterator(this._a); }; function ArrayIterator(a) { this._a = a; this._l = toLength(a); this._i = 0; } ArrayIterator.prototype[$iterator$] = function () { return this; }; ArrayIterator.prototype.next = function () { return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator; }; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function getIterable(o) { var i = o[$iterator$], it; if (!i && typeof o === 'string') { it = new StringIterable(o); return it[$iterator$](); } if (!i && o.length !== undefined) { it = new ArrayIterable(o); return it[$iterator$](); } if (!i) { throw new TypeError('Object is not iterable'); } return o[$iterator$](); } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isFunction(mapFn)) { throw new Error('mapFn when provided must be a function'); } if (mapFn) { var mapper = bindCallback(mapFn, thisArg, 2); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new FromObservable(iterable, mapper, scheduler); } var FromArrayObservable = (function(__super__) { inherits(FromArrayObservable, __super__); function FromArrayObservable(args, scheduler) { this._args = args; this._scheduler = scheduler; __super__.call(this); } function scheduleMethod(o, args) { var len = args.length; return function loopRecursive (i, recurse) { if (i < len) { o.onNext(args[i]); recurse(i + 1); } else { o.onCompleted(); } }; } FromArrayObservable.prototype.subscribeCore = function (o) { return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._args)); }; return FromArrayObservable; }(ObservableBase)); /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * @deprecated use Observable.from or Observable.of * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new FromArrayObservable(array, scheduler) }; var GenerateObservable = (function (__super__) { inherits(GenerateObservable, __super__); function GenerateObservable(state, cndFn, itrFn, resFn, s) { this._initialState = state; this._cndFn = cndFn; this._itrFn = itrFn; this._resFn = resFn; this._s = s; __super__.call(this); } function scheduleRecursive(state, recurse) { if (state.first) { state.first = false; } else { state.newState = tryCatch(state.self._itrFn)(state.newState); if (state.newState === errorObj) { return state.o.onError(state.newState.e); } } var hasResult = tryCatch(state.self._cndFn)(state.newState); if (hasResult === errorObj) { return state.o.onError(hasResult.e); } if (hasResult) { var result = tryCatch(state.self._resFn)(state.newState); if (result === errorObj) { return state.o.onError(result.e); } state.o.onNext(result); recurse(state); } else { state.o.onCompleted(); } } GenerateObservable.prototype.subscribeCore = function (o) { var state = { o: o, self: this, first: true, newState: this._initialState }; return this._s.scheduleRecursive(state, scheduleRecursive); }; return GenerateObservable; }(ObservableBase)); /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new GenerateObservable(initialState, condition, iterate, resultSelector, scheduler); }; var NeverObservable = (function(__super__) { inherits(NeverObservable, __super__); function NeverObservable() { __super__.call(this); } NeverObservable.prototype.subscribeCore = function (observer) { return disposableEmpty; }; return NeverObservable; }(ObservableBase)); var NEVER_OBSERVABLE = new NeverObservable(); /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return NEVER_OBSERVABLE; }; function observableOf (scheduler, array) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new FromArrayObservable(array, scheduler); } /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return new FromArrayObservable(args, currentThreadScheduler); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.ofWithScheduler = function (scheduler) { var len = arguments.length, args = new Array(len - 1); for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; } return new FromArrayObservable(args, scheduler); }; var PairsObservable = (function(__super__) { inherits(PairsObservable, __super__); function PairsObservable(o, scheduler) { this._o = o; this._keys = Object.keys(o); this._scheduler = scheduler; __super__.call(this); } function scheduleMethod(o, obj, keys) { return function loopRecursive(i, recurse) { if (i < keys.length) { var key = keys[i]; o.onNext([key, obj[key]]); recurse(i + 1); } else { o.onCompleted(); } }; } PairsObservable.prototype.subscribeCore = function (o) { return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._o, this._keys)); }; return PairsObservable; }(ObservableBase)); /** * Convert an object into an observable sequence of [key, value] pairs. * @param {Object} obj The object to inspect. * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} An observable sequence of [key, value] pairs from the object. */ Observable.pairs = function (obj, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new PairsObservable(obj, scheduler); }; var RangeObservable = (function(__super__) { inherits(RangeObservable, __super__); function RangeObservable(start, count, scheduler) { this.start = start; this.rangeCount = count; this.scheduler = scheduler; __super__.call(this); } function loopRecursive(start, count, o) { return function loop (i, recurse) { if (i < count) { o.onNext(start + i); recurse(i + 1); } else { o.onCompleted(); } }; } RangeObservable.prototype.subscribeCore = function (o) { return this.scheduler.scheduleRecursive( 0, loopRecursive(this.start, this.rangeCount, o) ); }; return RangeObservable; }(ObservableBase)); /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new RangeObservable(start, count, scheduler); }; var RepeatObservable = (function(__super__) { inherits(RepeatObservable, __super__); function RepeatObservable(value, repeatCount, scheduler) { this.value = value; this.repeatCount = repeatCount == null ? -1 : repeatCount; this.scheduler = scheduler; __super__.call(this); } RepeatObservable.prototype.subscribeCore = function (observer) { var sink = new RepeatSink(observer, this); return sink.run(); }; return RepeatObservable; }(ObservableBase)); function RepeatSink(observer, parent) { this.observer = observer; this.parent = parent; } RepeatSink.prototype.run = function () { var observer = this.observer, value = this.parent.value; function loopRecursive(i, recurse) { if (i === -1 || i > 0) { observer.onNext(value); i > 0 && i--; } if (i === 0) { return observer.onCompleted(); } recurse(i); } return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount, loopRecursive); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new RepeatObservable(value, repeatCount, scheduler); }; var JustObservable = (function(__super__) { inherits(JustObservable, __super__); function JustObservable(value, scheduler) { this._value = value; this._scheduler = scheduler; __super__.call(this); } JustObservable.prototype.subscribeCore = function (o) { var state = [this._value, o]; return this._scheduler === immediateScheduler ? scheduleItem(null, state) : this._scheduler.schedule(state, scheduleItem); }; function scheduleItem(s, state) { var value = state[0], observer = state[1]; observer.onNext(value); observer.onCompleted(); return disposableEmpty; } return JustObservable; }(ObservableBase)); /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just' or browsers <IE9. * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new JustObservable(value, scheduler); }; var ThrowObservable = (function(__super__) { inherits(ThrowObservable, __super__); function ThrowObservable(error, scheduler) { this._error = error; this._scheduler = scheduler; __super__.call(this); } ThrowObservable.prototype.subscribeCore = function (o) { var state = [this._error, o]; return this._scheduler === immediateScheduler ? scheduleItem(null, state) : this._scheduler.schedule(state, scheduleItem); }; function scheduleItem(s, state) { var e = state[0], o = state[1]; o.onError(e); return disposableEmpty; } return ThrowObservable; }(ObservableBase)); /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwError' for browsers <IE9. * @param {Mixed} error An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = function (error, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new ThrowObservable(error, scheduler); }; var UsingObservable = (function (__super__) { inherits(UsingObservable, __super__); function UsingObservable(resFn, obsFn) { this._resFn = resFn; this._obsFn = obsFn; __super__.call(this); } UsingObservable.prototype.subscribeCore = function (o) { var disposable = disposableEmpty; var resource = tryCatch(this._resFn)(); if (resource === errorObj) { return new BinaryDisposable(observableThrow(resource.e).subscribe(o), disposable); } resource && (disposable = resource); var source = tryCatch(this._obsFn)(resource); if (source === errorObj) { return new BinaryDisposable(observableThrow(source.e).subscribe(o), disposable); } return new BinaryDisposable(source.subscribe(o), disposable); }; return UsingObservable; }(ObservableBase)); /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new UsingObservable(resourceFactory, observableFactory); }; /** * Propagates the observable sequence or Promise that reacts first. * @param {Observable} rightSource Second observable sequence or Promise. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(rightSource) && (rightSource = observableFromPromise(rightSource)); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } var leftSubscribe = observerCreate( function (left) { choiceL(); choice === leftChoice && observer.onNext(left); }, function (e) { choiceL(); choice === leftChoice && observer.onError(e); }, function () { choiceL(); choice === leftChoice && observer.onCompleted(); } ); var rightSubscribe = observerCreate( function (right) { choiceR(); choice === rightChoice && observer.onNext(right); }, function (e) { choiceR(); choice === rightChoice && observer.onError(e); }, function () { choiceR(); choice === rightChoice && observer.onCompleted(); } ); leftSubscription.setDisposable(leftSource.subscribe(leftSubscribe)); rightSubscription.setDisposable(rightSource.subscribe(rightSubscribe)); return new BinaryDisposable(leftSubscription, rightSubscription); }); }; function amb(p, c) { return p.amb(c); } /** * Propagates the observable sequence or Promise that reacts first. * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items; if (Array.isArray(arguments[0])) { items = arguments[0]; } else { var len = arguments.length; items = new Array(items); for(var i = 0; i < len; i++) { items[i] = arguments[i]; } } for (var i = 0, len = items.length; i < len; i++) { acc = amb(acc, items[i]); } return acc; }; var CatchObservable = (function (__super__) { inherits(CatchObservable, __super__); function CatchObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } CatchObservable.prototype.subscribeCore = function (o) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(this.source.subscribe(new CatchObserver(o, subscription, this._fn))); return subscription; }; return CatchObservable; }(ObservableBase)); var CatchObserver = (function(__super__) { inherits(CatchObserver, __super__); function CatchObserver(o, s, fn) { this._o = o; this._s = s; this._fn = fn; __super__.call(this); } CatchObserver.prototype.next = function (x) { this._o.onNext(x); }; CatchObserver.prototype.completed = function () { return this._o.onCompleted(); }; CatchObserver.prototype.error = function (e) { var result = tryCatch(this._fn)(e); if (result === errorObj) { return this._o.onError(result.e); } isPromise(result) && (result = observableFromPromise(result)); var d = new SingleAssignmentDisposable(); this._s.setDisposable(d); d.setDisposable(result.subscribe(this._o)); }; return CatchObserver; }(AbstractObserver)); /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = function (handlerOrSecond) { return isFunction(handlerOrSecond) ? new CatchObservable(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs. * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable['catch'] = function () { var items; if (Array.isArray(arguments[0])) { items = arguments[0]; } else { var len = arguments.length; items = new Array(len); for(var i = 0; i < len; i++) { items[i] = arguments[i]; } } return enumerableOf(items).catchError(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; function falseFactory() { return false; } function argumentsToArray() { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return args; } var CombineLatestObservable = (function(__super__) { inherits(CombineLatestObservable, __super__); function CombineLatestObservable(params, cb) { this._params = params; this._cb = cb; __super__.call(this); } CombineLatestObservable.prototype.subscribeCore = function(observer) { var len = this._params.length, subscriptions = new Array(len); var state = { hasValue: arrayInitialize(len, falseFactory), hasValueAll: false, isDone: arrayInitialize(len, falseFactory), values: new Array(len) }; for (var i = 0; i < len; i++) { var source = this._params[i], sad = new SingleAssignmentDisposable(); subscriptions[i] = sad; isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(new CombineLatestObserver(observer, i, this._cb, state))); } return new NAryDisposable(subscriptions); }; return CombineLatestObservable; }(ObservableBase)); var CombineLatestObserver = (function (__super__) { inherits(CombineLatestObserver, __super__); function CombineLatestObserver(o, i, cb, state) { this._o = o; this._i = i; this._cb = cb; this._state = state; __super__.call(this); } function notTheSame(i) { return function (x, j) { return j !== i; }; } CombineLatestObserver.prototype.next = function (x) { this._state.values[this._i] = x; this._state.hasValue[this._i] = true; if (this._state.hasValueAll || (this._state.hasValueAll = this._state.hasValue.every(identity))) { var res = tryCatch(this._cb).apply(null, this._state.values); if (res === errorObj) { return this._o.onError(res.e); } this._o.onNext(res); } else if (this._state.isDone.filter(notTheSame(this._i)).every(identity)) { this._o.onCompleted(); } }; CombineLatestObserver.prototype.error = function (e) { this._o.onError(e); }; CombineLatestObserver.prototype.completed = function () { this._state.isDone[this._i] = true; this._state.isDone.every(identity) && this._o.onCompleted(); }; return CombineLatestObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; Array.isArray(args[0]) && (args = args[0]); return new CombineLatestObservable(args, resultSelector); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); } args.unshift(this); return observableConcat.apply(null, args); }; var ConcatObserver = (function(__super__) { inherits(ConcatObserver, __super__); function ConcatObserver(s, fn) { this._s = s; this._fn = fn; __super__.call(this); } ConcatObserver.prototype.next = function (x) { this._s.o.onNext(x); }; ConcatObserver.prototype.error = function (e) { this._s.o.onError(e); }; ConcatObserver.prototype.completed = function () { this._s.i++; this._fn(this._s); }; return ConcatObserver; }(AbstractObserver)); var ConcatObservable = (function(__super__) { inherits(ConcatObservable, __super__); function ConcatObservable(sources) { this._sources = sources; __super__.call(this); } function scheduleRecursive (state, recurse) { if (state.disposable.isDisposed) { return; } if (state.i === state.sources.length) { return state.o.onCompleted(); } // Check if promise var currentValue = state.sources[state.i]; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(currentValue.subscribe(new ConcatObserver(state, recurse))); } ConcatObservable.prototype.subscribeCore = function(o) { var subscription = new SerialDisposable(); var disposable = disposableCreate(noop); var state = { o: o, i: 0, subscription: subscription, disposable: disposable, sources: this._sources }; var cancelable = immediateScheduler.scheduleRecursive(state, scheduleRecursive); return new NAryDisposable([subscription, disposable, cancelable]); }; return ConcatObservable; }(ObservableBase)); /** * Concatenates all the observable sequences. * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence. * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { var args; if (Array.isArray(arguments[0])) { args = arguments[0]; } else { args = new Array(arguments.length); for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; } } return new ConcatObservable(args); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatAll = function () { return this.merge(1); }; var MergeObservable = (function (__super__) { inherits(MergeObservable, __super__); function MergeObservable(source, maxConcurrent) { this.source = source; this.maxConcurrent = maxConcurrent; __super__.call(this); } MergeObservable.prototype.subscribeCore = function(observer) { var g = new CompositeDisposable(); g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g))); return g; }; return MergeObservable; }(ObservableBase)); var MergeObserver = (function (__super__) { function MergeObserver(o, max, g) { this.o = o; this.max = max; this.g = g; this.done = false; this.q = []; this.activeCount = 0; __super__.call(this); } inherits(MergeObserver, __super__); MergeObserver.prototype.handleSubscribe = function (xs) { var sad = new SingleAssignmentDisposable(); this.g.add(sad); isPromise(xs) && (xs = observableFromPromise(xs)); sad.setDisposable(xs.subscribe(new InnerObserver(this, sad))); }; MergeObserver.prototype.next = function (innerSource) { if(this.activeCount < this.max) { this.activeCount++; this.handleSubscribe(innerSource); } else { this.q.push(innerSource); } }; MergeObserver.prototype.error = function (e) { this.o.onError(e); }; MergeObserver.prototype.completed = function () { this.done = true; this.activeCount === 0 && this.o.onCompleted(); }; function InnerObserver(parent, sad) { this.parent = parent; this.sad = sad; __super__.call(this); } inherits(InnerObserver, __super__); InnerObserver.prototype.next = function (x) { this.parent.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this.parent.o.onError(e); }; InnerObserver.prototype.completed = function () { this.parent.g.remove(this.sad); if (this.parent.q.length > 0) { this.parent.handleSubscribe(this.parent.q.shift()); } else { this.parent.activeCount--; this.parent.done && this.parent.activeCount === 0 && this.parent.o.onCompleted(); } }; return MergeObserver; }(AbstractObserver)); /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { return typeof maxConcurrentOrOther !== 'number' ? observableMerge(this, maxConcurrentOrOther) : new MergeObservable(this, maxConcurrentOrOther); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources = [], i, len = arguments.length; if (!arguments[0]) { scheduler = immediateScheduler; for(i = 1; i < len; i++) { sources.push(arguments[i]); } } else if (isScheduler(arguments[0])) { scheduler = arguments[0]; for(i = 1; i < len; i++) { sources.push(arguments[i]); } } else { scheduler = immediateScheduler; for(i = 0; i < len; i++) { sources.push(arguments[i]); } } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableOf(scheduler, sources).mergeAll(); }; var MergeAllObservable = (function (__super__) { inherits(MergeAllObservable, __super__); function MergeAllObservable(source) { this.source = source; __super__.call(this); } MergeAllObservable.prototype.subscribeCore = function (o) { var g = new CompositeDisposable(), m = new SingleAssignmentDisposable(); g.add(m); m.setDisposable(this.source.subscribe(new MergeAllObserver(o, g))); return g; }; return MergeAllObservable; }(ObservableBase)); var MergeAllObserver = (function (__super__) { function MergeAllObserver(o, g) { this.o = o; this.g = g; this.done = false; __super__.call(this); } inherits(MergeAllObserver, __super__); MergeAllObserver.prototype.next = function(innerSource) { var sad = new SingleAssignmentDisposable(); this.g.add(sad); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); sad.setDisposable(innerSource.subscribe(new InnerObserver(this, sad))); }; MergeAllObserver.prototype.error = function (e) { this.o.onError(e); }; MergeAllObserver.prototype.completed = function () { this.done = true; this.g.length === 1 && this.o.onCompleted(); }; function InnerObserver(parent, sad) { this.parent = parent; this.sad = sad; __super__.call(this); } inherits(InnerObserver, __super__); InnerObserver.prototype.next = function (x) { this.parent.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this.parent.o.onError(e); }; InnerObserver.prototype.completed = function () { this.parent.g.remove(this.sad); this.parent.done && this.parent.g.length === 1 && this.parent.o.onCompleted(); }; return MergeAllObserver; }(AbstractObserver)); /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeAll = function () { return new MergeAllObservable(this); }; var CompositeError = Rx.CompositeError = function(errors) { this.innerErrors = errors; this.message = 'This contains multiple errors. Check the innerErrors'; Error.call(this); }; CompositeError.prototype = Object.create(Error.prototype); CompositeError.prototype.name = 'CompositeError'; var MergeDelayErrorObservable = (function(__super__) { inherits(MergeDelayErrorObservable, __super__); function MergeDelayErrorObservable(source) { this.source = source; __super__.call(this); } MergeDelayErrorObservable.prototype.subscribeCore = function (o) { var group = new CompositeDisposable(), m = new SingleAssignmentDisposable(), state = { isStopped: false, errors: [], o: o }; group.add(m); m.setDisposable(this.source.subscribe(new MergeDelayErrorObserver(group, state))); return group; }; return MergeDelayErrorObservable; }(ObservableBase)); var MergeDelayErrorObserver = (function(__super__) { inherits(MergeDelayErrorObserver, __super__); function MergeDelayErrorObserver(group, state) { this._group = group; this._state = state; __super__.call(this); } function setCompletion(o, errors) { if (errors.length === 0) { o.onCompleted(); } else if (errors.length === 1) { o.onError(errors[0]); } else { o.onError(new CompositeError(errors)); } } MergeDelayErrorObserver.prototype.next = function (x) { var inner = new SingleAssignmentDisposable(); this._group.add(inner); // Check for promises support isPromise(x) && (x = observableFromPromise(x)); inner.setDisposable(x.subscribe(new InnerObserver(inner, this._group, this._state))); }; MergeDelayErrorObserver.prototype.error = function (e) { this._state.errors.push(e); this._state.isStopped = true; this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; MergeDelayErrorObserver.prototype.completed = function () { this._state.isStopped = true; this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; inherits(InnerObserver, __super__); function InnerObserver(inner, group, state) { this._inner = inner; this._group = group; this._state = state; __super__.call(this); } InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this._state.errors.push(e); this._group.remove(this._inner); this._state.isStopped && this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; InnerObserver.prototype.completed = function () { this._group.remove(this._inner); this._state.isStopped && this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; return MergeDelayErrorObserver; }(AbstractObserver)); /** * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to * receive all successfully emitted items from all of the source Observables without being interrupted by * an error notification from one of them. * * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an * error via the Observer's onError, mergeDelayError will refrain from propagating that * error notification until all of the merged Observables have finished emitting items. * @param {Array | Arguments} args Arguments or an array to merge. * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable */ Observable.mergeDelayError = function() { var args; if (Array.isArray(arguments[0])) { args = arguments[0]; } else { var len = arguments.length; args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } } var source = observableOf(null, args); return new MergeDelayErrorObservable(source); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; var OnErrorResumeNextObservable = (function(__super__) { inherits(OnErrorResumeNextObservable, __super__); function OnErrorResumeNextObservable(sources) { this.sources = sources; __super__.call(this); } function scheduleMethod(state, recurse) { if (state.pos < state.sources.length) { var current = state.sources[state.pos++]; isPromise(current) && (current = observableFromPromise(current)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(current.subscribe(new OnErrorResumeNextObserver(state, recurse))); } else { state.o.onCompleted(); } } OnErrorResumeNextObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(), state = {pos: 0, subscription: subscription, o: o, sources: this.sources }, cancellable = immediateScheduler.scheduleRecursive(state, scheduleMethod); return new BinaryDisposable(subscription, cancellable); }; return OnErrorResumeNextObservable; }(ObservableBase)); var OnErrorResumeNextObserver = (function(__super__) { inherits(OnErrorResumeNextObserver, __super__); function OnErrorResumeNextObserver(state, recurse) { this._state = state; this._recurse = recurse; __super__.call(this); } OnErrorResumeNextObserver.prototype.next = function (x) { this._state.o.onNext(x); }; OnErrorResumeNextObserver.prototype.error = function () { this._recurse(this._state); }; OnErrorResumeNextObserver.prototype.completed = function () { this._recurse(this._state); }; return OnErrorResumeNextObserver; }(AbstractObserver)); /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = []; if (Array.isArray(arguments[0])) { sources = arguments[0]; } else { var len = arguments.length; sources = new Array(len); for(var i = 0; i < len; i++) { sources[i] = arguments[i]; } } return new OnErrorResumeNextObservable(sources); }; var SkipUntilObservable = (function(__super__) { inherits(SkipUntilObservable, __super__); function SkipUntilObservable(source, other) { this._s = source; this._o = isPromise(other) ? observableFromPromise(other) : other; this._open = false; __super__.call(this); } SkipUntilObservable.prototype.subscribeCore = function(o) { var leftSubscription = new SingleAssignmentDisposable(); leftSubscription.setDisposable(this._s.subscribe(new SkipUntilSourceObserver(o, this))); isPromise(this._o) && (this._o = observableFromPromise(this._o)); var rightSubscription = new SingleAssignmentDisposable(); rightSubscription.setDisposable(this._o.subscribe(new SkipUntilOtherObserver(o, this, rightSubscription))); return new BinaryDisposable(leftSubscription, rightSubscription); }; return SkipUntilObservable; }(ObservableBase)); var SkipUntilSourceObserver = (function(__super__) { inherits(SkipUntilSourceObserver, __super__); function SkipUntilSourceObserver(o, p) { this._o = o; this._p = p; __super__.call(this); } SkipUntilSourceObserver.prototype.next = function (x) { this._p._open && this._o.onNext(x); }; SkipUntilSourceObserver.prototype.error = function (err) { this._o.onError(err); }; SkipUntilSourceObserver.prototype.onCompleted = function () { this._p._open && this._o.onCompleted(); }; return SkipUntilSourceObserver; }(AbstractObserver)); var SkipUntilOtherObserver = (function(__super__) { inherits(SkipUntilOtherObserver, __super__); function SkipUntilOtherObserver(o, p, r) { this._o = o; this._p = p; this._r = r; __super__.call(this); } SkipUntilOtherObserver.prototype.next = function () { this._p._open = true; this._r.dispose(); }; SkipUntilOtherObserver.prototype.error = function (err) { this._o.onError(err); }; SkipUntilOtherObserver.prototype.onCompleted = function () { this._r.dispose(); }; return SkipUntilOtherObserver; }(AbstractObserver)); /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { return new SkipUntilObservable(this, other); }; var SwitchObservable = (function(__super__) { inherits(SwitchObservable, __super__); function SwitchObservable(source) { this.source = source; __super__.call(this); } SwitchObservable.prototype.subscribeCore = function (o) { var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner)); return new BinaryDisposable(s, inner); }; inherits(SwitchObserver, AbstractObserver); function SwitchObserver(o, inner) { this.o = o; this.inner = inner; this.stopped = false; this.latest = 0; this.hasLatest = false; AbstractObserver.call(this); } SwitchObserver.prototype.next = function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++this.latest; this.hasLatest = true; this.inner.setDisposable(d); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); d.setDisposable(innerSource.subscribe(new InnerObserver(this, id))); }; SwitchObserver.prototype.error = function (e) { this.o.onError(e); }; SwitchObserver.prototype.completed = function () { this.stopped = true; !this.hasLatest && this.o.onCompleted(); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(parent, id) { this.parent = parent; this.id = id; AbstractObserver.call(this); } InnerObserver.prototype.next = function (x) { this.parent.latest === this.id && this.parent.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this.parent.latest === this.id && this.parent.o.onError(e); }; InnerObserver.prototype.completed = function () { if (this.parent.latest === this.id) { this.parent.hasLatest = false; this.parent.stopped && this.parent.o.onCompleted(); } }; return SwitchObservable; }(ObservableBase)); /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { return new SwitchObservable(this); }; var TakeUntilObservable = (function(__super__) { inherits(TakeUntilObservable, __super__); function TakeUntilObservable(source, other) { this.source = source; this.other = isPromise(other) ? observableFromPromise(other) : other; __super__.call(this); } TakeUntilObservable.prototype.subscribeCore = function(o) { return new BinaryDisposable( this.source.subscribe(o), this.other.subscribe(new TakeUntilObserver(o)) ); }; return TakeUntilObservable; }(ObservableBase)); var TakeUntilObserver = (function(__super__) { inherits(TakeUntilObserver, __super__); function TakeUntilObserver(o) { this._o = o; __super__.call(this); } TakeUntilObserver.prototype.next = function () { this._o.onCompleted(); }; TakeUntilObserver.prototype.error = function (err) { this._o.onError(err); }; TakeUntilObserver.prototype.onCompleted = noop; return TakeUntilObserver; }(AbstractObserver)); /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { return new TakeUntilObservable(this, other); }; function falseFactory() { return false; } function argumentsToArray() { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return args; } var WithLatestFromObservable = (function(__super__) { inherits(WithLatestFromObservable, __super__); function WithLatestFromObservable(source, sources, resultSelector) { this._s = source; this._ss = sources; this._cb = resultSelector; __super__.call(this); } WithLatestFromObservable.prototype.subscribeCore = function (o) { var len = this._ss.length; var state = { hasValue: arrayInitialize(len, falseFactory), hasValueAll: false, values: new Array(len) }; var n = this._ss.length, subscriptions = new Array(n + 1); for (var i = 0; i < n; i++) { var other = this._ss[i], sad = new SingleAssignmentDisposable(); isPromise(other) && (other = observableFromPromise(other)); sad.setDisposable(other.subscribe(new WithLatestFromOtherObserver(o, i, state))); subscriptions[i] = sad; } var outerSad = new SingleAssignmentDisposable(); outerSad.setDisposable(this._s.subscribe(new WithLatestFromSourceObserver(o, this._cb, state))); subscriptions[n] = outerSad; return new NAryDisposable(subscriptions); }; return WithLatestFromObservable; }(ObservableBase)); var WithLatestFromOtherObserver = (function (__super__) { inherits(WithLatestFromOtherObserver, __super__); function WithLatestFromOtherObserver(o, i, state) { this._o = o; this._i = i; this._state = state; __super__.call(this); } WithLatestFromOtherObserver.prototype.next = function (x) { this._state.values[this._i] = x; this._state.hasValue[this._i] = true; this._state.hasValueAll = this._state.hasValue.every(identity); }; WithLatestFromOtherObserver.prototype.error = function (e) { this._o.onError(e); }; WithLatestFromOtherObserver.prototype.completed = noop; return WithLatestFromOtherObserver; }(AbstractObserver)); var WithLatestFromSourceObserver = (function (__super__) { inherits(WithLatestFromSourceObserver, __super__); function WithLatestFromSourceObserver(o, cb, state) { this._o = o; this._cb = cb; this._state = state; __super__.call(this); } WithLatestFromSourceObserver.prototype.next = function (x) { var allValues = [x].concat(this._state.values); if (!this._state.hasValueAll) { return; } var res = tryCatch(this._cb).apply(null, allValues); if (res === errorObj) { return this._o.onError(res.e); } this._o.onNext(res); }; WithLatestFromSourceObserver.prototype.error = function (e) { this._o.onError(e); }; WithLatestFromSourceObserver.prototype.completed = function () { this._o.onCompleted(); }; return WithLatestFromSourceObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.withLatestFrom = function () { if (arguments.length === 0) { throw new Error('invalid arguments'); } var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; Array.isArray(args[0]) && (args = args[0]); return new WithLatestFromObservable(this, args, resultSelector); }; function falseFactory() { return false; } function emptyArrayFactory() { return []; } var ZipObservable = (function(__super__) { inherits(ZipObservable, __super__); function ZipObservable(sources, resultSelector) { this._s = sources; this._cb = resultSelector; __super__.call(this); } ZipObservable.prototype.subscribeCore = function(observer) { var n = this._s.length, subscriptions = new Array(n), done = arrayInitialize(n, falseFactory), q = arrayInitialize(n, emptyArrayFactory); for (var i = 0; i < n; i++) { var source = this._s[i], sad = new SingleAssignmentDisposable(); subscriptions[i] = sad; isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(new ZipObserver(observer, i, this, q, done))); } return new NAryDisposable(subscriptions); }; return ZipObservable; }(ObservableBase)); var ZipObserver = (function (__super__) { inherits(ZipObserver, __super__); function ZipObserver(o, i, p, q, d) { this._o = o; this._i = i; this._p = p; this._q = q; this._d = d; __super__.call(this); } function notEmpty(x) { return x.length > 0; } function shiftEach(x) { return x.shift(); } function notTheSame(i) { return function (x, j) { return j !== i; }; } ZipObserver.prototype.next = function (x) { this._q[this._i].push(x); if (this._q.every(notEmpty)) { var queuedValues = this._q.map(shiftEach); var res = tryCatch(this._p._cb).apply(null, queuedValues); if (res === errorObj) { return this._o.onError(res.e); } this._o.onNext(res); } else if (this._d.filter(notTheSame(this._i)).every(identity)) { this._o.onCompleted(); } }; ZipObserver.prototype.error = function (e) { this._o.onError(e); }; ZipObserver.prototype.completed = function () { this._d[this._i] = true; this._d.every(identity) && this._o.onCompleted(); }; return ZipObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. */ observableProto.zip = function () { if (arguments.length === 0) { throw new Error('invalid arguments'); } var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; Array.isArray(args[0]) && (args = args[0]); var parent = this; args.unshift(parent); return new ZipObservable(args, resultSelector); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } if (Array.isArray(args[0])) { args = isFunction(args[1]) ? args[0].concat(args[1]) : args[0]; } var first = args.shift(); return first.zip.apply(first, args); }; function falseFactory() { return false; } function emptyArrayFactory() { return []; } function argumentsToArray() { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return args; } var ZipIterableObservable = (function(__super__) { inherits(ZipIterableObservable, __super__); function ZipIterableObservable(sources, cb) { this.sources = sources; this._cb = cb; __super__.call(this); } ZipIterableObservable.prototype.subscribeCore = function (o) { var sources = this.sources, len = sources.length, subscriptions = new Array(len); var state = { q: arrayInitialize(len, emptyArrayFactory), done: arrayInitialize(len, falseFactory), cb: this._cb, o: o }; for (var i = 0; i < len; i++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); subscriptions[i] = sad; sad.setDisposable(source.subscribe(new ZipIterableObserver(state, i))); }(i)); } return new NAryDisposable(subscriptions); }; return ZipIterableObservable; }(ObservableBase)); var ZipIterableObserver = (function (__super__) { inherits(ZipIterableObserver, __super__); function ZipIterableObserver(s, i) { this._s = s; this._i = i; __super__.call(this); } function notEmpty(x) { return x.length > 0; } function shiftEach(x) { return x.shift(); } function notTheSame(i) { return function (x, j) { return j !== i; }; } ZipIterableObserver.prototype.next = function (x) { this._s.q[this._i].push(x); if (this._s.q.every(notEmpty)) { var queuedValues = this._s.q.map(shiftEach), res = tryCatch(this._s.cb).apply(null, queuedValues); if (res === errorObj) { return this._s.o.onError(res.e); } this._s.o.onNext(res); } else if (this._s.done.filter(notTheSame(this._i)).every(identity)) { this._s.o.onCompleted(); } }; ZipIterableObserver.prototype.error = function (e) { this._s.o.onError(e); }; ZipIterableObserver.prototype.completed = function () { this._s.done[this._i] = true; this._s.done.every(identity) && this._s.o.onCompleted(); }; return ZipIterableObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. */ observableProto.zipIterable = function () { if (arguments.length === 0) { throw new Error('invalid arguments'); } var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; var parent = this; args.unshift(parent); return new ZipIterableObservable(args, resultSelector); }; function asObservable(source) { return function subscribe(o) { return source.subscribe(o); }; } /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { return new AnonymousObservable(asObservable(this), this); }; function toArray(x) { return x.toArray(); } function notEmpty(x) { return x.length > 0; } /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = observableProto.bufferCount = function (count, skip) { typeof skip !== 'number' && (skip = count); return this.windowWithCount(count, skip) .flatMap(toArray) .filter(notEmpty); }; var DematerializeObservable = (function (__super__) { inherits(DematerializeObservable, __super__); function DematerializeObservable(source) { this.source = source; __super__.call(this); } DematerializeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DematerializeObserver(o)); }; return DematerializeObservable; }(ObservableBase)); var DematerializeObserver = (function (__super__) { inherits(DematerializeObserver, __super__); function DematerializeObserver(o) { this._o = o; __super__.call(this); } DematerializeObserver.prototype.next = function (x) { x.accept(this._o); }; DematerializeObserver.prototype.error = function (e) { this._o.onError(e); }; DematerializeObserver.prototype.completed = function () { this._o.onCompleted(); }; return DematerializeObserver; }(AbstractObserver)); /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { return new DematerializeObservable(this); }; var DistinctUntilChangedObservable = (function(__super__) { inherits(DistinctUntilChangedObservable, __super__); function DistinctUntilChangedObservable(source, keyFn, comparer) { this.source = source; this.keyFn = keyFn; this.comparer = comparer; __super__.call(this); } DistinctUntilChangedObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DistinctUntilChangedObserver(o, this.keyFn, this.comparer)); }; return DistinctUntilChangedObservable; }(ObservableBase)); var DistinctUntilChangedObserver = (function(__super__) { inherits(DistinctUntilChangedObserver, __super__); function DistinctUntilChangedObserver(o, keyFn, comparer) { this.o = o; this.keyFn = keyFn; this.comparer = comparer; this.hasCurrentKey = false; this.currentKey = null; __super__.call(this); } DistinctUntilChangedObserver.prototype.next = function (x) { var key = x, comparerEquals; if (isFunction(this.keyFn)) { key = tryCatch(this.keyFn)(x); if (key === errorObj) { return this.o.onError(key.e); } } if (this.hasCurrentKey) { comparerEquals = tryCatch(this.comparer)(this.currentKey, key); if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); } } if (!this.hasCurrentKey || !comparerEquals) { this.hasCurrentKey = true; this.currentKey = key; this.o.onNext(x); } }; DistinctUntilChangedObserver.prototype.error = function(e) { this.o.onError(e); }; DistinctUntilChangedObserver.prototype.completed = function () { this.o.onCompleted(); }; return DistinctUntilChangedObserver; }(AbstractObserver)); /** * Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer. * @param {Function} [keyFn] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keyFn, comparer) { comparer || (comparer = defaultComparer); return new DistinctUntilChangedObservable(this, keyFn, comparer); }; var TapObservable = (function(__super__) { inherits(TapObservable,__super__); function TapObservable(source, observerOrOnNext, onError, onCompleted) { this.source = source; this._oN = observerOrOnNext; this._oE = onError; this._oC = onCompleted; __super__.call(this); } TapObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new InnerObserver(o, this)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o, p) { this.o = o; this.t = !p._oN || isFunction(p._oN) ? observerCreate(p._oN || noop, p._oE || noop, p._oC || noop) : p._oN; this.isStopped = false; AbstractObserver.call(this); } InnerObserver.prototype.next = function(x) { var res = tryCatch(this.t.onNext).call(this.t, x); if (res === errorObj) { this.o.onError(res.e); } this.o.onNext(x); }; InnerObserver.prototype.error = function(err) { var res = tryCatch(this.t.onError).call(this.t, err); if (res === errorObj) { return this.o.onError(res.e); } this.o.onError(err); }; InnerObserver.prototype.completed = function() { var res = tryCatch(this.t.onCompleted).call(this.t); if (res === errorObj) { return this.o.onError(res.e); } this.o.onCompleted(); }; return TapObservable; }(ObservableBase)); /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { return new TapObservable(this, observerOrOnNext, onError, onCompleted); }; /** * Invokes an action for each element in the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onNext Action to invoke for each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext); }; /** * Invokes an action upon exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError); }; /** * Invokes an action upon graceful termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted); }; var FinallyObservable = (function (__super__) { inherits(FinallyObservable, __super__); function FinallyObservable(source, fn, thisArg) { this.source = source; this._fn = bindCallback(fn, thisArg, 0); __super__.call(this); } FinallyObservable.prototype.subscribeCore = function (o) { var d = tryCatch(this.source.subscribe).call(this.source, o); if (d === errorObj) { this._fn(); thrower(d.e); } return new FinallyDisposable(d, this._fn); }; function FinallyDisposable(s, fn) { this.isDisposed = false; this._s = s; this._fn = fn; } FinallyDisposable.prototype.dispose = function () { if (!this.isDisposed) { var res = tryCatch(this._s.dispose).call(this._s); this._fn(); res === errorObj && thrower(res.e); } }; return FinallyObservable; }(ObservableBase)); /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = function (action, thisArg) { return new FinallyObservable(this, action, thisArg); }; var IgnoreElementsObservable = (function(__super__) { inherits(IgnoreElementsObservable, __super__); function IgnoreElementsObservable(source) { this.source = source; __super__.call(this); } IgnoreElementsObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o)); }; function InnerObserver(o) { this.o = o; this.isStopped = false; } InnerObserver.prototype.onNext = noop; InnerObserver.prototype.onError = function (err) { if(!this.isStopped) { this.isStopped = true; this.o.onError(err); } }; InnerObserver.prototype.onCompleted = function () { if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); } }; InnerObserver.prototype.dispose = function() { this.isStopped = true; }; InnerObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.observer.onError(e); return true; } return false; }; return IgnoreElementsObservable; }(ObservableBase)); /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { return new IgnoreElementsObservable(this); }; var MaterializeObservable = (function (__super__) { inherits(MaterializeObservable, __super__); function MaterializeObservable(source, fn) { this.source = source; __super__.call(this); } MaterializeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new MaterializeObserver(o)); }; return MaterializeObservable; }(ObservableBase)); var MaterializeObserver = (function (__super__) { inherits(MaterializeObserver, __super__); function MaterializeObserver(o) { this._o = o; __super__.call(this); } MaterializeObserver.prototype.next = function (x) { this._o.onNext(notificationCreateOnNext(x)) }; MaterializeObserver.prototype.error = function (e) { this._o.onNext(notificationCreateOnError(e)); this._o.onCompleted(); }; MaterializeObserver.prototype.completed = function () { this._o.onNext(notificationCreateOnCompleted()); this._o.onCompleted(); }; return MaterializeObserver; }(AbstractObserver)); /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { return new MaterializeObservable(this); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchError(); }; function repeat(value) { return { '@@iterator': function () { return { next: function () { return { done: false, value: value }; } }; } }; } var RetryWhenObservable = (function(__super__) { function createDisposable(state) { return { isDisposed: false, dispose: function () { if (!this.isDisposed) { this.isDisposed = true; state.isDisposed = true; } } }; } function RetryWhenObservable(source, notifier) { this.source = source; this._notifier = notifier; __super__.call(this); } inherits(RetryWhenObservable, __super__); RetryWhenObservable.prototype.subscribeCore = function (o) { var exceptions = new Subject(), notifier = new Subject(), handled = this._notifier(exceptions), notificationDisposable = handled.subscribe(notifier); var e = this.source['@@iterator'](); var state = { isDisposed: false }, lastError, subscription = new SerialDisposable(); var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, recurse) { if (state.isDisposed) { return; } var currentItem = e.next(); if (currentItem.done) { if (lastError) { o.onError(lastError); } else { o.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var outer = new SingleAssignmentDisposable(); var inner = new SingleAssignmentDisposable(); subscription.setDisposable(new BinaryDisposable(inner, outer)); outer.setDisposable(currentValue.subscribe( function(x) { o.onNext(x); }, function (exn) { inner.setDisposable(notifier.subscribe(recurse, function(ex) { o.onError(ex); }, function() { o.onCompleted(); })); exceptions.onNext(exn); outer.dispose(); }, function() { o.onCompleted(); })); }); return new NAryDisposable([notificationDisposable, subscription, cancelable, createDisposable(state)]); }; return RetryWhenObservable; }(ObservableBase)); observableProto.retryWhen = function (notifier) { return new RetryWhenObservable(repeat(this), notifier); }; function repeat(value) { return { '@@iterator': function () { return { next: function () { return { done: false, value: value }; } }; } }; } var RepeatWhenObservable = (function(__super__) { function createDisposable(state) { return { isDisposed: false, dispose: function () { if (!this.isDisposed) { this.isDisposed = true; state.isDisposed = true; } } }; } function RepeatWhenObservable(source, notifier) { this.source = source; this._notifier = notifier; __super__.call(this); } inherits(RepeatWhenObservable, __super__); RepeatWhenObservable.prototype.subscribeCore = function (o) { var completions = new Subject(), notifier = new Subject(), handled = this._notifier(completions), notificationDisposable = handled.subscribe(notifier); var e = this.source['@@iterator'](); var state = { isDisposed: false }, lastError, subscription = new SerialDisposable(); var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, recurse) { if (state.isDisposed) { return; } var currentItem = e.next(); if (currentItem.done) { if (lastError) { o.onError(lastError); } else { o.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var outer = new SingleAssignmentDisposable(); var inner = new SingleAssignmentDisposable(); subscription.setDisposable(new BinaryDisposable(inner, outer)); outer.setDisposable(currentValue.subscribe( function(x) { o.onNext(x); }, function (exn) { o.onError(exn); }, function() { inner.setDisposable(notifier.subscribe(recurse, function(ex) { o.onError(ex); }, function() { o.onCompleted(); })); completions.onNext(null); outer.dispose(); })); }); return new NAryDisposable([notificationDisposable, subscription, cancelable, createDisposable(state)]); }; return RepeatWhenObservable; }(ObservableBase)); observableProto.repeatWhen = function (notifier) { return new RepeatWhenObservable(repeat(this), notifier); }; var ScanObservable = (function(__super__) { inherits(ScanObservable, __super__); function ScanObservable(source, accumulator, hasSeed, seed) { this.source = source; this.accumulator = accumulator; this.hasSeed = hasSeed; this.seed = seed; __super__.call(this); } ScanObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new ScanObserver(o,this)); }; return ScanObservable; }(ObservableBase)); var ScanObserver = (function (__super__) { inherits(ScanObserver, __super__); function ScanObserver(o, parent) { this._o = o; this._p = parent; this._fn = parent.accumulator; this._hs = parent.hasSeed; this._s = parent.seed; this._ha = false; this._a = null; this._hv = false; this._i = 0; __super__.call(this); } ScanObserver.prototype.next = function (x) { !this._hv && (this._hv = true); if (this._ha) { this._a = tryCatch(this._fn)(this._a, x, this._i, this._p); } else { this._a = this._hs ? tryCatch(this._fn)(this._s, x, this._i, this._p) : x; this._ha = true; } if (this._a === errorObj) { return this._o.onError(this._a.e); } this._o.onNext(this._a); this._i++; }; ScanObserver.prototype.error = function (e) { this._o.onError(e); }; ScanObserver.prototype.completed = function () { !this._hv && this._hs && this._o.onNext(this._s); this._o.onCompleted(); }; return ScanObserver; }(AbstractObserver)); /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator = arguments[0]; if (arguments.length === 2) { hasSeed = true; seed = arguments[1]; } return new ScanObservable(this, accumulator, hasSeed, seed); }; var SkipLastObservable = (function (__super__) { inherits(SkipLastObservable, __super__); function SkipLastObservable(source, c) { this.source = source; this._c = c; __super__.call(this); } SkipLastObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SkipLastObserver(o, this._c)); }; return SkipLastObservable; }(ObservableBase)); var SkipLastObserver = (function (__super__) { inherits(SkipLastObserver, __super__); function SkipLastObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } SkipLastObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._o.onNext(this._q.shift()); }; SkipLastObserver.prototype.error = function (e) { this._o.onError(e); }; SkipLastObserver.prototype.completed = function () { this._o.onCompleted(); }; return SkipLastObserver; }(AbstractObserver)); /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } return new SkipLastObservable(this, count); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * @example * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * @param {Arguments} args The specified values to prepend to the observable sequence * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && isScheduler(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); } return observableConcat.apply(null, [observableFromArray(args, scheduler), this]); }; var TakeLastObserver = (function (__super__) { inherits(TakeLastObserver, __super__); function TakeLastObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } TakeLastObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._q.shift(); }; TakeLastObserver.prototype.error = function (e) { this._o.onError(e); }; TakeLastObserver.prototype.completed = function () { while (this._q.length > 0) { this._o.onNext(this._q.shift()); } this._o.onCompleted(); }; return TakeLastObserver; }(AbstractObserver)); /** * Returns a specified number of contiguous elements from the end of an observable sequence. * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } var source = this; return new AnonymousObservable(function (o) { return source.subscribe(new TakeLastObserver(o, count)); }, source); }; var TakeLastBufferObserver = (function (__super__) { inherits(TakeLastBufferObserver, __super__); function TakeLastBufferObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } TakeLastBufferObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._q.shift(); }; TakeLastBufferObserver.prototype.error = function (e) { this._o.onError(e); }; TakeLastBufferObserver.prototype.completed = function () { this._o.onNext(this._q); this._o.onCompleted(); }; return TakeLastBufferObserver; }(AbstractObserver)); /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } var source = this; return new AnonymousObservable(function (o) { return source.subscribe(new TakeLastBufferObserver(o, count)); }, source); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = observableProto.windowCount = function (count, skip) { var source = this; +count || (count = 0); Math.abs(count) === Infinity && (count = 0); if (count <= 0) { throw new ArgumentOutOfRangeError(); } skip == null && (skip = count); +skip || (skip = 0); Math.abs(skip) === Infinity && (skip = 0); if (skip <= 0) { throw new ArgumentOutOfRangeError(); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = []; function createWindow () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } createWindow(); m.setDisposable(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; c >= 0 && c % skip === 0 && q.shift().onCompleted(); ++n % skip === 0 && createWindow(); }, function (e) { while (q.length > 0) { q.shift().onError(e); } observer.onError(e); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }, source); }; observableProto.flatMapConcat = observableProto.concatMap = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(1); }; /** * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) { var source = this, onNextFunc = bindCallback(onNext, thisArg, 2), onErrorFunc = bindCallback(onError, thisArg, 1), onCompletedFunc = bindCallback(onCompleted, thisArg, 0); return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNextFunc(x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onErrorFunc(err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompletedFunc(); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }, this).concatAll(); }; var DefaultIfEmptyObserver = (function (__super__) { inherits(DefaultIfEmptyObserver, __super__); function DefaultIfEmptyObserver(o, d) { this._o = o; this._d = d; this._f = false; __super__.call(this); } DefaultIfEmptyObserver.prototype.next = function (x) { this._f = true; this._o.onNext(x); }; DefaultIfEmptyObserver.prototype.error = function (e) { this._o.onError(e); }; DefaultIfEmptyObserver.prototype.completed = function () { !this._f && this._o.onNext(this._d); this._o.onCompleted(); }; return DefaultIfEmptyObserver; }(AbstractObserver)); /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; defaultValue === undefined && (defaultValue = null); return new AnonymousObservable(function (o) { return source.subscribe(new DefaultIfEmptyObserver(o, defaultValue)); }, source); }; // Swap out for Array.findIndex function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; } function HashSet(comparer) { this.comparer = comparer; this.set = []; } HashSet.prototype.push = function(value) { var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; retValue && this.set.push(value); return retValue; }; var DistinctObservable = (function (__super__) { inherits(DistinctObservable, __super__); function DistinctObservable(source, keyFn, cmpFn) { this.source = source; this._keyFn = keyFn; this._cmpFn = cmpFn; __super__.call(this); } DistinctObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DistinctObserver(o, this._keyFn, this._cmpFn)); }; return DistinctObservable; }(ObservableBase)); var DistinctObserver = (function (__super__) { inherits(DistinctObserver, __super__); function DistinctObserver(o, keyFn, cmpFn) { this._o = o; this._keyFn = keyFn; this._h = new HashSet(cmpFn); __super__.call(this); } DistinctObserver.prototype.next = function (x) { var key = x; if (isFunction(this._keyFn)) { key = tryCatch(this._keyFn)(x); if (key === errorObj) { return this._o.onError(key.e); } } this._h.push(key) && this._o.onNext(x); }; DistinctObserver.prototype.error = function (e) { this._o.onError(e); }; DistinctObserver.prototype.completed = function () { this._o.onCompleted(); }; return DistinctObserver; }(AbstractObserver)); /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [comparer] Used to compare items in the collection. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, comparer) { comparer || (comparer = defaultComparer); return new DistinctObservable(this, keySelector, comparer); }; var MapObservable = (function (__super__) { inherits(MapObservable, __super__); function MapObservable(source, selector, thisArg) { this.source = source; this.selector = bindCallback(selector, thisArg, 3); __super__.call(this); } function innerMap(selector, self) { return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }; } MapObservable.prototype.internalMap = function (selector, thisArg) { return new MapObservable(this.source, innerMap(selector, this), thisArg); }; MapObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o, this.selector, this)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o, selector, source) { this.o = o; this.selector = selector; this.source = source; this.i = 0; AbstractObserver.call(this); } InnerObserver.prototype.next = function(x) { var result = tryCatch(this.selector)(x, this.i++, this.source); if (result === errorObj) { return this.o.onError(result.e); } this.o.onNext(result); }; InnerObserver.prototype.error = function (e) { this.o.onError(e); }; InnerObserver.prototype.completed = function () { this.o.onCompleted(); }; return MapObservable; }(ObservableBase)); /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.map = observableProto.select = function (selector, thisArg) { var selectorFn = typeof selector === 'function' ? selector : function () { return selector; }; return this instanceof MapObservable ? this.internalMap(selectorFn, thisArg) : new MapObservable(this, selectorFn, thisArg); }; function plucker(args, len) { return function mapper(x) { var currentProp = x; for (var i = 0; i < len; i++) { var p = currentProp[args[i]]; if (typeof p !== 'undefined') { currentProp = p; } else { return undefined; } } return currentProp; }; } /** * Retrieves the value of a specified nested property from all elements in * the Observable sequence. * @param {Arguments} arguments The nested properties to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function () { var len = arguments.length, args = new Array(len); if (len === 0) { throw new Error('List of properties cannot be empty.'); } for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return this.map(plucker(args, len)); }; observableProto.flatMap = observableProto.selectMany = observableProto.mergeMap = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).mergeAll(); }; /** * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }, source).mergeAll(); }; observableProto.flatMapLatest = observableProto.switchMap = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).switchLatest(); }; var SkipObservable = (function(__super__) { inherits(SkipObservable, __super__); function SkipObservable(source, count) { this.source = source; this._count = count; __super__.call(this); } SkipObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SkipObserver(o, this._count)); }; function SkipObserver(o, c) { this._o = o; this._r = c; AbstractObserver.call(this); } inherits(SkipObserver, AbstractObserver); SkipObserver.prototype.next = function (x) { if (this._r <= 0) { this._o.onNext(x); } else { this._r--; } }; SkipObserver.prototype.error = function(e) { this._o.onError(e); }; SkipObserver.prototype.completed = function() { this._o.onCompleted(); }; return SkipObservable; }(ObservableBase)); /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } return new SkipObservable(this, count); }; var SkipWhileObservable = (function (__super__) { inherits(SkipWhileObservable, __super__); function SkipWhileObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } SkipWhileObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SkipWhileObserver(o, this)); }; return SkipWhileObservable; }(ObservableBase)); var SkipWhileObserver = (function (__super__) { inherits(SkipWhileObserver, __super__); function SkipWhileObserver(o, p) { this._o = o; this._p = p; this._i = 0; this._r = false; __super__.call(this); } SkipWhileObserver.prototype.next = function (x) { if (!this._r) { var res = tryCatch(this._p._fn)(x, this._i++, this._p); if (res === errorObj) { return this._o.onError(res.e); } this._r = !res; } this._r && this._o.onNext(x); }; SkipWhileObserver.prototype.error = function (e) { this._o.onError(e); }; SkipWhileObserver.prototype.completed = function () { this._o.onCompleted(); }; return SkipWhileObserver; }(AbstractObserver)); /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var fn = bindCallback(predicate, thisArg, 3); return new SkipWhileObservable(this, fn); }; var TakeObservable = (function(__super__) { inherits(TakeObservable, __super__); function TakeObservable(source, count) { this.source = source; this._count = count; __super__.call(this); } TakeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new TakeObserver(o, this._count)); }; function TakeObserver(o, c) { this._o = o; this._c = c; this._r = c; AbstractObserver.call(this); } inherits(TakeObserver, AbstractObserver); TakeObserver.prototype.next = function (x) { if (this._r-- > 0) { this._o.onNext(x); this._r <= 0 && this._o.onCompleted(); } }; TakeObserver.prototype.error = function (e) { this._o.onError(e); }; TakeObserver.prototype.completed = function () { this._o.onCompleted(); }; return TakeObservable; }(ObservableBase)); /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new ArgumentOutOfRangeError(); } if (count === 0) { return observableEmpty(scheduler); } return new TakeObservable(this, count); }; var TakeWhileObservable = (function (__super__) { inherits(TakeWhileObservable, __super__); function TakeWhileObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } TakeWhileObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new TakeWhileObserver(o, this)); }; return TakeWhileObservable; }(ObservableBase)); var TakeWhileObserver = (function (__super__) { inherits(TakeWhileObserver, __super__); function TakeWhileObserver(o, p) { this._o = o; this._p = p; this._i = 0; this._r = true; __super__.call(this); } TakeWhileObserver.prototype.next = function (x) { if (this._r) { this._r = tryCatch(this._p._fn)(x, this._i++, this._p); if (this._r === errorObj) { return this._o.onError(this._r.e); } } if (this._r) { this._o.onNext(x); } else { this._o.onCompleted(); } }; TakeWhileObserver.prototype.error = function (e) { this._o.onError(e); }; TakeWhileObserver.prototype.completed = function () { this._o.onCompleted(); }; return TakeWhileObserver; }(AbstractObserver)); /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var fn = bindCallback(predicate, thisArg, 3); return new TakeWhileObservable(this, fn); }; var FilterObservable = (function (__super__) { inherits(FilterObservable, __super__); function FilterObservable(source, predicate, thisArg) { this.source = source; this.predicate = bindCallback(predicate, thisArg, 3); __super__.call(this); } FilterObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o, this.predicate, this)); }; function innerPredicate(predicate, self) { return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); } } FilterObservable.prototype.internalFilter = function(predicate, thisArg) { return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o, predicate, source) { this.o = o; this.predicate = predicate; this.source = source; this.i = 0; AbstractObserver.call(this); } InnerObserver.prototype.next = function(x) { var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source); if (shouldYield === errorObj) { return this.o.onError(shouldYield.e); } shouldYield && this.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this.o.onError(e); }; InnerObserver.prototype.completed = function () { this.o.onCompleted(); }; return FilterObservable; }(ObservableBase)); /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.filter = observableProto.where = function (predicate, thisArg) { return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) : new FilterObservable(this, predicate, thisArg); }; var TransduceObserver = (function (__super__) { inherits(TransduceObserver, __super__); function TransduceObserver(o, xform) { this._o = o; this._xform = xform; __super__.call(this); } TransduceObserver.prototype.next = function (x) { var res = tryCatch(this._xform['@@transducer/step']).call(this._xform, this._o, x); if (res === errorObj) { this._o.onError(res.e); } }; TransduceObserver.prototype.error = function (e) { this._o.onError(e); }; TransduceObserver.prototype.completed = function () { this._xform['@@transducer/result'](this._o); }; return TransduceObserver; }(AbstractObserver)); function transformForObserver(o) { return { '@@transducer/init': function() { return o; }, '@@transducer/step': function(obs, input) { return obs.onNext(input); }, '@@transducer/result': function(obs) { return obs.onCompleted(); } }; } /** * Executes a transducer to transform the observable sequence * @param {Transducer} transducer A transducer to execute * @returns {Observable} An Observable sequence containing the results from the transducer. */ observableProto.transduce = function(transducer) { var source = this; return new AnonymousObservable(function(o) { var xform = transducer(transformForObserver(o)); return source.subscribe(new TransduceObserver(o, xform)); }, source); }; var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { inherits(AnonymousObservable, __super__); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { return subscriber && isFunction(subscriber.dispose) ? subscriber : isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; } function setDisposable(s, state) { var ado = state[0], self = state[1]; var sub = tryCatch(self.__subscribe).call(self, ado); if (sub === errorObj && !ado.fail(errorObj.e)) { thrower(errorObj.e); } ado.setDisposable(fixSubscriber(sub)); } function AnonymousObservable(subscribe, parent) { this.source = parent; this.__subscribe = subscribe; __super__.call(this); } AnonymousObservable.prototype._subscribe = function (o) { var ado = new AutoDetachObserver(o), state = [ado, this]; if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(state, setDisposable); } else { setDisposable(null, state); } return ado; }; return AnonymousObservable; }(Observable)); var AutoDetachObserver = (function (__super__) { inherits(AutoDetachObserver, __super__); function AutoDetachObserver(observer) { __super__.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var result = tryCatch(this.observer.onNext).call(this.observer, value); if (result === errorObj) { this.dispose(); thrower(result.e); } }; AutoDetachObserverPrototype.error = function (err) { var result = tryCatch(this.observer.onError).call(this.observer, err); this.dispose(); result === errorObj && thrower(result.e); }; AutoDetachObserverPrototype.completed = function () { var result = tryCatch(this.observer.onCompleted).call(this.observer); this.dispose(); result === errorObj && thrower(result.e); }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); }; AutoDetachObserverPrototype.dispose = function () { __super__.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); var InnerSubscription = function (s, o) { this._s = s; this._o = o; }; InnerSubscription.prototype.dispose = function () { if (!this._s.isDisposed && this._o !== null) { var idx = this._s.observers.indexOf(this._o); this._s.observers.splice(idx, 1); this._o = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (__super__) { inherits(Subject, __super__); function Subject() { __super__.call(this); this.isDisposed = false; this.isStopped = false; this.observers = []; this.hasError = false; } addProperties(Subject.prototype, Observer.prototype, { _subscribe: function (o) { checkDisposed(this); if (!this.isStopped) { this.observers.push(o); return new InnerSubscription(this, o); } if (this.hasError) { o.onError(this.error); return disposableEmpty; } o.onCompleted(); return disposableEmpty; }, /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed(this); if (!this.isStopped) { this.isStopped = true; for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers.length = 0; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed(this); if (!this.isStopped) { this.isStopped = true; this.error = error; this.hasError = true; for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { os[i].onError(error); } this.observers.length = 0; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed(this); if (!this.isStopped) { for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (__super__) { inherits(AsyncSubject, __super__); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { __super__.call(this); this.isDisposed = false; this.isStopped = false; this.hasValue = false; this.observers = []; this.hasError = false; } addProperties(AsyncSubject.prototype, Observer.prototype, { _subscribe: function (o) { checkDisposed(this); if (!this.isStopped) { this.observers.push(o); return new InnerSubscription(this, o); } if (this.hasError) { o.onError(this.error); } else if (this.hasValue) { o.onNext(this.value); o.onCompleted(); } else { o.onCompleted(); } return disposableEmpty; }, /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var i, len; checkDisposed(this); if (!this.isStopped) { this.isStopped = true; var os = cloneArray(this.observers), len = os.length; if (this.hasValue) { for (i = 0; i < len; i++) { var o = os[i]; o.onNext(this.value); o.onCompleted(); } } else { for (i = 0; i < len; i++) { os[i].onCompleted(); } } this.observers.length = 0; } }, /** * Notifies all subscribed observers about the error. * @param {Mixed} error The Error to send to all observers. */ onError: function (error) { checkDisposed(this); if (!this.isStopped) { this.isStopped = true; this.hasError = true; this.error = error; for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { os[i].onError(error); } this.observers.length = 0; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed(this); if (this.isStopped) { return; } this.value = value; this.hasValue = true; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.error = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this); } addProperties(AnonymousSubject.prototype, Observer.prototype, { _subscribe: function (o) { return this.observable.subscribe(o); }, onCompleted: function () { this.observer.onCompleted(); }, onError: function (error) { this.observer.onError(error); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } // All code before this point will be filtered from stack traces. var rEndingLine = captureLine(); }.call(this));
extensions/cms/resolver/index.js
axax/lunuc
import GenericResolver from 'api/resolver/generic/genericResolver' import JsonDom from '../components/JsonDom' import React from 'react' import Util from 'api/util' import ClientUtil from 'client/util' import {getCmsPage} from '../util/cmsPage' import {resolveData} from '../util/dataResolver' import {pubsub} from 'api/subscription' import {DEFAULT_DATA_RESOLVER, DEFAULT_TEMPLATE, DEFAULT_SCRIPT, DEFAULT_STYLE, CAPABILITY_MANAGE_CMS_PAGES} from '../constants' import Cache from 'util/cache' import {withFilter} from 'graphql-subscriptions' import {getHostFromHeaders} from 'util/host' import Hook from '../../../util/hook' import {ObjectId} from 'mongodb' import {getStore} from '../../../client/store/index' import {setGraphQlOptions} from '../../../client/middleware/graphql' import {renderToString} from '../../../api/resolver/graphqlSsr' import {Provider} from 'react-redux' import { settingKeyPrefix } from '../util/cmsView' import config from 'gen/config' const {STATIC_PRIVATE_DIR} = config const PORT = (process.env.PORT || 3000) const createScopeForDataResolver = (query, _props) => { const queryParams = query ? ClientUtil.extractQueryParams(query) : {} const props = (_props ? JSON.parse(_props) : {}) const scope = {params: queryParams, props} return scope } const cmsPageStatus = {}, globalScope = {} export default db => ({ Query: { cmsPages: async ({limit, page, offset, filter, sort, _version}, {headers, context}) => { Util.checkIfUserIsLoggedIn(context) const fields = ['public', 'slug', 'hostRule', 'name', 'keyword', 'urlSensitiv', 'parseResolvedData', 'alwaysLoadAssets', 'loadPageOptions', 'ssrStyle', 'publicEdit', 'compress', 'isTemplate','ownerGroup$[UserGroup]'] if (filter) { const parsedFilter = Util.parseFilter(filter) const hasRest = parsedFilter.rest.length>0 // search in fields if(hasRest || parsedFilter.parts.dataResolver) { fields.push('dataResolver') } if(hasRest || parsedFilter.parts.script) { fields.push('script') } if(hasRest || parsedFilter.parts.serverScript) { fields.push('serverScript') } if(hasRest || parsedFilter.parts.template) { fields.push('template') } if(hasRest || parsedFilter.parts.style) { fields.push('style') } } const data = await GenericResolver.entities(db, context, 'CmsPage', fields, { limit, page, offset, filter, sort, _version }) return data }, cmsPage: async ({slug, query, props, nosession, editmode, dynamic, meta, _version}, req) => { const startTime = (new Date()).getTime() const {context, headers} = req let editable = Util.isUserLoggedIn(context) let cmsPages = await getCmsPage({db, context, slug, _version, checkHostrules: !dynamic, headers, editmode}) //console.log(`get cms ${slug} in ${(new Date()).getTime() - startTime}ms`) if (!cmsPages.results || cmsPages.results.length === 0) { Hook.call('trackMail', {req, event: '404', slug, db, context, data: query, meta}) throw new Error('Cms page doesn\'t exist') } const { _id, createdBy, template, script, style, resources, dataResolver, parseResolvedData, alwaysLoadAssets, loadPageOptions, ssrStyle, publicEdit, compress, ssr, modifiedAt, urlSensitiv, name, serverScript } = cmsPages.results[0] const scope = { ...createScopeForDataResolver(query, props), page: {slug, host: getHostFromHeaders(headers), meta, referer: req.headers['referer'], lang: context.lang}, editmode } const ispublic = cmsPages.results[0].public const {resolvedData, subscriptions} = await resolveData({ db, context, dataResolver, scope, nosession, req, editmode, dynamic }) if(resolvedData.access ){ if(resolvedData.access.read === false){ throw new Error('No access rights') } if(resolvedData.access.edit === false){ editable = false } } let html if (ssr) { // Server side rendering try { const store = getStore() const loc = {pathname: '', search: '', origin: ''} if (req) { const host = getHostFromHeaders(req.headers) loc.origin = (req.isHttps ? 'https://' : 'http://') + host } window.location = globalThis.location = loc setGraphQlOptions({url: 'http://localhost:' + PORT + '/graphql'}) html = await renderToString(<Provider store={store}> <JsonDom template={template} script={script} style={style} location={loc} history={{location: loc}} slug="_ssr" resolvedData={JSON.stringify(resolvedData)} editMode={false} scope={JSON.stringify(scope)}/> </Provider>, context) } catch (e) { console.log(e) html = e.message } } const result = { _id, modifiedAt, createdBy, ssr, public: ispublic, online: _version === 'default', slug, realSlug: cmsPages.results[0].slug, template, script, resources, style, html, publicEdit, resolvedData: JSON.stringify(resolvedData), parseResolvedData, alwaysLoadAssets, loadPageOptions, ssrStyle, compress, subscriptions, urlSensitiv, editable, cacheKey: '' // todo: remove } const setPageOptions = async ()=>{ const pageName = result.realSlug.split('/')[0] const pageOptions = await Util.keyValueGlobalMap(db, context, ['PageOptions-' + pageName], {parse: true}) const meta = { PageOptions: pageOptions['PageOptions-' + pageName] } result.meta = JSON.stringify(meta) } if (editable && editmode) { // return all data if user is loggedin, and in editmode and has the capability to mange cms pages result.name = name if (!dynamic) { const pageName = result.realSlug.split('/')[0] const pageOptions = await Util.keyValueGlobalMap(db, context, ['PageOptionsDefinition-' + pageName, 'PageOptions-' + pageName], {parse: true}) const editorOptions = await Util.keyvalueMap(db, context, [settingKeyPrefix, settingKeyPrefix + '-' + result.realSlug], {parse: true}) const meta = { PageOptionsDefinition: pageOptions['PageOptionsDefinition-' + pageName], PageOptions: pageOptions['PageOptions-' + pageName], EditorPageOptions: editorOptions[settingKeyPrefix + '-' + result.realSlug], EditorOptions: editorOptions[settingKeyPrefix] } result.meta = JSON.stringify(meta) }else if( loadPageOptions ){ await setPageOptions() } if (await Util.userHasCapability(db, context, CAPABILITY_MANAGE_CMS_PAGES)) { result.dataResolver = dataResolver result.serverScript = serverScript } } else { // if user is not looged in return only slug and rendered html // never return sensitiv data here result.name = {[context.lang]: name[context.lang]} if( loadPageOptions ){ await setPageOptions() } } console.log(`cms resolver for ${slug} got data in ${(new Date()).getTime() - startTime}ms`) //TODO: only experimental if(meta === 'fetchMore'){ delete result.dataResolver delete result.serverScript delete result.template delete result.script delete result.style delete result.name } return result }, cmsPageStatus: async ({slug}, req) => { if (!req.context.id) { return {user: null} } if (!cmsPageStatus[slug] || (new Date() - cmsPageStatus[slug].time) > 6000) { cmsPageStatus[slug] = {user: {username: req.context.username, _id: req.context.id}} } if (cmsPageStatus[slug].user._id === req.context.id) { cmsPageStatus[slug].time = new Date() } const data = {} if (Hook.hooks['cmsPageStatus'] && Hook.hooks['cmsPageStatus'].length) { let c = Hook.hooks['cmsPageStatus'].length for (let i = 0; i < Hook.hooks['cmsPageStatus'].length; ++i) { await Hook.hooks['cmsPageStatus'][i].callback({db, slug, req, data}) } } return {user: cmsPageStatus[slug].user, data: JSON.stringify(data)} }, cmsServerMethod: async ({slug, methodName, args, query, props, dynamic, _version}, req) => { if (!methodName.match(/^[0-9a-zA-Z_]+$/) || methodName.trim() === 'require') { throw new Error('Invalid methodName') } const {context, headers} = req const startTime = (new Date()).getTime() let cmsPages = await getCmsPage({db, context, slug, checkHostrules: !dynamic, _version, headers}) if (!cmsPages.results || cmsPages.results.length === 0) { throw new Error('Cms page doesn\'t exist') } const {serverScript, dataResolver} = cmsPages.results[0] if (!serverScript) { throw new Error('serverScript doesn\'t exist') } if (args) { try { args = JSON.parse(args) } catch (e) { } } console.log(`Server methode call ${methodName}`) let result const scriptExecution = ` const fs = this.require('fs') const path = this.require('path') const paths = [ { name: 'static_private', rel: '../../..${STATIC_PRIVATE_DIR}/' }, { name: 'api', rel: '../../../api/' }, { name: 'client', rel: '../../../client/' }, { name: 'ext', rel: '../../../extensions/' }, { name: 'gen', rel: '../../../gensrc/' } ] const require = (filePath)=>{ if(filePath.startsWith('@')){ for(let i = 0; i < paths.length;i++){ const p = paths[i] if(filePath.startsWith('@'+p.name+'/')){ let pathToCheck = path.join(this.__dirname, p.rel+filePath.substring(p.name.length+2)) if (fs.existsSync(pathToCheck+'.js') || fs.existsSync(pathToCheck)) { return this.require(pathToCheck) } } } } return this.require(filePath) } const data = (async () => { try{ ${serverScript} let result = ${methodName}(this.args) this.resolve({result: result}) }catch(error){ this.resolve({error}) } })()` try { const script = await new Promise(resolve => { const tpl = new Function(scriptExecution) tpl.call({ args, require, resolve, db, __dirname, context, req, GenericResolver, ObjectId, globalScope }) }) if (script.error) { result = {error: script.error} console.log(script.error) } else { result = await script.result } } catch (error) { console.log(error) result = {error: error.message} } if (result && result.constructor !== String) { result = JSON.stringify(result) } return {result} } }, Mutation: { createCmsPage: async ({slug,ownerGroup, ...rest}, req) => { Util.checkIfUserIsLoggedIn(req.context) if (!slug) slug = '' slug = encodeURI(slug.trim()) return await GenericResolver.createEntity(db, req, 'CmsPage', { slug, ...rest, ownerGroup:(ownerGroup?ownerGroup.reduce((o,id)=>{o.push(ObjectId(id));return o},[]):ownerGroup), dataResolver: DEFAULT_DATA_RESOLVER, template: DEFAULT_TEMPLATE, script: DEFAULT_SCRIPT, style: DEFAULT_STYLE }) }, updateCmsPage: async ({_id, slug, realSlug, query, props, createdBy, ownerGroup, ...rest}, req) => { const {context, headers} = req Util.checkIfUserIsLoggedIn(context) const {_version} = rest if (realSlug) { rest.slug = realSlug }else{ rest.slug = slug } // clear server cache const cacheKey = 'cmsPage-' + (_version ? _version + '-' : '') + rest.slug Cache.clearStartWith(cacheKey) const result = await GenericResolver.updateEnity(db, context, 'CmsPage', { _id, ownerGroup:(ownerGroup?ownerGroup.reduce((o,id)=>{o.push(ObjectId(id));return o},[]):ownerGroup), createdBy: (createdBy ? ObjectId(createdBy) : createdBy), ...rest }) result.slug = slug result.realSlug = rest.slug // if dataResolver has changed resolveData and return it if (rest.dataResolver) { const scope = { ...createScopeForDataResolver(query, props), page: {slug, realSlug: rest.slug, host: getHostFromHeaders(headers)} } const {resolvedData, subscriptions} = await resolveData({ db, context, dataResolver: rest.dataResolver, scope, req }) result.resolvedData = JSON.stringify(resolvedData) result.subscriptions = subscriptions } else if (rest.dataResolver === '') { // if resolver explicitly is set to '' result.resolvedData = '{}' } pubsub.publish('newNotification', { userId: context.id, newNotification: { key: 'updateCmsPage', message: `CMS Page ${_id} was successfully updated on ${new Date().toLocaleTimeString()}` } }) return result }, deleteCmsPage: async ({_id, _version}, {context}) => { return GenericResolver.deleteEnity(db, context, 'CmsPage', {_id, _version}) }, deleteCmsPages: async ({_id, _version}, {context}) => { return GenericResolver.deleteEnities(db, context, 'CmsPage', {_id, _version}) }, cloneCmsPage: async (data, {context}) => { return GenericResolver.cloneEntity(db, context, 'CmsPage', data) } }, Subscription: { cmsPageData: withFilter(() => pubsub.asyncIterator('cmsPageData'), (payload, context) => { return payload && payload.session === context.session //payload.userId === context.id } ), cmsCustomData: withFilter(() => pubsub.asyncIterator('cmsCustomData'), (payload, context) => { return payload && payload.session === context.session //payload.userId === context.id } ) } })
ajax/libs/forerunnerdb/1.3.454/fdb-core.js
dc-js/cdnjs
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ var Core = _dereq_('../lib/Core'), ShimIE8 = _dereq_('../lib/Shim.IE8'); if (typeof window !== 'undefined') { window.ForerunnerDB = Core; } module.exports = Core; },{"../lib/Core":4,"../lib/Shim.IE8":27}],2:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'); var BinaryTree = function (data, compareFunc, hashFunc) { this.init.apply(this, arguments); }; BinaryTree.prototype.init = function (data, index, compareFunc, hashFunc) { this._store = []; this._keys = []; if (index !== undefined) { this.index(index); } if (compareFunc !== undefined) { this.compareFunc(compareFunc); } if (hashFunc !== undefined) { this.hashFunc(hashFunc); } if (data !== undefined) { this.data(data); } }; Shared.addModule('BinaryTree', BinaryTree); Shared.mixin(BinaryTree.prototype, 'Mixin.ChainReactor'); Shared.mixin(BinaryTree.prototype, 'Mixin.Sorting'); Shared.mixin(BinaryTree.prototype, 'Mixin.Common'); Shared.synthesize(BinaryTree.prototype, 'compareFunc'); Shared.synthesize(BinaryTree.prototype, 'hashFunc'); Shared.synthesize(BinaryTree.prototype, 'indexDir'); Shared.synthesize(BinaryTree.prototype, 'keys'); Shared.synthesize(BinaryTree.prototype, 'index', function (index) { if (index !== undefined) { // Convert the index object to an array of key val objects this.keys(this.extractKeys(index)); } return this.$super.call(this, index); }); BinaryTree.prototype.extractKeys = function (obj) { var i, keys = []; for (i in obj) { if (obj.hasOwnProperty(i)) { keys.push({ key: i, val: obj[i] }); } } return keys; }; BinaryTree.prototype.data = function (val) { if (val !== undefined) { this._data = val; if (this._hashFunc) { this._hash = this._hashFunc(val); } return this; } return this._data; }; /** * Pushes an item to the binary tree node's store array. * @param {*} val The item to add to the store. * @returns {*} */ BinaryTree.prototype.push = function (val) { if (val !== undefined) { this._store.push(val); return this; } return false; }; /** * Pulls an item from the binary tree node's store array. * @param {*} val The item to remove from the store. * @returns {*} */ BinaryTree.prototype.pull = function (val) { if (val !== undefined) { var index = this._store.indexOf(val); if (index > -1) { this._store.splice(index, 1); return this; } } return false; }; /** * Default compare method. Can be overridden. * @param a * @param b * @returns {number} * @private */ BinaryTree.prototype._compareFunc = function (a, b) { // Loop the index array var i, indexData, result = 0; for (i = 0; i < this._keys.length; i++) { indexData = this._keys[i]; if (indexData.val === 1) { result = this.sortAsc(a[indexData.key], b[indexData.key]); } else if (indexData.val === -1) { result = this.sortDesc(a[indexData.key], b[indexData.key]); } if (result !== 0) { return result; } } return result; }; /** * Default hash function. Can be overridden. * @param obj * @private */ BinaryTree.prototype._hashFunc = function (obj) { /*var i, indexData, hash = ''; for (i = 0; i < this._keys.length; i++) { indexData = this._keys[i]; if (hash) { hash += '_'; } hash += obj[indexData.key]; } return hash;*/ return obj[this._keys[0].key]; }; BinaryTree.prototype.insert = function (data) { var result, inserted, failed, i; if (data instanceof Array) { // Insert array of data inserted = []; failed = []; for (i = 0; i < data.length; i++) { if (this.insert(data[i])) { inserted.push(data[i]); } else { failed.push(data[i]); } } return { inserted: inserted, failed: failed }; } if (!this._data) { // Insert into this node (overwrite) as there is no data this.data(data); //this.push(data); return true; } result = this._compareFunc(this._data, data); if (result === 0) { this.push(data); // Less than this node if (this._left) { // Propagate down the left branch this._left.insert(data); } else { // Assign to left branch this._left = new BinaryTree(data, this._index, this._compareFunc, this._hashFunc); } return true; } if (result === -1) { // Greater than this node if (this._right) { // Propagate down the right branch this._right.insert(data); } else { // Assign to right branch this._right = new BinaryTree(data, this._index, this._compareFunc, this._hashFunc); } return true; } if (result === 1) { // Less than this node if (this._left) { // Propagate down the left branch this._left.insert(data); } else { // Assign to left branch this._left = new BinaryTree(data, this._index, this._compareFunc, this._hashFunc); } return true; } return false; }; BinaryTree.prototype.lookup = function (data, resultArr) { var result = this._compareFunc(this._data, data); resultArr = resultArr || []; if (result === 0) { if (this._left) { this._left.lookup(data, resultArr); } resultArr.push(this._data); if (this._right) { this._right.lookup(data, resultArr); } } if (result === -1) { if (this._right) { this._right.lookup(data, resultArr); } } if (result === 1) { if (this._left) { this._left.lookup(data, resultArr); } } return resultArr; }; BinaryTree.prototype.inOrder = function (type, resultArr) { resultArr = resultArr || []; if (this._left) { this._left.inOrder(type, resultArr); } switch (type) { case 'hash': resultArr.push(this._hash); break; case 'data': resultArr.push(this._data); break; default: resultArr.push({ key: this._data, arr: this._store }); break; } if (this._right) { this._right.inOrder(type, resultArr); } return resultArr; }; /*BinaryTree.prototype.find = function (type, search, resultArr) { resultArr = resultArr || []; if (this._left) { this._left.find(type, search, resultArr); } // Check if this node's data is greater or less than the from value var fromResult = this.sortAsc(this._data[key], from), toResult = this.sortAsc(this._data[key], to); if ((fromResult === 0 || fromResult === 1) && (toResult === 0 || toResult === -1)) { // This data node is greater than or equal to the from value, // and less than or equal to the to value so include it switch (type) { case 'hash': resultArr.push(this._hash); break; case 'data': resultArr.push(this._data); break; default: resultArr.push({ key: this._data, arr: this._store }); break; } } if (this._right) { this._right.find(type, search, resultArr); } return resultArr; };*/ /** * * @param {String} type * @param {String} key The data key / path to range search against. * @param {Number} from Range search from this value (inclusive) * @param {Number} to Range search to this value (inclusive) * @param {Array=} resultArr Leave undefined when calling (internal use), * passes the result array between recursive calls to be returned when * the recursion chain completes. * @param {Path=} pathResolver Leave undefined when calling (internal use), * caches the path resolver instance for performance. * @returns {Array} Array of matching document objects */ BinaryTree.prototype.findRange = function (type, key, from, to, resultArr, pathResolver) { resultArr = resultArr || []; pathResolver = pathResolver || new Path(key); if (this._left) { this._left.findRange(type, key, from, to, resultArr, pathResolver); } // Check if this node's data is greater or less than the from value var pathVal = pathResolver.value(this._data), fromResult = this.sortAsc(pathVal, from), toResult = this.sortAsc(pathVal, to); if ((fromResult === 0 || fromResult === 1) && (toResult === 0 || toResult === -1)) { // This data node is greater than or equal to the from value, // and less than or equal to the to value so include it switch (type) { case 'hash': resultArr.push(this._hash); break; case 'data': resultArr.push(this._data); break; default: resultArr.push({ key: this._data, arr: this._store }); break; } } if (this._right) { this._right.findRange(type, key, from, to, resultArr, pathResolver); } return resultArr; }; /*BinaryTree.prototype.findRegExp = function (type, key, pattern, resultArr) { resultArr = resultArr || []; if (this._left) { this._left.findRegExp(type, key, pattern, resultArr); } // Check if this node's data is greater or less than the from value var fromResult = this.sortAsc(this._data[key], from), toResult = this.sortAsc(this._data[key], to); if ((fromResult === 0 || fromResult === 1) && (toResult === 0 || toResult === -1)) { // This data node is greater than or equal to the from value, // and less than or equal to the to value so include it switch (type) { case 'hash': resultArr.push(this._hash); break; case 'data': resultArr.push(this._data); break; default: resultArr.push({ key: this._data, arr: this._store }); break; } } if (this._right) { this._right.findRegExp(type, key, pattern, resultArr); } return resultArr; };*/ BinaryTree.prototype.match = function (query, options) { // Check if the passed query has data in the keys our index // operates on and if so, is the query sort matching our order var pathSolver = new Path(), indexKeyArr, queryArr, matchedKeys = [], matchedKeyCount = 0, i; indexKeyArr = pathSolver.parseArr(this._index, { verbose: true }); queryArr = pathSolver.parseArr(query, { ignore:/\$/, verbose: true }); // Loop the query array and check the order of keys against the // index key array to see if this index can be used for (i = 0; i < indexKeyArr.length; i++) { if (queryArr[i] === indexKeyArr[i]) { matchedKeyCount++; matchedKeys.push(queryArr[i]); } } return { matchedKeys: matchedKeys, totalKeyCount: queryArr.length, score: matchedKeyCount }; //return pathSolver.countObjectPaths(this._keys, query); }; Shared.finishModule('BinaryTree'); module.exports = BinaryTree; },{"./Path":23,"./Shared":26}],3:[function(_dereq_,module,exports){ "use strict"; var Shared, Db, Metrics, KeyValueStore, Path, IndexHashMap, IndexBinaryTree, Crc, Overload, ReactorIO; Shared = _dereq_('./Shared'); /** * Creates a new collection. Collections store multiple documents and * handle CRUD against those documents. * @constructor */ var Collection = function (name) { this.init.apply(this, arguments); }; Collection.prototype.init = function (name, options) { this._primaryKey = '_id'; this._primaryIndex = new KeyValueStore('primary'); this._primaryCrc = new KeyValueStore('primaryCrc'); this._crcLookup = new KeyValueStore('crcLookup'); this._name = name; this._data = []; this._metrics = new Metrics(); this._options = options || { changeTimestamp: false }; // Create an object to store internal protected data this._metaData = {}; this._deferQueue = { insert: [], update: [], remove: [], upsert: [] }; this._deferThreshold = { insert: 100, update: 100, remove: 100, upsert: 100 }; this._deferTime = { insert: 1, update: 1, remove: 1, upsert: 1 }; this._deferredCalls = true; // Set the subset to itself since it is the root collection this.subsetOf(this); }; Shared.addModule('Collection', Collection); Shared.mixin(Collection.prototype, 'Mixin.Common'); Shared.mixin(Collection.prototype, 'Mixin.Events'); Shared.mixin(Collection.prototype, 'Mixin.ChainReactor'); Shared.mixin(Collection.prototype, 'Mixin.CRUD'); Shared.mixin(Collection.prototype, 'Mixin.Constants'); Shared.mixin(Collection.prototype, 'Mixin.Triggers'); Shared.mixin(Collection.prototype, 'Mixin.Sorting'); Shared.mixin(Collection.prototype, 'Mixin.Matching'); Shared.mixin(Collection.prototype, 'Mixin.Updating'); Shared.mixin(Collection.prototype, 'Mixin.Tags'); Metrics = _dereq_('./Metrics'); KeyValueStore = _dereq_('./KeyValueStore'); Path = _dereq_('./Path'); IndexHashMap = _dereq_('./IndexHashMap'); IndexBinaryTree = _dereq_('./IndexBinaryTree'); Crc = _dereq_('./Crc'); Db = Shared.modules.Db; Overload = _dereq_('./Overload'); ReactorIO = _dereq_('./ReactorIO'); /** * Returns a checksum of a string. * @param {String} string The string to checksum. * @return {String} The checksum generated. */ Collection.prototype.crc = Crc; /** * Gets / sets the deferred calls flag. If set to true (default) * then operations on large data sets can be broken up and done * over multiple CPU cycles (creating an async state). For purely * synchronous behaviour set this to false. * @param {Boolean=} val The value to set. * @returns {Boolean} */ Shared.synthesize(Collection.prototype, 'deferredCalls'); /** * Gets / sets the current state. * @param {String=} val The name of the state to set. * @returns {*} */ Shared.synthesize(Collection.prototype, 'state'); /** * Gets / sets the name of the collection. * @param {String=} val The name of the collection to set. * @returns {*} */ Shared.synthesize(Collection.prototype, 'name'); /** * Gets / sets the metadata stored in the collection. */ Shared.synthesize(Collection.prototype, 'metaData'); /** * Gets / sets boolean to determine if the collection should be * capped or not. */ Shared.synthesize(Collection.prototype, 'capped'); /** * Gets / sets capped collection size. This is the maximum number * of records that the capped collection will store. */ Shared.synthesize(Collection.prototype, 'cappedSize'); /** * Get the data array that represents the collection's data. * This data is returned by reference and should not be altered outside * of the provided CRUD functionality of the collection as doing so * may cause unstable index behaviour within the collection. * @returns {Array} */ Collection.prototype.data = function () { return this._data; }; /** * Drops a collection and all it's stored data from the database. * @returns {boolean} True on success, false on failure. */ Collection.prototype.drop = function (callback) { var key; if (!this.isDropped()) { if (this._db && this._db._collection && this._name) { if (this.debug()) { console.log(this.logIdentifier() + ' Dropping'); } this._state = 'dropped'; this.emit('drop', this); delete this._db._collection[this._name]; // Remove any reactor IO chain links if (this._collate) { for (key in this._collate) { if (this._collate.hasOwnProperty(key)) { this.collateRemove(key); } } } delete this._primaryKey; delete this._primaryIndex; delete this._primaryCrc; delete this._crcLookup; delete this._name; delete this._data; delete this._metrics; if (callback) { callback(false, true); } return true; } } else { if (callback) { callback(false, true); } return true; } if (callback) { callback(false, true); } return false; }; /** * Gets / sets the primary key for this collection. * @param {String=} keyName The name of the primary key. * @returns {*} */ Collection.prototype.primaryKey = function (keyName) { if (keyName !== undefined) { if (this._primaryKey !== keyName) { var oldKey = this._primaryKey; this._primaryKey = keyName; // Set the primary key index primary key this._primaryIndex.primaryKey(keyName); // Rebuild the primary key index this.rebuildPrimaryKeyIndex(); // Propagate change down the chain this.chainSend('primaryKey', keyName, {oldData: oldKey}); } return this; } return this._primaryKey; }; /** * Handles insert events and routes changes to binds and views as required. * @param {Array} inserted An array of inserted documents. * @param {Array} failed An array of documents that failed to insert. * @private */ Collection.prototype._onInsert = function (inserted, failed) { this.emit('insert', inserted, failed); }; /** * Handles update events and routes changes to binds and views as required. * @param {Array} items An array of updated documents. * @private */ Collection.prototype._onUpdate = function (items) { this.emit('update', items); }; /** * Handles remove events and routes changes to binds and views as required. * @param {Array} items An array of removed documents. * @private */ Collection.prototype._onRemove = function (items) { this.emit('remove', items); }; /** * Handles any change to the collection. * @private */ Collection.prototype._onChange = function () { if (this._options.changeTimestamp) { // Record the last change timestamp this._metaData.lastChange = new Date(); } }; /** * Gets / sets the db instance this class instance belongs to. * @param {Db=} db The db instance. * @returns {*} */ Shared.synthesize(Collection.prototype, 'db', function (db) { if (db) { if (this.primaryKey() === '_id') { // Set primary key to the db's key by default this.primaryKey(db.primaryKey()); // Apply the same debug settings this.debug(db.debug()); } } return this.$super.apply(this, arguments); }); /** * Gets / sets mongodb emulation mode. * @param {Boolean=} val True to enable, false to disable. * @returns {*} */ Shared.synthesize(Collection.prototype, 'mongoEmulation'); /** * Sets the collection's data to the array / documents passed. If any * data already exists in the collection it will be removed before the * new data is set. * @param {Array|Object} data The array of documents or a single document * that will be set as the collections data. * @param options Optional options object. * @param callback Optional callback function. */ Collection.prototype.setData = function (data, options, callback) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } if (data) { var op = this._metrics.create('setData'); op.start(); options = this.options(options); this.preSetData(data, options, callback); if (options.$decouple) { data = this.decouple(data); } if (!(data instanceof Array)) { data = [data]; } op.time('transformIn'); data = this.transformIn(data); op.time('transformIn'); var oldData = [].concat(this._data); this._dataReplace(data); // Update the primary key index op.time('Rebuild Primary Key Index'); this.rebuildPrimaryKeyIndex(options); op.time('Rebuild Primary Key Index'); // Rebuild all other indexes op.time('Rebuild All Other Indexes'); this._rebuildIndexes(); op.time('Rebuild All Other Indexes'); op.time('Resolve chains'); this.chainSend('setData', data, {oldData: oldData}); op.time('Resolve chains'); op.stop(); this._onChange(); this.emit('setData', this._data, oldData); } if (callback) { callback(false); } return this; }; /** * Drops and rebuilds the primary key index for all documents in the collection. * @param {Object=} options An optional options object. * @private */ Collection.prototype.rebuildPrimaryKeyIndex = function (options) { options = options || { $ensureKeys: undefined, $violationCheck: undefined }; var ensureKeys = options && options.$ensureKeys !== undefined ? options.$ensureKeys : true, violationCheck = options && options.$violationCheck !== undefined ? options.$violationCheck : true, arr, arrCount, arrItem, pIndex = this._primaryIndex, crcIndex = this._primaryCrc, crcLookup = this._crcLookup, pKey = this._primaryKey, jString; // Drop the existing primary index pIndex.truncate(); crcIndex.truncate(); crcLookup.truncate(); // Loop the data and check for a primary key in each object arr = this._data; arrCount = arr.length; while (arrCount--) { arrItem = arr[arrCount]; if (ensureKeys) { // Make sure the item has a primary key this.ensurePrimaryKey(arrItem); } if (violationCheck) { // Check for primary key violation if (!pIndex.uniqueSet(arrItem[pKey], arrItem)) { // Primary key violation throw(this.logIdentifier() + ' Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: ' + arrItem[this._primaryKey]); } } else { pIndex.set(arrItem[pKey], arrItem); } // Generate a CRC string jString = this.jStringify(arrItem); crcIndex.set(arrItem[pKey], jString); crcLookup.set(jString, arrItem); } }; /** * Checks for a primary key on the document and assigns one if none * currently exists. * @param {Object} obj The object to check a primary key against. * @private */ Collection.prototype.ensurePrimaryKey = function (obj) { if (obj[this._primaryKey] === undefined) { // Assign a primary key automatically obj[this._primaryKey] = this.objectId(); } }; /** * Clears all data from the collection. * @returns {Collection} */ Collection.prototype.truncate = function () { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } this.emit('truncate', this._data); // Clear all the data from the collection this._data.length = 0; // Re-create the primary index data this._primaryIndex = new KeyValueStore('primary'); this._primaryCrc = new KeyValueStore('primaryCrc'); this._crcLookup = new KeyValueStore('crcLookup'); this._onChange(); this.deferEmit('change', {type: 'truncate'}); return this; }; /** * Modifies an existing document or documents in a collection. This will update * all matches for 'query' with the data held in 'update'. It will not overwrite * the matched documents with the update document. * * @param {Object} obj The document object to upsert or an array containing * documents to upsert. * * If the document contains a primary key field (based on the collections's primary * key) then the database will search for an existing document with a matching id. * If a matching document is found, the document will be updated. Any keys that * match keys on the existing document will be overwritten with new data. Any keys * that do not currently exist on the document will be added to the document. * * If the document does not contain an id or the id passed does not match an existing * document, an insert is performed instead. If no id is present a new primary key * id is provided for the item. * * @param {Function=} callback Optional callback method. * @returns {Object} An object containing two keys, "op" contains either "insert" or * "update" depending on the type of operation that was performed and "result" * contains the return data from the operation used. */ Collection.prototype.upsert = function (obj, callback) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } if (obj) { var queue = this._deferQueue.upsert, deferThreshold = this._deferThreshold.upsert, returnData = {}, query, i; // Determine if the object passed is an array or not if (obj instanceof Array) { if (this._deferredCalls && obj.length > deferThreshold) { // Break up upsert into blocks this._deferQueue.upsert = queue.concat(obj); // Fire off the insert queue handler this.processQueue('upsert', callback); return {}; } else { // Loop the array and upsert each item returnData = []; for (i = 0; i < obj.length; i++) { returnData.push(this.upsert(obj[i])); } if (callback) { callback(); } return returnData; } } // Determine if the operation is an insert or an update if (obj[this._primaryKey]) { // Check if an object with this primary key already exists query = {}; query[this._primaryKey] = obj[this._primaryKey]; if (this._primaryIndex.lookup(query)[0]) { // The document already exists with this id, this operation is an update returnData.op = 'update'; } else { // No document with this id exists, this operation is an insert returnData.op = 'insert'; } } else { // The document passed does not contain an id, this operation is an insert returnData.op = 'insert'; } switch (returnData.op) { case 'insert': returnData.result = this.insert(obj); break; case 'update': returnData.result = this.update(query, obj); break; default: break; } return returnData; } else { if (callback) { callback(); } } return {}; }; /** * Executes a method against each document that matches query and returns an * array of documents that may have been modified by the method. * @param {Object} query The query object. * @param {Function} func The method that each document is passed to. If this method * returns false for a particular document it is excluded from the results. * @param {Object=} options Optional options object. * @returns {Array} */ Collection.prototype.filter = function (query, func, options) { return (this.find(query, options)).filter(func); }; /** * Executes a method against each document that matches query and then executes * an update based on the return data of the method. * @param {Object} query The query object. * @param {Function} func The method that each document is passed to. If this method * returns false for a particular document it is excluded from the update. * @param {Object=} options Optional options object passed to the initial find call. * @returns {Array} */ Collection.prototype.filterUpdate = function (query, func, options) { var items = this.find(query, options), results = [], singleItem, singleQuery, singleUpdate, pk = this.primaryKey(), i; for (i = 0; i < items.length; i++) { singleItem = items[i]; singleUpdate = func(singleItem); if (singleUpdate) { singleQuery = {}; singleQuery[pk] = singleItem[pk]; results.push(this.update(singleQuery, singleUpdate)); } } return results; }; /** * Modifies an existing document or documents in a collection. This will update * all matches for 'query' with the data held in 'update'. It will not overwrite * the matched documents with the update document. * * @param {Object} query The query that must be matched for a document to be * operated on. * @param {Object} update The object containing updated key/values. Any keys that * match keys on the existing document will be overwritten with this data. Any * keys that do not currently exist on the document will be added to the document. * @param {Object=} options An options object. * @returns {Array} The items that were updated. */ Collection.prototype.update = function (query, update, options) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } // Decouple the update data update = this.decouple(update); // Convert queries from mongo dot notation to forerunner queries if (this.mongoEmulation()) { this.convertToFdb(query); this.convertToFdb(update); } // Handle transform update = this.transformIn(update); if (this.debug()) { console.log(this.logIdentifier() + ' Updating some data'); } var self = this, op = this._metrics.create('update'), dataSet, updated, updateCall = function (referencedDoc) { var oldDoc = self.decouple(referencedDoc), newDoc, triggerOperation, result; if (self.willTrigger(self.TYPE_UPDATE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_UPDATE, self.PHASE_AFTER)) { newDoc = self.decouple(referencedDoc); triggerOperation = { type: 'update', query: self.decouple(query), update: self.decouple(update), options: self.decouple(options), op: op }; // Update newDoc with the update criteria so we know what the data will look // like AFTER the update is processed result = self.updateObject(newDoc, triggerOperation.update, triggerOperation.query, triggerOperation.options, ''); if (self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_BEFORE, referencedDoc, newDoc) !== false) { // No triggers complained so let's execute the replacement of the existing // object with the new one result = self.updateObject(referencedDoc, newDoc, triggerOperation.query, triggerOperation.options, ''); // NOTE: If for some reason we would only like to fire this event if changes are actually going // to occur on the object from the proposed update then we can add "result &&" to the if self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_AFTER, oldDoc, newDoc); } else { // Trigger cancelled operation so tell result that it was not updated result = false; } } else { // No triggers complained so let's execute the replacement of the existing // object with the new one result = self.updateObject(referencedDoc, update, query, options, ''); } // Inform indexes of the change self._updateIndexes(oldDoc, referencedDoc); return result; }; op.start(); op.time('Retrieve documents to update'); dataSet = this.find(query, {$decouple: false}); op.time('Retrieve documents to update'); if (dataSet.length) { op.time('Update documents'); updated = dataSet.filter(updateCall); op.time('Update documents'); if (updated.length) { op.time('Resolve chains'); this.chainSend('update', { query: query, update: update, dataSet: updated }, options); op.time('Resolve chains'); this._onUpdate(updated); this._onChange(); this.deferEmit('change', {type: 'update', data: updated}); } } op.stop(); // TODO: Should we decouple the updated array before return by default? return updated || []; }; /** * Replaces an existing object with data from the new object without * breaking data references. * @param {Object} currentObj The object to alter. * @param {Object} newObj The new object to overwrite the existing one with. * @returns {*} Chain. * @private */ Collection.prototype._replaceObj = function (currentObj, newObj) { var i; // Check if the new document has a different primary key value from the existing one // Remove item from indexes this._removeFromIndexes(currentObj); // Remove existing keys from current object for (i in currentObj) { if (currentObj.hasOwnProperty(i)) { delete currentObj[i]; } } // Add new keys to current object for (i in newObj) { if (newObj.hasOwnProperty(i)) { currentObj[i] = newObj[i]; } } // Update the item in the primary index if (!this._insertIntoIndexes(currentObj)) { throw(this.logIdentifier() + ' Primary key violation in update! Key violated: ' + currentObj[this._primaryKey]); } // Update the object in the collection data //this._data.splice(this._data.indexOf(currentObj), 1, newObj); return this; }; /** * Helper method to update a document from it's id. * @param {String} id The id of the document. * @param {Object} update The object containing the key/values to update to. * @returns {Array} The items that were updated. */ Collection.prototype.updateById = function (id, update) { var searchObj = {}; searchObj[this._primaryKey] = id; return this.update(searchObj, update); }; /** * Internal method for document updating. * @param {Object} doc The document to update. * @param {Object} update The object with key/value pairs to update the document with. * @param {Object} query The query object that we need to match to perform an update. * @param {Object} options An options object. * @param {String} path The current recursive path. * @param {String} opType The type of update operation to perform, if none is specified * default is to set new data against matching fields. * @returns {Boolean} True if the document was updated with new / changed data or * false if it was not updated because the data was the same. * @private */ Collection.prototype.updateObject = function (doc, update, query, options, path, opType) { // TODO: This method is long, try to break it into smaller pieces update = this.decouple(update); // Clear leading dots from path path = path || ''; if (path.substr(0, 1) === '.') { path = path.substr(1, path.length -1); } //var oldDoc = this.decouple(doc), var updated = false, recurseUpdated = false, operation, tmpArray, tmpIndex, tmpCount, tempIndex, pathInstance, sourceIsArray, updateIsArray, i; // Loop each key in the update object for (i in update) { if (update.hasOwnProperty(i)) { // Reset operation flag operation = false; // Check if the property starts with a dollar (function) if (i.substr(0, 1) === '$') { // Check for commands switch (i) { case '$key': case '$index': case '$data': case '$min': case '$max': // Ignore some operators operation = true; break; case '$each': operation = true; // Loop over the array of updates and run each one tmpCount = update.$each.length; for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) { recurseUpdated = this.updateObject(doc, update.$each[tmpIndex], query, options, path); if (recurseUpdated) { updated = true; } } updated = updated || recurseUpdated; break; default: operation = true; // Now run the operation recurseUpdated = this.updateObject(doc, update[i], query, options, path, i); updated = updated || recurseUpdated; break; } } // Check if the key has a .$ at the end, denoting an array lookup if (this._isPositionalKey(i)) { operation = true; // Modify i to be the name of the field i = i.substr(0, i.length - 2); pathInstance = new Path(path + '.' + i); // Check if the key is an array and has items if (doc[i] && doc[i] instanceof Array && doc[i].length) { tmpArray = []; // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { if (this._match(doc[i][tmpIndex], pathInstance.value(query)[0], options, '', {})) { tmpArray.push(tmpIndex); } } // Loop the items that matched and update them for (tmpIndex = 0; tmpIndex < tmpArray.length; tmpIndex++) { recurseUpdated = this.updateObject(doc[i][tmpArray[tmpIndex]], update[i + '.$'], query, options, path + '.' + i, opType); updated = updated || recurseUpdated; } } } if (!operation) { if (!opType && typeof(update[i]) === 'object') { if (doc[i] !== null && typeof(doc[i]) === 'object') { // Check if we are dealing with arrays sourceIsArray = doc[i] instanceof Array; updateIsArray = update[i] instanceof Array; if (sourceIsArray || updateIsArray) { // Check if the update is an object and the doc is an array if (!updateIsArray && sourceIsArray) { // Update is an object, source is an array so match the array items // with our query object to find the one to update inside this array // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { recurseUpdated = this.updateObject(doc[i][tmpIndex], update[i], query, options, path + '.' + i, opType); updated = updated || recurseUpdated; } } else { // Either both source and update are arrays or the update is // an array and the source is not, so set source to update if (doc[i] !== update[i]) { this._updateProperty(doc, i, update[i]); updated = true; } } } else { // The doc key is an object so traverse the // update further recurseUpdated = this.updateObject(doc[i], update[i], query, options, path + '.' + i, opType); updated = updated || recurseUpdated; } } else { if (doc[i] !== update[i]) { this._updateProperty(doc, i, update[i]); updated = true; } } } else { switch (opType) { case '$inc': var doUpdate = true; // Check for a $min / $max operator if (update[i] > 0) { if (update.$max) { // Check current value if (doc[i] >= update.$max) { // Don't update doUpdate = false; } } } else if (update[i] < 0) { if (update.$min) { // Check current value if (doc[i] <= update.$min) { // Don't update doUpdate = false; } } } if (doUpdate) { this._updateIncrement(doc, i, update[i]); updated = true; } break; case '$cast': // Casts a property to the type specified if it is not already // that type. If the cast is an array or an object and the property // is not already that type a new array or object is created and // set to the property, overwriting the previous value switch (update[i]) { case 'array': if (!(doc[i] instanceof Array)) { // Cast to an array this._updateProperty(doc, i, update.$data || []); updated = true; } break; case 'object': if (!(doc[i] instanceof Object) || (doc[i] instanceof Array)) { // Cast to an object this._updateProperty(doc, i, update.$data || {}); updated = true; } break; case 'number': if (typeof doc[i] !== 'number') { // Cast to a number this._updateProperty(doc, i, Number(doc[i])); updated = true; } break; case 'string': if (typeof doc[i] !== 'string') { // Cast to a string this._updateProperty(doc, i, String(doc[i])); updated = true; } break; default: throw(this.logIdentifier() + ' Cannot update cast to unknown type: ' + update[i]); } break; case '$push': // Check if the target key is undefined and if so, create an array if (doc[i] === undefined) { // Initialise a new array this._updateProperty(doc, i, []); } // Check that the target key is an array if (doc[i] instanceof Array) { // Check for a $position modifier with an $each if (update[i].$position !== undefined && update[i].$each instanceof Array) { // Grab the position to insert at tempIndex = update[i].$position; // Loop the each array and push each item tmpCount = update[i].$each.length; for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) { this._updateSplicePush(doc[i], tempIndex + tmpIndex, update[i].$each[tmpIndex]); } } else if (update[i].$each instanceof Array) { // Do a loop over the each to push multiple items tmpCount = update[i].$each.length; for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) { this._updatePush(doc[i], update[i].$each[tmpIndex]); } } else { // Do a standard push this._updatePush(doc[i], update[i]); } updated = true; } else { throw(this.logIdentifier() + ' Cannot push to a key that is not an array! (' + i + ')'); } break; case '$pull': if (doc[i] instanceof Array) { tmpArray = []; // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { if (this._match(doc[i][tmpIndex], update[i], options, '', {})) { tmpArray.push(tmpIndex); } } tmpCount = tmpArray.length; // Now loop the pull array and remove items to be pulled while (tmpCount--) { this._updatePull(doc[i], tmpArray[tmpCount]); updated = true; } } break; case '$pullAll': if (doc[i] instanceof Array) { if (update[i] instanceof Array) { tmpArray = doc[i]; tmpCount = tmpArray.length; if (tmpCount > 0) { // Now loop the pull array and remove items to be pulled while (tmpCount--) { for (tempIndex = 0; tempIndex < update[i].length; tempIndex++) { if (tmpArray[tmpCount] === update[i][tempIndex]) { this._updatePull(doc[i], tmpCount); tmpCount--; updated = true; } } if (tmpCount < 0) { break; } } } } else { throw(this.logIdentifier() + ' Cannot pullAll without being given an array of values to pull! (' + i + ')'); } } break; case '$addToSet': // Check if the target key is undefined and if so, create an array if (doc[i] === undefined) { // Initialise a new array this._updateProperty(doc, i, []); } // Check that the target key is an array if (doc[i] instanceof Array) { // Loop the target array and check for existence of item var targetArr = doc[i], targetArrIndex, targetArrCount = targetArr.length, objHash, addObj = true, optionObj = (options && options.$addToSet), hashMode, pathSolver; // Check if we have an options object for our operation if (update[i].$key) { hashMode = false; pathSolver = new Path(update[i].$key); objHash = pathSolver.value(update[i])[0]; // Remove the key from the object before we add it delete update[i].$key; } else if (optionObj && optionObj.key) { hashMode = false; pathSolver = new Path(optionObj.key); objHash = pathSolver.value(update[i])[0]; } else { objHash = this.jStringify(update[i]); hashMode = true; } for (targetArrIndex = 0; targetArrIndex < targetArrCount; targetArrIndex++) { if (hashMode) { // Check if objects match via a string hash (JSON) if (this.jStringify(targetArr[targetArrIndex]) === objHash) { // The object already exists, don't add it addObj = false; break; } } else { // Check if objects match based on the path if (objHash === pathSolver.value(targetArr[targetArrIndex])[0]) { // The object already exists, don't add it addObj = false; break; } } } if (addObj) { this._updatePush(doc[i], update[i]); updated = true; } } else { throw(this.logIdentifier() + ' Cannot addToSet on a key that is not an array! (' + i + ')'); } break; case '$splicePush': // Check if the target key is undefined and if so, create an array if (doc[i] === undefined) { // Initialise a new array this._updateProperty(doc, i, []); } // Check that the target key is an array if (doc[i] instanceof Array) { tempIndex = update.$index; if (tempIndex !== undefined) { delete update.$index; // Check for out of bounds index if (tempIndex > doc[i].length) { tempIndex = doc[i].length; } this._updateSplicePush(doc[i], tempIndex, update[i]); updated = true; } else { throw(this.logIdentifier() + ' Cannot splicePush without a $index integer value!'); } } else { throw(this.logIdentifier() + ' Cannot splicePush with a key that is not an array! (' + i + ')'); } break; case '$move': if (doc[i] instanceof Array) { // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { if (this._match(doc[i][tmpIndex], update[i], options, '', {})) { var moveToIndex = update.$index; if (moveToIndex !== undefined) { delete update.$index; this._updateSpliceMove(doc[i], tmpIndex, moveToIndex); updated = true; } else { throw(this.logIdentifier() + ' Cannot move without a $index integer value!'); } break; } } } else { throw(this.logIdentifier() + ' Cannot move on a key that is not an array! (' + i + ')'); } break; case '$mul': this._updateMultiply(doc, i, update[i]); updated = true; break; case '$rename': this._updateRename(doc, i, update[i]); updated = true; break; case '$overwrite': this._updateOverwrite(doc, i, update[i]); updated = true; break; case '$unset': this._updateUnset(doc, i); updated = true; break; case '$clear': this._updateClear(doc, i); updated = true; break; case '$pop': if (doc[i] instanceof Array) { if (this._updatePop(doc[i], update[i])) { updated = true; } } else { throw(this.logIdentifier() + ' Cannot pop from a key that is not an array! (' + i + ')'); } break; case '$toggle': // Toggle the boolean property between true and false this._updateProperty(doc, i, !doc[i]); updated = true; break; default: if (doc[i] !== update[i]) { this._updateProperty(doc, i, update[i]); updated = true; } break; } } } } } return updated; }; /** * Determines if the passed key has an array positional mark (a dollar at the end * of its name). * @param {String} key The key to check. * @returns {Boolean} True if it is a positional or false if not. * @private */ Collection.prototype._isPositionalKey = function (key) { return key.substr(key.length - 2, 2) === '.$'; }; /** * Removes any documents from the collection that match the search query * key/values. * @param {Object} query The query object. * @param {Object=} options An options object. * @param {Function=} callback A callback method. * @returns {Array} An array of the documents that were removed. */ Collection.prototype.remove = function (query, options, callback) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } var self = this, dataSet, index, arrIndex, returnArr, removeMethod, triggerOperation, doc, newDoc; if (typeof(options) === 'function') { callback = options; options = {}; } // Convert queries from mongo dot notation to forerunner queries if (this.mongoEmulation()) { this.convertToFdb(query); } if (query instanceof Array) { returnArr = []; for (arrIndex = 0; arrIndex < query.length; arrIndex++) { returnArr.push(this.remove(query[arrIndex], {noEmit: true})); } if (!options || (options && !options.noEmit)) { this._onRemove(returnArr); } if (callback) { callback(false, returnArr); } return returnArr; } else { returnArr = []; dataSet = this.find(query, {$decouple: false}); if (dataSet.length) { removeMethod = function (dataItem) { // Remove the item from the collection's indexes self._removeFromIndexes(dataItem); // Remove data from internal stores index = self._data.indexOf(dataItem); self._dataRemoveAtIndex(index); returnArr.push(dataItem); }; // Remove the data from the collection for (var i = 0; i < dataSet.length; i++) { doc = dataSet[i]; if (self.willTrigger(self.TYPE_REMOVE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_REMOVE, self.PHASE_AFTER)) { triggerOperation = { type: 'remove' }; newDoc = self.decouple(doc); if (self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_BEFORE, newDoc, newDoc) !== false) { // The trigger didn't ask to cancel so execute the removal method removeMethod(doc); self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_AFTER, newDoc, newDoc); } } else { // No triggers to execute removeMethod(doc); } } if (returnArr.length) { //op.time('Resolve chains'); self.chainSend('remove', { query: query, dataSet: returnArr }, options); //op.time('Resolve chains'); if (!options || (options && !options.noEmit)) { this._onRemove(returnArr); } this._onChange(); this.deferEmit('change', {type: 'remove', data: returnArr}); } } if (callback) { callback(false, returnArr); } return returnArr; } }; /** * Helper method that removes a document that matches the given id. * @param {String} id The id of the document to remove. * @returns {Array} An array of documents that were removed. */ Collection.prototype.removeById = function (id) { var searchObj = {}; searchObj[this._primaryKey] = id; return this.remove(searchObj); }; /** * Processes a deferred action queue. * @param {String} type The queue name to process. * @param {Function} callback A method to call when the queue has processed. * @param {Object=} resultObj A temp object to hold results in. */ Collection.prototype.processQueue = function (type, callback, resultObj) { var self = this, queue = this._deferQueue[type], deferThreshold = this._deferThreshold[type], deferTime = this._deferTime[type], dataArr, result; resultObj = resultObj || { deferred: true }; if (queue.length) { // Process items up to the threshold if (queue.length) { if (queue.length > deferThreshold) { // Grab items up to the threshold value dataArr = queue.splice(0, deferThreshold); } else { // Grab all the remaining items dataArr = queue.splice(0, queue.length); } result = self[type](dataArr); switch (type) { case 'insert': resultObj.inserted = resultObj.inserted || []; resultObj.failed = resultObj.failed || []; resultObj.inserted = resultObj.inserted.concat(result.inserted); resultObj.failed = resultObj.failed.concat(result.failed); break; } } // Queue another process setTimeout(function () { self.processQueue.call(self, type, callback, resultObj); }, deferTime); } else { if (callback) { callback(resultObj); } } // Check if all queues are complete if (!this.isProcessingQueue()) { this.emit('queuesComplete'); } }; /** * Checks if any CRUD operations have been deferred and are still waiting to * be processed. * @returns {Boolean} True if there are still deferred CRUD operations to process * or false if all queues are clear. */ Collection.prototype.isProcessingQueue = function () { var i; for (i in this._deferQueue) { if (this._deferQueue.hasOwnProperty(i)) { if (this._deferQueue[i].length) { return true; } } } return false; }; /** * Inserts a document or array of documents into the collection. * @param {Object|Array} data Either a document object or array of document * @param {Number=} index Optional index to insert the record at. * @param {Function=} callback Optional callback called once action is complete. * objects to insert into the collection. */ Collection.prototype.insert = function (data, index, callback) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } if (typeof(index) === 'function') { callback = index; index = this._data.length; } else if (index === undefined) { index = this._data.length; } data = this.transformIn(data); return this._insertHandle(data, index, callback); }; /** * Inserts a document or array of documents into the collection. * @param {Object|Array} data Either a document object or array of document * @param {Number=} index Optional index to insert the record at. * @param {Function=} callback Optional callback called once action is complete. * objects to insert into the collection. */ Collection.prototype._insertHandle = function (data, index, callback) { var //self = this, queue = this._deferQueue.insert, deferThreshold = this._deferThreshold.insert, //deferTime = this._deferTime.insert, inserted = [], failed = [], insertResult, resultObj, i; if (data instanceof Array) { // Check if there are more insert items than the insert defer // threshold, if so, break up inserts so we don't tie up the // ui or thread if (this._deferredCalls && data.length > deferThreshold) { // Break up insert into blocks this._deferQueue.insert = queue.concat(data); // Fire off the insert queue handler this.processQueue('insert', callback); return; } else { // Loop the array and add items for (i = 0; i < data.length; i++) { insertResult = this._insert(data[i], index + i); if (insertResult === true) { inserted.push(data[i]); } else { failed.push({ doc: data[i], reason: insertResult }); } } } } else { // Store the data item insertResult = this._insert(data, index); if (insertResult === true) { inserted.push(data); } else { failed.push({ doc: data, reason: insertResult }); } } resultObj = { deferred: false, inserted: inserted, failed: failed }; this._onInsert(inserted, failed); if (callback) { callback(resultObj); } this._onChange(); this.deferEmit('change', {type: 'insert', data: inserted}); return resultObj; }; /** * Internal method to insert a document into the collection. Will * check for index violations before allowing the document to be inserted. * @param {Object} doc The document to insert after passing index violation * tests. * @param {Number=} index Optional index to insert the document at. * @returns {Boolean|Object} True on success, false if no document passed, * or an object containing details about an index violation if one occurred. * @private */ Collection.prototype._insert = function (doc, index) { if (doc) { var self = this, indexViolation, triggerOperation, insertMethod, newDoc, capped = this.capped(), cappedSize = this.cappedSize(); this.ensurePrimaryKey(doc); // Check indexes are not going to be broken by the document indexViolation = this.insertIndexViolation(doc); insertMethod = function (doc) { // Add the item to the collection's indexes self._insertIntoIndexes(doc); // Check index overflow if (index > self._data.length) { index = self._data.length; } // Insert the document self._dataInsertAtIndex(index, doc); // Check capped collection status and remove first record // if we are over the threshold if (capped && self._data.length > cappedSize) { // Remove the first item in the data array self.removeById(self._data[0][self._primaryKey]); } //op.time('Resolve chains'); self.chainSend('insert', doc, {index: index}); //op.time('Resolve chains'); }; if (!indexViolation) { if (self.willTrigger(self.TYPE_INSERT, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) { triggerOperation = { type: 'insert' }; if (self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_BEFORE, {}, doc) !== false) { insertMethod(doc); if (self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) { // Clone the doc so that the programmer cannot update the internal document // on the "after" phase trigger newDoc = self.decouple(doc); self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_AFTER, {}, newDoc); } } else { // The trigger just wants to cancel the operation return 'Trigger cancelled operation'; } } else { // No triggers to execute insertMethod(doc); } return true; } else { return 'Index violation in index: ' + indexViolation; } } return 'No document passed to insert'; }; /** * Inserts a document into the internal collection data array at * Inserts a document into the internal collection data array at * the specified index. * @param {number} index The index to insert at. * @param {object} doc The document to insert. * @private */ Collection.prototype._dataInsertAtIndex = function (index, doc) { this._data.splice(index, 0, doc); }; /** * Removes a document from the internal collection data array at * the specified index. * @param {number} index The index to remove from. * @private */ Collection.prototype._dataRemoveAtIndex = function (index) { this._data.splice(index, 1); }; /** * Replaces all data in the collection's internal data array with * the passed array of data. * @param {array} data The array of data to replace existing data with. * @private */ Collection.prototype._dataReplace = function (data) { // Clear the array - using a while loop with pop is by far the // fastest way to clear an array currently while (this._data.length) { this._data.pop(); } // Append new items to the array this._data = this._data.concat(data); }; /** * Inserts a document into the collection indexes. * @param {Object} doc The document to insert. * @private */ Collection.prototype._insertIntoIndexes = function (doc) { var arr = this._indexByName, arrIndex, violated, jString = this.jStringify(doc); // Insert to primary key index violated = this._primaryIndex.uniqueSet(doc[this._primaryKey], doc); this._primaryCrc.uniqueSet(doc[this._primaryKey], jString); this._crcLookup.uniqueSet(jString, doc); // Insert into other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arr[arrIndex].insert(doc); } } return violated; }; /** * Removes a document from the collection indexes. * @param {Object} doc The document to remove. * @private */ Collection.prototype._removeFromIndexes = function (doc) { var arr = this._indexByName, arrIndex, jString = this.jStringify(doc); // Remove from primary key index this._primaryIndex.unSet(doc[this._primaryKey]); this._primaryCrc.unSet(doc[this._primaryKey]); this._crcLookup.unSet(jString); // Remove from other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arr[arrIndex].remove(doc); } } }; /** * Updates collection index data for the passed document. * @param {Object} oldDoc The old document as it was before the update. * @param {Object} newDoc The document as it now is after the update. * @private */ Collection.prototype._updateIndexes = function (oldDoc, newDoc) { this._removeFromIndexes(oldDoc); this._insertIntoIndexes(newDoc); }; /** * Rebuild collection indexes. * @private */ Collection.prototype._rebuildIndexes = function () { var arr = this._indexByName, arrIndex; // Remove from other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arr[arrIndex].rebuild(); } } }; /** * Uses the passed query to generate a new collection with results * matching the query parameters. * * @param {Object} query The query object to generate the subset with. * @param {Object=} options An options object. * @returns {*} */ Collection.prototype.subset = function (query, options) { var result = this.find(query, options); return new Collection() .subsetOf(this) .primaryKey(this._primaryKey) .setData(result); }; /** * Gets / sets the collection that this collection is a subset of. * @param {Collection=} collection The collection to set as the parent of this subset. * @returns {Collection} */ Shared.synthesize(Collection.prototype, 'subsetOf'); /** * Checks if the collection is a subset of the passed collection. * @param {Collection} collection The collection to test against. * @returns {Boolean} True if the passed collection is the parent of * the current collection. */ Collection.prototype.isSubsetOf = function (collection) { return this._subsetOf === collection; }; /** * Find the distinct values for a specified field across a single collection and * returns the results in an array. * @param {String} key The field path to return distinct values for e.g. "person.name". * @param {Object=} query The query to use to filter the documents used to return values from. * @param {Object=} options The query options to use when running the query. * @returns {Array} */ Collection.prototype.distinct = function (key, query, options) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } var data = this.find(query, options), pathSolver = new Path(key), valueUsed = {}, distinctValues = [], value, i; // Loop the data and build array of distinct values for (i = 0; i < data.length; i++) { value = pathSolver.value(data[i])[0]; if (value && !valueUsed[value]) { valueUsed[value] = true; distinctValues.push(value); } } return distinctValues; }; /** * Helper method to find a document by it's id. * @param {String} id The id of the document. * @param {Object=} options The options object, allowed keys are sort and limit. * @returns {Array} The items that were updated. */ Collection.prototype.findById = function (id, options) { var searchObj = {}; searchObj[this._primaryKey] = id; return this.find(searchObj, options)[0]; }; /** * Finds all documents that contain the passed string or search object * regardless of where the string might occur within the document. This * will match strings from the start, middle or end of the document's * string (partial match). * @param search The string to search for. Case sensitive. * @param options A standard find() options object. * @returns {Array} An array of documents that matched the search string. */ Collection.prototype.peek = function (search, options) { // Loop all items var arr = this._data, arrCount = arr.length, arrIndex, arrItem, tempColl = new Collection(), typeOfSearch = typeof search; if (typeOfSearch === 'string') { for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { // Get json representation of object arrItem = this.jStringify(arr[arrIndex]); // Check if string exists in object json if (arrItem.indexOf(search) > -1) { // Add this item to the temp collection tempColl.insert(arr[arrIndex]); } } return tempColl.find({}, options); } else { return this.find(search, options); } }; /** * Provides a query plan / operations log for a query. * @param {Object} query The query to execute. * @param {Object=} options Optional options object. * @returns {Object} The query plan. */ Collection.prototype.explain = function (query, options) { var result = this.find(query, options); return result.__fdbOp._data; }; /** * Generates an options object with default values or adds default * values to a passed object if those values are not currently set * to anything. * @param {object=} obj Optional options object to modify. * @returns {object} The options object. */ Collection.prototype.options = function (obj) { obj = obj || {}; obj.$decouple = obj.$decouple !== undefined ? obj.$decouple : true; obj.$explain = obj.$explain !== undefined ? obj.$explain : false; return obj; }; /** * Queries the collection based on the query object passed. * @param {Object} query The query key/values that a document must match in * order for it to be returned in the result array. * @param {Object=} options An optional options object. * @param {Function=} callback !! DO NOT USE, THIS IS NON-OPERATIONAL !! * Optional callback. If specified the find process * will not return a value and will assume that you wish to operate under an * async mode. This will break up large find requests into smaller chunks and * process them in a non-blocking fashion allowing large datasets to be queried * without causing the browser UI to pause. Results from this type of operation * will be passed back to the callback once completed. * * @returns {Array} The results array from the find operation, containing all * documents that matched the query. */ Collection.prototype.find = function (query, options, callback) { // Convert queries from mongo dot notation to forerunner queries if (this.mongoEmulation()) { this.convertToFdb(query); } if (callback) { // Check the size of the collection's data array // Split operation into smaller tasks and callback when complete callback('Callbacks for the find() operation are not yet implemented!', []); return []; } return this._find.apply(this, arguments); }; Collection.prototype._find = function (query, options) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } // TODO: This method is quite long, break into smaller pieces query = query || {}; options = this.options(options); var op = this._metrics.create('find'), pk = this.primaryKey(), self = this, analysis, scanLength, requiresTableScan = true, resultArr, joinCollectionIndex, joinIndex, joinCollection = {}, joinQuery, joinPath, joinCollectionName, joinCollectionInstance, joinMatch, joinMatchIndex, joinSearchQuery, joinSearchOptions, joinMulti, joinRequire, joinFindResults, joinFindResult, joinItem, joinPrefix, resultCollectionName, resultIndex, resultRemove = [], index, i, j, k, l, fieldListOn = [], fieldListOff = [], elemMatchPathSolver, elemMatchSubArr, elemMatchSpliceArr, matcherTmpOptions = {}, result, cursor = {}, //renameFieldMethod, //renameFieldPath, matcher = function (doc) { return self._match(doc, query, options, 'and', matcherTmpOptions); }; op.start(); if (query) { // Get query analysis to execute best optimised code path op.time('analyseQuery'); analysis = this._analyseQuery(self.decouple(query), options, op); op.time('analyseQuery'); op.data('analysis', analysis); if (analysis.hasJoin && analysis.queriesJoin) { // The query has a join and tries to limit by it's joined data // Get an instance reference to the join collections op.time('joinReferences'); for (joinIndex = 0; joinIndex < analysis.joinsOn.length; joinIndex++) { joinCollectionName = analysis.joinsOn[joinIndex]; joinPath = new Path(analysis.joinQueries[joinCollectionName]); joinQuery = joinPath.value(query)[0]; joinCollection[analysis.joinsOn[joinIndex]] = this._db.collection(analysis.joinsOn[joinIndex]).subset(joinQuery); // Remove join clause from main query delete query[analysis.joinQueries[joinCollectionName]]; } op.time('joinReferences'); } // Check if an index lookup can be used to return this result if (analysis.indexMatch.length && (!options || (options && !options.$skipIndex))) { op.data('index.potential', analysis.indexMatch); op.data('index.used', analysis.indexMatch[0].index); // Get the data from the index op.time('indexLookup'); resultArr = analysis.indexMatch[0].lookup || []; op.time('indexLookup'); // Check if the index coverage is all keys, if not we still need to table scan it if (analysis.indexMatch[0].keyData.totalKeyCount === analysis.indexMatch[0].keyData.score) { // Don't require a table scan to find relevant documents requiresTableScan = false; } } else { op.flag('usedIndex', false); } if (requiresTableScan) { if (resultArr && resultArr.length) { scanLength = resultArr.length; op.time('tableScan: ' + scanLength); // Filter the source data and return the result resultArr = resultArr.filter(matcher); } else { // Filter the source data and return the result scanLength = this._data.length; op.time('tableScan: ' + scanLength); resultArr = this._data.filter(matcher); } op.time('tableScan: ' + scanLength); } // Order the array if we were passed a sort clause if (options.$orderBy) { op.time('sort'); resultArr = this.sort(options.$orderBy, resultArr); op.time('sort'); } if (options.$page !== undefined && options.$limit !== undefined) { // Record paging data cursor.page = options.$page; cursor.pages = Math.ceil(resultArr.length / options.$limit); cursor.records = resultArr.length; // Check if we actually need to apply the paging logic if (options.$page && options.$limit > 0) { op.data('cursor', cursor); // Skip to the page specified based on limit resultArr.splice(0, options.$page * options.$limit); } } if (options.$skip) { cursor.skip = options.$skip; // Skip past the number of records specified resultArr.splice(0, options.$skip); op.data('skip', options.$skip); } if (options.$limit && resultArr && resultArr.length > options.$limit) { cursor.limit = options.$limit; resultArr.length = options.$limit; op.data('limit', options.$limit); } if (options.$decouple) { // Now decouple the data from the original objects op.time('decouple'); resultArr = this.decouple(resultArr); op.time('decouple'); op.data('flag.decouple', true); } // Now process any joins on the final data if (options.$join) { for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) { for (joinCollectionName in options.$join[joinCollectionIndex]) { if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) { // Set the key to store the join result in to the collection name by default resultCollectionName = joinCollectionName; // Get the join collection instance from the DB if (joinCollection[joinCollectionName]) { joinCollectionInstance = joinCollection[joinCollectionName]; } else { joinCollectionInstance = this._db.collection(joinCollectionName); } // Get the match data for the join joinMatch = options.$join[joinCollectionIndex][joinCollectionName]; // Loop our result data array for (resultIndex = 0; resultIndex < resultArr.length; resultIndex++) { // Loop the join conditions and build a search object from them joinSearchQuery = {}; joinMulti = false; joinRequire = false; joinPrefix = ''; for (joinMatchIndex in joinMatch) { if (joinMatch.hasOwnProperty(joinMatchIndex)) { // Check the join condition name for a special command operator if (joinMatchIndex.substr(0, 1) === '$') { // Special command switch (joinMatchIndex) { case '$where': if (joinMatch[joinMatchIndex].query) { // Commented old code here, new one does dynamic reverse lookups //joinSearchQuery = joinMatch[joinMatchIndex].query; joinSearchQuery = self._resolveDynamicQuery(joinMatch[joinMatchIndex].query, resultArr[resultIndex]); } if (joinMatch[joinMatchIndex].options) { joinSearchOptions = joinMatch[joinMatchIndex].options; } break; case '$as': // Rename the collection when stored in the result document resultCollectionName = joinMatch[joinMatchIndex]; break; case '$multi': // Return an array of documents instead of a single matching document joinMulti = joinMatch[joinMatchIndex]; break; case '$require': // Remove the result item if no matching join data is found joinRequire = joinMatch[joinMatchIndex]; break; case '$prefix': // Add a prefix to properties mixed in joinPrefix = joinMatch[joinMatchIndex]; break; default: break; } } else { // Get the data to match against and store in the search object // Resolve complex referenced query joinSearchQuery[joinMatchIndex] = self._resolveDynamicQuery(joinMatch[joinMatchIndex], resultArr[resultIndex]); } } } // Do a find on the target collection against the match data joinFindResults = joinCollectionInstance.find(joinSearchQuery, joinSearchOptions); // Check if we require a joined row to allow the result item if (!joinRequire || (joinRequire && joinFindResults[0])) { // Join is not required or condition is met if (resultCollectionName === '$root') { // The property name to store the join results in is $root // which means we need to mixin the results but this only // works if joinMulti is disabled if (joinMulti !== false) { // Throw an exception here as this join is not physically possible! throw(this.logIdentifier() + ' Cannot combine [$as: "$root"] with [$multi: true] in $join clause!'); } // Mixin the result joinFindResult = joinFindResults[0]; joinItem = resultArr[resultIndex]; for (l in joinFindResult) { if (joinFindResult.hasOwnProperty(l) && joinItem[joinPrefix + l] === undefined) { // Properties are only mixed in if they do not already exist // in the target item (are undefined). Using a prefix denoted via // $prefix is a good way to prevent property name conflicts joinItem[joinPrefix + l] = joinFindResult[l]; } } } else { resultArr[resultIndex][resultCollectionName] = joinMulti === false ? joinFindResults[0] : joinFindResults; } } else { // Join required but condition not met, add item to removal queue resultRemove.push(resultArr[resultIndex]); } } } } } op.data('flag.join', true); } // Process removal queue if (resultRemove.length) { op.time('removalQueue'); for (i = 0; i < resultRemove.length; i++) { index = resultArr.indexOf(resultRemove[i]); if (index > -1) { resultArr.splice(index, 1); } } op.time('removalQueue'); } if (options.$transform) { op.time('transform'); for (i = 0; i < resultArr.length; i++) { resultArr.splice(i, 1, options.$transform(resultArr[i])); } op.time('transform'); op.data('flag.transform', true); } // Process transforms if (this._transformEnabled && this._transformOut) { op.time('transformOut'); resultArr = this.transformOut(resultArr); op.time('transformOut'); } op.data('results', resultArr.length); } else { resultArr = []; } // Check for an $as operator in the options object and if it exists // iterate over the fields and generate a rename function that will // operate over the entire returned data array and rename each object's // fields to their new names // TODO: Enable $as in collection find to allow renaming fields /*if (options.$as) { renameFieldPath = new Path(); renameFieldMethod = function (obj, oldFieldPath, newFieldName) { renameFieldPath.path(oldFieldPath); renameFieldPath.rename(newFieldName); }; for (i in options.$as) { if (options.$as.hasOwnProperty(i)) { } } }*/ // Generate a list of fields to limit data by // Each property starts off being enabled by default (= 1) then // if any property is explicitly specified as 1 then all switch to // zero except _id. // // Any that are explicitly set to zero are switched off. op.time('scanFields'); for (i in options) { if (options.hasOwnProperty(i) && i.indexOf('$') !== 0) { if (options[i] === 1) { fieldListOn.push(i); } else if (options[i] === 0) { fieldListOff.push(i); } } } op.time('scanFields'); // Limit returned fields by the options data if (fieldListOn.length || fieldListOff.length) { op.data('flag.limitFields', true); op.data('limitFields.on', fieldListOn); op.data('limitFields.off', fieldListOff); op.time('limitFields'); // We have explicit fields switched on or off for (i = 0; i < resultArr.length; i++) { result = resultArr[i]; for (j in result) { if (result.hasOwnProperty(j)) { if (fieldListOn.length) { // We have explicit fields switched on so remove all fields // that are not explicitly switched on // Check if the field name is not the primary key if (j !== pk) { if (fieldListOn.indexOf(j) === -1) { // This field is not in the on list, remove it delete result[j]; } } } if (fieldListOff.length) { // We have explicit fields switched off so remove fields // that are explicitly switched off if (fieldListOff.indexOf(j) > -1) { // This field is in the off list, remove it delete result[j]; } } } } } op.time('limitFields'); } // Now run any projections on the data required if (options.$elemMatch) { op.data('flag.elemMatch', true); op.time('projection-elemMatch'); for (i in options.$elemMatch) { if (options.$elemMatch.hasOwnProperty(i)) { elemMatchPathSolver = new Path(i); // Loop the results array for (j = 0; j < resultArr.length; j++) { elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0]; // Check we have a sub-array to loop if (elemMatchSubArr && elemMatchSubArr.length) { // Loop the sub-array and check for projection query matches for (k = 0; k < elemMatchSubArr.length; k++) { // Check if the current item in the sub-array matches the projection query if (self._match(elemMatchSubArr[k], options.$elemMatch[i], options, '', {})) { // The item matches the projection query so set the sub-array // to an array that ONLY contains the matching item and then // exit the loop since we only want to match the first item elemMatchPathSolver.set(resultArr[j], i, [elemMatchSubArr[k]]); break; } } } } } } op.time('projection-elemMatch'); } if (options.$elemsMatch) { op.data('flag.elemsMatch', true); op.time('projection-elemsMatch'); for (i in options.$elemsMatch) { if (options.$elemsMatch.hasOwnProperty(i)) { elemMatchPathSolver = new Path(i); // Loop the results array for (j = 0; j < resultArr.length; j++) { elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0]; // Check we have a sub-array to loop if (elemMatchSubArr && elemMatchSubArr.length) { elemMatchSpliceArr = []; // Loop the sub-array and check for projection query matches for (k = 0; k < elemMatchSubArr.length; k++) { // Check if the current item in the sub-array matches the projection query if (self._match(elemMatchSubArr[k], options.$elemsMatch[i], options, '', {})) { // The item matches the projection query so add it to the final array elemMatchSpliceArr.push(elemMatchSubArr[k]); } } // Now set the final sub-array to the matched items elemMatchPathSolver.set(resultArr[j], i, elemMatchSpliceArr); } } } } op.time('projection-elemsMatch'); } op.stop(); resultArr.__fdbOp = op; resultArr.$cursor = cursor; return resultArr; }; Collection.prototype._resolveDynamicQuery = function (query, item) { var self = this, newQuery, propType, propVal, pathResult, i; if (typeof query === 'string') { // Check if the property name starts with a back-reference if (query.substr(0, 3) === '$$.') { // Fill the query with a back-referenced value pathResult = new Path(query.substr(3, query.length - 3)).value(item); } else { pathResult = new Path(query).value(item); } if (pathResult.length > 1) { return {$in: pathResult}; } else { return pathResult[0]; } } newQuery = {}; for (i in query) { if (query.hasOwnProperty(i)) { propType = typeof query[i]; propVal = query[i]; switch (propType) { case 'string': // Check if the property name starts with a back-reference if (propVal.substr(0, 3) === '$$.') { // Fill the query with a back-referenced value newQuery[i] = new Path(propVal.substr(3, propVal.length - 3)).value(item)[0]; } else { newQuery[i] = propVal; } break; case 'object': newQuery[i] = self._resolveDynamicQuery(propVal, item); break; default: newQuery[i] = propVal; break; } } } return newQuery; }; /** * Returns one document that satisfies the specified query criteria. If multiple * documents satisfy the query, this method returns the first document to match * the query. * @returns {*} */ Collection.prototype.findOne = function () { return (this.find.apply(this, arguments))[0]; }; /** * Gets the index in the collection data array of the first item matched by * the passed query object. * @param {Object} query The query to run to find the item to return the index of. * @param {Object=} options An options object. * @returns {Number} */ Collection.prototype.indexOf = function (query, options) { var item = this.find(query, {$decouple: false})[0], sortedData; if (item) { if (!options || options && !options.$orderBy) { // Basic lookup from order of insert return this._data.indexOf(item); } else { // Trying to locate index based on query with sort order options.$decouple = false; sortedData = this.find(query, options); return sortedData.indexOf(item); } } return -1; }; /** * Returns the index of the document identified by the passed item's primary key. * @param {*} itemLookup The document whose primary key should be used to lookup * or the id to lookup. * @param {Object=} options An options object. * @returns {Number} The index the item with the matching primary key is occupying. */ Collection.prototype.indexOfDocById = function (itemLookup, options) { var item, sortedData; if (typeof itemLookup !== 'object') { item = this._primaryIndex.get(itemLookup); } else { item = this._primaryIndex.get(itemLookup[this._primaryKey]); } if (item) { if (!options || options && !options.$orderBy) { // Basic lookup return this._data.indexOf(item); } else { // Sorted lookup options.$decouple = false; sortedData = this.find({}, options); return sortedData.indexOf(item); } } return -1; }; /** * Removes a document from the collection by it's index in the collection's * data array. * @param {Number} index The index of the document to remove. * @returns {Object} The document that has been removed or false if none was * removed. */ Collection.prototype.removeByIndex = function (index) { var doc, docId; doc = this._data[index]; if (doc !== undefined) { doc = this.decouple(doc); docId = doc[this.primaryKey()]; return this.removeById(docId); } return false; }; /** * Gets / sets the collection transform options. * @param {Object} obj A collection transform options object. * @returns {*} */ Collection.prototype.transform = function (obj) { if (obj !== undefined) { if (typeof obj === "object") { if (obj.enabled !== undefined) { this._transformEnabled = obj.enabled; } if (obj.dataIn !== undefined) { this._transformIn = obj.dataIn; } if (obj.dataOut !== undefined) { this._transformOut = obj.dataOut; } } else { this._transformEnabled = obj !== false; } return this; } return { enabled: this._transformEnabled, dataIn: this._transformIn, dataOut: this._transformOut }; }; /** * Transforms data using the set transformIn method. * @param {Object} data The data to transform. * @returns {*} */ Collection.prototype.transformIn = function (data) { if (this._transformEnabled && this._transformIn) { if (data instanceof Array) { var finalArr = [], i; for (i = 0; i < data.length; i++) { finalArr[i] = this._transformIn(data[i]); } return finalArr; } else { return this._transformIn(data); } } return data; }; /** * Transforms data using the set transformOut method. * @param {Object} data The data to transform. * @returns {*} */ Collection.prototype.transformOut = function (data) { if (this._transformEnabled && this._transformOut) { if (data instanceof Array) { var finalArr = [], i; for (i = 0; i < data.length; i++) { finalArr[i] = this._transformOut(data[i]); } return finalArr; } else { return this._transformOut(data); } } return data; }; /** * Sorts an array of documents by the given sort path. * @param {*} sortObj The keys and orders the array objects should be sorted by. * @param {Array} arr The array of documents to sort. * @returns {Array} */ Collection.prototype.sort = function (sortObj, arr) { // Make sure we have an array object arr = arr || []; var sortArr = [], sortKey, sortSingleObj; for (sortKey in sortObj) { if (sortObj.hasOwnProperty(sortKey)) { sortSingleObj = {}; sortSingleObj[sortKey] = sortObj[sortKey]; sortSingleObj.___fdbKey = String(sortKey); sortArr.push(sortSingleObj); } } if (sortArr.length < 2) { // There is only one sort criteria, do a simple sort and return it return this._sort(sortObj, arr); } else { return this._bucketSort(sortArr, arr); } }; /** * Takes array of sort paths and sorts them into buckets before returning final * array fully sorted by multi-keys. * @param keyArr * @param arr * @returns {*} * @private */ Collection.prototype._bucketSort = function (keyArr, arr) { var keyObj = keyArr.shift(), arrCopy, bucketData, bucketOrder, bucketKey, buckets, i, finalArr = []; if (keyArr.length > 0) { // Sort array by bucket key arr = this._sort(keyObj, arr); // Split items into buckets bucketData = this.bucket(keyObj.___fdbKey, arr); bucketOrder = bucketData.order; buckets = bucketData.buckets; // Loop buckets and sort contents for (i = 0; i < bucketOrder.length; i++) { bucketKey = bucketOrder[i]; arrCopy = [].concat(keyArr); finalArr = finalArr.concat(this._bucketSort(arrCopy, buckets[bucketKey])); } return finalArr; } else { return this._sort(keyObj, arr); } }; /** * Sorts array by individual sort path. * @param key * @param arr * @returns {Array|*} * @private */ Collection.prototype._sort = function (key, arr) { var self = this, sorterMethod, pathSolver = new Path(), dataPath = pathSolver.parse(key, true)[0]; pathSolver.path(dataPath.path); if (dataPath.value === 1) { // Sort ascending sorterMethod = function (a, b) { var valA = pathSolver.value(a)[0], valB = pathSolver.value(b)[0]; return self.sortAsc(valA, valB); }; } else if (dataPath.value === -1) { // Sort descending sorterMethod = function (a, b) { var valA = pathSolver.value(a)[0], valB = pathSolver.value(b)[0]; return self.sortDesc(valA, valB); }; } else { throw(this.logIdentifier() + ' $orderBy clause has invalid direction: ' + dataPath.value + ', accepted values are 1 or -1 for ascending or descending!'); } return arr.sort(sorterMethod); }; /** * Takes an array of objects and returns a new object with the array items * split into buckets by the passed key. * @param {String} key The key to split the array into buckets by. * @param {Array} arr An array of objects. * @returns {Object} */ Collection.prototype.bucket = function (key, arr) { var i, oldField, field, fieldArr = [], buckets = {}; for (i = 0; i < arr.length; i++) { field = String(arr[i][key]); if (oldField !== field) { fieldArr.push(field); oldField = field; } buckets[field] = buckets[field] || []; buckets[field].push(arr[i]); } return { buckets: buckets, order: fieldArr }; }; /** * Internal method that takes a search query and options and returns an object * containing details about the query which can be used to optimise the search. * * @param query * @param options * @param op * @returns {Object} * @private */ Collection.prototype._analyseQuery = function (query, options, op) { var analysis = { queriesOn: [this._name], indexMatch: [], hasJoin: false, queriesJoin: false, joinQueries: {}, query: query, options: options }, joinCollectionIndex, joinCollectionName, joinCollections = [], joinCollectionReferences = [], queryPath, index, indexMatchData, indexRef, indexRefName, indexLookup, pathSolver, queryKeyCount, i; // Check if the query is a primary key lookup op.time('checkIndexes'); pathSolver = new Path(); queryKeyCount = pathSolver.countKeys(query); if (queryKeyCount) { if (query[this._primaryKey] !== undefined) { // Return item via primary key possible op.time('checkIndexMatch: Primary Key'); analysis.indexMatch.push({ lookup: this._primaryIndex.lookup(query, options), keyData: { matchedKeys: [this._primaryKey], totalKeyCount: queryKeyCount, score: 1 }, index: this._primaryIndex }); op.time('checkIndexMatch: Primary Key'); } // Check if an index can speed up the query for (i in this._indexById) { if (this._indexById.hasOwnProperty(i)) { indexRef = this._indexById[i]; indexRefName = indexRef.name(); op.time('checkIndexMatch: ' + indexRefName); indexMatchData = indexRef.match(query, options); if (indexMatchData.score > 0) { // This index can be used, store it indexLookup = indexRef.lookup(query, options); analysis.indexMatch.push({ lookup: indexLookup, keyData: indexMatchData, index: indexRef }); } op.time('checkIndexMatch: ' + indexRefName); if (indexMatchData.score === queryKeyCount) { // Found an optimal index, do not check for any more break; } } } op.time('checkIndexes'); // Sort array descending on index key count (effectively a measure of relevance to the query) if (analysis.indexMatch.length > 1) { op.time('findOptimalIndex'); analysis.indexMatch.sort(function (a, b) { if (a.keyData.score > b.keyData.score) { // This index has a higher score than the other return -1; } if (a.keyData.score < b.keyData.score) { // This index has a lower score than the other return 1; } // The indexes have the same score but can still be compared by the number of records // they return from the query. The fewer records they return the better so order by // record count if (a.keyData.score === b.keyData.score) { return a.lookup.length - b.lookup.length; } }); op.time('findOptimalIndex'); } } // Check for join data if (options.$join) { analysis.hasJoin = true; // Loop all join operations for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) { // Loop the join collections and keep a reference to them for (joinCollectionName in options.$join[joinCollectionIndex]) { if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) { joinCollections.push(joinCollectionName); // Check if the join uses an $as operator if ('$as' in options.$join[joinCollectionIndex][joinCollectionName]) { joinCollectionReferences.push(options.$join[joinCollectionIndex][joinCollectionName].$as); } else { joinCollectionReferences.push(joinCollectionName); } } } } // Loop the join collection references and determine if the query references // any of the collections that are used in the join. If there no queries against // joined collections the find method can use a code path optimised for this. // Queries against joined collections requires the joined collections to be filtered // first and then joined so requires a little more work. for (index = 0; index < joinCollectionReferences.length; index++) { // Check if the query references any collection data that the join will create queryPath = this._queryReferencesCollection(query, joinCollectionReferences[index], ''); if (queryPath) { analysis.joinQueries[joinCollections[index]] = queryPath; analysis.queriesJoin = true; } } analysis.joinsOn = joinCollections; analysis.queriesOn = analysis.queriesOn.concat(joinCollections); } return analysis; }; /** * Checks if the passed query references this collection. * @param query * @param collection * @param path * @returns {*} * @private */ Collection.prototype._queryReferencesCollection = function (query, collection, path) { var i; for (i in query) { if (query.hasOwnProperty(i)) { // Check if this key is a reference match if (i === collection) { if (path) { path += '.'; } return path + i; } else { if (typeof(query[i]) === 'object') { // Recurse if (path) { path += '.'; } path += i; return this._queryReferencesCollection(query[i], collection, path); } } } } return false; }; /** * Returns the number of documents currently in the collection. * @returns {Number} */ Collection.prototype.count = function (query, options) { if (!query) { return this._data.length; } else { // Run query and return count return this.find(query, options).length; } }; /** * Finds sub-documents from the collection's documents. * @param {Object} match The query object to use when matching parent documents * from which the sub-documents are queried. * @param {String} path The path string used to identify the key in which * sub-documents are stored in parent documents. * @param {Object=} subDocQuery The query to use when matching which sub-documents * to return. * @param {Object=} subDocOptions The options object to use when querying for * sub-documents. * @returns {*} */ Collection.prototype.findSub = function (match, path, subDocQuery, subDocOptions) { var pathHandler = new Path(path), docArr = this.find(match), docCount = docArr.length, docIndex, subDocArr, subDocCollection = this._db.collection('__FDB_temp_' + this.objectId()), subDocResults, resultObj = { parents: docCount, subDocTotal: 0, subDocs: [], pathFound: false, err: '' }; subDocOptions = subDocOptions || {}; for (docIndex = 0; docIndex < docCount; docIndex++) { subDocArr = pathHandler.value(docArr[docIndex])[0]; if (subDocArr) { subDocCollection.setData(subDocArr); subDocResults = subDocCollection.find(subDocQuery, subDocOptions); if (subDocOptions.returnFirst && subDocResults.length) { return subDocResults[0]; } if (subDocOptions.$split) { resultObj.subDocs.push(subDocResults); } else { resultObj.subDocs = resultObj.subDocs.concat(subDocResults); } resultObj.subDocTotal += subDocResults.length; resultObj.pathFound = true; } } // Drop the sub-document collection subDocCollection.drop(); // Check if the call should not return stats, if so return only subDocs array if (subDocOptions.$stats) { return resultObj; } else { return resultObj.subDocs; } if (!resultObj.pathFound) { resultObj.err = 'No objects found in the parent documents with a matching path of: ' + path; } return resultObj; }; /** * Finds the first sub-document from the collection's documents that matches * the subDocQuery parameter. * @param {Object} match The query object to use when matching parent documents * from which the sub-documents are queried. * @param {String} path The path string used to identify the key in which * sub-documents are stored in parent documents. * @param {Object=} subDocQuery The query to use when matching which sub-documents * to return. * @param {Object=} subDocOptions The options object to use when querying for * sub-documents. * @returns {Object} */ Collection.prototype.findSubOne = function (match, path, subDocQuery, subDocOptions) { return this.findSub(match, path, subDocQuery, subDocOptions)[0]; }; /** * Checks that the passed document will not violate any index rules if * inserted into the collection. * @param {Object} doc The document to check indexes against. * @returns {Boolean} Either false (no violation occurred) or true if * a violation was detected. */ Collection.prototype.insertIndexViolation = function (doc) { var indexViolated, arr = this._indexByName, arrIndex, arrItem; // Check the item's primary key is not already in use if (this._primaryIndex.get(doc[this._primaryKey])) { indexViolated = this._primaryIndex; } else { // Check violations of other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arrItem = arr[arrIndex]; if (arrItem.unique()) { if (arrItem.violation(doc)) { indexViolated = arrItem; break; } } } } } return indexViolated ? indexViolated.name() : false; }; /** * Creates an index on the specified keys. * @param {Object} keys The object containing keys to index. * @param {Object} options An options object. * @returns {*} */ Collection.prototype.ensureIndex = function (keys, options) { if (this.isDropped()) { throw(this.logIdentifier() + ' Cannot operate in a dropped state!'); } this._indexByName = this._indexByName || {}; this._indexById = this._indexById || {}; var index, time = { start: new Date().getTime() }; if (options) { switch (options.type) { case 'hashed': index = new IndexHashMap(keys, options, this); break; case 'btree': index = new IndexBinaryTree(keys, options, this); break; default: // Default index = new IndexHashMap(keys, options, this); break; } } else { // Default index = new IndexHashMap(keys, options, this); } // Check the index does not already exist if (this._indexByName[index.name()]) { // Index already exists return { err: 'Index with that name already exists' }; } if (this._indexById[index.id()]) { // Index already exists return { err: 'Index with those keys already exists' }; } // Create the index index.rebuild(); // Add the index this._indexByName[index.name()] = index; this._indexById[index.id()] = index; time.end = new Date().getTime(); time.total = time.end - time.start; this._lastOp = { type: 'ensureIndex', stats: { time: time } }; return { index: index, id: index.id(), name: index.name(), state: index.state() }; }; /** * Gets an index by it's name. * @param {String} name The name of the index to retreive. * @returns {*} */ Collection.prototype.index = function (name) { if (this._indexByName) { return this._indexByName[name]; } }; /** * Gets the last reporting operation's details such as run time. * @returns {Object} */ Collection.prototype.lastOp = function () { return this._metrics.list(); }; /** * Generates a difference object that contains insert, update and remove arrays * representing the operations to execute to make this collection have the same * data as the one passed. * @param {Collection} collection The collection to diff against. * @returns {{}} */ Collection.prototype.diff = function (collection) { var diff = { insert: [], update: [], remove: [] }; var pm = this.primaryKey(), arr, arrIndex, arrItem, arrCount; // Check if the primary key index of each collection can be utilised if (pm !== collection.primaryKey()) { throw(this.logIdentifier() + ' Diffing requires that both collections have the same primary key!'); } // Use the collection primary key index to do the diff (super-fast) arr = collection._data; // Check if we have an array or another collection while (arr && !(arr instanceof Array)) { // We don't have an array, assign collection and get data collection = arr; arr = collection._data; } arrCount = arr.length; // Loop the collection's data array and check for matching items for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arrItem = arr[arrIndex]; // Check for a matching item in this collection if (this._primaryIndex.get(arrItem[pm])) { // Matching item exists, check if the data is the same if (this._primaryCrc.get(arrItem[pm]) !== collection._primaryCrc.get(arrItem[pm])) { // The documents exist in both collections but data differs, update required diff.update.push(arrItem); } } else { // The document is missing from this collection, insert required diff.insert.push(arrItem); } } // Now loop this collection's data and check for matching items arr = this._data; arrCount = arr.length; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arrItem = arr[arrIndex]; if (!collection._primaryIndex.get(arrItem[pm])) { // The document does not exist in the other collection, remove required diff.remove.push(arrItem); } } return diff; }; Collection.prototype.collateAdd = new Overload({ /** * Adds a data source to collate data from and specifies the * key name to collate data to. * @func collateAdd * @memberof Collection * @param {Collection} collection The collection to collate data from. * @param {String=} keyName Optional name of the key to collate data to. * If none is provided the record CRUD is operated on the root collection * data. */ 'object, string': function (collection, keyName) { var self = this; self.collateAdd(collection, function (packet) { var obj1, obj2; switch (packet.type) { case 'insert': if (keyName) { obj1 = { $push: {} }; obj1.$push[keyName] = self.decouple(packet.data); self.update({}, obj1); } else { self.insert(packet.data); } break; case 'update': if (keyName) { obj1 = {}; obj2 = {}; obj1[keyName] = packet.data.query; obj2[keyName + '.$'] = packet.data.update; self.update(obj1, obj2); } else { self.update(packet.data.query, packet.data.update); } break; case 'remove': if (keyName) { obj1 = { $pull: {} }; obj1.$pull[keyName] = {}; obj1.$pull[keyName][self.primaryKey()] = packet.data.dataSet[0][collection.primaryKey()]; self.update({}, obj1); } else { self.remove(packet.data); } break; default: } }); }, /** * Adds a data source to collate data from and specifies a process * method that will handle the collation functionality (for custom * collation). * @func collateAdd * @memberof Collection * @param {Collection} collection The collection to collate data from. * @param {Function} process The process method. */ 'object, function': function (collection, process) { if (typeof collection === 'string') { // The collection passed is a name, not a reference so get // the reference from the name collection = this._db.collection(collection, { autoCreate: false, throwError: false }); } if (collection) { this._collate = this._collate || {}; this._collate[collection.name()] = new ReactorIO(collection, this, process); return this; } else { throw('Cannot collate from a non-existent collection!'); } } }); Collection.prototype.collateRemove = function (collection) { if (typeof collection === 'object') { // We need to have the name of the collection to remove it collection = collection.name(); } if (collection) { // Drop the reactor IO chain node this._collate[collection].drop(); // Remove the collection data from the collate object delete this._collate[collection]; return this; } else { throw('No collection name passed to collateRemove() or collection not found!'); } }; Db.prototype.collection = new Overload({ /** * Get a collection with no name (generates a random name). If the * collection does not already exist then one is created for that * name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @returns {Collection} */ '': function () { return this.$main.call(this, { name: this.objectId() }); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {Object} data An options object or a collection instance. * @returns {Collection} */ 'object': function (data) { // Handle being passed an instance if (data instanceof Collection) { if (data.state() !== 'droppped') { return data; } else { return this.$main.call(this, { name: data.name() }); } } return this.$main.call(this, data); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @returns {Collection} */ 'string': function (collectionName) { return this.$main.call(this, { name: collectionName }); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @param {String} primaryKey Optional primary key to specify the primary key field on the collection * objects. Defaults to "_id". * @returns {Collection} */ 'string, string': function (collectionName, primaryKey) { return this.$main.call(this, { name: collectionName, primaryKey: primaryKey }); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @param {Object} options An options object. * @returns {Collection} */ 'string, object': function (collectionName, options) { options.name = collectionName; return this.$main.call(this, options); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @param {String} primaryKey Optional primary key to specify the primary key field on the collection * objects. Defaults to "_id". * @param {Object} options An options object. * @returns {Collection} */ 'string, string, object': function (collectionName, primaryKey, options) { options.name = collectionName; options.primaryKey = primaryKey; return this.$main.call(this, options); }, /** * The main handler method. This gets called by all the other variants and * handles the actual logic of the overloaded method. * @func collection * @memberof Db * @param {Object} options An options object. * @returns {*} */ '$main': function (options) { var name = options.name; if (name) { if (!this._collection[name]) { if (options && options.autoCreate === false) { if (options && options.throwError !== false) { throw(this.logIdentifier() + ' Cannot get collection ' + name + ' because it does not exist and auto-create has been disabled!'); } } if (this.debug()) { console.log(this.logIdentifier() + ' Creating collection ' + name); } } this._collection[name] = this._collection[name] || new Collection(name, options).db(this); this._collection[name].mongoEmulation(this.mongoEmulation()); if (options.primaryKey !== undefined) { this._collection[name].primaryKey(options.primaryKey); } if (options.capped !== undefined) { // Check we have a size if (options.size !== undefined) { this._collection[name].capped(options.capped); this._collection[name].cappedSize(options.size); } else { throw(this.logIdentifier() + ' Cannot create a capped collection without specifying a size!'); } } return this._collection[name]; } else { if (!options || (options && options.throwError !== false)) { throw(this.logIdentifier() + ' Cannot get collection with undefined name!'); } } } }); /** * Determine if a collection with the passed name already exists. * @memberof Db * @param {String} viewName The name of the collection to check for. * @returns {boolean} */ Db.prototype.collectionExists = function (viewName) { return Boolean(this._collection[viewName]); }; /** * Returns an array of collections the DB currently has. * @memberof Db * @param {String|RegExp=} search The optional search string or regular expression to use * to match collection names against. * @returns {Array} An array of objects containing details of each collection * the database is currently managing. */ Db.prototype.collections = function (search) { var arr = [], collections = this._collection, collection, i; if (search) { if (!(search instanceof RegExp)) { // Turn the search into a regular expression search = new RegExp(search); } } for (i in collections) { if (collections.hasOwnProperty(i)) { collection = collections[i]; if (search) { if (search.exec(i)) { arr.push({ name: i, count: collection.count(), linked: collection.isLinked !== undefined ? collection.isLinked() : false }); } } else { arr.push({ name: i, count: collection.count(), linked: collection.isLinked !== undefined ? collection.isLinked() : false }); } } } arr.sort(function (a, b) { return a.name.localeCompare(b.name); }); return arr; }; Shared.finishModule('Collection'); module.exports = Collection; },{"./Crc":5,"./IndexBinaryTree":7,"./IndexHashMap":8,"./KeyValueStore":9,"./Metrics":10,"./Overload":22,"./Path":23,"./ReactorIO":24,"./Shared":26}],4:[function(_dereq_,module,exports){ /* License Copyright (c) 2015 Irrelon Software Limited http://www.irrelon.com http://www.forerunnerdb.com Please visit the license page to see latest license information: http://www.forerunnerdb.com/licensing.html */ "use strict"; var Shared, Db, Metrics, Overload, _instances = []; Shared = _dereq_('./Shared'); Overload = _dereq_('./Overload'); /** * Creates a new ForerunnerDB instance. Core instances handle the lifecycle of * multiple database instances. * @constructor */ var Core = function (name) { this.init.apply(this, arguments); }; Core.prototype.init = function (name) { this._db = {}; this._debug = {}; this._name = name || 'ForerunnerDB'; _instances.push(this); }; /** * Returns the number of instantiated ForerunnerDB objects. * @returns {Number} The number of instantiated instances. */ Core.prototype.instantiatedCount = function () { return _instances.length; }; /** * Get all instances as an array or a single ForerunnerDB instance * by it's array index. * @param {Number=} index Optional index of instance to get. * @returns {Array|Object} Array of instances or a single instance. */ Core.prototype.instances = function (index) { if (index !== undefined) { return _instances[index]; } return _instances; }; /** * Get all instances as an array of instance names or a single ForerunnerDB * instance by it's name. * @param {String=} name Optional name of instance to get. * @returns {Array|Object} Array of instance names or a single instance. */ Core.prototype.namedInstances = function (name) { var i, instArr; if (name !== undefined) { for (i = 0; i < _instances.length; i++) { if (_instances[i].name === name) { return _instances[i]; } } return undefined; } instArr = []; for (i = 0; i < _instances.length; i++) { instArr.push(_instances[i].name); } return instArr; }; Core.prototype.moduleLoaded = new Overload({ /** * Checks if a module has been loaded into the database. * @func moduleLoaded * @memberof Core * @param {String} moduleName The name of the module to check for. * @returns {Boolean} True if the module is loaded, false if not. */ 'string': function (moduleName) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } return true; } return false; }, /** * Checks if a module is loaded and if so calls the passed * callback method. * @func moduleLoaded * @memberof Core * @param {String} moduleName The name of the module to check for. * @param {Function} callback The callback method to call if module is loaded. */ 'string, function': function (moduleName, callback) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } if (callback) { callback(); } } }, /** * Checks if an array of named modules are loaded and if so * calls the passed callback method. * @func moduleLoaded * @memberof Core * @param {Array} moduleName The array of module names to check for. * @param {Function} callback The callback method to call if modules are loaded. */ 'array, function': function (moduleNameArr, callback) { var moduleName, i; for (i = 0; i < moduleNameArr.length; i++) { moduleName = moduleNameArr[i]; if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } } } if (callback) { callback(); } }, /** * Checks if a module is loaded and if so calls the passed * success method, otherwise calls the failure method. * @func moduleLoaded * @memberof Core * @param {String} moduleName The name of the module to check for. * @param {Function} success The callback method to call if module is loaded. * @param {Function} failure The callback method to call if module not loaded. */ 'string, function, function': function (moduleName, success, failure) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { failure(); return false; } } success(); } } }); /** * Checks version against the string passed and if it matches (or partially matches) * then the callback is called. * @param {String} val The version to check against. * @param {Function} callback The callback to call if match is true. * @returns {Boolean} */ Core.prototype.version = function (val, callback) { if (val !== undefined) { if (Shared.version.indexOf(val) === 0) { if (callback) { callback(); } return true; } return false; } return Shared.version; }; // Expose moduleLoaded() method to non-instantiated object ForerunnerDB Core.moduleLoaded = Core.prototype.moduleLoaded; // Expose version() method to non-instantiated object ForerunnerDB Core.version = Core.prototype.version; // Expose instances() method to non-instantiated object ForerunnerDB Core.instances = Core.prototype.instances; // Expose instantiatedCount() method to non-instantiated object ForerunnerDB Core.instantiatedCount = Core.prototype.instantiatedCount; // Provide public access to the Shared object Core.shared = Shared; Core.prototype.shared = Shared; Shared.addModule('Core', Core); Shared.mixin(Core.prototype, 'Mixin.Common'); Shared.mixin(Core.prototype, 'Mixin.Constants'); Db = _dereq_('./Db.js'); Metrics = _dereq_('./Metrics.js'); /** * Gets / sets the name of the instance. This is primarily used for * name-spacing persistent storage. * @param {String=} val The name of the instance to set. * @returns {*} */ Shared.synthesize(Core.prototype, 'name'); /** * Gets / sets mongodb emulation mode. * @param {Boolean=} val True to enable, false to disable. * @returns {*} */ Shared.synthesize(Core.prototype, 'mongoEmulation'); // Set a flag to determine environment Core.prototype._isServer = false; /** * Returns true if ForerunnerDB is running on a client browser. * @returns {boolean} */ Core.prototype.isClient = function () { return !this._isServer; }; /** * Returns true if ForerunnerDB is running on a server. * @returns {boolean} */ Core.prototype.isServer = function () { return this._isServer; }; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a browser. */ Core.prototype.isClient = function () { return !this._isServer; }; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a server. */ Core.prototype.isServer = function () { return this._isServer; }; /** * Added to provide an error message for users who have not seen * the new instantiation breaking change warning and try to get * a collection directly from the core instance. */ Core.prototype.collection = function () { throw("ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"); }; module.exports = Core; },{"./Db.js":6,"./Metrics.js":10,"./Overload":22,"./Shared":26}],5:[function(_dereq_,module,exports){ "use strict"; /** * @mixin */ var crcTable = (function () { var crcTable = [], c, n, k; for (n = 0; n < 256; n++) { c = n; for (k = 0; k < 8; k++) { c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); // jshint ignore:line } crcTable[n] = c; } return crcTable; }()); module.exports = function(str) { var crc = 0 ^ (-1), // jshint ignore:line i; for (i = 0; i < str.length; i++) { crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF]; // jshint ignore:line } return (crc ^ (-1)) >>> 0; // jshint ignore:line }; },{}],6:[function(_dereq_,module,exports){ "use strict"; var Shared, Core, Collection, Metrics, Crc, Overload; Shared = _dereq_('./Shared'); Overload = _dereq_('./Overload'); /** * Creates a new ForerunnerDB database instance. * @constructor */ var Db = function (name, core) { this.init.apply(this, arguments); }; Db.prototype.init = function (name, core) { this.core(core); this._primaryKey = '_id'; this._name = name; this._collection = {}; this._debug = {}; }; Shared.addModule('Db', Db); Db.prototype.moduleLoaded = new Overload({ /** * Checks if a module has been loaded into the database. * @func moduleLoaded * @memberof Db * @param {String} moduleName The name of the module to check for. * @returns {Boolean} True if the module is loaded, false if not. */ 'string': function (moduleName) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } return true; } return false; }, /** * Checks if a module is loaded and if so calls the passed * callback method. * @func moduleLoaded * @memberof Db * @param {String} moduleName The name of the module to check for. * @param {Function} callback The callback method to call if module is loaded. */ 'string, function': function (moduleName, callback) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } if (callback) { callback(); } } }, /** * Checks if a module is loaded and if so calls the passed * success method, otherwise calls the failure method. * @func moduleLoaded * @memberof Db * @param {String} moduleName The name of the module to check for. * @param {Function} success The callback method to call if module is loaded. * @param {Function} failure The callback method to call if module not loaded. */ 'string, function, function': function (moduleName, success, failure) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { failure(); return false; } } success(); } } }); /** * Checks version against the string passed and if it matches (or partially matches) * then the callback is called. * @param {String} val The version to check against. * @param {Function} callback The callback to call if match is true. * @returns {Boolean} */ Db.prototype.version = function (val, callback) { if (val !== undefined) { if (Shared.version.indexOf(val) === 0) { if (callback) { callback(); } return true; } return false; } return Shared.version; }; // Expose moduleLoaded method to non-instantiated object ForerunnerDB Db.moduleLoaded = Db.prototype.moduleLoaded; // Expose version method to non-instantiated object ForerunnerDB Db.version = Db.prototype.version; // Provide public access to the Shared object Db.shared = Shared; Db.prototype.shared = Shared; Shared.addModule('Db', Db); Shared.mixin(Db.prototype, 'Mixin.Common'); Shared.mixin(Db.prototype, 'Mixin.ChainReactor'); Shared.mixin(Db.prototype, 'Mixin.Constants'); Shared.mixin(Db.prototype, 'Mixin.Tags'); Core = Shared.modules.Core; Collection = _dereq_('./Collection.js'); Metrics = _dereq_('./Metrics.js'); Crc = _dereq_('./Crc.js'); Db.prototype._isServer = false; /** * Gets / sets the core object this database belongs to. */ Shared.synthesize(Db.prototype, 'core'); /** * Gets / sets the default primary key for new collections. * @param {String=} val The name of the primary key to set. * @returns {*} */ Shared.synthesize(Db.prototype, 'primaryKey'); /** * Gets / sets the current state. * @param {String=} val The name of the state to set. * @returns {*} */ Shared.synthesize(Db.prototype, 'state'); /** * Gets / sets the name of the database. * @param {String=} val The name of the database to set. * @returns {*} */ Shared.synthesize(Db.prototype, 'name'); /** * Gets / sets mongodb emulation mode. * @param {Boolean=} val True to enable, false to disable. * @returns {*} */ Shared.synthesize(Db.prototype, 'mongoEmulation'); /** * Returns true if ForerunnerDB is running on a client browser. * @returns {boolean} */ Db.prototype.isClient = function () { return !this._isServer; }; /** * Returns true if ForerunnerDB is running on a server. * @returns {boolean} */ Db.prototype.isServer = function () { return this._isServer; }; /** * Returns a checksum of a string. * @param {String} string The string to checksum. * @return {String} The checksum generated. */ Db.prototype.crc = Crc; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a browser. */ Db.prototype.isClient = function () { return !this._isServer; }; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a server. */ Db.prototype.isServer = function () { return this._isServer; }; /** * Converts a normal javascript array of objects into a DB collection. * @param {Array} arr An array of objects. * @returns {Collection} A new collection instance with the data set to the * array passed. */ Db.prototype.arrayToCollection = function (arr) { return new Collection().setData(arr); }; /** * Registers an event listener against an event name. * @param {String} event The name of the event to listen for. * @param {Function} listener The listener method to call when * the event is fired. * @returns {*} */ Db.prototype.on = function(event, listener) { this._listeners = this._listeners || {}; this._listeners[event] = this._listeners[event] || []; this._listeners[event].push(listener); return this; }; /** * De-registers an event listener from an event name. * @param {String} event The name of the event to stop listening for. * @param {Function} listener The listener method passed to on() when * registering the event listener. * @returns {*} */ Db.prototype.off = function(event, listener) { if (event in this._listeners) { var arr = this._listeners[event], index = arr.indexOf(listener); if (index > -1) { arr.splice(index, 1); } } return this; }; /** * Emits an event by name with the given data. * @param {String} event The name of the event to emit. * @param {*=} data The data to emit with the event. * @returns {*} */ Db.prototype.emit = function(event, data) { this._listeners = this._listeners || {}; if (event in this._listeners) { var arr = this._listeners[event], arrCount = arr.length, arrIndex; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arr[arrIndex].apply(this, Array.prototype.slice.call(arguments, 1)); } } return this; }; Db.prototype.peek = function (search) { var i, coll, arr = [], typeOfSearch = typeof search; // Loop collections for (i in this._collection) { if (this._collection.hasOwnProperty(i)) { coll = this._collection[i]; if (typeOfSearch === 'string') { arr = arr.concat(coll.peek(search)); } else { arr = arr.concat(coll.find(search)); } } } return arr; }; /** * Find all documents across all collections in the database that match the passed * string or search object. * @param search String or search object. * @returns {Array} */ Db.prototype.peek = function (search) { var i, coll, arr = [], typeOfSearch = typeof search; // Loop collections for (i in this._collection) { if (this._collection.hasOwnProperty(i)) { coll = this._collection[i]; if (typeOfSearch === 'string') { arr = arr.concat(coll.peek(search)); } else { arr = arr.concat(coll.find(search)); } } } return arr; }; /** * Find all documents across all collections in the database that match the passed * string or search object and return them in an object where each key is the name * of the collection that the document was matched in. * @param search String or search object. * @returns {object} */ Db.prototype.peekCat = function (search) { var i, coll, cat = {}, arr, typeOfSearch = typeof search; // Loop collections for (i in this._collection) { if (this._collection.hasOwnProperty(i)) { coll = this._collection[i]; if (typeOfSearch === 'string') { arr = coll.peek(search); if (arr && arr.length) { cat[coll.name()] = arr; } } else { arr = coll.find(search); if (arr && arr.length) { cat[coll.name()] = arr; } } } } return cat; }; Db.prototype.drop = new Overload({ /** * Drops the database. * @func drop * @memberof Db */ '': function () { if (!this.isDropped()) { var arr = this.collections(), arrCount = arr.length, arrIndex; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; }, /** * Drops the database with optional callback method. * @func drop * @memberof Db * @param {Function} callback Optional callback method. */ 'function': function (callback) { if (!this.isDropped()) { var arr = this.collections(), arrCount = arr.length, arrIndex, finishCount = 0, afterDrop = function () { finishCount++; if (finishCount === arrCount) { if (callback) { callback(); } } }; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(afterDrop); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; }, /** * Drops the database with optional persistent storage drop. Persistent * storage is dropped by default if no preference is provided. * @func drop * @memberof Db * @param {Boolean} removePersist Drop persistent storage for this database. */ 'boolean': function (removePersist) { if (!this.isDropped()) { var arr = this.collections(), arrCount = arr.length, arrIndex; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(removePersist); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; }, /** * Drops the database and optionally controls dropping persistent storage * and callback method. * @func drop * @memberof Db * @param {Boolean} removePersist Drop persistent storage for this database. * @param {Function} callback Optional callback method. */ 'boolean, function': function (removePersist, callback) { if (!this.isDropped()) { var arr = this.collections(), arrCount = arr.length, arrIndex, finishCount = 0, afterDrop = function () { finishCount++; if (finishCount === arrCount) { if (callback) { callback(); } } }; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(removePersist, afterDrop); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; } }); /** * Gets a database instance by name. * @memberof Core * @param {String=} name Optional name of the database. If none is provided * a random name is assigned. * @returns {Db} */ Core.prototype.db = function (name) { // Handle being passed an instance if (name instanceof Db) { return name; } if (!name) { name = this.objectId(); } this._db[name] = this._db[name] || new Db(name, this); this._db[name].mongoEmulation(this.mongoEmulation()); return this._db[name]; }; /** * Returns an array of databases that ForerunnerDB currently has. * @memberof Core * @param {String|RegExp=} search The optional search string or regular expression to use * to match collection names against. * @returns {Array} An array of objects containing details of each database * that ForerunnerDB is currently managing and it's child entities. */ Core.prototype.databases = function (search) { var arr = [], tmpObj, addDb, i; if (search) { if (!(search instanceof RegExp)) { // Turn the search into a regular expression search = new RegExp(search); } } for (i in this._db) { if (this._db.hasOwnProperty(i)) { addDb = true; if (search) { if (!search.exec(i)) { addDb = false; } } if (addDb) { tmpObj = { name: i, children: [] }; if (this.shared.moduleExists('Collection')) { tmpObj.children.push({ module: 'collection', moduleName: 'Collections', count: this._db[i].collections().length }); } if (this.shared.moduleExists('CollectionGroup')) { tmpObj.children.push({ module: 'collectionGroup', moduleName: 'Collection Groups', count: this._db[i].collectionGroups().length }); } if (this.shared.moduleExists('Document')) { tmpObj.children.push({ module: 'document', moduleName: 'Documents', count: this._db[i].documents().length }); } if (this.shared.moduleExists('Grid')) { tmpObj.children.push({ module: 'grid', moduleName: 'Grids', count: this._db[i].grids().length }); } if (this.shared.moduleExists('Overview')) { tmpObj.children.push({ module: 'overview', moduleName: 'Overviews', count: this._db[i].overviews().length }); } if (this.shared.moduleExists('View')) { tmpObj.children.push({ module: 'view', moduleName: 'Views', count: this._db[i].views().length }); } arr.push(tmpObj); } } } arr.sort(function (a, b) { return a.name.localeCompare(b.name); }); return arr; }; Shared.finishModule('Db'); module.exports = Db; },{"./Collection.js":3,"./Crc.js":5,"./Metrics.js":10,"./Overload":22,"./Shared":26}],7:[function(_dereq_,module,exports){ "use strict"; /* name id rebuild state match lookup */ var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'), BinaryTree = _dereq_('./BinaryTree'), treeInstance = new BinaryTree(), btree = function () {}; treeInstance.inOrder('hash'); /** * The index class used to instantiate hash map indexes that the database can * use to speed up queries on collections and views. * @constructor */ var IndexBinaryTree = function () { this.init.apply(this, arguments); }; IndexBinaryTree.prototype.init = function (keys, options, collection) { this._btree = new (btree.create(2, this.sortAsc))(); this._size = 0; this._id = this._itemKeyHash(keys, keys); this.unique(options && options.unique ? options.unique : false); if (keys !== undefined) { this.keys(keys); } if (collection !== undefined) { this.collection(collection); } this.name(options && options.name ? options.name : this._id); }; Shared.addModule('IndexBinaryTree', IndexBinaryTree); Shared.mixin(IndexBinaryTree.prototype, 'Mixin.ChainReactor'); Shared.mixin(IndexBinaryTree.prototype, 'Mixin.Sorting'); IndexBinaryTree.prototype.id = function () { return this._id; }; IndexBinaryTree.prototype.state = function () { return this._state; }; IndexBinaryTree.prototype.size = function () { return this._size; }; Shared.synthesize(IndexBinaryTree.prototype, 'data'); Shared.synthesize(IndexBinaryTree.prototype, 'name'); Shared.synthesize(IndexBinaryTree.prototype, 'collection'); Shared.synthesize(IndexBinaryTree.prototype, 'type'); Shared.synthesize(IndexBinaryTree.prototype, 'unique'); IndexBinaryTree.prototype.keys = function (val) { if (val !== undefined) { this._keys = val; // Count the keys this._keyCount = (new Path()).parse(this._keys).length; return this; } return this._keys; }; IndexBinaryTree.prototype.rebuild = function () { // Do we have a collection? if (this._collection) { // Get sorted data var collection = this._collection.subset({}, { $decouple: false, $orderBy: this._keys }), collectionData = collection.find(), dataIndex, dataCount = collectionData.length; // Clear the index data for the index this._btree = new (btree.create(2, this.sortAsc))(); if (this._unique) { this._uniqueLookup = {}; } // Loop the collection data for (dataIndex = 0; dataIndex < dataCount; dataIndex++) { this.insert(collectionData[dataIndex]); } } this._state = { name: this._name, keys: this._keys, indexSize: this._size, built: new Date(), updated: new Date(), ok: true }; }; IndexBinaryTree.prototype.insert = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, dataItemHash = this._itemKeyHash(dataItem, this._keys), keyArr; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); this._uniqueLookup[uniqueHash] = dataItem; } // We store multiple items that match a key inside an array // that is then stored against that key in the tree... // Check if item exists for this key already keyArr = this._btree.get(dataItemHash); // Check if the array exists if (keyArr === undefined) { // Generate an array for this key first keyArr = []; // Put the new array into the tree under the key this._btree.put(dataItemHash, keyArr); } // Push the item into the array keyArr.push(dataItem); this._size++; }; IndexBinaryTree.prototype.remove = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, dataItemHash = this._itemKeyHash(dataItem, this._keys), keyArr, itemIndex; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); delete this._uniqueLookup[uniqueHash]; } // Try and get the array for the item hash key keyArr = this._btree.get(dataItemHash); if (keyArr !== undefined) { // The key array exits, remove the item from the key array itemIndex = keyArr.indexOf(dataItem); if (itemIndex > -1) { // Check the length of the array if (keyArr.length === 1) { // This item is the last in the array, just kill the tree entry this._btree.del(dataItemHash); } else { // Remove the item keyArr.splice(itemIndex, 1); } this._size--; } } }; IndexBinaryTree.prototype.violation = function (dataItem) { // Generate item hash var uniqueHash = this._itemHash(dataItem, this._keys); // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexBinaryTree.prototype.hashViolation = function (uniqueHash) { // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexBinaryTree.prototype.lookup = function (query) { return this._data[this._itemHash(query, this._keys)] || []; }; IndexBinaryTree.prototype.match = function (query, options) { // Check if the passed query has data in the keys our index // operates on and if so, is the query sort matching our order var pathSolver = new Path(); var indexKeyArr = pathSolver.parseArr(this._keys), queryArr = pathSolver.parseArr(query), matchedKeys = [], matchedKeyCount = 0, i; // Loop the query array and check the order of keys against the // index key array to see if this index can be used for (i = 0; i < indexKeyArr.length; i++) { if (queryArr[i] === indexKeyArr[i]) { matchedKeyCount++; matchedKeys.push(queryArr[i]); } else { // Query match failed - this is a hash map index so partial key match won't work return { matchedKeys: [], totalKeyCount: queryArr.length, score: 0 }; } } return { matchedKeys: matchedKeys, totalKeyCount: queryArr.length, score: matchedKeyCount }; //return pathSolver.countObjectPaths(this._keys, query); }; IndexBinaryTree.prototype._itemHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.value(item, pathData[k].path).join(':'); } return hash; }; IndexBinaryTree.prototype._itemKeyHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.keyValue(item, pathData[k].path); } return hash; }; IndexBinaryTree.prototype._itemHashArr = function (item, keys) { var path = new Path(), pathData, //hash = '', hashArr = [], valArr, i, k, j; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { valArr = path.value(item, pathData[k].path); for (i = 0; i < valArr.length; i++) { if (k === 0) { // Setup the initial hash array hashArr.push(valArr[i]); } else { // Loop the hash array and concat the value to it for (j = 0; j < hashArr.length; j++) { hashArr[j] = hashArr[j] + '_' + valArr[i]; } } } } return hashArr; }; Shared.finishModule('IndexBinaryTree'); module.exports = IndexBinaryTree; },{"./BinaryTree":2,"./Path":23,"./Shared":26}],8:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'); /** * The index class used to instantiate hash map indexes that the database can * use to speed up queries on collections and views. * @constructor */ var IndexHashMap = function () { this.init.apply(this, arguments); }; IndexHashMap.prototype.init = function (keys, options, collection) { this._crossRef = {}; this._size = 0; this._id = this._itemKeyHash(keys, keys); this.data({}); this.unique(options && options.unique ? options.unique : false); if (keys !== undefined) { this.keys(keys); } if (collection !== undefined) { this.collection(collection); } this.name(options && options.name ? options.name : this._id); }; Shared.addModule('IndexHashMap', IndexHashMap); Shared.mixin(IndexHashMap.prototype, 'Mixin.ChainReactor'); IndexHashMap.prototype.id = function () { return this._id; }; IndexHashMap.prototype.state = function () { return this._state; }; IndexHashMap.prototype.size = function () { return this._size; }; Shared.synthesize(IndexHashMap.prototype, 'data'); Shared.synthesize(IndexHashMap.prototype, 'name'); Shared.synthesize(IndexHashMap.prototype, 'collection'); Shared.synthesize(IndexHashMap.prototype, 'type'); Shared.synthesize(IndexHashMap.prototype, 'unique'); IndexHashMap.prototype.keys = function (val) { if (val !== undefined) { this._keys = val; // Count the keys this._keyCount = (new Path()).parse(this._keys).length; return this; } return this._keys; }; IndexHashMap.prototype.rebuild = function () { // Do we have a collection? if (this._collection) { // Get sorted data var collection = this._collection.subset({}, { $decouple: false, $orderBy: this._keys }), collectionData = collection.find(), dataIndex, dataCount = collectionData.length; // Clear the index data for the index this._data = {}; if (this._unique) { this._uniqueLookup = {}; } // Loop the collection data for (dataIndex = 0; dataIndex < dataCount; dataIndex++) { this.insert(collectionData[dataIndex]); } } this._state = { name: this._name, keys: this._keys, indexSize: this._size, built: new Date(), updated: new Date(), ok: true }; }; IndexHashMap.prototype.insert = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, itemHashArr, hashIndex; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); this._uniqueLookup[uniqueHash] = dataItem; } // Generate item hash itemHashArr = this._itemHashArr(dataItem, this._keys); // Get the path search results and store them for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) { this.pushToPathValue(itemHashArr[hashIndex], dataItem); } }; IndexHashMap.prototype.update = function (dataItem, options) { // TODO: Write updates to work // 1: Get uniqueHash for the dataItem primary key value (may need to generate a store for this) // 2: Remove the uniqueHash as it currently stands // 3: Generate a new uniqueHash for dataItem // 4: Insert the new uniqueHash }; IndexHashMap.prototype.remove = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, itemHashArr, hashIndex; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); delete this._uniqueLookup[uniqueHash]; } // Generate item hash itemHashArr = this._itemHashArr(dataItem, this._keys); // Get the path search results and store them for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) { this.pullFromPathValue(itemHashArr[hashIndex], dataItem); } }; IndexHashMap.prototype.violation = function (dataItem) { // Generate item hash var uniqueHash = this._itemHash(dataItem, this._keys); // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexHashMap.prototype.hashViolation = function (uniqueHash) { // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexHashMap.prototype.pushToPathValue = function (hash, obj) { var pathValArr = this._data[hash] = this._data[hash] || []; // Make sure we have not already indexed this object at this path/value if (pathValArr.indexOf(obj) === -1) { // Index the object pathValArr.push(obj); // Record the reference to this object in our index size this._size++; // Cross-reference this association for later lookup this.pushToCrossRef(obj, pathValArr); } }; IndexHashMap.prototype.pullFromPathValue = function (hash, obj) { var pathValArr = this._data[hash], indexOfObject; // Make sure we have already indexed this object at this path/value indexOfObject = pathValArr.indexOf(obj); if (indexOfObject > -1) { // Un-index the object pathValArr.splice(indexOfObject, 1); // Record the reference to this object in our index size this._size--; // Remove object cross-reference this.pullFromCrossRef(obj, pathValArr); } // Check if we should remove the path value array if (!pathValArr.length) { // Remove the array delete this._data[hash]; } }; IndexHashMap.prototype.pull = function (obj) { // Get all places the object has been used and remove them var id = obj[this._collection.primaryKey()], crossRefArr = this._crossRef[id], arrIndex, arrCount = crossRefArr.length, arrItem; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arrItem = crossRefArr[arrIndex]; // Remove item from this index lookup array this._pullFromArray(arrItem, obj); } // Record the reference to this object in our index size this._size--; // Now remove the cross-reference entry for this object delete this._crossRef[id]; }; IndexHashMap.prototype._pullFromArray = function (arr, obj) { var arrCount = arr.length; while (arrCount--) { if (arr[arrCount] === obj) { arr.splice(arrCount, 1); } } }; IndexHashMap.prototype.pushToCrossRef = function (obj, pathValArr) { var id = obj[this._collection.primaryKey()], crObj; this._crossRef[id] = this._crossRef[id] || []; // Check if the cross-reference to the pathVal array already exists crObj = this._crossRef[id]; if (crObj.indexOf(pathValArr) === -1) { // Add the cross-reference crObj.push(pathValArr); } }; IndexHashMap.prototype.pullFromCrossRef = function (obj, pathValArr) { var id = obj[this._collection.primaryKey()]; delete this._crossRef[id]; }; IndexHashMap.prototype.lookup = function (query) { return this._data[this._itemHash(query, this._keys)] || []; }; IndexHashMap.prototype.match = function (query, options) { // Check if the passed query has data in the keys our index // operates on and if so, is the query sort matching our order var pathSolver = new Path(); var indexKeyArr = pathSolver.parseArr(this._keys), queryArr = pathSolver.parseArr(query), matchedKeys = [], matchedKeyCount = 0, i; // Loop the query array and check the order of keys against the // index key array to see if this index can be used for (i = 0; i < indexKeyArr.length; i++) { if (queryArr[i] === indexKeyArr[i]) { matchedKeyCount++; matchedKeys.push(queryArr[i]); } else { // Query match failed - this is a hash map index so partial key match won't work return { matchedKeys: [], totalKeyCount: queryArr.length, score: 0 }; } } return { matchedKeys: matchedKeys, totalKeyCount: queryArr.length, score: matchedKeyCount }; //return pathSolver.countObjectPaths(this._keys, query); }; IndexHashMap.prototype._itemHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.value(item, pathData[k].path).join(':'); } return hash; }; IndexHashMap.prototype._itemKeyHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.keyValue(item, pathData[k].path); } return hash; }; IndexHashMap.prototype._itemHashArr = function (item, keys) { var path = new Path(), pathData, //hash = '', hashArr = [], valArr, i, k, j; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { valArr = path.value(item, pathData[k].path); for (i = 0; i < valArr.length; i++) { if (k === 0) { // Setup the initial hash array hashArr.push(valArr[i]); } else { // Loop the hash array and concat the value to it for (j = 0; j < hashArr.length; j++) { hashArr[j] = hashArr[j] + '_' + valArr[i]; } } } } return hashArr; }; Shared.finishModule('IndexHashMap'); module.exports = IndexHashMap; },{"./Path":23,"./Shared":26}],9:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'); /** * The key value store class used when storing basic in-memory KV data, * and can be queried for quick retrieval. Mostly used for collection * primary key indexes and lookups. * @param {String=} name Optional KV store name. * @constructor */ var KeyValueStore = function (name) { this.init.apply(this, arguments); }; KeyValueStore.prototype.init = function (name) { this._name = name; this._data = {}; this._primaryKey = '_id'; }; Shared.addModule('KeyValueStore', KeyValueStore); Shared.mixin(KeyValueStore.prototype, 'Mixin.ChainReactor'); /** * Get / set the name of the key/value store. * @param {String} val The name to set. * @returns {*} */ Shared.synthesize(KeyValueStore.prototype, 'name'); /** * Get / set the primary key. * @param {String} key The key to set. * @returns {*} */ KeyValueStore.prototype.primaryKey = function (key) { if (key !== undefined) { this._primaryKey = key; return this; } return this._primaryKey; }; /** * Removes all data from the store. * @returns {*} */ KeyValueStore.prototype.truncate = function () { this._data = {}; return this; }; /** * Sets data against a key in the store. * @param {String} key The key to set data for. * @param {*} value The value to assign to the key. * @returns {*} */ KeyValueStore.prototype.set = function (key, value) { this._data[key] = value ? value : true; return this; }; /** * Gets data stored for the passed key. * @param {String} key The key to get data for. * @returns {*} */ KeyValueStore.prototype.get = function (key) { return this._data[key]; }; /** * Get / set the primary key. * @param {*} obj A lookup query, can be a string key, an array of string keys, * an object with further query clauses or a regular expression that should be * run against all keys. * @returns {*} */ KeyValueStore.prototype.lookup = function (obj) { var pKeyVal = obj[this._primaryKey], arrIndex, arrCount, lookupItem, result; if (pKeyVal instanceof Array) { // An array of primary keys, find all matches arrCount = pKeyVal.length; result = []; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { lookupItem = this._data[pKeyVal[arrIndex]]; if (lookupItem) { result.push(lookupItem); } } return result; } else if (pKeyVal instanceof RegExp) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (pKeyVal.test(arrIndex)) { result.push(this._data[arrIndex]); } } } return result; } else if (typeof pKeyVal === 'object') { // The primary key clause is an object, now we have to do some // more extensive searching if (pKeyVal.$ne) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (arrIndex !== pKeyVal.$ne) { result.push(this._data[arrIndex]); } } } return result; } if (pKeyVal.$in && (pKeyVal.$in instanceof Array)) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (pKeyVal.$in.indexOf(arrIndex) > -1) { result.push(this._data[arrIndex]); } } } return result; } if (pKeyVal.$nin && (pKeyVal.$nin instanceof Array)) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (pKeyVal.$nin.indexOf(arrIndex) === -1) { result.push(this._data[arrIndex]); } } } return result; } if (pKeyVal.$or && (pKeyVal.$or instanceof Array)) { // Create new data result = []; for (arrIndex = 0; arrIndex < pKeyVal.$or.length; arrIndex++) { result = result.concat(this.lookup(pKeyVal.$or[arrIndex])); } return result; } } else { // Key is a basic lookup from string lookupItem = this._data[pKeyVal]; if (lookupItem !== undefined) { return [lookupItem]; } else { return []; } } }; /** * Removes data for the given key from the store. * @param {String} key The key to un-set. * @returns {*} */ KeyValueStore.prototype.unSet = function (key) { delete this._data[key]; return this; }; /** * Sets data for the give key in the store only where the given key * does not already have a value in the store. * @param {String} key The key to set data for. * @param {*} value The value to assign to the key. * @returns {Boolean} True if data was set or false if data already * exists for the key. */ KeyValueStore.prototype.uniqueSet = function (key, value) { if (this._data[key] === undefined) { this._data[key] = value; return true; } return false; }; Shared.finishModule('KeyValueStore'); module.exports = KeyValueStore; },{"./Shared":26}],10:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Operation = _dereq_('./Operation'); /** * The metrics class used to store details about operations. * @constructor */ var Metrics = function () { this.init.apply(this, arguments); }; Metrics.prototype.init = function () { this._data = []; }; Shared.addModule('Metrics', Metrics); Shared.mixin(Metrics.prototype, 'Mixin.ChainReactor'); /** * Creates an operation within the metrics instance and if metrics * are currently enabled (by calling the start() method) the operation * is also stored in the metrics log. * @param {String} name The name of the operation. * @returns {Operation} */ Metrics.prototype.create = function (name) { var op = new Operation(name); if (this._enabled) { this._data.push(op); } return op; }; /** * Starts logging operations. * @returns {Metrics} */ Metrics.prototype.start = function () { this._enabled = true; return this; }; /** * Stops logging operations. * @returns {Metrics} */ Metrics.prototype.stop = function () { this._enabled = false; return this; }; /** * Clears all logged operations. * @returns {Metrics} */ Metrics.prototype.clear = function () { this._data = []; return this; }; /** * Returns an array of all logged operations. * @returns {Array} */ Metrics.prototype.list = function () { return this._data; }; Shared.finishModule('Metrics'); module.exports = Metrics; },{"./Operation":21,"./Shared":26}],11:[function(_dereq_,module,exports){ "use strict"; var CRUD = { preSetData: function () { }, postSetData: function () { } }; module.exports = CRUD; },{}],12:[function(_dereq_,module,exports){ "use strict"; /** * The chain reactor mixin, provides methods to the target object that allow chain * reaction events to propagate to the target and be handled, processed and passed * on down the chain. * @mixin */ var ChainReactor = { /** * * @param obj */ chain: function (obj) { if (this.debug && this.debug()) { if (obj._reactorIn && obj._reactorOut) { console.log(obj._reactorIn.logIdentifier() + ' Adding target "' + obj._reactorOut.instanceIdentifier() + '" to the chain reactor target list'); } else { console.log(this.logIdentifier() + ' Adding target "' + obj.instanceIdentifier() + '" to the chain reactor target list'); } } this._chain = this._chain || []; var index = this._chain.indexOf(obj); if (index === -1) { this._chain.push(obj); } }, unChain: function (obj) { if (this.debug && this.debug()) { if (obj._reactorIn && obj._reactorOut) { console.log(obj._reactorIn.logIdentifier() + ' Removing target "' + obj._reactorOut.instanceIdentifier() + '" from the chain reactor target list'); } else { console.log(this.logIdentifier() + ' Removing target "' + obj.instanceIdentifier() + '" from the chain reactor target list'); } } if (this._chain) { var index = this._chain.indexOf(obj); if (index > -1) { this._chain.splice(index, 1); } } }, chainSend: function (type, data, options) { if (this._chain) { var arr = this._chain, arrItem, count = arr.length, index; for (index = 0; index < count; index++) { arrItem = arr[index]; if (!arrItem._state || (arrItem._state && !arrItem.isDropped())) { if (this.debug && this.debug()) { if (arrItem._reactorIn && arrItem._reactorOut) { console.log(arrItem._reactorIn.logIdentifier() + ' Sending data down the chain reactor pipe to "' + arrItem._reactorOut.instanceIdentifier() + '"'); } else { console.log(this.logIdentifier() + ' Sending data down the chain reactor pipe to "' + arrItem.instanceIdentifier() + '"'); } } arrItem.chainReceive(this, type, data, options); } else { console.log('Reactor Data:', type, data, options); console.log('Reactor Node:', arrItem); throw('Chain reactor attempting to send data to target reactor node that is in a dropped state!'); } } } }, chainReceive: function (sender, type, data, options) { var chainPacket = { sender: sender, type: type, data: data, options: options }; if (this.debug && this.debug()) { console.log(this.logIdentifier() + 'Received data from parent reactor node'); } // Fire our internal handler if (!this._chainHandler || (this._chainHandler && !this._chainHandler(chainPacket))) { // Propagate the message down the chain this.chainSend(chainPacket.type, chainPacket.data, chainPacket.options); } } }; module.exports = ChainReactor; },{}],13:[function(_dereq_,module,exports){ "use strict"; var idCounter = 0, Overload = _dereq_('./Overload'), Serialiser = _dereq_('./Serialiser'), Common, serialiser = new Serialiser(); /** * Provides commonly used methods to most classes in ForerunnerDB. * @mixin */ Common = { // Expose the serialiser object so it can be extended with new data handlers. serialiser: serialiser, /** * Gets / sets data in the item store. The store can be used to set and * retrieve data against a key. Useful for adding arbitrary key/value data * to a collection / view etc and retrieving it later. * @param {String|*} key The key under which to store the passed value or * retrieve the existing stored value. * @param {*=} val Optional value. If passed will overwrite the existing value * stored against the specified key if one currently exists. * @returns {*} */ store: function (key, val) { if (key !== undefined) { if (val !== undefined) { // Store the data this._store = this._store || {}; this._store[key] = val; return this; } if (this._store) { return this._store[key]; } } return undefined; }, /** * Removes a previously stored key/value pair from the item store, set previously * by using the store() method. * @param {String|*} key The key of the key/value pair to remove; * @returns {Common} Returns this for chaining. */ unStore: function (key) { if (key !== undefined) { delete this._store[key]; } return this; }, /** * Returns a non-referenced version of the passed object / array. * @param {Object} data The object or array to return as a non-referenced version. * @param {Number=} copies Optional number of copies to produce. If specified, the return * value will be an array of decoupled objects, each distinct from the other. * @returns {*} */ decouple: function (data, copies) { if (data !== undefined) { if (!copies) { return this.jParse(this.jStringify(data)); } else { var i, json = this.jStringify(data), copyArr = []; for (i = 0; i < copies; i++) { copyArr.push(this.jParse(json)); } return copyArr; } } return undefined; }, /** * Parses and returns data from stringified version. * @param {String} data The stringified version of data to parse. * @returns {Object} The parsed JSON object from the data. */ jParse: function (data) { return serialiser.parse(data); //return JSON.parse(data); }, /** * Converts a JSON object into a stringified version. * @param {Object} data The data to stringify. * @returns {String} The stringified data. */ jStringify: function (data) { return serialiser.stringify(data); //return JSON.stringify(data); }, /** * Generates a new 16-character hexadecimal unique ID or * generates a new 16-character hexadecimal ID based on * the passed string. Will always generate the same ID * for the same string. * @param {String=} str A string to generate the ID from. * @return {String} */ objectId: function (str) { var id, pow = Math.pow(10, 17); if (!str) { idCounter++; id = (idCounter + ( Math.random() * pow + Math.random() * pow + Math.random() * pow + Math.random() * pow )).toString(16); } else { var val = 0, count = str.length, i; for (i = 0; i < count; i++) { val += str.charCodeAt(i) * pow; } id = val.toString(16); } return id; }, /** * Gets / sets debug flag that can enable debug message output to the * console if required. * @param {Boolean} val The value to set debug flag to. * @return {Boolean} True if enabled, false otherwise. */ /** * Sets debug flag for a particular type that can enable debug message * output to the console if required. * @param {String} type The name of the debug type to set flag for. * @param {Boolean} val The value to set debug flag to. * @return {Boolean} True if enabled, false otherwise. */ debug: new Overload([ function () { return this._debug && this._debug.all; }, function (val) { if (val !== undefined) { if (typeof val === 'boolean') { this._debug = this._debug || {}; this._debug.all = val; this.chainSend('debug', this._debug); return this; } else { return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[val]) || (this._debug && this._debug.all); } } return this._debug && this._debug.all; }, function (type, val) { if (type !== undefined) { if (val !== undefined) { this._debug = this._debug || {}; this._debug[type] = val; this.chainSend('debug', this._debug); return this; } return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[type]); } return this._debug && this._debug.all; } ]), /** * Returns a string describing the class this instance is derived from. * @returns {string} */ classIdentifier: function () { return 'ForerunnerDB.' + this.className; }, /** * Returns a string describing the instance by it's class name and instance * object name. * @returns {String} The instance identifier. */ instanceIdentifier: function () { return '[' + this.className + ']' + this.name(); }, /** * Returns a string used to denote a console log against this instance, * consisting of the class identifier and instance identifier. * @returns {string} The log identifier. */ logIdentifier: function () { return this.classIdentifier() + ': ' + this.instanceIdentifier(); }, /** * Converts a query object with MongoDB dot notation syntax * to Forerunner's object notation syntax. * @param {Object} obj The object to convert. */ convertToFdb: function (obj) { var varName, splitArr, objCopy, i; for (i in obj) { if (obj.hasOwnProperty(i)) { objCopy = obj; if (i.indexOf('.') > -1) { // Replace .$ with a placeholder before splitting by . char i = i.replace('.$', '[|$|]'); splitArr = i.split('.'); while ((varName = splitArr.shift())) { // Replace placeholder back to original .$ varName = varName.replace('[|$|]', '.$'); if (splitArr.length) { objCopy[varName] = {}; } else { objCopy[varName] = obj[i]; } objCopy = objCopy[varName]; } delete obj[i]; } } } }, /** * Checks if the state is dropped. * @returns {boolean} True when dropped, false otherwise. */ isDropped: function () { return this._state === 'dropped'; } }; module.exports = Common; },{"./Overload":22,"./Serialiser":25}],14:[function(_dereq_,module,exports){ "use strict"; /** * Provides some database constants. * @mixin */ var Constants = { TYPE_INSERT: 0, TYPE_UPDATE: 1, TYPE_REMOVE: 2, PHASE_BEFORE: 0, PHASE_AFTER: 1 }; module.exports = Constants; },{}],15:[function(_dereq_,module,exports){ "use strict"; var Overload = _dereq_('./Overload'); /** * Provides event emitter functionality including the methods: on, off, once, emit, deferEmit. * @mixin */ var Events = { on: new Overload({ /** * Attach an event listener to the passed event. * @param {String} event The name of the event to listen for. * @param {Function} listener The method to call when the event is fired. */ 'string, function': function (event, listener) { this._listeners = this._listeners || {}; this._listeners[event] = this._listeners[event] || {}; this._listeners[event]['*'] = this._listeners[event]['*'] || []; this._listeners[event]['*'].push(listener); return this; }, /** * Attach an event listener to the passed event only if the passed * id matches the document id for the event being fired. * @param {String} event The name of the event to listen for. * @param {*} id The document id to match against. * @param {Function} listener The method to call when the event is fired. */ 'string, *, function': function (event, id, listener) { this._listeners = this._listeners || {}; this._listeners[event] = this._listeners[event] || {}; this._listeners[event][id] = this._listeners[event][id] || []; this._listeners[event][id].push(listener); return this; } }), once: new Overload({ 'string, function': function (eventName, callback) { var self = this, internalCallback = function () { self.off(eventName, internalCallback); callback.apply(self, arguments); }; return this.on(eventName, internalCallback); }, 'string, *, function': function (eventName, id, callback) { var self = this, internalCallback = function () { self.off(eventName, id, internalCallback); callback.apply(self, arguments); }; return this.on(eventName, id, internalCallback); } }), off: new Overload({ 'string': function (event) { if (this._listeners && this._listeners[event] && event in this._listeners) { delete this._listeners[event]; } return this; }, 'string, function': function (event, listener) { var arr, index; if (typeof(listener) === 'string') { if (this._listeners && this._listeners[event] && this._listeners[event][listener]) { delete this._listeners[event][listener]; } } else { if (this._listeners && event in this._listeners) { arr = this._listeners[event]['*']; index = arr.indexOf(listener); if (index > -1) { arr.splice(index, 1); } } } return this; }, 'string, *, function': function (event, id, listener) { if (this._listeners && event in this._listeners && id in this.listeners[event]) { var arr = this._listeners[event][id], index = arr.indexOf(listener); if (index > -1) { arr.splice(index, 1); } } }, 'string, *': function (event, id) { if (this._listeners && event in this._listeners && id in this._listeners[event]) { // Kill all listeners for this event id delete this._listeners[event][id]; } } }), emit: function (event, data) { this._listeners = this._listeners || {}; if (event in this._listeners) { var arrIndex, arrCount, tmpFunc, arr, listenerIdArr, listenerIdCount, listenerIdIndex; // Handle global emit if (this._listeners[event]['*']) { arr = this._listeners[event]['*']; arrCount = arr.length; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { // Check we have a function to execute tmpFunc = arr[arrIndex]; if (typeof tmpFunc === 'function') { tmpFunc.apply(this, Array.prototype.slice.call(arguments, 1)); } } } // Handle individual emit if (data instanceof Array) { // Check if the array is an array of objects in the collection if (data[0] && data[0][this._primaryKey]) { // Loop the array and check for listeners against the primary key listenerIdArr = this._listeners[event]; arrCount = data.length; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { if (listenerIdArr[data[arrIndex][this._primaryKey]]) { // Emit for this id listenerIdCount = listenerIdArr[data[arrIndex][this._primaryKey]].length; for (listenerIdIndex = 0; listenerIdIndex < listenerIdCount; listenerIdIndex++) { tmpFunc = listenerIdArr[data[arrIndex][this._primaryKey]][listenerIdIndex]; if (typeof tmpFunc === 'function') { listenerIdArr[data[arrIndex][this._primaryKey]][listenerIdIndex].apply(this, Array.prototype.slice.call(arguments, 1)); } } } } } } } return this; }, /** * Queues an event to be fired. This has automatic de-bouncing so that any * events of the same type that occur within 100 milliseconds of a previous * one will all be wrapped into a single emit rather than emitting tons of * events for lots of chained inserts etc. Only the data from the last * de-bounced event will be emitted. * @param {String} eventName The name of the event to emit. * @param {*=} data Optional data to emit with the event. */ deferEmit: function (eventName, data) { var self = this, args; if (!this._noEmitDefer && (!this._db || (this._db && !this._db._noEmitDefer))) { args = arguments; // Check for an existing timeout this._deferTimeout = this._deferTimeout || {}; if (this._deferTimeout[eventName]) { clearTimeout(this._deferTimeout[eventName]); } // Set a timeout this._deferTimeout[eventName] = setTimeout(function () { if (self.debug()) { console.log(self.logIdentifier() + ' Emitting ' + args[0]); } self.emit.apply(self, args); }, 1); } else { this.emit.apply(this, arguments); } return this; } }; module.exports = Events; },{"./Overload":22}],16:[function(_dereq_,module,exports){ "use strict"; /** * Provides object matching algorithm methods. * @mixin */ var Matching = { /** * Internal method that checks a document against a test object. * @param {*} source The source object or value to test against. * @param {*} test The test object or value to test with. * @param {Object} queryOptions The options the query was passed with. * @param {String=} opToApply The special operation to apply to the test such * as 'and' or an 'or' operator. * @param {Object=} options An object containing options to apply to the * operation such as limiting the fields returned etc. * @returns {Boolean} True if the test was positive, false on negative. * @private */ _match: function (source, test, queryOptions, opToApply, options) { // TODO: This method is quite long, break into smaller pieces var operation, applyOp = opToApply, recurseVal, tmpIndex, sourceType = typeof source, testType = typeof test, matchedAll = true, opResult, substringCache, i; options = options || {}; queryOptions = queryOptions || {}; // Check if options currently holds a root query object if (!options.$rootQuery) { // Root query not assigned, hold the root query options.$rootQuery = test; } options.$rootData = options.$rootData || {}; // Check if the comparison data are both strings or numbers if ((sourceType === 'string' || sourceType === 'number') && (testType === 'string' || testType === 'number')) { // The source and test data are flat types that do not require recursive searches, // so just compare them and return the result if (sourceType === 'number') { // Number comparison if (source !== test) { matchedAll = false; } } else { // String comparison // TODO: We can probably use a queryOptions.$locale as a second parameter here // TODO: to satisfy https://github.com/Irrelon/ForerunnerDB/issues/35 if (source.localeCompare(test)) { matchedAll = false; } } } else { for (i in test) { if (test.hasOwnProperty(i)) { // Reset operation flag operation = false; substringCache = i.substr(0, 2); // Check if the property is a comment (ignorable) if (substringCache === '//') { // Skip this property continue; } // Check if the property starts with a dollar (function) if (substringCache.indexOf('$') === 0) { // Ask the _matchOp method to handle the operation opResult = this._matchOp(i, source, test[i], queryOptions, options); // Check the result of the matchOp operation // If the result is -1 then no operation took place, otherwise the result // will be a boolean denoting a match (true) or no match (false) if (opResult > -1) { if (opResult) { if (opToApply === 'or') { return true; } } else { // Set the matchedAll flag to the result of the operation // because the operation did not return true matchedAll = opResult; } // Record that an operation was handled operation = true; } } // Check for regex if (!operation && test[i] instanceof RegExp) { operation = true; if (sourceType === 'object' && source[i] !== undefined && test[i].test(source[i])) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } if (!operation) { // Check if our query is an object if (typeof(test[i]) === 'object') { // Because test[i] is an object, source must also be an object // Check if our source data we are checking the test query against // is an object or an array if (source[i] !== undefined) { if (source[i] instanceof Array && !(test[i] instanceof Array)) { // The source data is an array, so check each item until a // match is found recurseVal = false; for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) { recurseVal = this._match(source[i][tmpIndex], test[i], queryOptions, applyOp, options); if (recurseVal) { // One of the array items matched the query so we can // include this item in the results, so break now break; } } if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else if (!(source[i] instanceof Array) && test[i] instanceof Array) { // The test key data is an array and the source key data is not so check // each item in the test key data to see if the source item matches one // of them. This is effectively an $in search. recurseVal = false; for (tmpIndex = 0; tmpIndex < test[i].length; tmpIndex++) { recurseVal = this._match(source[i], test[i][tmpIndex], queryOptions, applyOp, options); if (recurseVal) { // One of the array items matched the query so we can // include this item in the results, so break now break; } } if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else if (typeof(source) === 'object') { // Recurse down the object tree recurseVal = this._match(source[i], test[i], queryOptions, applyOp, options); if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else { recurseVal = this._match(undefined, test[i], queryOptions, applyOp, options); if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } } else { // First check if the test match is an $exists if (test[i] && test[i].$exists !== undefined) { // Push the item through another match recurse recurseVal = this._match(undefined, test[i], queryOptions, applyOp, options); if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else { matchedAll = false; } } } else { // Check if the prop matches our test value if (source && source[i] === test[i]) { if (opToApply === 'or') { return true; } } else if (source && source[i] && source[i] instanceof Array && test[i] && typeof(test[i]) !== "object") { // We are looking for a value inside an array // The source data is an array, so check each item until a // match is found recurseVal = false; for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) { recurseVal = this._match(source[i][tmpIndex], test[i], queryOptions, applyOp, options); if (recurseVal) { // One of the array items matched the query so we can // include this item in the results, so break now break; } } if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else { matchedAll = false; } } } if (opToApply === 'and' && !matchedAll) { return false; } } } } return matchedAll; }, /** * Internal method, performs a matching process against a query operator such as $gt or $nin. * @param {String} key The property name in the test that matches the operator to perform * matching against. * @param {*} source The source data to match the query against. * @param {*} test The query to match the source against. * @param {Object} queryOptions The options the query was passed with. * @param {Object=} options An options object. * @returns {*} * @private */ _matchOp: function (key, source, test, queryOptions, options) { // Check for commands switch (key) { case '$gt': // Greater than return source > test; case '$gte': // Greater than or equal return source >= test; case '$lt': // Less than return source < test; case '$lte': // Less than or equal return source <= test; case '$exists': // Property exists return (source === undefined) !== test; case '$eq': // Equals return source == test; // jshint ignore:line case '$eeq': // Equals equals return source === test; case '$ne': // Not equals return source != test; // jshint ignore:line case '$nee': // Not equals equals return source !== test; case '$or': // Match true on ANY check to pass for (var orIndex = 0; orIndex < test.length; orIndex++) { if (this._match(source, test[orIndex], queryOptions, 'and', options)) { return true; } } return false; case '$and': // Match true on ALL checks to pass for (var andIndex = 0; andIndex < test.length; andIndex++) { if (!this._match(source, test[andIndex], queryOptions, 'and', options)) { return false; } } return true; case '$in': // In // Check that the in test is an array if (test instanceof Array) { var inArr = test, inArrCount = inArr.length, inArrIndex; for (inArrIndex = 0; inArrIndex < inArrCount; inArrIndex++) { if (inArr[inArrIndex] instanceof RegExp && inArr[inArrIndex].test(source)) { return true; } else if (inArr[inArrIndex] === source) { return true; } } return false; } else { throw(this.logIdentifier() + ' Cannot use an $in operator on a non-array key: ' + key); } break; case '$nin': // Not in // Check that the not-in test is an array if (test instanceof Array) { var notInArr = test, notInArrCount = notInArr.length, notInArrIndex; for (notInArrIndex = 0; notInArrIndex < notInArrCount; notInArrIndex++) { if (notInArr[notInArrIndex] === source) { return false; } } return true; } else { throw(this.logIdentifier() + ' Cannot use a $nin operator on a non-array key: ' + key); } break; case '$distinct': // Ensure options holds a distinct lookup options.$rootData['//distinctLookup'] = options.$rootData['//distinctLookup'] || {}; for (var distinctProp in test) { if (test.hasOwnProperty(distinctProp)) { options.$rootData['//distinctLookup'][distinctProp] = options.$rootData['//distinctLookup'][distinctProp] || {}; // Check if the options distinct lookup has this field's value if (options.$rootData['//distinctLookup'][distinctProp][source[distinctProp]]) { // Value is already in use return false; } else { // Set the value in the lookup options.$rootData['//distinctLookup'][distinctProp][source[distinctProp]] = true; // Allow the item in the results return true; } } } break; case '$count': var countKey, countArr, countVal; // Iterate the count object's keys for (countKey in test) { if (test.hasOwnProperty(countKey)) { // Check the property exists and is an array. If the property being counted is not // an array (or doesn't exist) then use a value of zero in any further count logic countArr = source[countKey]; if (typeof countArr === 'object' && countArr instanceof Array) { countVal = countArr.length; } else { countVal = 0; } // Now recurse down the query chain further to satisfy the query for this key (countKey) if (!this._match(countVal, test[countKey], queryOptions, 'and', options)) { return false; } } } // Allow the item in the results return true; } return -1; } }; module.exports = Matching; },{}],17:[function(_dereq_,module,exports){ "use strict"; /** * Provides sorting methods. * @mixin */ var Sorting = { /** * Sorts the passed value a against the passed value b ascending. * @param {*} a The first value to compare. * @param {*} b The second value to compare. * @returns {*} 1 if a is sorted after b, -1 if a is sorted before b. */ sortAsc: function (a, b) { if (typeof(a) === 'string' && typeof(b) === 'string') { return a.localeCompare(b); } else { if (a > b) { return 1; } else if (a < b) { return -1; } } return 0; }, /** * Sorts the passed value a against the passed value b descending. * @param {*} a The first value to compare. * @param {*} b The second value to compare. * @returns {*} 1 if a is sorted after b, -1 if a is sorted before b. */ sortDesc: function (a, b) { if (typeof(a) === 'string' && typeof(b) === 'string') { return b.localeCompare(a); } else { if (a > b) { return -1; } else if (a < b) { return 1; } } return 0; } }; module.exports = Sorting; },{}],18:[function(_dereq_,module,exports){ "use strict"; var Tags, tagMap = {}; /** * Provides class instance tagging and tag operation methods. * @mixin */ Tags = { /** * Tags a class instance for later lookup. * @param {String} name The tag to add. * @returns {boolean} */ tagAdd: function (name) { var i, self = this, mapArr = tagMap[name] = tagMap[name] || []; for (i = 0; i < mapArr.length; i++) { if (mapArr[i] === self) { return true; } } mapArr.push(self); // Hook the drop event for this so we can react if (self.on) { self.on('drop', function () { // We've been dropped so remove ourselves from the tag map self.tagRemove(name); }); } return true; }, /** * Removes a tag from a class instance. * @param {String} name The tag to remove. * @returns {boolean} */ tagRemove: function (name) { var i, mapArr = tagMap[name]; if (mapArr) { for (i = 0; i < mapArr.length; i++) { if (mapArr[i] === this) { mapArr.splice(i, 1); return true; } } } return false; }, /** * Gets an array of all instances tagged with the passed tag name. * @param {String} name The tag to lookup. * @returns {Array} The array of instances that have the passed tag. */ tagLookup: function (name) { return tagMap[name] || []; }, /** * Drops all instances that are tagged with the passed tag name. * @param {String} name The tag to lookup. * @param {Function} callback Callback once dropping has completed * for all instances that match the passed tag name. * @returns {boolean} */ tagDrop: function (name, callback) { var arr = this.tagLookup(name), dropCb, dropCount, i; dropCb = function () { dropCount--; if (callback && dropCount === 0) { callback(false); } }; if (arr.length) { dropCount = arr.length; // Loop the array and drop all items for (i = arr.length - 1; i >= 0; i--) { arr[i].drop(dropCb); } } return true; } }; module.exports = Tags; },{}],19:[function(_dereq_,module,exports){ "use strict"; var Overload = _dereq_('./Overload'); /** * Provides trigger functionality methods. * @mixin */ var Triggers = { /** * Add a trigger by id. * @param {String} id The id of the trigger. This must be unique to the type and * phase of the trigger. Only one trigger may be added with this id per type and * phase. * @param {Number} type The type of operation to apply the trigger to. See * Mixin.Constants for constants to use. * @param {Number} phase The phase of an operation to fire the trigger on. See * Mixin.Constants for constants to use. * @param {Function} method The method to call when the trigger is fired. * @returns {boolean} True if the trigger was added successfully, false if not. */ addTrigger: function (id, type, phase, method) { var self = this, triggerIndex; // Check if the trigger already exists triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex === -1) { // The trigger does not exist, create it self._trigger = self._trigger || {}; self._trigger[type] = self._trigger[type] || {}; self._trigger[type][phase] = self._trigger[type][phase] || []; self._trigger[type][phase].push({ id: id, method: method, enabled: true }); return true; } return false; }, /** * * @param {String} id The id of the trigger to remove. * @param {Number} type The type of operation to remove the trigger from. See * Mixin.Constants for constants to use. * @param {Number} phase The phase of the operation to remove the trigger from. * See Mixin.Constants for constants to use. * @returns {boolean} True if removed successfully, false if not. */ removeTrigger: function (id, type, phase) { var self = this, triggerIndex; // Check if the trigger already exists triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex > -1) { // The trigger exists, remove it self._trigger[type][phase].splice(triggerIndex, 1); } return false; }, enableTrigger: new Overload({ 'string': function (id) { // Alter all triggers of this type var self = this, types = self._trigger, phases, triggers, result = false, i, k, j; if (types) { for (j in types) { if (types.hasOwnProperty(j)) { phases = types[j]; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set enabled flag for (k = 0; k < triggers.length; k++) { if (triggers[k].id === id) { triggers[k].enabled = true; result = true; } } } } } } } } return result; }, 'number': function (type) { // Alter all triggers of this type var self = this, phases = self._trigger[type], triggers, result = false, i, k; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set to enabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = true; result = true; } } } } return result; }, 'number, number': function (type, phase) { // Alter all triggers of this type and phase var self = this, phases = self._trigger[type], triggers, result = false, k; if (phases) { triggers = phases[phase]; if (triggers) { // Loop triggers and set to enabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = true; result = true; } } } return result; }, 'string, number, number': function (id, type, phase) { // Check if the trigger already exists var self = this, triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex > -1) { // Update the trigger self._trigger[type][phase][triggerIndex].enabled = true; return true; } return false; } }), disableTrigger: new Overload({ 'string': function (id) { // Alter all triggers of this type var self = this, types = self._trigger, phases, triggers, result = false, i, k, j; if (types) { for (j in types) { if (types.hasOwnProperty(j)) { phases = types[j]; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set enabled flag for (k = 0; k < triggers.length; k++) { if (triggers[k].id === id) { triggers[k].enabled = false; result = true; } } } } } } } } return result; }, 'number': function (type) { // Alter all triggers of this type var self = this, phases = self._trigger[type], triggers, result = false, i, k; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set to disabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = false; result = true; } } } } return result; }, 'number, number': function (type, phase) { // Alter all triggers of this type and phase var self = this, phases = self._trigger[type], triggers, result = false, k; if (phases) { triggers = phases[phase]; if (triggers) { // Loop triggers and set to disabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = false; result = true; } } } return result; }, 'string, number, number': function (id, type, phase) { // Check if the trigger already exists var self = this, triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex > -1) { // Update the trigger self._trigger[type][phase][triggerIndex].enabled = false; return true; } return false; } }), /** * Checks if a trigger will fire based on the type and phase provided. * @param {Number} type The type of operation. See Mixin.Constants for * constants to use. * @param {Number} phase The phase of the operation. See Mixin.Constants * for constants to use. * @returns {Boolean} True if the trigger will fire, false otherwise. */ willTrigger: function (type, phase) { if (this._trigger && this._trigger[type] && this._trigger[type][phase] && this._trigger[type][phase].length) { // Check if a trigger in this array is enabled var arr = this._trigger[type][phase], i; for (i = 0; i < arr.length; i++) { if (arr[i].enabled) { return true; } } } return false; }, /** * Processes trigger actions based on the operation, type and phase. * @param {Object} operation Operation data to pass to the trigger. * @param {Number} type The type of operation. See Mixin.Constants for * constants to use. * @param {Number} phase The phase of the operation. See Mixin.Constants * for constants to use. * @param {Object} oldDoc The document snapshot before operations are * carried out against the data. * @param {Object} newDoc The document snapshot after operations are * carried out against the data. * @returns {boolean} */ processTrigger: function (operation, type, phase, oldDoc, newDoc) { var self = this, triggerArr, triggerIndex, triggerCount, triggerItem, response; if (self._trigger && self._trigger[type] && self._trigger[type][phase]) { triggerArr = self._trigger[type][phase]; triggerCount = triggerArr.length; for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) { triggerItem = triggerArr[triggerIndex]; // Check if the trigger is enabled if (triggerItem.enabled) { if (this.debug()) { var typeName, phaseName; switch (type) { case this.TYPE_INSERT: typeName = 'insert'; break; case this.TYPE_UPDATE: typeName = 'update'; break; case this.TYPE_REMOVE: typeName = 'remove'; break; default: typeName = ''; break; } switch (phase) { case this.PHASE_BEFORE: phaseName = 'before'; break; case this.PHASE_AFTER: phaseName = 'after'; break; default: phaseName = ''; break; } //console.log('Triggers: Processing trigger "' + id + '" for ' + typeName + ' in phase "' + phaseName + '"'); } // Run the trigger's method and store the response response = triggerItem.method.call(self, operation, oldDoc, newDoc); // Check the response for a non-expected result (anything other than // undefined, true or false is considered a throwable error) if (response === false) { // The trigger wants us to cancel operations return false; } if (response !== undefined && response !== true && response !== false) { // Trigger responded with error, throw the error throw('ForerunnerDB.Mixin.Triggers: Trigger error: ' + response); } } } // Triggers all ran without issue, return a success (true) return true; } }, /** * Returns the index of a trigger by id based on type and phase. * @param {String} id The id of the trigger to find the index of. * @param {Number} type The type of operation. See Mixin.Constants for * constants to use. * @param {Number} phase The phase of the operation. See Mixin.Constants * for constants to use. * @returns {number} * @private */ _triggerIndexOf: function (id, type, phase) { var self = this, triggerArr, triggerCount, triggerIndex; if (self._trigger && self._trigger[type] && self._trigger[type][phase]) { triggerArr = self._trigger[type][phase]; triggerCount = triggerArr.length; for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) { if (triggerArr[triggerIndex].id === id) { return triggerIndex; } } } return -1; } }; module.exports = Triggers; },{"./Overload":22}],20:[function(_dereq_,module,exports){ "use strict"; /** * Provides methods to handle object update operations. * @mixin */ var Updating = { /** * Updates a property on an object. * @param {Object} doc The object whose property is to be updated. * @param {String} prop The property to update. * @param {*} val The new value of the property. * @private */ _updateProperty: function (doc, prop, val) { doc[prop] = val; if (this.debug()) { console.log(this.logIdentifier() + ' Setting non-data-bound document property "' + prop + '"'); } }, /** * Increments a value for a property on a document by the passed number. * @param {Object} doc The document to modify. * @param {String} prop The property to modify. * @param {Number} val The amount to increment by. * @private */ _updateIncrement: function (doc, prop, val) { doc[prop] += val; }, /** * Changes the index of an item in the passed array. * @param {Array} arr The array to modify. * @param {Number} indexFrom The index to move the item from. * @param {Number} indexTo The index to move the item to. * @private */ _updateSpliceMove: function (arr, indexFrom, indexTo) { arr.splice(indexTo, 0, arr.splice(indexFrom, 1)[0]); if (this.debug()) { console.log(this.logIdentifier() + ' Moving non-data-bound document array index from "' + indexFrom + '" to "' + indexTo + '"'); } }, /** * Inserts an item into the passed array at the specified index. * @param {Array} arr The array to insert into. * @param {Number} index The index to insert at. * @param {Object} doc The document to insert. * @private */ _updateSplicePush: function (arr, index, doc) { if (arr.length > index) { arr.splice(index, 0, doc); } else { arr.push(doc); } }, /** * Inserts an item at the end of an array. * @param {Array} arr The array to insert the item into. * @param {Object} doc The document to insert. * @private */ _updatePush: function (arr, doc) { arr.push(doc); }, /** * Removes an item from the passed array. * @param {Array} arr The array to modify. * @param {Number} index The index of the item in the array to remove. * @private */ _updatePull: function (arr, index) { arr.splice(index, 1); }, /** * Multiplies a value for a property on a document by the passed number. * @param {Object} doc The document to modify. * @param {String} prop The property to modify. * @param {Number} val The amount to multiply by. * @private */ _updateMultiply: function (doc, prop, val) { doc[prop] *= val; }, /** * Renames a property on a document to the passed property. * @param {Object} doc The document to modify. * @param {String} prop The property to rename. * @param {Number} val The new property name. * @private */ _updateRename: function (doc, prop, val) { doc[val] = doc[prop]; delete doc[prop]; }, /** * Sets a property on a document to the passed value. * @param {Object} doc The document to modify. * @param {String} prop The property to delete. * @param {*} val The new property value. * @private */ _updateOverwrite: function (doc, prop, val) { doc[prop] = val; }, /** * Deletes a property on a document. * @param {Object} doc The document to modify. * @param {String} prop The property to delete. * @private */ _updateUnset: function (doc, prop) { delete doc[prop]; }, /** * Removes all properties from an object without destroying * the object instance, thereby maintaining data-bound linking. * @param {Object} doc The parent object to modify. * @param {String} prop The name of the child object to clear. * @private */ _updateClear: function (doc, prop) { var obj = doc[prop], i; if (obj && typeof obj === 'object') { for (i in obj) { if (obj.hasOwnProperty(i)) { this._updateUnset(obj, i); } } } }, /** * Pops an item or items from the array stack. * @param {Object} doc The document to modify. * @param {Number} val If set to a positive integer, will pop the number specified * from the stack, if set to a negative integer will shift the number specified * from the stack. * @return {Boolean} * @private */ _updatePop: function (doc, val) { var updated = false, i; if (doc.length > 0) { if (val > 0) { for (i = 0; i < val; i++) { doc.pop(); } updated = true; } else if (val < 0) { for (i = 0; i > val; i--) { doc.shift(); } updated = true; } } return updated; } }; module.exports = Updating; },{}],21:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'); /** * The operation class, used to store details about an operation being * performed by the database. * @param {String} name The name of the operation. * @constructor */ var Operation = function (name) { this.pathSolver = new Path(); this.counter = 0; this.init.apply(this, arguments); }; Operation.prototype.init = function (name) { this._data = { operation: name, // The name of the operation executed such as "find", "update" etc index: { potential: [], // Indexes that could have potentially been used used: false // The index that was picked to use }, steps: [], // The steps taken to generate the query results, time: { startMs: 0, stopMs: 0, totalMs: 0, process: {} }, flag: {}, // An object with flags that denote certain execution paths log: [] // Any extra data that might be useful such as warnings or helpful hints }; }; Shared.addModule('Operation', Operation); Shared.mixin(Operation.prototype, 'Mixin.ChainReactor'); /** * Starts the operation timer. */ Operation.prototype.start = function () { this._data.time.startMs = new Date().getTime(); }; /** * Adds an item to the operation log. * @param {String} event The item to log. * @returns {*} */ Operation.prototype.log = function (event) { if (event) { var lastLogTime = this._log.length > 0 ? this._data.log[this._data.log.length - 1].time : 0, logObj = { event: event, time: new Date().getTime(), delta: 0 }; this._data.log.push(logObj); if (lastLogTime) { logObj.delta = logObj.time - lastLogTime; } return this; } return this._data.log; }; /** * Called when starting and ending a timed operation, used to time * internal calls within an operation's execution. * @param {String} section An operation name. * @returns {*} */ Operation.prototype.time = function (section) { if (section !== undefined) { var process = this._data.time.process, processObj = process[section] = process[section] || {}; if (!processObj.startMs) { // Timer started processObj.startMs = new Date().getTime(); processObj.stepObj = { name: section }; this._data.steps.push(processObj.stepObj); } else { processObj.stopMs = new Date().getTime(); processObj.totalMs = processObj.stopMs - processObj.startMs; processObj.stepObj.totalMs = processObj.totalMs; delete processObj.stepObj; } return this; } return this._data.time; }; /** * Used to set key/value flags during operation execution. * @param {String} key * @param {String} val * @returns {*} */ Operation.prototype.flag = function (key, val) { if (key !== undefined && val !== undefined) { this._data.flag[key] = val; } else if (key !== undefined) { return this._data.flag[key]; } else { return this._data.flag; } }; Operation.prototype.data = function (path, val, noTime) { if (val !== undefined) { // Assign value to object path this.pathSolver.set(this._data, path, val); return this; } return this.pathSolver.get(this._data, path); }; Operation.prototype.pushData = function (path, val, noTime) { // Assign value to object path this.pathSolver.push(this._data, path, val); }; /** * Stops the operation timer. */ Operation.prototype.stop = function () { this._data.time.stopMs = new Date().getTime(); this._data.time.totalMs = this._data.time.stopMs - this._data.time.startMs; }; Shared.finishModule('Operation'); module.exports = Operation; },{"./Path":23,"./Shared":26}],22:[function(_dereq_,module,exports){ "use strict"; /** * Allows a method to accept overloaded calls with different parameters controlling * which passed overload function is called. * @param {Object} def * @returns {Function} * @constructor */ var Overload = function (def) { if (def) { var self = this, index, count, tmpDef, defNewKey, sigIndex, signatures; if (!(def instanceof Array)) { tmpDef = {}; // Def is an object, make sure all prop names are devoid of spaces for (index in def) { if (def.hasOwnProperty(index)) { defNewKey = index.replace(/ /g, ''); // Check if the definition array has a * string in it if (defNewKey.indexOf('*') === -1) { // No * found tmpDef[defNewKey] = def[index]; } else { // A * was found, generate the different signatures that this // definition could represent signatures = this.generateSignaturePermutations(defNewKey); for (sigIndex = 0; sigIndex < signatures.length; sigIndex++) { if (!tmpDef[signatures[sigIndex]]) { tmpDef[signatures[sigIndex]] = def[index]; } } } } } def = tmpDef; } return function () { var arr = [], lookup, type, name; // Check if we are being passed a key/function object or an array of functions if (def instanceof Array) { // We were passed an array of functions count = def.length; for (index = 0; index < count; index++) { if (def[index].length === arguments.length) { return self.callExtend(this, '$main', def, def[index], arguments); } } } else { // Generate lookup key from arguments // Copy arguments to an array for (index = 0; index < arguments.length; index++) { type = typeof arguments[index]; // Handle detecting arrays if (type === 'object' && arguments[index] instanceof Array) { type = 'array'; } // Handle been presented with a single undefined argument if (arguments.length === 1 && type === 'undefined') { break; } // Add the type to the argument types array arr.push(type); } lookup = arr.join(','); // Check for an exact lookup match if (def[lookup]) { return self.callExtend(this, '$main', def, def[lookup], arguments); } else { for (index = arr.length; index >= 0; index--) { // Get the closest match lookup = arr.slice(0, index).join(','); if (def[lookup + ',...']) { // Matched against arguments + "any other" return self.callExtend(this, '$main', def, def[lookup + ',...'], arguments); } } } } name = typeof this.name === 'function' ? this.name() : 'Unknown'; console.log('Overload: ', def); throw('ForerunnerDB.Overload "' + name + '": Overloaded method does not have a matching signature for the passed arguments: ' + this.jStringify(arr)); }; } return function () {}; }; /** * Generates an array of all the different definition signatures that can be * created from the passed string with a catch-all wildcard *. E.g. it will * convert the signature: string,*,string to all potentials: * string,string,string * string,number,string * string,object,string, * string,function,string, * string,undefined,string * * @param {String} str Signature string with a wildcard in it. * @returns {Array} An array of signature strings that are generated. */ Overload.prototype.generateSignaturePermutations = function (str) { var signatures = [], newSignature, types = ['string', 'object', 'number', 'function', 'undefined'], index; if (str.indexOf('*') > -1) { // There is at least one "any" type, break out into multiple keys // We could do this at query time with regular expressions but // would be significantly slower for (index = 0; index < types.length; index++) { newSignature = str.replace('*', types[index]); signatures = signatures.concat(this.generateSignaturePermutations(newSignature)); } } else { signatures.push(str); } return signatures; }; Overload.prototype.callExtend = function (context, prop, propContext, func, args) { var tmp, ret; if (context && propContext[prop]) { tmp = context[prop]; context[prop] = propContext[prop]; ret = func.apply(context, args); context[prop] = tmp; return ret; } else { return func.apply(context, args); } }; module.exports = Overload; },{}],23:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'); /** * Path object used to resolve object paths and retrieve data from * objects by using paths. * @param {String=} path The path to assign. * @constructor */ var Path = function (path) { this.init.apply(this, arguments); }; Path.prototype.init = function (path) { if (path) { this.path(path); } }; Shared.addModule('Path', Path); Shared.mixin(Path.prototype, 'Mixin.Common'); Shared.mixin(Path.prototype, 'Mixin.ChainReactor'); /** * Gets / sets the given path for the Path instance. * @param {String=} path The path to assign. */ Path.prototype.path = function (path) { if (path !== undefined) { this._path = this.clean(path); this._pathParts = this._path.split('.'); return this; } return this._path; }; /** * Tests if the passed object has the paths that are specified and that * a value exists in those paths. * @param {Object} testKeys The object describing the paths to test for. * @param {Object} testObj The object to test paths against. * @returns {Boolean} True if the object paths exist. */ Path.prototype.hasObjectPaths = function (testKeys, testObj) { var result = true, i; for (i in testKeys) { if (testKeys.hasOwnProperty(i)) { if (testObj[i] === undefined) { return false; } if (typeof testKeys[i] === 'object') { // Recurse object result = this.hasObjectPaths(testKeys[i], testObj[i]); // Should we exit early? if (!result) { return false; } } } } return result; }; /** * Counts the total number of key endpoints in the passed object. * @param {Object} testObj The object to count key endpoints for. * @returns {Number} The number of endpoints. */ Path.prototype.countKeys = function (testObj) { var totalKeys = 0, i; for (i in testObj) { if (testObj.hasOwnProperty(i)) { if (testObj[i] !== undefined) { if (typeof testObj[i] !== 'object') { totalKeys++; } else { totalKeys += this.countKeys(testObj[i]); } } } } return totalKeys; }; /** * Tests if the passed object has the paths that are specified and that * a value exists in those paths and if so returns the number matched. * @param {Object} testKeys The object describing the paths to test for. * @param {Object} testObj The object to test paths against. * @returns {Object} Stats on the matched keys */ Path.prototype.countObjectPaths = function (testKeys, testObj) { var matchData, matchedKeys = {}, matchedKeyCount = 0, totalKeyCount = 0, i; for (i in testObj) { if (testObj.hasOwnProperty(i)) { if (typeof testObj[i] === 'object') { // The test / query object key is an object, recurse matchData = this.countObjectPaths(testKeys[i], testObj[i]); matchedKeys[i] = matchData.matchedKeys; totalKeyCount += matchData.totalKeyCount; matchedKeyCount += matchData.matchedKeyCount; } else { // The test / query object has a property that is not an object so add it as a key totalKeyCount++; // Check if the test keys also have this key and it is also not an object if (testKeys && testKeys[i] && typeof testKeys[i] !== 'object') { matchedKeys[i] = true; matchedKeyCount++; } else { matchedKeys[i] = false; } } } } return { matchedKeys: matchedKeys, matchedKeyCount: matchedKeyCount, totalKeyCount: totalKeyCount }; }; /** * Takes a non-recursive object and converts the object hierarchy into * a path string. * @param {Object} obj The object to parse. * @param {Boolean=} withValue If true will include a 'value' key in the returned * object that represents the value the object path points to. * @returns {Object} */ Path.prototype.parse = function (obj, withValue) { var paths = [], path = '', resultData, i, k; for (i in obj) { if (obj.hasOwnProperty(i)) { // Set the path to the key path = i; if (typeof(obj[i]) === 'object') { if (withValue) { resultData = this.parse(obj[i], withValue); for (k = 0; k < resultData.length; k++) { paths.push({ path: path + '.' + resultData[k].path, value: resultData[k].value }); } } else { resultData = this.parse(obj[i]); for (k = 0; k < resultData.length; k++) { paths.push({ path: path + '.' + resultData[k].path }); } } } else { if (withValue) { paths.push({ path: path, value: obj[i] }); } else { paths.push({ path: path }); } } } } return paths; }; /** * Takes a non-recursive object and converts the object hierarchy into * an array of path strings that allow you to target all possible paths * in an object. * * The options object accepts an "ignore" field with a regular expression * as the value. If any key matches the expression it is not included in * the results. * * The options object accepts a boolean "verbose" field. If set to true * the results will include all paths leading up to endpoints as well as * they endpoints themselves. * * @returns {Array} */ Path.prototype.parseArr = function (obj, options) { options = options || {}; return this._parseArr(obj, '', [], options); }; Path.prototype._parseArr = function (obj, path, paths, options) { var i, newPath = ''; path = path || ''; paths = paths || []; for (i in obj) { if (obj.hasOwnProperty(i)) { if (!options.ignore || (options.ignore && !options.ignore.test(i))) { if (path) { newPath = path + '.' + i; } else { newPath = i; } if (typeof(obj[i]) === 'object') { if (options.verbose) { paths.push(newPath); } this._parseArr(obj[i], newPath, paths, options); } else { paths.push(newPath); } } } } return paths; }; /** * Gets the value(s) that the object contains for the currently assigned path string. * @param {Object} obj The object to evaluate the path against. * @param {String=} path A path to use instead of the existing one passed in path(). * @returns {Array} An array of values for the given path. */ Path.prototype.value = function (obj, path) { if (obj !== undefined && typeof obj === 'object') { var pathParts, arr, arrCount, objPart, objPartParent, valuesArr = [], i, k; if (path !== undefined) { path = this.clean(path); pathParts = path.split('.'); } arr = pathParts || this._pathParts; arrCount = arr.length; objPart = obj; for (i = 0; i < arrCount; i++) { objPart = objPart[arr[i]]; if (objPartParent instanceof Array) { // Search inside the array for the next key for (k = 0; k < objPartParent.length; k++) { valuesArr = valuesArr.concat(this.value(objPartParent, k + '.' + arr[i])); } return valuesArr; } else { if (!objPart || typeof(objPart) !== 'object') { break; } } objPartParent = objPart; } return [objPart]; } else { return []; } }; /** * Sets a value on an object for the specified path. * @param {Object} obj The object to update. * @param {String} path The path to update. * @param {*} val The value to set the object path to. * @returns {*} */ Path.prototype.set = function (obj, path, val) { if (obj !== undefined && path !== undefined) { var pathParts, part; path = this.clean(path); pathParts = path.split('.'); part = pathParts.shift(); if (pathParts.length) { // Generate the path part in the object if it does not already exist obj[part] = obj[part] || {}; // Recurse this.set(obj[part], pathParts.join('.'), val); } else { // Set the value obj[part] = val; } } return obj; }; Path.prototype.get = function (obj, path) { return this.value(obj, path)[0]; }; /** * Push a value to an array on an object for the specified path. * @param {Object} obj The object to update. * @param {String} path The path to the array to push to. * @param {*} val The value to push to the array at the object path. * @returns {*} */ Path.prototype.push = function (obj, path, val) { if (obj !== undefined && path !== undefined) { var pathParts, part; path = this.clean(path); pathParts = path.split('.'); part = pathParts.shift(); if (pathParts.length) { // Generate the path part in the object if it does not already exist obj[part] = obj[part] || {}; // Recurse this.set(obj[part], pathParts.join('.'), val); } else { // Set the value obj[part] = obj[part] || []; if (obj[part] instanceof Array) { obj[part].push(val); } else { throw('ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!'); } } } return obj; }; /** * Gets the value(s) that the object contains for the currently assigned path string * with their associated keys. * @param {Object} obj The object to evaluate the path against. * @param {String=} path A path to use instead of the existing one passed in path(). * @returns {Array} An array of values for the given path with the associated key. */ Path.prototype.keyValue = function (obj, path) { var pathParts, arr, arrCount, objPart, objPartParent, objPartHash, i; if (path !== undefined) { path = this.clean(path); pathParts = path.split('.'); } arr = pathParts || this._pathParts; arrCount = arr.length; objPart = obj; for (i = 0; i < arrCount; i++) { objPart = objPart[arr[i]]; if (!objPart || typeof(objPart) !== 'object') { objPartHash = arr[i] + ':' + objPart; break; } objPartParent = objPart; } return objPartHash; }; /** * Sets a value on an object for the specified path. * @param {Object} obj The object to update. * @param {String} path The path to update. * @param {*} val The value to set the object path to. * @returns {*} */ Path.prototype.set = function (obj, path, val) { if (obj !== undefined && path !== undefined) { var pathParts, part; path = this.clean(path); pathParts = path.split('.'); part = pathParts.shift(); if (pathParts.length) { // Generate the path part in the object if it does not already exist obj[part] = obj[part] || {}; // Recurse this.set(obj[part], pathParts.join('.'), val); } else { // Set the value obj[part] = val; } } return obj; }; /** * Removes leading period (.) from string and returns it. * @param {String} str The string to clean. * @returns {*} */ Path.prototype.clean = function (str) { if (str.substr(0, 1) === '.') { str = str.substr(1, str.length -1); } return str; }; Shared.finishModule('Path'); module.exports = Path; },{"./Shared":26}],24:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'); /** * Provides chain reactor node linking so that a chain reaction can propagate * down a node tree. Effectively creates a chain link between the reactorIn and * reactorOut objects where a chain reaction from the reactorIn is passed through * the reactorProcess before being passed to the reactorOut object. Reactor * packets are only passed through to the reactorOut if the reactor IO method * chainSend is used. * @param {*} reactorIn An object that has the Mixin.ChainReactor methods mixed * in to it. Chain reactions that occur inside this object will be passed through * to the reactorOut object. * @param {*} reactorOut An object that has the Mixin.ChainReactor methods mixed * in to it. Chain reactions that occur in the reactorIn object will be passed * through to this object. * @param {Function} reactorProcess The processing method to use when chain * reactions occur. * @constructor */ var ReactorIO = function (reactorIn, reactorOut, reactorProcess) { if (reactorIn && reactorOut && reactorProcess) { this._reactorIn = reactorIn; this._reactorOut = reactorOut; this._chainHandler = reactorProcess; if (!reactorIn.chain || !reactorOut.chainReceive) { throw('ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!'); } // Register the reactorIO with the input reactorIn.chain(this); // Register the output with the reactorIO this.chain(reactorOut); } else { throw('ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!'); } }; Shared.addModule('ReactorIO', ReactorIO); /** * Drop a reactor IO object, breaking the reactor link between the in and out * reactor nodes. * @returns {boolean} */ ReactorIO.prototype.drop = function () { if (!this.isDropped()) { this._state = 'dropped'; // Remove links if (this._reactorIn) { this._reactorIn.unChain(this); } if (this._reactorOut) { this.unChain(this._reactorOut); } delete this._reactorIn; delete this._reactorOut; delete this._chainHandler; this.emit('drop', this); } return true; }; /** * Gets / sets the current state. * @param {String=} val The name of the state to set. * @returns {*} */ Shared.synthesize(ReactorIO.prototype, 'state'); Shared.mixin(ReactorIO.prototype, 'Mixin.Common'); Shared.mixin(ReactorIO.prototype, 'Mixin.ChainReactor'); Shared.mixin(ReactorIO.prototype, 'Mixin.Events'); Shared.finishModule('ReactorIO'); module.exports = ReactorIO; },{"./Shared":26}],25:[function(_dereq_,module,exports){ "use strict"; /** * Provides functionality to encode and decode JavaScript objects to strings * and back again. This differs from JSON.stringify and JSON.parse in that * special objects such as dates can be encoded to strings and back again * so that the reconstituted version of the string still contains a JavaScript * date object. * @constructor */ var Serialiser = function () { this.init.apply(this, arguments); }; Serialiser.prototype.init = function () { this._encoder = []; this._decoder = {}; // Register our handlers this.registerEncoder('$date', function (data) { if (data instanceof Date) { return data.toISOString(); } }); this.registerDecoder('$date', function (data) { return new Date(data); }); }; /** * Register an encoder that can handle encoding for a particular * object type. * @param {String} handles The name of the handler e.g. $date. * @param {Function} method The encoder method. */ Serialiser.prototype.registerEncoder = function (handles, method) { this._encoder.push(function (data) { var methodVal = method(data), returnObj; if (methodVal !== undefined) { returnObj = {}; returnObj[handles] = methodVal; } return returnObj; }); }; /** * Register a decoder that can handle decoding for a particular * object type. * @param {String} handles The name of the handler e.g. $date. When an object * has a field matching this handler name then this decode will be invoked * to provide a decoded version of the data that was previously encoded by * it's counterpart encoder method. * @param {Function} method The decoder method. */ Serialiser.prototype.registerDecoder = function (handles, method) { this._decoder[handles] = method; }; /** * Loops the encoders and asks each one if it wants to handle encoding for * the passed data object. If no value is returned (undefined) then the data * will be passed to the next encoder and so on. If a value is returned the * loop will break and the encoded data will be used. * @param {Object} data The data object to handle. * @returns {*} The encoded data. * @private */ Serialiser.prototype._encode = function (data) { // Loop the encoders and if a return value is given by an encoder // the loop will exit and return that value. var count = this._encoder.length, retVal; while (count-- && !retVal) { retVal = this._encoder[count](data); } return retVal; }; /** * Converts a previously encoded string back into an object. * @param {String} data The string to convert to an object. * @returns {Object} The reconstituted object. */ Serialiser.prototype.parse = function (data) { return this._parse(JSON.parse(data)); }; /** * Handles restoring an object with special data markers back into * it's original format. * @param {Object} data The object to recurse. * @param {Object=} target The target object to restore data to. * @returns {Object} The final restored object. * @private */ Serialiser.prototype._parse = function (data, target) { var i; if (typeof data === 'object' && data !== null) { if (data instanceof Array) { target = target || []; } else { target = target || {}; } // Iterate through the object's keys and handle // special object types and restore them for (i in data) { if (data.hasOwnProperty(i)) { if (i.substr(0, 1) === '$' && this._decoder[i]) { // This is a special object type and a handler // exists, restore it return this._decoder[i](data[i]); } // Not a special object or no handler, recurse as normal target[i] = this._parse(data[i], target[i]); } } } else { target = data; } // The data is a basic type return target; }; /** * Converts an object to a encoded string representation. * @param {Object} data The object to encode. */ Serialiser.prototype.stringify = function (data) { return JSON.stringify(this._stringify(data)); }; /** * Recurse down an object and encode special objects so they can be * stringified and later restored. * @param {Object} data The object to parse. * @param {Object=} target The target object to store converted data to. * @returns {Object} The converted object. * @private */ Serialiser.prototype._stringify = function (data, target) { var handledData, i; if (typeof data === 'object' && data !== null) { // Handle special object types so they can be encoded with // a special marker and later restored by a decoder counterpart handledData = this._encode(data); if (handledData) { // An encoder handled this object type so return it now return handledData; } if (data instanceof Array) { target = target || []; } else { target = target || {}; } // Iterate through the object's keys and serialise for (i in data) { if (data.hasOwnProperty(i)) { target[i] = this._stringify(data[i], target[i]); } } } else { target = data; } // The data is a basic type return target; }; module.exports = Serialiser; },{}],26:[function(_dereq_,module,exports){ "use strict"; var Overload = _dereq_('./Overload'); /** * A shared object that can be used to store arbitrary data between class * instances, and access helper methods. * @mixin */ var Shared = { version: '1.3.454', modules: {}, plugins: {}, _synth: {}, /** * Adds a module to ForerunnerDB. * @memberof Shared * @param {String} name The name of the module. * @param {Function} module The module class. */ addModule: function (name, module) { // Store the module in the module registry this.modules[name] = module; // Tell the universe we are loading this module this.emit('moduleLoad', [name, module]); }, /** * Called by the module once all processing has been completed. Used to determine * if the module is ready for use by other modules. * @memberof Shared * @param {String} name The name of the module. */ finishModule: function (name) { if (this.modules[name]) { // Set the finished loading flag to true this.modules[name]._fdbFinished = true; // Assign the module name to itself so it knows what it // is called if (this.modules[name].prototype) { this.modules[name].prototype.className = name; } else { this.modules[name].className = name; } this.emit('moduleFinished', [name, this.modules[name]]); } else { throw('ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): ' + name); } }, /** * Will call your callback method when the specified module has loaded. If the module * is already loaded the callback is called immediately. * @memberof Shared * @param {String} name The name of the module. * @param {Function} callback The callback method to call when the module is loaded. */ moduleFinished: function (name, callback) { if (this.modules[name] && this.modules[name]._fdbFinished) { if (callback) { callback(name, this.modules[name]); } } else { this.on('moduleFinished', callback); } }, /** * Determines if a module has been added to ForerunnerDB or not. * @memberof Shared * @param {String} name The name of the module. * @returns {Boolean} True if the module exists or false if not. */ moduleExists: function (name) { return Boolean(this.modules[name]); }, /** * Adds the properties and methods defined in the mixin to the passed object. * @memberof Shared * @param {Object} obj The target object to add mixin key/values to. * @param {String} mixinName The name of the mixin to add to the object. */ mixin: new Overload({ 'object, string': function (obj, mixinName) { var mixinObj; if (typeof mixinName === 'string') { mixinObj = this.mixins[mixinName]; if (!mixinObj) { throw('ForerunnerDB.Shared: Cannot find mixin named: ' + mixinName); } } return this.$main.call(this, obj, mixinObj); }, 'object, *': function (obj, mixinObj) { return this.$main.call(this, obj, mixinObj); }, '$main': function (obj, mixinObj) { if (mixinObj && typeof mixinObj === 'object') { for (var i in mixinObj) { if (mixinObj.hasOwnProperty(i)) { obj[i] = mixinObj[i]; } } } return obj; } }), /** * Generates a generic getter/setter method for the passed method name. * @memberof Shared * @param {Object} obj The object to add the getter/setter to. * @param {String} name The name of the getter/setter to generate. * @param {Function=} extend A method to call before executing the getter/setter. * The existing getter/setter can be accessed from the extend method via the * $super e.g. this.$super(); */ synthesize: function (obj, name, extend) { this._synth[name] = this._synth[name] || function (val) { if (val !== undefined) { this['_' + name] = val; return this; } return this['_' + name]; }; if (extend) { var self = this; obj[name] = function () { var tmp = this.$super, ret; this.$super = self._synth[name]; ret = extend.apply(this, arguments); this.$super = tmp; return ret; }; } else { obj[name] = this._synth[name]; } }, /** * Allows a method to be overloaded. * @memberof Shared * @param arr * @returns {Function} * @constructor */ overload: Overload, /** * Define the mixins that other modules can use as required. * @memberof Shared */ mixins: { 'Mixin.Common': _dereq_('./Mixin.Common'), 'Mixin.Events': _dereq_('./Mixin.Events'), 'Mixin.ChainReactor': _dereq_('./Mixin.ChainReactor'), 'Mixin.CRUD': _dereq_('./Mixin.CRUD'), 'Mixin.Constants': _dereq_('./Mixin.Constants'), 'Mixin.Triggers': _dereq_('./Mixin.Triggers'), 'Mixin.Sorting': _dereq_('./Mixin.Sorting'), 'Mixin.Matching': _dereq_('./Mixin.Matching'), 'Mixin.Updating': _dereq_('./Mixin.Updating'), 'Mixin.Tags': _dereq_('./Mixin.Tags') } }; // Add event handling to shared Shared.mixin(Shared, 'Mixin.Events'); module.exports = Shared; },{"./Mixin.CRUD":11,"./Mixin.ChainReactor":12,"./Mixin.Common":13,"./Mixin.Constants":14,"./Mixin.Events":15,"./Mixin.Matching":16,"./Mixin.Sorting":17,"./Mixin.Tags":18,"./Mixin.Triggers":19,"./Mixin.Updating":20,"./Overload":22}],27:[function(_dereq_,module,exports){ /* jshint strict:false */ if (!Array.prototype.filter) { Array.prototype.filter = function(fun/*, thisArg*/) { if (this === void 0 || this === null) { throw new TypeError(); } var t = Object(this); var len = t.length >>> 0; // jshint ignore:line if (typeof fun !== 'function') { throw new TypeError(); } var res = []; var thisArg = arguments.length >= 2 ? arguments[1] : void 0; for (var i = 0; i < len; i++) { if (i in t) { var val = t[i]; // NOTE: Technically this should Object.defineProperty at // the next index, as push can be affected by // properties on Object.prototype and Array.prototype. // But that method's new, and collisions should be // rare, so use the more-compatible alternative. if (fun.call(thisArg, val, i, t)) { res.push(val); } } } return res; }; } if (typeof Object.create !== 'function') { Object.create = (function() { var Temp = function() {}; return function (prototype) { if (arguments.length > 1) { throw Error('Second argument not supported'); } if (typeof prototype !== 'object') { throw TypeError('Argument must be an object'); } Temp.prototype = prototype; var result = new Temp(); Temp.prototype = null; return result; }; })(); } // Production steps of ECMA-262, Edition 5, 15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14e if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(searchElement, fromIndex) { var k; // 1. Let O be the result of calling ToObject passing // the this value as the argument. if (this === null) { throw new TypeError('"this" is null or not defined'); } var O = Object(this); // 2. Let lenValue be the result of calling the Get // internal method of O with the argument "length". // 3. Let len be ToUint32(lenValue). var len = O.length >>> 0; // jshint ignore:line // 4. If len is 0, return -1. if (len === 0) { return -1; } // 5. If argument fromIndex was passed let n be // ToInteger(fromIndex); else let n be 0. var n = +fromIndex || 0; if (Math.abs(n) === Infinity) { n = 0; } // 6. If n >= len, return -1. if (n >= len) { return -1; } // 7. If n >= 0, then Let k be n. // 8. Else, n<0, Let k be len - abs(n). // If k is less than 0, then let k be 0. k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); // 9. Repeat, while k < len while (k < len) { // a. Let Pk be ToString(k). // This is implicit for LHS operands of the in operator // b. Let kPresent be the result of calling the // HasProperty internal method of O with argument Pk. // This step can be combined with c // c. If kPresent is true, then // i. Let elementK be the result of calling the Get // internal method of O with the argument ToString(k). // ii. Let same be the result of applying the // Strict Equality Comparison Algorithm to // searchElement and elementK. // iii. If same is true, return k. if (k in O && O[k] === searchElement) { return k; } k++; } return -1; }; } module.exports = {}; },{}]},{},[1]);
ajax/libs/react-inlinesvg/0.5.0/react-inlinesvg.js
jdh8/cdnjs
(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.ReactInlineSVG = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ function emptyFunction() {} emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; },{}],2:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var emptyObject = {}; if (process.env.NODE_ENV !== 'production') { Object.freeze(emptyObject); } module.exports = emptyObject; }).call(this,require('_process')) },{"_process":22}],3:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ function invariant(condition, format, a, b, c, d, e, f) { if (process.env.NODE_ENV !== 'production') { if (format === undefined) { throw new Error('invariant requires an error message argument'); } } if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } module.exports = invariant; }).call(this,require('_process')) },{"_process":22}],4:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks static-only */ 'use strict'; var invariant = require('./invariant'); /** * Constructs an enumeration with keys equal to their value. * * For example: * * var COLORS = keyMirror({blue: null, red: null}); * var myColor = COLORS.blue; * var isColorValid = !!COLORS[myColor]; * * The last line could not be performed if the values of the generated enum were * not equal to their keys. * * Input: {key1: val1, key2: val2} * Output: {key1: key1, key2: key2} * * @param {object} obj * @return {object} */ var keyMirror = function (obj) { var ret = {}; var key; !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0; for (key in obj) { if (!obj.hasOwnProperty(key)) { continue; } ret[key] = key; } return ret; }; module.exports = keyMirror; }).call(this,require('_process')) },{"./invariant":3,"_process":22}],5:[function(require,module,exports){ "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ /** * Allows extraction of a minified key. Let's the build system minify keys * without losing the ability to dynamically use key strings as values * themselves. Pass in an object with a single key/val pair and it will return * you the string key of that single record. Suppose you want to grab the * value for a key 'className' inside of an object. Key/val minification may * have aliased that key to be 'xa12'. keyOf({className: null}) will return * 'xa12' in that case. Resolve keys you want to use once at startup time, then * reuse those resolutions. */ var keyOf = function (oneKeyObj) { var key; for (key in oneKeyObj) { if (!oneKeyObj.hasOwnProperty(key)) { continue; } return key; } return null; }; module.exports = keyOf; },{}],6:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Executes the provided `callback` once for each enumerable own property in the * object and constructs a new object from the results. The `callback` is * invoked with three arguments: * * - the property value * - the property name * - the object being traversed * * Properties that are added after the call to `mapObject` will not be visited * by `callback`. If the values of existing properties are changed, the value * passed to `callback` will be the value at the time `mapObject` visits them. * Properties that are deleted before being visited are not visited. * * @grep function objectMap() * @grep function objMap() * * @param {?object} object * @param {function} callback * @param {*} context * @return {?object} */ function mapObject(object, callback, context) { if (!object) { return null; } var result = {}; for (var name in object) { if (hasOwnProperty.call(object, name)) { result[name] = callback.call(context, object[name], name, object); } } return result; } module.exports = mapObject; },{}],7:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks * */ /*eslint-disable no-self-compare */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. * Returns true when the values of all keys are strictly equal. */ function shallowEqual(objA, objB) { if (is(objA, objB)) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. for (var i = 0; i < keysA.length; i++) { if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; } module.exports = shallowEqual; },{}],8:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var emptyFunction = require('./emptyFunction'); /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = emptyFunction; if (process.env.NODE_ENV !== 'production') { warning = function (condition, format) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } if (format === undefined) { throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); } if (format.indexOf('Failed Composite propType: ') === 0) { return; // Ignore CompositeComponent proptype check. } if (!condition) { var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} } }; } module.exports = warning; }).call(this,require('_process')) },{"./emptyFunction":1,"_process":22}],9:[function(require,module,exports){ 'use strict'; var Response = require('./response'); var extractResponseProps = require('./utils/extractResponseProps'); var extend = require('xtend'); function RequestError(message, props) { var err = new Error(message); err.name = 'RequestError'; this.name = err.name; this.message = err.message; if (err.stack) { this.stack = err.stack; } this.toString = function() { return this.message; }; for (var k in props) { if (props.hasOwnProperty(k)) { this[k] = props[k]; } } } RequestError.prototype = extend(Error.prototype); RequestError.prototype.constructor = RequestError; RequestError.create = function(message, req, props) { var err = new RequestError(message, props); Response.call(err, extractResponseProps(req)); return err; }; module.exports = RequestError; },{"./response":12,"./utils/extractResponseProps":14,"xtend":17}],10:[function(require,module,exports){ 'use strict'; var cleanURL = require('../plugins/cleanurl'), XHR = require('./xhr'), delay = require('./utils/delay'), RequestError = require('./error'), Response = require('./response'), Request = require('./request'), extend = require('xtend'), once = require('./utils/once'); var i, createError = RequestError.create; function factory(defaults, plugins) { defaults = defaults || {}; plugins = plugins || []; function http(req, cb) { var xhr, plugin, done, k, timeoutId, supportsLoadAndErrorEvents; req = new Request(extend(defaults, req)); for (i = 0; i < plugins.length; i++) { plugin = plugins[i]; if (plugin.processRequest) { plugin.processRequest(req); } } // Give the plugins a chance to create the XHR object for (i = 0; i < plugins.length; i++) { plugin = plugins[i]; if (plugin.createXHR) { xhr = plugin.createXHR(req); break; // First come, first serve } } xhr = xhr || new XHR(); req.xhr = xhr; // Use a single completion callback. This can be called with or without // an error. If no error is passed, the request will be examined to see // if it was successful. done = once(delay(function(rawError) { clearTimeout(timeoutId); xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = xhr.ontimeout = xhr.onprogress = null; var err = getError(req, rawError); var res = err || Response.fromRequest(req); for (i = 0; i < plugins.length; i++) { plugin = plugins[i]; if (plugin.processResponse) { plugin.processResponse(res); } } // Invoke callbacks if (err && req.onerror) req.onerror(err); if (!err && req.onload) req.onload(res); if (cb) cb(err, err ? undefined : res); })); supportsLoadAndErrorEvents = ('onload' in xhr) && ('onerror' in xhr); xhr.onload = function() { done(); }; xhr.onerror = done; xhr.onabort = function() { done(); }; // We'd rather use `onload`, `onerror`, and `onabort` since they're the // only way to reliably detect successes and failures but, if they // aren't available, we fall back to using `onreadystatechange`. xhr.onreadystatechange = function() { if (xhr.readyState !== 4) return; if (req.aborted) return done(); if (!supportsLoadAndErrorEvents) { // Assume a status of 0 is an error. This could be a false // positive, but there's no way to tell when using // `onreadystatechange` ): // See matthewwithanm/react-inlinesvg#10. // Some browsers don't like you reading XHR properties when the // XHR has been aborted. In case we've gotten here as a result // of that (either our calling `about()` in the timeout handler // or the user calling it directly even though they shouldn't), // be careful about accessing it. var status; try { status = xhr.status; } catch (err) {} var err = status === 0 ? new Error('Internal XHR Error') : null; return done(err); } }; // IE sometimes fails if you don't specify every handler. // See http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment xhr.ontimeout = function() { /* noop */ }; xhr.onprogress = function() { /* noop */ }; xhr.open(req.method, req.url); if (req.timeout) { // If we use the normal XHR timeout mechanism (`xhr.timeout` and // `xhr.ontimeout`), `onreadystatechange` will be triggered before // `ontimeout`. There's no way to recognize that it was triggered by // a timeout, and we'd be unable to dispatch the right error. timeoutId = setTimeout(function() { req.timedOut = true; done(); try { xhr.abort(); } catch (err) {} }, req.timeout); } for (k in req.headers) { if (req.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, req.headers[k]); } } xhr.send(req.body); return req; } var method, methods = ['get', 'post', 'put', 'head', 'patch', 'delete'], verb = function(method) { return function(req, cb) { req = new Request(req); req.method = method; return http(req, cb); }; }; for (i = 0; i < methods.length; i++) { method = methods[i]; http[method] = verb(method); } http.plugins = function() { return plugins; }; http.defaults = function(newValues) { if (newValues) { return factory(extend(defaults, newValues), plugins); } return defaults; }; http.use = function() { var newPlugins = Array.prototype.slice.call(arguments, 0); return factory(defaults, plugins.concat(newPlugins)); }; http.bare = function() { return factory(); }; http.Request = Request; http.Response = Response; http.RequestError = RequestError; return http; } module.exports = factory({}, [cleanURL]); /** * Analyze the request to see if it represents an error. If so, return it! An * original error object can be passed as a hint. */ function getError(req, err) { if (req.aborted) return createError('Request aborted', req, {name: 'Abort'}); if (req.timedOut) return createError('Request timeout', req, {name: 'Timeout'}); var xhr = req.xhr; var type = Math.floor(xhr.status / 100); var kind; switch (type) { case 0: case 2: // These don't represent errors unless the function was passed an // error object explicitly. if (!err) return; return createError(err.message, req); case 4: // Sometimes 4XX statuses aren't errors. if (xhr.status === 404 && !req.errorOn404) return; kind = 'Client'; break; case 5: kind = 'Server'; break; default: kind = 'HTTP'; } var msg = kind + ' Error: ' + 'The server returned a status of ' + xhr.status + ' for the request "' + req.method.toUpperCase() + ' ' + req.url + '"'; return createError(msg, req); } },{"../plugins/cleanurl":18,"./error":9,"./request":11,"./response":12,"./utils/delay":13,"./utils/once":15,"./xhr":16,"xtend":17}],11:[function(require,module,exports){ 'use strict'; function Request(optsOrUrl) { var opts = typeof optsOrUrl === 'string' ? {url: optsOrUrl} : optsOrUrl || {}; this.method = opts.method ? opts.method.toUpperCase() : 'GET'; this.url = opts.url; this.headers = opts.headers || {}; this.body = opts.body; this.timeout = opts.timeout || 0; this.errorOn404 = opts.errorOn404 != null ? opts.errorOn404 : true; this.onload = opts.onload; this.onerror = opts.onerror; } Request.prototype.abort = function() { if (this.aborted) return; this.aborted = true; this.xhr.abort(); return this; }; Request.prototype.header = function(name, value) { var k; for (k in this.headers) { if (this.headers.hasOwnProperty(k)) { if (name.toLowerCase() === k.toLowerCase()) { if (arguments.length === 1) { return this.headers[k]; } delete this.headers[k]; break; } } } if (value != null) { this.headers[name] = value; return value; } }; module.exports = Request; },{}],12:[function(require,module,exports){ 'use strict'; var Request = require('./request'); var extractResponseProps = require('./utils/extractResponseProps'); function Response(props) { this.request = props.request; this.xhr = props.xhr; this.headers = props.headers || {}; this.status = props.status || 0; this.text = props.text; this.body = props.body; this.contentType = props.contentType; this.isHttpError = props.status >= 400; } Response.prototype.header = Request.prototype.header; Response.fromRequest = function(req) { return new Response(extractResponseProps(req)); }; module.exports = Response; },{"./request":11,"./utils/extractResponseProps":14}],13:[function(require,module,exports){ 'use strict'; // Wrap a function in a `setTimeout` call. This is used to guarantee async // behavior, which can avoid unexpected errors. module.exports = function(fn) { return function() { var args = Array.prototype.slice.call(arguments, 0), newFunc = function() { return fn.apply(null, args); }; setTimeout(newFunc, 0); }; }; },{}],14:[function(require,module,exports){ 'use strict'; var extend = require('xtend'); module.exports = function(req) { var xhr = req.xhr; var props = {request: req, xhr: xhr}; // Try to create the response from the request. If the request was aborted, // accesssing properties of the XHR may throw an error, so we wrap in a // try/catch. try { var lines, i, m, headers = {}; if (xhr.getAllResponseHeaders) { lines = xhr.getAllResponseHeaders().split('\n'); for (i = 0; i < lines.length; i++) { if ((m = lines[i].match(/\s*([^\s]+):\s+([^\s]+)/))) { headers[m[1]] = m[2]; } } } props = extend(props, { status: xhr.status, contentType: xhr.contentType || (xhr.getResponseHeader && xhr.getResponseHeader('Content-Type')), headers: headers, text: xhr.responseText, body: xhr.response || xhr.responseText }); } catch (err) {} return props; }; },{"xtend":17}],15:[function(require,module,exports){ 'use strict'; // A "once" utility. module.exports = function(fn) { var result, called = false; return function() { if (!called) { called = true; result = fn.apply(this, arguments); } return result; }; }; },{}],16:[function(require,module,exports){ module.exports = window.XMLHttpRequest; },{}],17:[function(require,module,exports){ module.exports = extend function extend() { var target = {} for (var i = 0; i < arguments.length; i++) { var source = arguments[i] for (var key in source) { if (source.hasOwnProperty(key)) { target[key] = source[key] } } } return target } },{}],18:[function(require,module,exports){ 'use strict'; module.exports = { processRequest: function(req) { req.url = req.url.replace(/[^%]+/g, function(s) { return encodeURI(s); }); } }; },{}],19:[function(require,module,exports){ 'use strict'; var urllite = require('urllite/lib/core'), once = require('../lib/utils/once'); var warningShown = false; var supportsXHR = once(function() { return ( typeof window !== 'undefined' && window !== null && window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest() ); }); // This plugin creates a Microsoft `XDomainRequest` in supporting browsers when // the URL being requested is on a different domain. This is necessary to // support IE9, which only supports CORS via its proprietary `XDomainRequest` // object. We need to check the URL because `XDomainRequest` *doesn't* work for // same domain requests (unless your server sends CORS headers). // `XDomainRequest` also has other limitations (no custom headers), so we try to // catch those and error. module.exports = { createXHR: function(req) { var a, b, k; if (typeof window === 'undefined' || window === null) { return; } a = urllite(req.url); b = urllite(window.location.href); // Don't do anything for same-domain requests. if (!a.host) { return; } if (a.protocol === b.protocol && a.host === b.host && a.port === b.port) { return; } // Show a warning if there are custom headers. We do this even in // browsers that won't use XDomainRequest so that users know there's an // issue right away, instead of if/when they test in IE9. if (!warningShown && req.headers) { for (k in req.headers) { if (req.headers.hasOwnProperty(k)) { warningShown = true; if (window && window.console && window.console.warn) { window.console.warn('Request headers are ignored in old IE when using the oldiexdomain plugin.'); } break; } } } // Don't do anything if we can't do anything (: // Don't do anything if the browser supports proper XHR. if (window.XDomainRequest && !supportsXHR()) { // We've come this far. Might as well make an XDomainRequest. var xdr = new window.XDomainRequest(); xdr.setRequestHeader = function() {}; // Ignore request headers. return xdr; } } }; },{"../lib/utils/once":15,"urllite/lib/core":45}],20:[function(require,module,exports){ /* eslint-disable no-unused-vars */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } module.exports = Object.assign || function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (Object.getOwnPropertySymbols) { symbols = Object.getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; },{}],21:[function(require,module,exports){ var wrappy = require('wrappy') module.exports = wrappy(once) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } },{"wrappy":46}],22:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = setTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; clearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { setTimeout(drainQueue, 0); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; },{}],23:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule PooledClass */ 'use strict'; var invariant = require('fbjs/lib/invariant'); /** * Static poolers. Several custom versions for each potential number of * arguments. A completely generic pooler is easy to implement, but would * require accessing the `arguments` object. In each of these, `this` refers to * the Class itself, not an instance. If any others are needed, simply add them * here, or in their own files. */ var oneArgumentPooler = function (copyFieldsFrom) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, copyFieldsFrom); return instance; } else { return new Klass(copyFieldsFrom); } }; var twoArgumentPooler = function (a1, a2) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2); return instance; } else { return new Klass(a1, a2); } }; var threeArgumentPooler = function (a1, a2, a3) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3); return instance; } else { return new Klass(a1, a2, a3); } }; var fourArgumentPooler = function (a1, a2, a3, a4) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3, a4); return instance; } else { return new Klass(a1, a2, a3, a4); } }; var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3, a4, a5); return instance; } else { return new Klass(a1, a2, a3, a4, a5); } }; var standardReleaser = function (instance) { var Klass = this; !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0; instance.destructor(); if (Klass.instancePool.length < Klass.poolSize) { Klass.instancePool.push(instance); } }; var DEFAULT_POOL_SIZE = 10; var DEFAULT_POOLER = oneArgumentPooler; /** * Augments `CopyConstructor` to be a poolable class, augmenting only the class * itself (statically) not adding any prototypical fields. Any CopyConstructor * you give this may have a `poolSize` property, and will look for a * prototypical `destructor` on instances (optional). * * @param {Function} CopyConstructor Constructor that can be used to reset. * @param {Function} pooler Customizable pooler. */ var addPoolingTo = function (CopyConstructor, pooler) { var NewKlass = CopyConstructor; NewKlass.instancePool = []; NewKlass.getPooled = pooler || DEFAULT_POOLER; if (!NewKlass.poolSize) { NewKlass.poolSize = DEFAULT_POOL_SIZE; } NewKlass.release = standardReleaser; return NewKlass; }; var PooledClass = { addPoolingTo: addPoolingTo, oneArgumentPooler: oneArgumentPooler, twoArgumentPooler: twoArgumentPooler, threeArgumentPooler: threeArgumentPooler, fourArgumentPooler: fourArgumentPooler, fiveArgumentPooler: fiveArgumentPooler }; module.exports = PooledClass; }).call(this,require('_process')) },{"_process":22,"fbjs/lib/invariant":3}],24:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule React */ 'use strict'; var _assign = require('object-assign'); var ReactChildren = require('./ReactChildren'); var ReactComponent = require('./ReactComponent'); var ReactClass = require('./ReactClass'); var ReactDOMFactories = require('./ReactDOMFactories'); var ReactElement = require('./ReactElement'); var ReactElementValidator = require('./ReactElementValidator'); var ReactPropTypes = require('./ReactPropTypes'); var ReactVersion = require('./ReactVersion'); var onlyChild = require('./onlyChild'); var warning = require('fbjs/lib/warning'); var createElement = ReactElement.createElement; var createFactory = ReactElement.createFactory; var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; cloneElement = ReactElementValidator.cloneElement; } var __spread = _assign; if (process.env.NODE_ENV !== 'production') { var warned = false; __spread = function () { process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0; warned = true; return _assign.apply(null, arguments); }; } var React = { // Modern Children: { map: ReactChildren.map, forEach: ReactChildren.forEach, count: ReactChildren.count, toArray: ReactChildren.toArray, only: onlyChild }, Component: ReactComponent, createElement: createElement, cloneElement: cloneElement, isValidElement: ReactElement.isValidElement, // Classic PropTypes: ReactPropTypes, createClass: ReactClass.createClass, createFactory: createFactory, createMixin: function (mixin) { // Currently a noop. Will be used to validate and trace mixins. return mixin; }, // This looks DOM specific but these are actually isomorphic helpers // since they are just generating DOM strings. DOM: ReactDOMFactories, version: ReactVersion, // Deprecated hook for JSX spread, don't use this for anything. __spread: __spread }; module.exports = React; }).call(this,require('_process')) },{"./ReactChildren":25,"./ReactClass":26,"./ReactComponent":27,"./ReactDOMFactories":29,"./ReactElement":31,"./ReactElementValidator":32,"./ReactPropTypes":38,"./ReactVersion":39,"./onlyChild":42,"_process":22,"fbjs/lib/warning":8,"object-assign":20}],25:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactChildren */ 'use strict'; var PooledClass = require('./PooledClass'); var ReactElement = require('./ReactElement'); var emptyFunction = require('fbjs/lib/emptyFunction'); var traverseAllChildren = require('./traverseAllChildren'); var twoArgumentPooler = PooledClass.twoArgumentPooler; var fourArgumentPooler = PooledClass.fourArgumentPooler; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); } /** * PooledClass representing the bookkeeping associated with performing a child * traversal. Allows avoiding binding callbacks. * * @constructor ForEachBookKeeping * @param {!function} forEachFunction Function to perform traversal with. * @param {?*} forEachContext Context to perform context with. */ function ForEachBookKeeping(forEachFunction, forEachContext) { this.func = forEachFunction; this.context = forEachContext; this.count = 0; } ForEachBookKeeping.prototype.destructor = function () { this.func = null; this.context = null; this.count = 0; }; PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); function forEachSingleChild(bookKeeping, child, name) { var func = bookKeeping.func; var context = bookKeeping.context; func.call(context, child, bookKeeping.count++); } /** * Iterates through children that are typically specified as `props.children`. * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); ForEachBookKeeping.release(traverseContext); } /** * PooledClass representing the bookkeeping associated with performing a child * mapping. Allows avoiding binding callbacks. * * @constructor MapBookKeeping * @param {!*} mapResult Object containing the ordered map of results. * @param {!function} mapFunction Function to perform mapping with. * @param {?*} mapContext Context to perform mapping with. */ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { this.result = mapResult; this.keyPrefix = keyPrefix; this.func = mapFunction; this.context = mapContext; this.count = 0; } MapBookKeeping.prototype.destructor = function () { this.result = null; this.keyPrefix = null; this.func = null; this.context = null; this.count = 0; }; PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); function mapSingleChildIntoContext(bookKeeping, child, childKey) { var result = bookKeeping.result; var keyPrefix = bookKeeping.keyPrefix; var func = bookKeeping.func; var context = bookKeeping.context; var mappedChild = func.call(context, child, bookKeeping.count++); if (Array.isArray(mappedChild)) { mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); } else if (mappedChild != null) { if (ReactElement.isValidElement(mappedChild)) { mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); } result.push(mappedChild); } } function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { var escapedPrefix = ''; if (prefix != null) { escapedPrefix = escapeUserProvidedKey(prefix) + '/'; } var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); MapBookKeeping.release(traverseContext); } /** * Maps children that are typically specified as `props.children`. * * The provided mapFunction(child, key, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} func The map function. * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; mapIntoWithKeyPrefixInternal(children, result, null, func, context); return result; } function forEachSingleChildDummy(traverseContext, child, name) { return null; } /** * Count the number of children that are typically specified as * `props.children`. * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children, context) { return traverseAllChildren(children, forEachSingleChildDummy, null); } /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. */ function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); return result; } var ReactChildren = { forEach: forEachChildren, map: mapChildren, mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, count: countChildren, toArray: toArray }; module.exports = ReactChildren; },{"./PooledClass":23,"./ReactElement":31,"./traverseAllChildren":43,"fbjs/lib/emptyFunction":1}],26:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactClass */ 'use strict'; var _assign = require('object-assign'); var ReactComponent = require('./ReactComponent'); var ReactElement = require('./ReactElement'); var ReactPropTypeLocations = require('./ReactPropTypeLocations'); var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); var emptyObject = require('fbjs/lib/emptyObject'); var invariant = require('fbjs/lib/invariant'); var keyMirror = require('fbjs/lib/keyMirror'); var keyOf = require('fbjs/lib/keyOf'); var warning = require('fbjs/lib/warning'); var MIXINS_KEY = keyOf({ mixins: null }); /** * Policies that describe methods in `ReactClassInterface`. */ var SpecPolicy = keyMirror({ /** * These methods may be defined only once by the class specification or mixin. */ DEFINE_ONCE: null, /** * These methods may be defined by both the class specification and mixins. * Subsequent definitions will be chained. These methods must return void. */ DEFINE_MANY: null, /** * These methods are overriding the base class. */ OVERRIDE_BASE: null, /** * These methods are similar to DEFINE_MANY, except we assume they return * objects. We try to merge the keys of the return values of all the mixed in * functions. If there is a key conflict we throw. */ DEFINE_MANY_MERGED: null }); var injectedMixins = []; /** * Composite components are higher-level components that compose other composite * or native components. * * To create a new type of `ReactClass`, pass a specification of * your new class to `React.createClass`. The only requirement of your class * specification is that you implement a `render` method. * * var MyComponent = React.createClass({ * render: function() { * return <div>Hello World</div>; * } * }); * * The class specification supports a specific protocol of methods that have * special meaning (e.g. `render`). See `ReactClassInterface` for * more the comprehensive protocol. Any other properties and methods in the * class specification will be available on the prototype. * * @interface ReactClassInterface * @internal */ var ReactClassInterface = { /** * An array of Mixin objects to include when defining your component. * * @type {array} * @optional */ mixins: SpecPolicy.DEFINE_MANY, /** * An object containing properties and methods that should be defined on * the component's constructor instead of its prototype (static methods). * * @type {object} * @optional */ statics: SpecPolicy.DEFINE_MANY, /** * Definition of prop types for this component. * * @type {object} * @optional */ propTypes: SpecPolicy.DEFINE_MANY, /** * Definition of context types for this component. * * @type {object} * @optional */ contextTypes: SpecPolicy.DEFINE_MANY, /** * Definition of context types this component sets for its children. * * @type {object} * @optional */ childContextTypes: SpecPolicy.DEFINE_MANY, // ==== Definition methods ==== /** * Invoked when the component is mounted. Values in the mapping will be set on * `this.props` if that prop is not specified (i.e. using an `in` check). * * This method is invoked before `getInitialState` and therefore cannot rely * on `this.state` or use `this.setState`. * * @return {object} * @optional */ getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, /** * Invoked once before the component is mounted. The return value will be used * as the initial value of `this.state`. * * getInitialState: function() { * return { * isOn: false, * fooBaz: new BazFoo() * } * } * * @return {object} * @optional */ getInitialState: SpecPolicy.DEFINE_MANY_MERGED, /** * @return {object} * @optional */ getChildContext: SpecPolicy.DEFINE_MANY_MERGED, /** * Uses props from `this.props` and state from `this.state` to render the * structure of the component. * * No guarantees are made about when or how often this method is invoked, so * it must not have side effects. * * render: function() { * var name = this.props.name; * return <div>Hello, {name}!</div>; * } * * @return {ReactComponent} * @nosideeffects * @required */ render: SpecPolicy.DEFINE_ONCE, // ==== Delegate methods ==== /** * Invoked when the component is initially created and about to be mounted. * This may have side effects, but any external subscriptions or data created * by this method must be cleaned up in `componentWillUnmount`. * * @optional */ componentWillMount: SpecPolicy.DEFINE_MANY, /** * Invoked when the component has been mounted and has a DOM representation. * However, there is no guarantee that the DOM node is in the document. * * Use this as an opportunity to operate on the DOM when the component has * been mounted (initialized and rendered) for the first time. * * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidMount: SpecPolicy.DEFINE_MANY, /** * Invoked before the component receives new props. * * Use this as an opportunity to react to a prop transition by updating the * state using `this.setState`. Current props are accessed via `this.props`. * * componentWillReceiveProps: function(nextProps, nextContext) { * this.setState({ * likesIncreasing: nextProps.likeCount > this.props.likeCount * }); * } * * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop * transition may cause a state change, but the opposite is not true. If you * need it, you are probably looking for `componentWillUpdate`. * * @param {object} nextProps * @optional */ componentWillReceiveProps: SpecPolicy.DEFINE_MANY, /** * Invoked while deciding if the component should be updated as a result of * receiving new props, state and/or context. * * Use this as an opportunity to `return false` when you're certain that the * transition to the new props/state/context will not require a component * update. * * shouldComponentUpdate: function(nextProps, nextState, nextContext) { * return !equal(nextProps, this.props) || * !equal(nextState, this.state) || * !equal(nextContext, this.context); * } * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @return {boolean} True if the component should update. * @optional */ shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, /** * Invoked when the component is about to update due to a transition from * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` * and `nextContext`. * * Use this as an opportunity to perform preparation before an update occurs. * * NOTE: You **cannot** use `this.setState()` in this method. * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @param {ReactReconcileTransaction} transaction * @optional */ componentWillUpdate: SpecPolicy.DEFINE_MANY, /** * Invoked when the component's DOM representation has been updated. * * Use this as an opportunity to operate on the DOM when the component has * been updated. * * @param {object} prevProps * @param {?object} prevState * @param {?object} prevContext * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidUpdate: SpecPolicy.DEFINE_MANY, /** * Invoked when the component is about to be removed from its parent and have * its DOM representation destroyed. * * Use this as an opportunity to deallocate any external resources. * * NOTE: There is no `componentDidUnmount` since your component will have been * destroyed by that point. * * @optional */ componentWillUnmount: SpecPolicy.DEFINE_MANY, // ==== Advanced methods ==== /** * Updates the component's currently mounted DOM representation. * * By default, this implements React's rendering and reconciliation algorithm. * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction * @internal * @overridable */ updateComponent: SpecPolicy.OVERRIDE_BASE }; /** * Mapping from class specification keys to special processing functions. * * Although these are declared like instance properties in the specification * when defining classes using `React.createClass`, they are actually static * and are accessible on the constructor instead of the prototype. Despite * being static, they must be defined outside of the "statics" key under * which all other static methods are defined. */ var RESERVED_SPEC_KEYS = { displayName: function (Constructor, displayName) { Constructor.displayName = displayName; }, mixins: function (Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, childContextTypes: function (Constructor, childContextTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext); } Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); }, contextTypes: function (Constructor, contextTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context); } Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); }, /** * Special case getDefaultProps which should move into statics but requires * automatic merging. */ getDefaultProps: function (Constructor, getDefaultProps) { if (Constructor.getDefaultProps) { Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); } else { Constructor.getDefaultProps = getDefaultProps; } }, propTypes: function (Constructor, propTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop); } Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); }, statics: function (Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); }, autobind: function () {} }; // noop function validateTypeDef(Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { // use a warning instead of an invariant so components // don't show up in prod but only in __DEV__ process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; } } } function validateMethodOverride(isAlreadyDefined, name) { var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; // Disallow overriding of base class methods unless explicitly allowed. if (ReactClassMixin.hasOwnProperty(name)) { !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : void 0; } // Disallow defining methods more than once unless explicitly allowed. if (isAlreadyDefined) { !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : void 0; } } /** * Mixin helper which handles policy validation and reserved * specification keys when building React classes. */ function mixSpecIntoComponent(Constructor, spec) { if (!spec) { return; } !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.') : invariant(false) : void 0; !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : void 0; var proto = Constructor.prototype; var autoBindPairs = proto.__reactAutoBindPairs; // By handling mixins before any other properties, we ensure the same // chaining order is applied to methods with DEFINE_MANY policy, whether // mixins are listed before or after these methods in the spec. if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { // We have already handled mixins in a special case above. continue; } var property = spec[name]; var isAlreadyDefined = proto.hasOwnProperty(name); validateMethodOverride(isAlreadyDefined, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactClass methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; if (shouldAutoBind) { autoBindPairs.push(name, property); proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : void 0; // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === SpecPolicy.DEFINE_MANY) { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if (process.env.NODE_ENV !== 'production') { // Add verbose displayName to the function, which helps when looking // at profiling tools. if (typeof property === 'function' && spec.displayName) { proto[name].displayName = spec.displayName + '_' + name; } } } } } } } function mixStaticSpecIntoComponent(Constructor, statics) { if (!statics) { return; } for (var name in statics) { var property = statics[name]; if (!statics.hasOwnProperty(name)) { continue; } var isReserved = name in RESERVED_SPEC_KEYS; !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : void 0; var isInherited = name in Constructor; !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : void 0; Constructor[name] = property; } } /** * Merge two objects, but throw if both contain the same key. * * @param {object} one The first object, which is mutated. * @param {object} two The second object * @return {object} one after it has been mutated to contain everything in two. */ function mergeIntoWithNoDuplicateKeys(one, two) { !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : void 0; for (var key in two) { if (two.hasOwnProperty(key)) { !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : void 0; one[key] = two[key]; } } return one; } /** * Creates a function that invokes two functions and merges their return values. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createMergedResultFunction(one, two) { return function mergedResult() { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c, a); mergeIntoWithNoDuplicateKeys(c, b); return c; }; } /** * Creates a function that invokes two functions and ignores their return vales. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; } /** * Binds a method to the component. * * @param {object} component Component whose method is going to be bound. * @param {function} method Method to be bound. * @return {function} The bound method. */ function bindAutoBindMethod(component, method) { var boundMethod = method.bind(component); if (process.env.NODE_ENV !== 'production') { boundMethod.__reactBoundContext = component; boundMethod.__reactBoundMethod = method; boundMethod.__reactBoundArguments = null; var componentName = component.constructor.displayName; var _bind = boundMethod.bind; boundMethod.bind = function (newThis) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } // User is trying to bind() an autobound method; we effectively will // ignore the value of "this" that the user is trying to use, so // let's warn. if (newThis !== component && newThis !== null) { process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; } else if (!args.length) { process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; return boundMethod; } var reboundMethod = _bind.apply(boundMethod, arguments); reboundMethod.__reactBoundContext = component; reboundMethod.__reactBoundMethod = method; reboundMethod.__reactBoundArguments = args; return reboundMethod; }; } return boundMethod; } /** * Binds all auto-bound methods in a component. * * @param {object} component Component whose method is going to be bound. */ function bindAutoBindMethods(component) { var pairs = component.__reactAutoBindPairs; for (var i = 0; i < pairs.length; i += 2) { var autoBindKey = pairs[i]; var method = pairs[i + 1]; component[autoBindKey] = bindAutoBindMethod(component, method); } } /** * Add more to the ReactClass base class. These are all legacy features and * therefore not already part of the modern ReactComponent. */ var ReactClassMixin = { /** * TODO: This will be deprecated because state should always keep a consistent * type signature and the only use case for this, is to avoid that. */ replaceState: function (newState, callback) { this.updater.enqueueReplaceState(this, newState); if (callback) { this.updater.enqueueCallback(this, callback, 'replaceState'); } }, /** * Checks whether or not this composite component is mounted. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function () { return this.updater.isMounted(this); } }; var ReactClassComponent = function () {}; _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); /** * Module for creating composite components. * * @class ReactClass */ var ReactClass = { /** * Creates a composite component class given a class specification. * * @param {object} spec Class specification (which must define `render`). * @return {function} Component constructor function. * @public */ createClass: function (spec) { var Constructor = function (props, context, updater) { // This constructor gets overridden by mocks. The argument is used // by mocks to assert on what gets mounted. if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; } // Wire up auto-binding if (this.__reactAutoBindPairs.length) { bindAutoBindMethods(this); } this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; this.state = null; // ReactClasses doesn't have constructors. Instead, they use the // getInitialState and componentWillMount methods for initialization. var initialState = this.getInitialState ? this.getInitialState() : null; if (process.env.NODE_ENV !== 'production') { // We allow auto-mocks to proceed as if they're returning null. if (initialState === undefined && this.getInitialState._isMockFunction) { // This is probably bad practice. Consider warning here and // deprecating this convenience. initialState = null; } } !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : void 0; this.state = initialState; }; Constructor.prototype = new ReactClassComponent(); Constructor.prototype.constructor = Constructor; Constructor.prototype.__reactAutoBindPairs = []; injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); mixSpecIntoComponent(Constructor, spec); // Initialize the defaultProps property after all mixins have been merged. if (Constructor.getDefaultProps) { Constructor.defaultProps = Constructor.getDefaultProps(); } if (process.env.NODE_ENV !== 'production') { // This is a tag to indicate that the use of these method names is ok, // since it's used with createClass. If it's not, then it's likely a // mistake so we'll warn you to use the static property, property // initializer or constructor respectively. if (Constructor.getDefaultProps) { Constructor.getDefaultProps.isReactClassApproved = {}; } if (Constructor.prototype.getInitialState) { Constructor.prototype.getInitialState.isReactClassApproved = {}; } } !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; } // Reduce time spent doing lookups by setting these on the prototype. for (var methodName in ReactClassInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; } } return Constructor; }, injection: { injectMixin: function (mixin) { injectedMixins.push(mixin); } } }; module.exports = ReactClass; }).call(this,require('_process')) },{"./ReactComponent":27,"./ReactElement":31,"./ReactNoopUpdateQueue":35,"./ReactPropTypeLocationNames":36,"./ReactPropTypeLocations":37,"_process":22,"fbjs/lib/emptyObject":2,"fbjs/lib/invariant":3,"fbjs/lib/keyMirror":4,"fbjs/lib/keyOf":5,"fbjs/lib/warning":8,"object-assign":20}],27:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponent */ 'use strict'; var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); var ReactInstrumentation = require('./ReactInstrumentation'); var canDefineProperty = require('./canDefineProperty'); var emptyObject = require('fbjs/lib/emptyObject'); var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); /** * Base class helpers for the updating state of a component. */ function ReactComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } ReactComponent.prototype.isReactComponent = {}; /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * When a function is provided to setState, it will be called at some point in * the future (not synchronously). It will be called with the up to date * component arguments (state, props, context). These values can be different * from this.* because your function may be called after receiveProps but before * shouldComponentUpdate, and this new state, props, and context will not yet be * assigned to this. * * @param {object|function} partialState Next partial state or function to * produce next partial state to be merged with current state. * @param {?function} callback Called after state is updated. * @final * @protected */ ReactComponent.prototype.setState = function (partialState, callback) { !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : void 0; if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onSetState(); process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0; } this.updater.enqueueSetState(this, partialState); if (callback) { this.updater.enqueueCallback(this, callback, 'setState'); } }; /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ ReactComponent.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this); if (callback) { this.updater.enqueueCallback(this, callback, 'forceUpdate'); } }; /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ if (process.env.NODE_ENV !== 'production') { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; var defineDeprecationWarning = function (methodName, info) { if (canDefineProperty) { Object.defineProperty(ReactComponent.prototype, methodName, { get: function () { process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0; return undefined; } }); } }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } module.exports = ReactComponent; }).call(this,require('_process')) },{"./ReactInstrumentation":33,"./ReactNoopUpdateQueue":35,"./canDefineProperty":40,"_process":22,"fbjs/lib/emptyObject":2,"fbjs/lib/invariant":3,"fbjs/lib/warning":8}],28:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactCurrentOwner */ 'use strict'; /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; module.exports = ReactCurrentOwner; },{}],29:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMFactories */ 'use strict'; var ReactElement = require('./ReactElement'); var ReactElementValidator = require('./ReactElementValidator'); var mapObject = require('fbjs/lib/mapObject'); /** * Create a factory that creates HTML tag elements. * * @param {string} tag Tag name (e.g. `div`). * @private */ function createDOMFactory(tag) { if (process.env.NODE_ENV !== 'production') { return ReactElementValidator.createFactory(tag); } return ReactElement.createFactory(tag); } /** * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. * This is also accessible via `React.DOM`. * * @public */ var ReactDOMFactories = mapObject({ a: 'a', abbr: 'abbr', address: 'address', area: 'area', article: 'article', aside: 'aside', audio: 'audio', b: 'b', base: 'base', bdi: 'bdi', bdo: 'bdo', big: 'big', blockquote: 'blockquote', body: 'body', br: 'br', button: 'button', canvas: 'canvas', caption: 'caption', cite: 'cite', code: 'code', col: 'col', colgroup: 'colgroup', data: 'data', datalist: 'datalist', dd: 'dd', del: 'del', details: 'details', dfn: 'dfn', dialog: 'dialog', div: 'div', dl: 'dl', dt: 'dt', em: 'em', embed: 'embed', fieldset: 'fieldset', figcaption: 'figcaption', figure: 'figure', footer: 'footer', form: 'form', h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', head: 'head', header: 'header', hgroup: 'hgroup', hr: 'hr', html: 'html', i: 'i', iframe: 'iframe', img: 'img', input: 'input', ins: 'ins', kbd: 'kbd', keygen: 'keygen', label: 'label', legend: 'legend', li: 'li', link: 'link', main: 'main', map: 'map', mark: 'mark', menu: 'menu', menuitem: 'menuitem', meta: 'meta', meter: 'meter', nav: 'nav', noscript: 'noscript', object: 'object', ol: 'ol', optgroup: 'optgroup', option: 'option', output: 'output', p: 'p', param: 'param', picture: 'picture', pre: 'pre', progress: 'progress', q: 'q', rp: 'rp', rt: 'rt', ruby: 'ruby', s: 's', samp: 'samp', script: 'script', section: 'section', select: 'select', small: 'small', source: 'source', span: 'span', strong: 'strong', style: 'style', sub: 'sub', summary: 'summary', sup: 'sup', table: 'table', tbody: 'tbody', td: 'td', textarea: 'textarea', tfoot: 'tfoot', th: 'th', thead: 'thead', time: 'time', title: 'title', tr: 'tr', track: 'track', u: 'u', ul: 'ul', 'var': 'var', video: 'video', wbr: 'wbr', // SVG circle: 'circle', clipPath: 'clipPath', defs: 'defs', ellipse: 'ellipse', g: 'g', image: 'image', line: 'line', linearGradient: 'linearGradient', mask: 'mask', path: 'path', pattern: 'pattern', polygon: 'polygon', polyline: 'polyline', radialGradient: 'radialGradient', rect: 'rect', stop: 'stop', svg: 'svg', text: 'text', tspan: 'tspan' }, createDOMFactory); module.exports = ReactDOMFactories; }).call(this,require('_process')) },{"./ReactElement":31,"./ReactElementValidator":32,"_process":22,"fbjs/lib/mapObject":6}],30:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDebugTool */ 'use strict'; var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool'); var warning = require('fbjs/lib/warning'); var eventHandlers = []; var handlerDoesThrowForEvent = {}; function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) { if (process.env.NODE_ENV !== 'production') { eventHandlers.forEach(function (handler) { try { if (handler[handlerFunctionName]) { handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5); } } catch (e) { process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0; handlerDoesThrowForEvent[handlerFunctionName] = true; } }); } } var ReactDebugTool = { addDevtool: function (devtool) { eventHandlers.push(devtool); }, removeDevtool: function (devtool) { for (var i = 0; i < eventHandlers.length; i++) { if (eventHandlers[i] === devtool) { eventHandlers.splice(i, 1); i--; } } }, onBeginProcessingChildContext: function () { emitEvent('onBeginProcessingChildContext'); }, onEndProcessingChildContext: function () { emitEvent('onEndProcessingChildContext'); }, onSetState: function () { emitEvent('onSetState'); }, onMountRootComponent: function (internalInstance) { emitEvent('onMountRootComponent', internalInstance); }, onMountComponent: function (internalInstance) { emitEvent('onMountComponent', internalInstance); }, onUpdateComponent: function (internalInstance) { emitEvent('onUpdateComponent', internalInstance); }, onUnmountComponent: function (internalInstance) { emitEvent('onUnmountComponent', internalInstance); } }; ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool); module.exports = ReactDebugTool; }).call(this,require('_process')) },{"./ReactInvalidSetStateWarningDevTool":34,"_process":22,"fbjs/lib/warning":8}],31:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactElement */ 'use strict'; var _assign = require('object-assign'); var ReactCurrentOwner = require('./ReactCurrentOwner'); var warning = require('fbjs/lib/warning'); var canDefineProperty = require('./canDefineProperty'); // The Symbol used to tag the ReactElement type. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown, specialPropRefWarningShown; /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, no instanceof check * will work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} key * @param {string|object} ref * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @param {*} owner * @param {*} props * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allow us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; if (process.env.NODE_ENV !== 'production') { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. if (canDefineProperty) { Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); } else { element._store.validated = false; element._self = self; element._source = source; } if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; ReactElement.createElement = function (type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (process.env.NODE_ENV !== 'production') { ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref; key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key; } else { ref = config.ref === undefined ? null : config.ref; key = config.key === undefined ? null : '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } if (process.env.NODE_ENV !== 'production') { // Create dummy `key` and `ref` property to `props` to warn users // against its use if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { if (!props.hasOwnProperty('key')) { Object.defineProperty(props, 'key', { get: function () { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0; } return undefined; }, configurable: true }); } if (!props.hasOwnProperty('ref')) { Object.defineProperty(props, 'ref', { get: function () { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0; } return undefined; }, configurable: true }); } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); }; ReactElement.createFactory = function (type) { var factory = ReactElement.createElement.bind(null, type); // Expose the type on the factory and the prototype so that it can be // easily accessed on elements. E.g. `<Foo />.type === Foo`. // This should not be named `constructor` since this may not be the function // that created the element, and it may not even be a constructor. // Legacy hook TODO: Warn if this is accessed factory.type = type; return factory; }; ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; }; ReactElement.cloneElement = function (element, config, children) { var propName; // Original props are copied var props = _assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (config.ref !== undefined) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (config.key !== undefined) { key = '' + config.key; } // Remaining properties override existing props var defaultProps; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); }; /** * @param {?object} object * @return {boolean} True if `object` is a valid component. * @final */ ReactElement.isValidElement = function (object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; module.exports = ReactElement; }).call(this,require('_process')) },{"./ReactCurrentOwner":28,"./canDefineProperty":40,"_process":22,"fbjs/lib/warning":8,"object-assign":20}],32:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactElementValidator */ /** * ReactElementValidator provides a wrapper around a element factory * which validates the props passed to the element. This is intended to be * used only in DEV and could be replaced by a static type checker for languages * that support it. */ 'use strict'; var ReactElement = require('./ReactElement'); var ReactPropTypeLocations = require('./ReactPropTypeLocations'); var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); var ReactCurrentOwner = require('./ReactCurrentOwner'); var canDefineProperty = require('./canDefineProperty'); var getIteratorFn = require('./getIteratorFn'); var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); if (name) { return ' Check the render method of `' + name + '`.'; } } return ''; } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; var loggedTypeFailures = {}; /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var addenda = getAddendaForKeyUse('uniqueKey', element, parentType); if (addenda === null) { // we already showed the warning return; } process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : void 0; } /** * Shared warning and monitoring code for the key warnings. * * @internal * @param {string} messageType A key used for de-duping warnings. * @param {ReactElement} element Component that requires a key. * @param {*} parentType element's parent's type. * @returns {?object} A set of addenda to use in the warning message, or null * if the warning has already been shown before (and shouldn't be shown again). */ function getAddendaForKeyUse(messageType, element, parentType) { var addendum = getDeclarationErrorAddendum(); if (!addendum) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { addendum = ' Check the top-level render call using <' + parentName + '>.'; } } var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {}); if (memoizer[addendum]) { return null; } memoizer[addendum] = true; var addenda = { parentOrOwner: addendum, url: ' See https://fb.me/react-warning-keys for more information.', childOwner: null }; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; } return addenda; } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (ReactElement.isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (ReactElement.isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); // Entry iterators provide implicit keys. if (iteratorFn) { if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (ReactElement.isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } /** * Assert that the props are valid * * @param {string} componentName Name of the component for error messages. * @param {object} propTypes Map of prop name to a ReactPropType * @param {object} props * @param {string} location e.g. "prop", "context", "child context" * @private */ function checkPropTypes(componentName, propTypes, props, location) { for (var propName in propTypes) { if (propTypes.hasOwnProperty(propName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0; error = propTypes[propName](props, propName, componentName, location); } catch (ex) { error = ex; } process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : void 0; if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var addendum = getDeclarationErrorAddendum(); process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : void 0; } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { var componentClass = element.type; if (typeof componentClass !== 'function') { return; } var name = componentClass.displayName || componentClass.name; if (componentClass.propTypes) { checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop); } if (typeof componentClass.getDefaultProps === 'function') { process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; } } var ReactElementValidator = { createElement: function (type, props, children) { var validType = typeof type === 'string' || typeof type === 'function'; // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; var element = ReactElement.createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } validatePropTypes(element); return element; }, createFactory: function (type) { var validatedFactory = ReactElementValidator.createElement.bind(null, type); // Legacy hook TODO: Warn if this is accessed validatedFactory.type = type; if (process.env.NODE_ENV !== 'production') { if (canDefineProperty) { Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0; Object.defineProperty(this, 'type', { value: type }); return type; } }); } } return validatedFactory; }, cloneElement: function (element, props, children) { var newElement = ReactElement.cloneElement.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } }; module.exports = ReactElementValidator; }).call(this,require('_process')) },{"./ReactCurrentOwner":28,"./ReactElement":31,"./ReactPropTypeLocationNames":36,"./ReactPropTypeLocations":37,"./canDefineProperty":40,"./getIteratorFn":41,"_process":22,"fbjs/lib/invariant":3,"fbjs/lib/warning":8}],33:[function(require,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInstrumentation */ 'use strict'; var ReactDebugTool = require('./ReactDebugTool'); module.exports = { debugTool: ReactDebugTool }; },{"./ReactDebugTool":30}],34:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInvalidSetStateWarningDevTool */ 'use strict'; var warning = require('fbjs/lib/warning'); if (process.env.NODE_ENV !== 'production') { var processingChildContext = false; var warnInvalidSetState = function () { process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0; }; } var ReactInvalidSetStateWarningDevTool = { onBeginProcessingChildContext: function () { processingChildContext = true; }, onEndProcessingChildContext: function () { processingChildContext = false; }, onSetState: function () { warnInvalidSetState(); } }; module.exports = ReactInvalidSetStateWarningDevTool; }).call(this,require('_process')) },{"_process":22,"fbjs/lib/warning":8}],35:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactNoopUpdateQueue */ 'use strict'; var warning = require('fbjs/lib/warning'); function warnTDZ(publicInstance, callerName) { if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : void 0; } } /** * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function (publicInstance) { return false; }, /** * Enqueue a callback that will be executed after all the pending updates * have processed. * * @param {ReactClass} publicInstance The instance to use as `this` context. * @param {?function} callback Called after state is updated. * @internal */ enqueueCallback: function (publicInstance, callback) {}, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @internal */ enqueueForceUpdate: function (publicInstance) { warnTDZ(publicInstance, 'forceUpdate'); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @internal */ enqueueReplaceState: function (publicInstance, completeState) { warnTDZ(publicInstance, 'replaceState'); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @internal */ enqueueSetState: function (publicInstance, partialState) { warnTDZ(publicInstance, 'setState'); } }; module.exports = ReactNoopUpdateQueue; }).call(this,require('_process')) },{"_process":22,"fbjs/lib/warning":8}],36:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypeLocationNames */ 'use strict'; var ReactPropTypeLocationNames = {}; if (process.env.NODE_ENV !== 'production') { ReactPropTypeLocationNames = { prop: 'prop', context: 'context', childContext: 'child context' }; } module.exports = ReactPropTypeLocationNames; }).call(this,require('_process')) },{"_process":22}],37:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypeLocations */ 'use strict'; var keyMirror = require('fbjs/lib/keyMirror'); var ReactPropTypeLocations = keyMirror({ prop: null, context: null, childContext: null }); module.exports = ReactPropTypeLocations; },{"fbjs/lib/keyMirror":4}],38:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypes */ 'use strict'; var ReactElement = require('./ReactElement'); var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); var emptyFunction = require('fbjs/lib/emptyFunction'); var getIteratorFn = require('./getIteratorFn'); /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<<anonymous>>'; var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName, location, propFullName) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (props[propName] == null) { var locationName = ReactPropTypeLocationNames[location]; if (isRequired) { return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { var locationName = ReactPropTypeLocationNames[location]; // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunction.thatReturns(null)); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var locationName = ReactPropTypeLocationNames[location]; var propType = getPropType(propValue); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']'); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!ReactElement.isValidElement(props[propName])) { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var locationName = ReactPropTypeLocationNames[location]; var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { return createChainableTypeChecker(function () { return new Error('Invalid argument supplied to oneOf, expected an instance of array.'); }); } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var locationName = ReactPropTypeLocationNames[location]; var valuesString = JSON.stringify(expectedValues); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (propValue.hasOwnProperty(key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { return createChainableTypeChecker(function () { return new Error('Invalid argument supplied to oneOfType, expected an instance of array.'); }); } function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (checker(props, propName, componentName, location, propFullName) == null) { return null; } } var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker(propValue, key, componentName, location, propFullName + '.' + key); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || ReactElement.isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } module.exports = ReactPropTypes; },{"./ReactElement":31,"./ReactPropTypeLocationNames":36,"./getIteratorFn":41,"fbjs/lib/emptyFunction":1}],39:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactVersion */ 'use strict'; module.exports = '15.0.1'; },{}],40:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule canDefineProperty */ 'use strict'; var canDefineProperty = false; if (process.env.NODE_ENV !== 'production') { try { Object.defineProperty({}, 'x', { get: function () {} }); canDefineProperty = true; } catch (x) { // IE will fail on defineProperty } } module.exports = canDefineProperty; }).call(this,require('_process')) },{"_process":22}],41:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getIteratorFn */ 'use strict'; /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } module.exports = getIteratorFn; },{}],42:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule onlyChild */ 'use strict'; var ReactElement = require('./ReactElement'); var invariant = require('fbjs/lib/invariant'); /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. The current implementation of this * function assumes that a single child gets passed without a wrapper, but the * purpose of this helper function is to abstract away the particular structure * of children. * * @param {?object} children Child collection structure. * @return {ReactComponent} The first and only `ReactComponent` contained in the * structure. */ function onlyChild(children) { !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0; return children; } module.exports = onlyChild; }).call(this,require('_process')) },{"./ReactElement":31,"_process":22,"fbjs/lib/invariant":3}],43:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule traverseAllChildren */ 'use strict'; var ReactCurrentOwner = require('./ReactCurrentOwner'); var ReactElement = require('./ReactElement'); var getIteratorFn = require('./getIteratorFn'); var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ var userProvidedKeyEscaperLookup = { '=': '=0', ':': '=2' }; var userProvidedKeyEscapeRegex = /[=:]/g; var didWarnAboutMaps = false; function userProvidedKeyEscaper(match) { return userProvidedKeyEscaperLookup[match]; } /** * Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ function getComponentKey(component, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (component && typeof component === 'object' && component.key != null) { // Explicit key return wrapUserProvidedKey(component.key); } // Implicit key determined by the index in the set return index.toString(36); } /** * Escape a component key so that it is safe to use in a reactid. * * @param {*} text Component key to be escaped. * @return {string} An escaped string. */ function escapeUserProvidedKey(text) { return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper); } /** * Wrap a `key` value explicitly provided by the user to distinguish it from * implicitly-generated keys generated by a component's index in its parent. * * @param {string} key Value of a user-provided `key` attribute * @return {string} */ function wrapUserProvidedKey(key) { return '$' + escapeUserProvidedKey(key); } /** * @param {?*} children Children tree container. * @param {!string} nameSoFar Name of the key path so far. * @param {!function} callback Callback to invoke with each child found. * @param {?*} traverseContext Used to pass information throughout the traversal * process. * @return {!number} The number of children in this subtree. */ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; if (type === 'undefined' || type === 'boolean') { // All of the above are perceived as null. children = null; } if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) { callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); return 1; } var child; var nextName; var subtreeCount = 0; // Count of children found in the current subtree. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getComponentKey(child, i); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else { var iteratorFn = getIteratorFn(children); if (iteratorFn) { var iterator = iteratorFn.call(children); var step; if (iteratorFn !== children.entries) { var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getComponentKey(child, ii++); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else { if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : void 0; didWarnAboutMaps = true; } // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { child = entry[1]; nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } } } else if (type === 'object') { var addendum = ''; if (process.env.NODE_ENV !== 'production') { addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; if (children._isReactElement) { addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; } if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); if (name) { addendum += ' Check the render method of `' + name + '`.'; } } } var childrenString = String(children); !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : void 0; } } return subtreeCount; } /** * Traverses children that are typically specified as `props.children`, but * might also be specified through attributes: * * - `traverseAllChildren(this.props.children, ...)` * - `traverseAllChildren(this.props.leftPanelChildren, ...)` * * The `traverseContext` is an optional argument that is passed through the * entire traversal. It can be used to store accumulations or anything else that * the callback might find relevant. * * @param {?*} children Children tree object. * @param {!function} callback To invoke upon traversing each child. * @param {?*} traverseContext Context for traversal. * @return {!number} The number of children in this subtree. */ function traverseAllChildren(children, callback, traverseContext) { if (children == null) { return 0; } return traverseAllChildrenImpl(children, '', callback, traverseContext); } module.exports = traverseAllChildren; }).call(this,require('_process')) },{"./ReactCurrentOwner":28,"./ReactElement":31,"./getIteratorFn":41,"_process":22,"fbjs/lib/invariant":3,"fbjs/lib/warning":8}],44:[function(require,module,exports){ 'use strict'; module.exports = require('./lib/React'); },{"./lib/React":24}],45:[function(require,module,exports){ (function() { var URL, URL_PATTERN, defaults, urllite, __hasProp = {}.hasOwnProperty; URL_PATTERN = /^(?:(?:([^:\/?\#]+:)\/+|(\/\/))(?:([a-z0-9-\._~%]+)(?::([a-z0-9-\._~%]+))?@)?(([a-z0-9-\._~%!$&'()*+,;=]+)(?::([0-9]+))?)?)?([^?\#]*?)(\?[^\#]*)?(\#.*)?$/; urllite = function(raw, opts) { return urllite.URL.parse(raw, opts); }; urllite.URL = URL = (function() { function URL(props) { var k, v, _ref; for (k in defaults) { if (!__hasProp.call(defaults, k)) continue; v = defaults[k]; this[k] = (_ref = props[k]) != null ? _ref : v; } this.host || (this.host = this.hostname && this.port ? "" + this.hostname + ":" + this.port : this.hostname ? this.hostname : ''); this.origin || (this.origin = this.protocol ? "" + this.protocol + "//" + this.host : ''); this.isAbsolutePathRelative = !this.host && this.pathname.charAt(0) === '/'; this.isPathRelative = !this.host && this.pathname.charAt(0) !== '/'; this.isRelative = this.isSchemeRelative || this.isAbsolutePathRelative || this.isPathRelative; this.isAbsolute = !this.isRelative; } URL.parse = function(raw) { var m, pathname, protocol; m = raw.toString().match(URL_PATTERN); pathname = m[8] || ''; protocol = m[1]; return new urllite.URL({ protocol: protocol, username: m[3], password: m[4], hostname: m[6], port: m[7], pathname: protocol && pathname.charAt(0) !== '/' ? "/" + pathname : pathname, search: m[9], hash: m[10], isSchemeRelative: m[2] != null }); }; return URL; })(); defaults = { protocol: '', username: '', password: '', host: '', hostname: '', port: '', pathname: '', search: '', hash: '', origin: '', isSchemeRelative: false }; module.exports = urllite; }).call(this); },{}],46:[function(require,module,exports){ // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } },{}],47:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _once = require('once'); var _once2 = _interopRequireDefault(_once); var _httpplease = require('httpplease'); var _httpplease2 = _interopRequireDefault(_httpplease); var _oldiexdomain = require('httpplease/plugins/oldiexdomain'); var _oldiexdomain2 = _interopRequireDefault(_oldiexdomain); var _shouldComponentUpdate = require('./shouldComponentUpdate'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var http = _httpplease2.default.use(_oldiexdomain2.default); var Status = { PENDING: 'pending', LOADING: 'loading', LOADED: 'loaded', FAILED: 'failed', UNSUPPORTED: 'unsupported' }; var supportsInlineSVG = (0, _once2.default)(function () { if (!document) { return false; } var div = document.createElement('div'); div.innerHTML = '<svg />'; return div.firstChild && div.firstChild.namespaceURI === 'http://www.w3.org/2000/svg'; }); var isSupportedEnvironment = (0, _once2.default)(function () { return ((typeof window !== 'undefined' && window !== null ? window.XMLHttpRequest : void 0) || (typeof window !== 'undefined' && window !== null ? window.XDomainRequest : void 0)) && supportsInlineSVG(); }); var uniquifyIDs = function () { var mkAttributePattern = function mkAttributePattern(attr) { return '(?:(?:\\s|\\:)' + attr + ')'; }; var idPattern = new RegExp('(?:(' + mkAttributePattern('id') + ')="([^"]+)")|(?:(' + mkAttributePattern('href') + '|' + mkAttributePattern('role') + '|' + mkAttributePattern('arcrole') + ')="\\#([^"]+)")|(?:="url\\(\\#([^\\)]+)\\)")', 'g'); return function (svgText, svgID) { var uniquifyID = function uniquifyID(id) { return id + '___' + svgID; }; return svgText.replace(idPattern, function (m, p1, p2, p3, p4, p5) { //eslint-disable-line consistent-return if (p2) { return p1 + '="' + uniquifyID(p2) + '"'; } else if (p4) { return p3 + '="#' + uniquifyID(p4) + '"'; } else if (p5) { return '="url(#' + uniquifyID(p5) + ')"'; } }); }; }(); var getHash = function getHash(str) { var chr = void 0; var hash = 0; var i = void 0; var j = void 0; var len = void 0; if (!str) { return hash; } for (i = 0, j = 0, len = str.length; len <= 0 ? j < len : j > len; i = len <= 0 ? ++j : --j) { chr = str.charCodeAt(i); hash = (hash << 5) - hash + chr; hash = hash & hash; } return hash; }; var InlineSVGError = function (_Error) { _inherits(InlineSVGError, _Error); function InlineSVGError(message) { var _ret; _classCallCheck(this, InlineSVGError); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(InlineSVGError).call(this)); _this.name = 'InlineSVGError'; _this.isSupportedBrowser = true; _this.isConfigurationError = false; _this.isUnsupportedBrowserError = false; _this.message = message; return _ret = _this, _possibleConstructorReturn(_this, _ret); } return InlineSVGError; }(Error); var createError = function createError(message, attrs) { var err = new InlineSVGError(message); for (var k in attrs) { if (attrs.hasOwnProperty(k)) { err[k] = attrs[k]; } } return err; }; var unsupportedBrowserError = function unsupportedBrowserError(message) { var newMessage = message; if (newMessage === null) { newMessage = 'Unsupported Browser'; } return createError(newMessage, { isSupportedBrowser: false, isUnsupportedBrowserError: true }); }; var configurationError = function configurationError(message) { return createError(message, { isConfigurationError: true }); }; var InlineSVG = function (_React$Component) { _inherits(InlineSVG, _React$Component); function InlineSVG(props) { _classCallCheck(this, InlineSVG); var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(InlineSVG).call(this, props)); _this2.shouldComponentUpdate = _shouldComponentUpdate.shouldComponentUpdate; _this2.state = { status: Status.PENDING }; _this2.handleLoad = _this2.handleLoad.bind(_this2); return _this2; } _createClass(InlineSVG, [{ key: 'componentWillMount', value: function componentWillMount() { if (this.state.status === Status.PENDING) { if (this.props.supportTest()) { if (this.props.src) { this.setState({ status: Status.LOADING }, this.load); } else { this.fail(configurationError('Missing source')); } } else { this.fail(unsupportedBrowserError()); } } } }, { key: 'fail', value: function fail(error) { var _this3 = this; var status = error.isUnsupportedBrowserError ? Status.UNSUPPORTED : Status.FAILED; this.setState({ status: status }, function () { if (typeof _this3.props.onError === 'function') { _this3.props.onError(error); } }); } }, { key: 'handleLoad', value: function handleLoad(err, res) { var _this4 = this; if (err) { this.fail(err); return; } this.setState({ loadedText: res.text, status: Status.LOADED }, function () { return typeof _this4.props.onLoad === 'function' ? _this4.props.onLoad() : null; }); } }, { key: 'load', value: function load() { var match = this.props.src.match(/data:image\/svg[^,]*?(;base64)?,(.*)/); if (match) { return this.handleLoad(null, { text: match[1] ? atob(match[2]) : decodeURIComponent(match[2]) }); } return http.get(this.props.src, this.handleLoad); } }, { key: 'getClassName', value: function getClassName() { var className = 'isvg ' + this.state.status; if (this.props.className) { className += ' ' + this.props.className; } return className; } }, { key: 'processSVG', value: function processSVG(svgText) { if (this.props.uniquifyIDs) { return uniquifyIDs(svgText, getHash(this.props.src)); } return svgText; } }, { key: 'renderContents', value: function renderContents() { switch (this.state.status) { case Status.UNSUPPORTED: return this.props.children; default: return this.props.preloader; } } }, { key: 'render', value: function render() { return this.props.wrapper({ className: this.getClassName(), dangerouslySetInnerHTML: this.state.loadedText ? { __html: this.processSVG(this.state.loadedText) } : undefined }, this.renderContents()); } }]); return InlineSVG; }(_react2.default.Component); InlineSVG.propTypes = { children: _react2.default.PropTypes.array, className: _react2.default.PropTypes.string, onError: _react2.default.PropTypes.func, onLoad: _react2.default.PropTypes.func, preloader: _react2.default.PropTypes.func, src: _react2.default.PropTypes.string.isRequired, supportTest: _react2.default.PropTypes.func, uniquifyIDs: _react2.default.PropTypes.bool, wrapper: _react2.default.PropTypes.func }; InlineSVG.defaultProps = { wrapper: _react2.default.DOM.span, supportTest: isSupportedEnvironment, uniquifyIDs: true }; exports.default = InlineSVG; module.exports = exports['default']; },{"./shouldComponentUpdate":48,"httpplease":10,"httpplease/plugins/oldiexdomain":19,"once":21,"react":44}],48:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shouldComponentUpdate = shouldComponentUpdate; exports.shouldComponentUpdateContext = shouldComponentUpdateContext; var _shallowEqual = require('fbjs/lib/shallowEqual'); var _shallowEqual2 = _interopRequireDefault(_shallowEqual); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @module PureRender */ /** * shouldComponentUpdate without context. * * @requires shallowEqual * * @param {Object} nextProps * @param {Object} nextState * * @returns {boolean} */ function shouldComponentUpdate(nextProps, nextState) { return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState); } /** * shouldComponentUpdate with context. * * @requires shallowEqual * * @param {Object} nextProps * @param {Object} nextState * @param {Object} nextContext * * @returns {boolean} */ function shouldComponentUpdateContext(nextProps, nextState, nextContext) { return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState) || !(0, _shallowEqual2.default)(this.context, nextContext); } exports.default = { shouldComponentUpdate: shouldComponentUpdate, shouldComponentUpdateContext: shouldComponentUpdateContext }; },{"fbjs/lib/shallowEqual":7}]},{},[47])(47) });
ajax/libs/core-js/0.5.4/shim.js
iros/cdnjs
/** * Core.js 0.5.4 * https://github.com/zloirock/core-js * License: http://rock.mit-license.org * © 2015 Denis Pushkarev */ !function(global, framework, undefined){ 'use strict'; /****************************************************************************** * Module : common * ******************************************************************************/ // Shortcuts for [[Class]] & property names var OBJECT = 'Object' , FUNCTION = 'Function' , ARRAY = 'Array' , STRING = 'String' , NUMBER = 'Number' , REGEXP = 'RegExp' , DATE = 'Date' , MAP = 'Map' , SET = 'Set' , WEAKMAP = 'WeakMap' , WEAKSET = 'WeakSet' , SYMBOL = 'Symbol' , PROMISE = 'Promise' , MATH = 'Math' , ARGUMENTS = 'Arguments' , PROTOTYPE = 'prototype' , CONSTRUCTOR = 'constructor' , TO_STRING = 'toString' , TO_STRING_TAG = TO_STRING + 'Tag' , TO_LOCALE = 'toLocaleString' , HAS_OWN = 'hasOwnProperty' , FOR_EACH = 'forEach' , ITERATOR = 'iterator' , FF_ITERATOR = '@@' + ITERATOR , PROCESS = 'process' , CREATE_ELEMENT = 'createElement' // Aliases global objects and prototypes , Function = global[FUNCTION] , Object = global[OBJECT] , Array = global[ARRAY] , String = global[STRING] , Number = global[NUMBER] , RegExp = global[REGEXP] , Date = global[DATE] , Map = global[MAP] , Set = global[SET] , WeakMap = global[WEAKMAP] , WeakSet = global[WEAKSET] , Symbol = global[SYMBOL] , Math = global[MATH] , TypeError = global.TypeError , RangeError = global.RangeError , setTimeout = global.setTimeout , setImmediate = global.setImmediate , clearImmediate = global.clearImmediate , parseInt = global.parseInt , isFinite = global.isFinite , process = global[PROCESS] , nextTick = process && process.nextTick , document = global.document , html = document && document.documentElement , navigator = global.navigator , define = global.define , ArrayProto = Array[PROTOTYPE] , ObjectProto = Object[PROTOTYPE] , FunctionProto = Function[PROTOTYPE] , Infinity = 1 / 0 , DOT = '.' // Methods from https://github.com/DeveloperToolsWG/console-object/blob/master/api.md , CONSOLE_METHODS = 'assert,clear,count,debug,dir,dirxml,error,exception,' + 'group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,' + 'markTimeline,profile,profileEnd,table,time,timeEnd,timeline,' + 'timelineEnd,timeStamp,trace,warn'; // http://jsperf.com/core-js-isobject function isObject(it){ return it !== null && (typeof it == 'object' || typeof it == 'function'); } function isFunction(it){ return typeof it == 'function'; } // Native function? var isNative = ctx(/./.test, /\[native code\]\s*\}\s*$/, 1); // Object internal [[Class]] or toStringTag // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring var toString = ObjectProto[TO_STRING]; function setToStringTag(it, tag, stat){ if(it && !has(it = stat ? it : it[PROTOTYPE], SYMBOL_TAG))hidden(it, SYMBOL_TAG, tag); } function cof(it){ return toString.call(it).slice(8, -1); } function classof(it){ var O, T; return it == undefined ? it === undefined ? 'Undefined' : 'Null' : typeof (T = (O = Object(it))[SYMBOL_TAG]) == 'string' ? T : cof(O); } // Function var call = FunctionProto.call , apply = FunctionProto.apply , REFERENCE_GET; // Partial apply function part(/* ...args */){ var fn = assertFunction(this) , length = arguments.length , args = Array(length) , i = 0 , _ = path._ , holder = false; while(length > i)if((args[i] = arguments[i++]) === _)holder = true; return function(/* ...args */){ var that = this , _length = arguments.length , i = 0, j = 0, _args; if(!holder && !_length)return invoke(fn, args, that); _args = args.slice(); if(holder)for(;length > i; i++)if(_args[i] === _)_args[i] = arguments[j++]; while(_length > j)_args.push(arguments[j++]); return invoke(fn, _args, that); } } // Optional / simple context binding function ctx(fn, that, length){ assertFunction(fn); if(~length && that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); } case 2: return function(a, b){ return fn.call(that, a, b); } case 3: return function(a, b, c){ return fn.call(that, a, b, c); } } return function(/* ...args */){ return fn.apply(that, arguments); } } // Fast apply // http://jsperf.lnkit.com/fast-apply/5 function invoke(fn, args, that){ var un = that === undefined; switch(args.length | 0){ case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); case 5: return un ? fn(args[0], args[1], args[2], args[3], args[4]) : fn.call(that, args[0], args[1], args[2], args[3], args[4]); } return fn.apply(that, args); } function construct(target, argumentsList /*, newTarget*/){ var proto = assertFunction(arguments.length < 3 ? target : arguments[2])[PROTOTYPE] , instance = create(isObject(proto) ? proto : ObjectProto) , result = apply.call(target, instance, argumentsList); return isObject(result) ? result : instance; } // Object: var create = Object.create , getPrototypeOf = Object.getPrototypeOf , setPrototypeOf = Object.setPrototypeOf , defineProperty = Object.defineProperty , defineProperties = Object.defineProperties , getOwnDescriptor = Object.getOwnPropertyDescriptor , getKeys = Object.keys , getNames = Object.getOwnPropertyNames , getSymbols = Object.getOwnPropertySymbols , isFrozen = Object.isFrozen , has = ctx(call, ObjectProto[HAS_OWN], 2) // Dummy, fix for not array-like ES3 string in es5 module , ES5Object = Object , Dict; function toObject(it){ return ES5Object(assertDefined(it)); } function returnIt(it){ return it; } function returnThis(){ return this; } function get(object, key){ if(has(object, key))return object[key]; } function ownKeys(it){ assertObject(it); return getSymbols ? getNames(it).concat(getSymbols(it)) : getNames(it); } // 19.1.2.1 Object.assign(target, source, ...) var assign = Object.assign || function(target, source){ var T = Object(assertDefined(target)) , l = arguments.length , i = 1; while(l > i){ var S = ES5Object(arguments[i++]) , keys = getKeys(S) , length = keys.length , j = 0 , key; while(length > j)T[key = keys[j++]] = S[key]; } return T; } function keyOf(object, el){ var O = toObject(object) , keys = getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; } // Array // array('str1,str2,str3') => ['str1', 'str2', 'str3'] function array(it){ return String(it).split(','); } var push = ArrayProto.push , unshift = ArrayProto.unshift , slice = ArrayProto.slice , splice = ArrayProto.splice , indexOf = ArrayProto.indexOf , forEach = ArrayProto[FOR_EACH]; /* * 0 -> forEach * 1 -> map * 2 -> filter * 3 -> some * 4 -> every * 5 -> find * 6 -> findIndex */ function createArrayMethod(type){ var isMap = type == 1 , isFilter = type == 2 , isSome = type == 3 , isEvery = type == 4 , isFindIndex = type == 6 , noholes = type == 5 || isFindIndex; return function(callbackfn/*, that = undefined */){ var O = Object(assertDefined(this)) , that = arguments[1] , self = ES5Object(O) , f = ctx(callbackfn, that, 3) , length = toLength(self.length) , index = 0 , result = isMap ? Array(length) : isFilter ? [] : undefined , val, res; for(;length > index; index++)if(noholes || index in self){ val = self[index]; res = f(val, index, O); if(type){ if(isMap)result[index] = res; // map else if(res)switch(type){ case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if(isEvery)return false; // every } } return isFindIndex ? -1 : isSome || isEvery ? isEvery : result; } } function createArrayContains(isContains){ return function(el /*, fromIndex = 0 */){ var O = toObject(this) , length = toLength(O.length) , index = toIndex(arguments[1], length); if(isContains && el != el){ for(;length > index; index++)if(sameNaN(O[index]))return isContains || index; } else for(;length > index; index++)if(isContains || index in O){ if(O[index] === el)return isContains || index; } return !isContains && -1; } } function generic(A, B){ // strange IE quirks mode bug -> use typeof vs isFunction return typeof A == 'function' ? A : B; } // Math var MAX_SAFE_INTEGER = 0x1fffffffffffff // pow(2, 53) - 1 == 9007199254740991 , pow = Math.pow , abs = Math.abs , ceil = Math.ceil , floor = Math.floor , max = Math.max , min = Math.min , random = Math.random , trunc = Math.trunc || function(it){ return (it > 0 ? floor : ceil)(it); } // 20.1.2.4 Number.isNaN(number) function sameNaN(number){ return number != number; } // 7.1.4 ToInteger function toInteger(it){ return isNaN(it) ? 0 : trunc(it); } // 7.1.15 ToLength function toLength(it){ return it > 0 ? min(toInteger(it), MAX_SAFE_INTEGER) : 0; } function toIndex(index, length){ var index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); } function lz(num){ return num > 9 ? num : '0' + num; } function createReplacer(regExp, replace, isStatic){ var replacer = isObject(replace) ? function(part){ return replace[part]; } : replace; return function(it){ return String(isStatic ? it : this).replace(regExp, replacer); } } function createPointAt(toString){ return function(pos){ var s = String(assertDefined(this)) , i = toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return toString ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? toString ? s.charAt(i) : a : toString ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; } } // Assertion & errors var REDUCE_ERROR = 'Reduce of empty object with no initial value'; function assert(condition, msg1, msg2){ if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1); } function assertDefined(it){ if(it == undefined)throw TypeError('Function called on null or undefined'); return it; } function assertFunction(it){ assert(isFunction(it), it, ' is not a function!'); return it; } function assertObject(it){ assert(isObject(it), it, ' is not an object!'); return it; } function assertInstance(it, Constructor, name){ assert(it instanceof Constructor, name, ": use the 'new' operator!"); } // Property descriptors & Symbol function descriptor(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value } } function simpleSet(object, key, value){ object[key] = value; return object; } function createDefiner(bitmap){ return DESC ? function(object, key, value){ return defineProperty(object, key, descriptor(bitmap, value)); } : simpleSet; } function uid(key){ return SYMBOL + '(' + key + ')_' + (++sid + random())[TO_STRING](36); } function getWellKnownSymbol(name, setter){ return (Symbol && Symbol[name]) || (setter ? Symbol : safeSymbol)(SYMBOL + DOT + name); } // The engine works fine with descriptors? Thank's IE8 for his funny defineProperty. var DESC = !!function(){ try { return defineProperty({}, 'a', {get: function(){ return 2 }}).a == 2; } catch(e){} }() , sid = 0 , hidden = createDefiner(1) , set = Symbol ? simpleSet : hidden , safeSymbol = Symbol || uid; function assignHidden(target, src){ for(var key in src)hidden(target, key, src[key]); return target; } var SYMBOL_UNSCOPABLES = getWellKnownSymbol('unscopables') , ArrayUnscopables = ArrayProto[SYMBOL_UNSCOPABLES] || {} , SYMBOL_SPECIES = getWellKnownSymbol('species'); function setSpecies(C){ if(framework || !isNative(C))defineProperty(C, SYMBOL_SPECIES, { configurable: true, get: returnThis }); } // Iterators var SYMBOL_ITERATOR = getWellKnownSymbol(ITERATOR) , SYMBOL_TAG = getWellKnownSymbol(TO_STRING_TAG) , SUPPORT_FF_ITER = FF_ITERATOR in ArrayProto , ITER = safeSymbol('iter') , KEY = 1 , VALUE = 2 , Iterators = {} , IteratorPrototype = {} , NATIVE_ITERATORS = SYMBOL_ITERATOR in ArrayProto // Safari define byggy iterators w/o `next` , BUGGY_ITERATORS = 'keys' in ArrayProto && !('next' in [].keys()); // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() setIterator(IteratorPrototype, returnThis); function setIterator(O, value){ hidden(O, SYMBOL_ITERATOR, value); // Add iterator for FF iterator protocol SUPPORT_FF_ITER && hidden(O, FF_ITERATOR, value); } function createIterator(Constructor, NAME, next, proto){ Constructor[PROTOTYPE] = create(proto || IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); } function defineIterator(Constructor, NAME, value, DEFAULT){ var proto = Constructor[PROTOTYPE] , iter = get(proto, SYMBOL_ITERATOR) || get(proto, FF_ITERATOR) || (DEFAULT && get(proto, DEFAULT)) || value; if(framework){ // Define iterator setIterator(proto, iter); if(iter !== value){ var iterProto = getPrototypeOf(iter.call(new Constructor)); // Set @@toStringTag to native iterators setToStringTag(iterProto, NAME + ' Iterator', true); // FF fix has(proto, FF_ITERATOR) && setIterator(iterProto, returnThis); } } // Plug for library Iterators[NAME] = iter; // FF & v8 fix Iterators[NAME + ' Iterator'] = returnThis; return iter; } function defineStdIterators(Base, NAME, Constructor, next, DEFAULT, IS_SET){ function createIter(kind){ return function(){ return new Constructor(this, kind); } } createIterator(Constructor, NAME, next); var entries = createIter(KEY+VALUE) , values = createIter(VALUE); if(DEFAULT == VALUE)values = defineIterator(Base, NAME, values, 'values'); else entries = defineIterator(Base, NAME, entries, 'entries'); if(DEFAULT){ $define(PROTO + FORCED * BUGGY_ITERATORS, NAME, { entries: entries, keys: IS_SET ? values : createIter(KEY), values: values }); } } function iterResult(done, value){ return {value: value, done: !!done}; } function isIterable(it){ var O = Object(it) , Symbol = global[SYMBOL] , hasExt = (Symbol && Symbol[ITERATOR] || FF_ITERATOR) in O; return hasExt || SYMBOL_ITERATOR in O || has(Iterators, classof(O)); } function getIterator(it){ var Symbol = global[SYMBOL] , ext = it[Symbol && Symbol[ITERATOR] || FF_ITERATOR] , getIter = ext || it[SYMBOL_ITERATOR] || Iterators[classof(it)]; return assertObject(getIter.call(it)); } function stepCall(fn, value, entries){ return entries ? invoke(fn, value) : fn(value); } function forOf(iterable, entries, fn, that){ var iterator = getIterator(iterable) , f = ctx(fn, that, entries ? 2 : 1) , step; while(!(step = iterator.next()).done)if(stepCall(f, step.value, entries) === false)return; } // core var NODE = cof(process) == PROCESS , core = {} , path = framework ? global : core , old = global.core , exportGlobal // type bitmap , FORCED = 1 , GLOBAL = 2 , STATIC = 4 , PROTO = 8 , BIND = 16 , WRAP = 32 , SIMPLE = 64; function $define(type, name, source){ var key, own, out, exp , isGlobal = type & GLOBAL , target = isGlobal ? global : (type & STATIC) ? global[name] : (global[name] || ObjectProto)[PROTOTYPE] , exports = isGlobal ? core : core[name] || (core[name] = {}); if(isGlobal)source = name; for(key in source){ // there is a similar native own = !(type & FORCED) && target && key in target && (!isFunction(target[key]) || isNative(target[key])); // export native or passed out = (own ? target : source)[key]; // prevent global pollution for namespaces if(!framework && isGlobal && !isFunction(target[key]))exp = source[key]; // bind timers to global for call from export context else if(type & BIND && own)exp = ctx(out, global); // wrap global constructors for prevent change them in library else if(type & WRAP && !framework && target[key] == out){ exp = function(param){ return this instanceof out ? new out(param) : out(param); } exp[PROTOTYPE] = out[PROTOTYPE]; } else exp = type & PROTO && isFunction(out) ? ctx(call, out) : out; // extend global if(framework && target && !own){ if(isGlobal || type & SIMPLE)target[key] = out; else delete target[key] && hidden(target, key, out); } // export if(exports[key] != out)hidden(exports, key, exp); } } // CommonJS export if(typeof module != 'undefined' && module.exports)module.exports = core; // RequireJS export else if(isFunction(define) && define.amd)define(function(){return core}); // Export to global object else exportGlobal = true; if(exportGlobal || framework){ core.noConflict = function(){ global.core = old; return core; } global.core = core; } /****************************************************************************** * Module : es5 * ******************************************************************************/ // ECMAScript 5 shim !function(IS_ENUMERABLE, Empty, _classof, $PROTO){ if(!DESC){ getOwnDescriptor = function(O, P){ if(has(O, P))return descriptor(!ObjectProto[IS_ENUMERABLE].call(O, P), O[P]); }; defineProperty = function(O, P, Attributes){ if('value' in Attributes)assertObject(O)[P] = Attributes.value; return O; }; defineProperties = function(O, Properties){ assertObject(O); var keys = getKeys(Properties) , length = keys.length , i = 0 , P, Attributes; while(length > i){ P = keys[i++]; Attributes = Properties[P]; if('value' in Attributes)O[P] = Attributes.value; } return O; }; } $define(STATIC + FORCED * !DESC, OBJECT, { // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: getOwnDescriptor, // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) defineProperty: defineProperty, // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) defineProperties: defineProperties }); // IE 8- don't enum bug keys var keys1 = [CONSTRUCTOR, HAS_OWN, 'isPrototypeOf', IS_ENUMERABLE, TO_LOCALE, TO_STRING, 'valueOf'] // Additional keys for getOwnPropertyNames , keys2 = keys1.concat('length', PROTOTYPE) , keysLen1 = keys1.length; // Create object with `null` prototype: use iframe Object with cleared prototype function createDict(){ // Thrash, waste and sodomy: IE GC bug var iframe = document[CREATE_ELEMENT]('iframe') , i = keysLen1 , iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = 'javascript:'; // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write('<script>document.F=Object</script>'); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict[PROTOTYPE][keys1[i]]; return createDict(); } function createGetKeys(names, length, isNames){ return function(object){ var O = toObject(object) , i = 0 , result = [] , key; for(key in O)if(key != $PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(length > i)if(has(O, key = names[i++])){ ~indexOf.call(result, key) || result.push(key); } return result; } } function isPrimitive(it){ return !isObject(it) } $define(STATIC, OBJECT, { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) getPrototypeOf: getPrototypeOf = getPrototypeOf || function(O){ O = Object(assertDefined(O)); if(has(O, $PROTO))return O[$PROTO]; if(isFunction(O[CONSTRUCTOR]) && O instanceof O[CONSTRUCTOR]){ return O[CONSTRUCTOR][PROTOTYPE]; } return O instanceof Object ? ObjectProto : null; }, // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) getOwnPropertyNames: getNames = getNames || createGetKeys(keys2, keys2.length, true), // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) create: create = create || function(O, /*?*/Properties){ var result if(O !== null){ Empty[PROTOTYPE] = assertObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf shim result[$PROTO] = O; } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }, // 19.1.2.14 / 15.2.3.14 Object.keys(O) keys: getKeys = getKeys || createGetKeys(keys1, keysLen1, false), // 19.1.2.17 / 15.2.3.8 Object.seal(O) seal: returnIt, // <- cap // 19.1.2.5 / 15.2.3.9 Object.freeze(O) freeze: returnIt, // <- cap // 19.1.2.15 / 15.2.3.10 Object.preventExtensions(O) preventExtensions: returnIt, // <- cap // 19.1.2.13 / 15.2.3.11 Object.isSealed(O) isSealed: isPrimitive, // <- cap // 19.1.2.12 / 15.2.3.12 Object.isFrozen(O) isFrozen: isFrozen = isFrozen || isPrimitive, // <- cap // 19.1.2.11 / 15.2.3.13 Object.isExtensible(O) isExtensible: isObject // <- cap }); // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) $define(PROTO, FUNCTION, { bind: function(that /*, args... */){ var fn = assertFunction(this) , partArgs = slice.call(arguments, 1); function bound(/* args... */){ var args = partArgs.concat(slice.call(arguments)); return this instanceof bound ? construct(fn, args) : invoke(fn, args, that); } return bound; } }); // Fix for not array-like ES3 string function arrayMethodFix(fn){ return function(){ return fn.apply(ES5Object(this), arguments); } } if(!(0 in Object(DOT) && DOT[0] == DOT)){ ES5Object = function(it){ return cof(it) == STRING ? it.split('') : Object(it); } slice = arrayMethodFix(slice); } $define(PROTO + FORCED * (ES5Object != Object), ARRAY, { slice: slice, join: arrayMethodFix(ArrayProto.join) }); // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) $define(STATIC, ARRAY, { isArray: function(arg){ return cof(arg) == ARRAY } }); function createArrayReduce(isRight){ return function(callbackfn, memo){ assertFunction(callbackfn); var O = toObject(this) , length = toLength(O.length) , index = isRight ? length - 1 : 0 , i = isRight ? -1 : 1; if(2 > arguments.length)for(;;){ if(index in O){ memo = O[index]; index += i; break; } index += i; assert(isRight ? index >= 0 : length > index, REDUCE_ERROR); } for(;isRight ? index >= 0 : length > index; index += i)if(index in O){ memo = callbackfn(memo, O[index], index, this); } return memo; } } $define(PROTO, ARRAY, { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: forEach = forEach || createArrayMethod(0), // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: createArrayMethod(1), // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: createArrayMethod(2), // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: createArrayMethod(3), // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: createArrayMethod(4), // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: createArrayReduce(false), // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: createArrayReduce(true), // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: indexOf = indexOf || createArrayContains(false), // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function(el, fromIndex /* = @[*-1] */){ var O = toObject(this) , length = toLength(O.length) , index = length - 1; if(arguments.length > 1)index = min(index, toInteger(fromIndex)); if(index < 0)index = toLength(length + index); for(;index >= 0; index--)if(index in O)if(O[index] === el)return index; return -1; } }); // 21.1.3.25 / 15.5.4.20 String.prototype.trim() $define(PROTO, STRING, {trim: createReplacer(/^\s*([\s\S]*\S)?\s*$/, '$1')}); // 20.3.3.1 / 15.9.4.4 Date.now() $define(STATIC, DATE, {now: function(){ return +new Date; }}); // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() $define(PROTO, DATE, {toISOString: function(){ if(!isFinite(this))throw RangeError('Invalid time value'); var d = this , y = d.getUTCFullYear() , m = d.getUTCMilliseconds() , s = y < 0 ? '-' : y > 9999 ? '+' : ''; return s + ('00000' + abs(y)).slice(s ? -6 : -4) + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; }}); if(_classof(function(){return arguments}()) == OBJECT)classof = function(it){ var cof = _classof(it); return cof == OBJECT && isFunction(it.callee) ? ARGUMENTS : cof; } }('propertyIsEnumerable', function(){}, classof, safeSymbol(PROTOTYPE)); /****************************************************************************** * Module : es6.symbol * ******************************************************************************/ // ECMAScript 6 symbols shim !function(TAG, SymbolRegistry, AllSymbols, setter){ // 19.4.1.1 Symbol([description]) if(!isNative(Symbol)){ Symbol = function(description){ assert(!(this instanceof Symbol), SYMBOL + ' is not a ' + CONSTRUCTOR); var tag = uid(description) , sym = set(create(Symbol[PROTOTYPE]), TAG, tag); AllSymbols[tag] = sym; DESC && setter && defineProperty(ObjectProto, tag, { configurable: true, set: function(value){ hidden(this, tag, value); } }); return sym; } hidden(Symbol[PROTOTYPE], TO_STRING, function(){ return this[TAG]; }); } $define(GLOBAL + WRAP, {Symbol: Symbol}); var symbolStatics = { // 19.4.2.1 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = Symbol(key); }, // 19.4.2.4 Symbol.iterator iterator: SYMBOL_ITERATOR, // 19.4.2.5 Symbol.keyFor(sym) keyFor: part.call(keyOf, SymbolRegistry), // 19.4.2.10 Symbol.species species: SYMBOL_SPECIES, // 19.4.2.13 Symbol.toStringTag toStringTag: SYMBOL_TAG = getWellKnownSymbol(TO_STRING_TAG, true), // 19.4.2.14 Symbol.unscopables unscopables: SYMBOL_UNSCOPABLES, pure: safeSymbol, set: set, useSetter: function(){setter = true}, useSimple: function(){setter = false} }; // 19.4.2.2 Symbol.hasInstance // 19.4.2.3 Symbol.isConcatSpreadable // 19.4.2.6 Symbol.match // 19.4.2.8 Symbol.replace // 19.4.2.9 Symbol.search // 19.4.2.11 Symbol.split // 19.4.2.12 Symbol.toPrimitive forEach.call(array('hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive'), function(it){ symbolStatics[it] = getWellKnownSymbol(it); } ); $define(STATIC, SYMBOL, symbolStatics); setToStringTag(Symbol, SYMBOL); $define(STATIC + FORCED * !isNative(Symbol), OBJECT, { // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: function(it){ var names = getNames(toObject(it)), result = [], key, i = 0; while(names.length > i)has(AllSymbols, key = names[i++]) || result.push(key); return result; }, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: function(it){ var names = getNames(toObject(it)), result = [], key, i = 0; while(names.length > i)has(AllSymbols, key = names[i++]) && result.push(AllSymbols[key]); return result; } }); }(safeSymbol('tag'), {}, {}, true); /****************************************************************************** * Module : es6.object * ******************************************************************************/ !function(tmp){ var objectStatic = { // 19.1.3.1 Object.assign(target, source) assign: assign, // 19.1.3.10 Object.is(value1, value2) is: function(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; } }; // 19.1.3.19 Object.setPrototypeOf(O, proto) // Works with __proto__ only. Old v8 can't works with null proto objects. '__proto__' in ObjectProto && function(buggy, set){ try { set = ctx(call, getOwnDescriptor(ObjectProto, '__proto__').set, 2); set({}, ArrayProto); } catch(e){ buggy = true } objectStatic.setPrototypeOf = setPrototypeOf = setPrototypeOf || function(O, proto){ assertObject(O); assert(proto === null || isObject(proto), proto, ": can't set as prototype!"); if(buggy)O.__proto__ = proto; else set(O, proto); return O; } }(); $define(STATIC, OBJECT, objectStatic); if(framework){ // 19.1.3.6 Object.prototype.toString() tmp[SYMBOL_TAG] = DOT; if(cof(tmp) != DOT)hidden(ObjectProto, TO_STRING, function(){ return '[object ' + classof(this) + ']'; }); } // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, MATH, true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); }({}); /****************************************************************************** * Module : es6.object.statics-accept-primitives * ******************************************************************************/ !function(){ // Object static methods accept primitives function wrapObjectMethod(key, MODE){ var fn = Object[key] , exp = core[OBJECT][key] , f = 0 , o = {}; if(!exp || isNative(exp)){ o[key] = MODE == 1 ? function(it){ return isObject(it) ? fn(it) : it; } : MODE == 2 ? function(it){ return isObject(it) ? fn(it) : true; } : MODE == 3 ? function(it){ return isObject(it) ? fn(it) : false; } : MODE == 4 ? function(it, key){ return fn(toObject(it), key); } : function(it){ return fn(toObject(it)); }; try { fn(DOT) } catch(e){ f = 1 } $define(STATIC + FORCED * f, OBJECT, o); } } wrapObjectMethod('freeze', 1); wrapObjectMethod('seal', 1); wrapObjectMethod('preventExtensions', 1); wrapObjectMethod('isFrozen', 2); wrapObjectMethod('isSealed', 2); wrapObjectMethod('isExtensible', 3); wrapObjectMethod('getOwnPropertyDescriptor', 4); wrapObjectMethod('getPrototypeOf'); wrapObjectMethod('keys'); wrapObjectMethod('getOwnPropertyNames'); }(); /****************************************************************************** * Module : es6.function * ******************************************************************************/ !function(NAME){ // 19.2.4.2 name NAME in FunctionProto || defineProperty(FunctionProto, NAME, { configurable: true, get: function(){ var match = String(this).match(/^\s*function ([^ (]*)/) , name = match ? match[1] : ''; has(this, NAME) || defineProperty(this, NAME, descriptor(5, name)); return name; }, set: function(value){ has(this, NAME) || defineProperty(this, NAME, descriptor(0, value)); } }); }('name'); /****************************************************************************** * Module : es6.number.constructor * ******************************************************************************/ Number('0o1') && Number('0b1') || function(_Number, NumberProto){ function toNumber(it){ if(isObject(it))it = toPrimitive(it); if(typeof it == 'string' && it.length > 2 && it.charCodeAt(0) == 48){ var binary = false; switch(it.charCodeAt(1)){ case 66 : case 98 : binary = true; case 79 : case 111 : return parseInt(it.slice(2), binary ? 2 : 8); } } return +it; } function toPrimitive(it){ var fn, val; if(isFunction(fn = it.valueOf) && !isObject(val = fn.call(it)))return val; if(isFunction(fn = it[TO_STRING]) && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to number"); } Number = function Number(it){ return this instanceof Number ? new _Number(toNumber(it)) : toNumber(it); } forEach.call(DESC ? getNames(_Number) : array('MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY'), function(key){ key in Number || defineProperty(Number, key, getOwnDescriptor(_Number, key)); }); Number[PROTOTYPE] = NumberProto; NumberProto[CONSTRUCTOR] = Number; hidden(global, NUMBER, Number); }(Number, Number[PROTOTYPE]); /****************************************************************************** * Module : es6.number * ******************************************************************************/ !function(isInteger){ $define(STATIC, NUMBER, { // 20.1.2.1 Number.EPSILON EPSILON: pow(2, -52), // 20.1.2.2 Number.isFinite(number) isFinite: function(it){ return typeof it == 'number' && isFinite(it); }, // 20.1.2.3 Number.isInteger(number) isInteger: isInteger, // 20.1.2.4 Number.isNaN(number) isNaN: sameNaN, // 20.1.2.5 Number.isSafeInteger(number) isSafeInteger: function(number){ return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER; }, // 20.1.2.6 Number.MAX_SAFE_INTEGER MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, // 20.1.2.10 Number.MIN_SAFE_INTEGER MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER, // 20.1.2.12 Number.parseFloat(string) parseFloat: parseFloat, // 20.1.2.13 Number.parseInt(string, radix) parseInt: parseInt }); // 20.1.2.3 Number.isInteger(number) }(Number.isInteger || function(it){ return !isObject(it) && isFinite(it) && floor(it) === it; }); /****************************************************************************** * Module : es6.math * ******************************************************************************/ // ECMAScript 6 shim !function(){ // 20.2.2.28 Math.sign(x) var E = Math.E , exp = Math.exp , log = Math.log , sqrt = Math.sqrt , sign = Math.sign || function(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; // 20.2.2.5 Math.asinh(x) function asinh(x){ return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1)); } // 20.2.2.14 Math.expm1(x) function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; } $define(STATIC, MATH, { // 20.2.2.3 Math.acosh(x) acosh: function(x){ return (x = +x) < 1 ? NaN : isFinite(x) ? log(x / E + sqrt(x + 1) * sqrt(x - 1) / E) + 1 : x; }, // 20.2.2.5 Math.asinh(x) asinh: asinh, // 20.2.2.7 Math.atanh(x) atanh: function(x){ return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2; }, // 20.2.2.9 Math.cbrt(x) cbrt: function(x){ return sign(x = +x) * pow(abs(x), 1 / 3); }, // 20.2.2.11 Math.clz32(x) clz32: function(x){ return (x >>>= 0) ? 32 - x[TO_STRING](2).length : 32; }, // 20.2.2.12 Math.cosh(x) cosh: function(x){ return (exp(x = +x) + exp(-x)) / 2; }, // 20.2.2.14 Math.expm1(x) expm1: expm1, // 20.2.2.16 Math.fround(x) // TODO: fallback for IE9- fround: function(x){ return new Float32Array([x])[0]; }, // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) hypot: function(value1, value2){ var sum = 0 , len1 = arguments.length , len2 = len1 , args = Array(len1) , larg = -Infinity , arg; while(len1--){ arg = args[len1] = +arguments[len1]; if(arg == Infinity || arg == -Infinity)return Infinity; if(arg > larg)larg = arg; } larg = arg || 1; while(len2--)sum += pow(args[len2] / larg, 2); return larg * sqrt(sum); }, // 20.2.2.18 Math.imul(x, y) imul: function(x, y){ var UInt16 = 0xffff , xn = +x , yn = +y , xl = UInt16 & xn , yl = UInt16 & yn; return 0 | xl * yl + ((UInt16 & xn >>> 16) * yl + xl * (UInt16 & yn >>> 16) << 16 >>> 0); }, // 20.2.2.20 Math.log1p(x) log1p: function(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x); }, // 20.2.2.21 Math.log10(x) log10: function(x){ return log(x) / Math.LN10; }, // 20.2.2.22 Math.log2(x) log2: function(x){ return log(x) / Math.LN2; }, // 20.2.2.28 Math.sign(x) sign: sign, // 20.2.2.30 Math.sinh(x) sinh: function(x){ return (abs(x = +x) < 1) ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2); }, // 20.2.2.33 Math.tanh(x) tanh: function(x){ var a = expm1(x = +x) , b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); }, // 20.2.2.34 Math.trunc(x) trunc: trunc }); }(); /****************************************************************************** * Module : es6.string * ******************************************************************************/ !function(fromCharCode){ function assertNotRegExp(it){ if(cof(it) == REGEXP)throw TypeError(); } $define(STATIC, STRING, { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function(x){ var res = [] , len = arguments.length , i = 0 , code while(len > i){ code = +arguments[i++]; if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); }, // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function(callSite){ var raw = toObject(callSite.raw) , len = toLength(raw.length) , sln = arguments.length , res = [] , i = 0; while(len > i){ res.push(String(raw[i++])); if(i < sln)res.push(String(arguments[i])); } return res.join(''); } }); $define(PROTO, STRING, { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: createPointAt(false), // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) endsWith: function(searchString /*, endPosition = @length */){ assertNotRegExp(searchString); var that = String(assertDefined(this)) , endPosition = arguments[1] , len = toLength(that.length) , end = endPosition === undefined ? len : min(toLength(endPosition), len); searchString += ''; return that.slice(end - searchString.length, end) === searchString; }, // 21.1.3.7 String.prototype.includes(searchString, position = 0) includes: function(searchString /*, position = 0 */){ assertNotRegExp(searchString); return !!~String(assertDefined(this)).indexOf(searchString, arguments[1]); }, // 21.1.3.13 String.prototype.repeat(count) repeat: function(count){ var str = String(assertDefined(this)) , res = '' , n = toInteger(count); if(0 > n || n == Infinity)throw RangeError("Count can't be negative"); for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }, // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) startsWith: function(searchString /*, position = 0 */){ assertNotRegExp(searchString); var that = String(assertDefined(this)) , index = toLength(min(arguments[1], that.length)); searchString += ''; return that.slice(index, index + searchString.length) === searchString; } }); }(String.fromCharCode); /****************************************************************************** * Module : es6.array * ******************************************************************************/ !function(){ $define(STATIC, ARRAY, { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ var O = Object(assertDefined(arrayLike)) , mapfn = arguments[1] , mapping = mapfn !== undefined , f = mapping ? ctx(mapfn, arguments[2], 2) : undefined , index = 0 , length, result, iter, step; if(isIterable(O))for(iter = getIterator(O), result = new (generic(this, Array)); !(step = iter.next()).done; index++){ result[index] = mapping ? f(step.value, index) : step.value; } else for(result = new (generic(this, Array))(length = toLength(O.length)); length > index; index++){ result[index] = mapping ? f(O[index], index) : O[index]; } result.length = index; return result; }, // 22.1.2.3 Array.of( ...items) of: function(/* ...args */){ var index = 0 , length = arguments.length , result = new (generic(this, Array))(length); while(length > index)result[index] = arguments[index++]; result.length = length; return result; } }); $define(PROTO, ARRAY, { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) copyWithin: function(target /* = 0 */, start /* = 0, end = @length */){ var O = Object(assertDefined(this)) , len = toLength(O.length) , to = toIndex(target, len) , from = toIndex(start, len) , end = arguments[2] , fin = end === undefined ? len : toIndex(end, len) , count = min(fin - from, len - to) , inc = 1; if(from < to && to < from + count){ inc = -1; from = from + count - 1; to = to + count - 1; } while(count-- > 0){ if(from in O)O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; }, // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) fill: function(value /*, start = 0, end = @length */){ var O = Object(assertDefined(this)) , length = toLength(O.length) , index = toIndex(arguments[1], length) , end = arguments[2] , endPos = end === undefined ? length : toIndex(end, length); while(endPos > index)O[index++] = value; return O; }, // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) find: createArrayMethod(5), // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) findIndex: createArrayMethod(6) }); if(framework){ // 22.1.3.31 Array.prototype[@@unscopables] forEach.call(array('find,findIndex,fill,copyWithin,entries,keys,values'), function(it){ ArrayUnscopables[it] = true; }); SYMBOL_UNSCOPABLES in ArrayProto || hidden(ArrayProto, SYMBOL_UNSCOPABLES, ArrayUnscopables); } setSpecies(Array); }(); /****************************************************************************** * Module : es6.iterators * ******************************************************************************/ !function(at){ // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() defineStdIterators(Array, ARRAY, function(iterated, kind){ set(this, ITER, {o: toObject(iterated), i: 0, k: kind}); // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var iter = this[ITER] , O = iter.o , kind = iter.k , index = iter.i++; if(!O || index >= O.length){ iter.o = undefined; return iterResult(1); } if(kind == KEY) return iterResult(0, index); if(kind == VALUE)return iterResult(0, O[index]); return iterResult(0, [index, O[index]]); }, VALUE); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators[ARGUMENTS] = Iterators[ARRAY]; // 21.1.3.27 String.prototype[@@iterator]() defineStdIterators(String, STRING, function(iterated){ set(this, ITER, {o: String(iterated), i: 0}); // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var iter = this[ITER] , O = iter.o , index = iter.i , point; if(index >= O.length)return iterResult(1); point = at.call(O, index); iter.i += point.length; return iterResult(0, point); }); }(createPointAt(true)); /****************************************************************************** * Module : es6.regexp * ******************************************************************************/ !function(RegExpProto, _RegExp){ function assertRegExpWrapper(fn){ return function(){ assert(cof(this) === REGEXP); return fn(this); } } // RegExp allows a regex with flags as the pattern if(DESC && !function(){try{return RegExp(/a/g, 'i') == '/a/i'}catch(e){}}()){ RegExp = function RegExp(pattern, flags){ return new _RegExp(cof(pattern) == REGEXP && flags !== undefined ? pattern.source : pattern, flags); } forEach.call(getNames(_RegExp), function(key){ key in RegExp || defineProperty(RegExp, key, { configurable: true, get: function(){ return _RegExp[key] }, set: function(it){ _RegExp[key] = it } }); }); RegExpProto[CONSTRUCTOR] = RegExp; RegExp[PROTOTYPE] = RegExpProto; hidden(global, REGEXP, RegExp); } // 21.2.5.3 get RegExp.prototype.flags() if(/./g.flags != 'g')defineProperty(RegExpProto, 'flags', { configurable: true, get: assertRegExpWrapper(createReplacer(/^.*\/(\w*)$/, '$1', true)) }); // 21.2.5.12 get RegExp.prototype.sticky() // 21.2.5.15 get RegExp.prototype.unicode() forEach.call(array('sticky,unicode'), function(key){ key in /./ || defineProperty(RegExpProto, key, DESC ? { configurable: true, get: assertRegExpWrapper(function(){ return false; }) } : descriptor(5, false)); }); setSpecies(RegExp); }(RegExp[PROTOTYPE], RegExp); /****************************************************************************** * Module : web.immediate * ******************************************************************************/ // setImmediate shim // Node.js 0.9+ & IE10+ has setImmediate, else: isFunction(setImmediate) && isFunction(clearImmediate) || function(ONREADYSTATECHANGE){ var postMessage = global.postMessage , addEventListener = global.addEventListener , MessageChannel = global.MessageChannel , counter = 0 , queue = {} , defer, channel, port; setImmediate = function(fn){ var args = [], i = 1; while(arguments.length > i)args.push(arguments[i++]); queue[++counter] = function(){ invoke(isFunction(fn) ? fn : Function(fn), args); } defer(counter); return counter; } clearImmediate = function(id){ delete queue[id]; } function run(id){ if(has(queue, id)){ var fn = queue[id]; delete queue[id]; fn(); } } function listner(event){ run(event.data); } // Node.js 0.8- if(NODE){ defer = function(id){ nextTick(part.call(run, id)); } // Modern browsers, skip implementation for WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is object } else if(addEventListener && isFunction(postMessage) && !global.importScripts){ defer = function(id){ postMessage(id, '*'); } addEventListener('message', listner, false); // WebWorkers } else if(isFunction(MessageChannel)){ channel = new MessageChannel; port = channel.port2; channel.port1.onmessage = listner; defer = ctx(port.postMessage, port, 1); // IE8- } else if(document && ONREADYSTATECHANGE in document[CREATE_ELEMENT]('script')){ defer = function(id){ html.appendChild(document[CREATE_ELEMENT]('script'))[ONREADYSTATECHANGE] = function(){ html.removeChild(this); run(id); } } // Rest old browsers } else { defer = function(id){ setTimeout(run, 0, id); } } }('onreadystatechange'); $define(GLOBAL + BIND, { setImmediate: setImmediate, clearImmediate: clearImmediate }); /****************************************************************************** * Module : es6.promise * ******************************************************************************/ // ES6 promises shim // Based on https://github.com/getify/native-promise-only/ !function(Promise, test){ isFunction(Promise) && isFunction(Promise.resolve) && Promise.resolve(test = new Promise(function(){})) == test || function(asap, DEF){ function isThenable(o){ var then; if(isObject(o))then = o.then; return isFunction(then) ? then : false; } function notify(def){ var chain = def.chain; chain.length && asap(function(){ var msg = def.msg , ok = def.state == 1 , i = 0; while(chain.length > i)!function(react){ var cb = ok ? react.ok : react.fail , ret, then; try { if(cb){ ret = cb === true ? msg : cb(msg); if(ret === react.P){ react.rej(TypeError(PROMISE + '-chain cycle')); } else if(then = isThenable(ret)){ then.call(ret, react.res, react.rej); } else react.res(ret); } else react.rej(msg); } catch(err){ react.rej(err); } }(chain[i++]); chain.length = 0; }); } function resolve(msg){ var def = this , then, wrapper; if(def.done)return; def.done = true; def = def.def || def; // unwrap try { if(then = isThenable(msg)){ wrapper = {def: def, done: false}; // wrap then.call(msg, ctx(resolve, wrapper, 1), ctx(reject, wrapper, 1)); } else { def.msg = msg; def.state = 1; notify(def); } } catch(err){ reject.call(wrapper || {def: def, done: false}, err); // wrap } } function reject(msg){ var def = this; if(def.done)return; def.done = true; def = def.def || def; // unwrap def.msg = msg; def.state = 2; notify(def); } function getConstructor(C){ var S = assertObject(C)[SYMBOL_SPECIES]; return S != undefined ? S : C; } // 25.4.3.1 Promise(executor) Promise = function(executor){ assertFunction(executor); assertInstance(this, Promise, PROMISE); var def = {chain: [], state: 0, done: false, msg: undefined}; hidden(this, DEF, def); try { executor(ctx(resolve, def, 1), ctx(reject, def, 1)); } catch(err){ reject.call(def, err); } } assignHidden(Promise[PROTOTYPE], { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function(onFulfilled, onRejected){ var S = assertObject(assertObject(this)[CONSTRUCTOR])[SYMBOL_SPECIES]; var react = { ok: isFunction(onFulfilled) ? onFulfilled : true, fail: isFunction(onRejected) ? onRejected : false } , P = react.P = new (S != undefined ? S : Promise)(function(resolve, reject){ react.res = assertFunction(resolve); react.rej = assertFunction(reject); }), def = this[DEF]; def.chain.push(react); def.state && notify(def); return P; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function(onRejected){ return this.then(undefined, onRejected); } }); assignHidden(Promise, { // 25.4.4.1 Promise.all(iterable) all: function(iterable){ var Promise = getConstructor(this) , values = []; return new Promise(function(resolve, reject){ forOf(iterable, false, push, values); var remaining = values.length , results = Array(remaining); if(remaining)forEach.call(values, function(promise, index){ Promise.resolve(promise).then(function(value){ results[index] = value; --remaining || resolve(results); }, reject); }); else resolve(results); }); }, // 25.4.4.4 Promise.race(iterable) race: function(iterable){ var Promise = getConstructor(this); return new Promise(function(resolve, reject){ forOf(iterable, false, function(promise){ Promise.resolve(promise).then(resolve, reject); }); }); }, // 25.4.4.5 Promise.reject(r) reject: function(r){ return new (getConstructor(this))(function(resolve, reject){ reject(r); }); }, // 25.4.4.6 Promise.resolve(x) resolve: function(x){ return isObject(x) && DEF in x && getPrototypeOf(x) === this[PROTOTYPE] ? x : new (getConstructor(this))(function(resolve, reject){ resolve(x); }); } }); }(nextTick || setImmediate, safeSymbol('def')); setToStringTag(Promise, PROMISE); setSpecies(Promise); $define(GLOBAL + FORCED * !isNative(Promise), {Promise: Promise}); }(global[PROMISE]); /****************************************************************************** * Module : es6.collections * ******************************************************************************/ // ECMAScript 6 collections shim !function(){ var UID = safeSymbol('uid') , O1 = safeSymbol('O1') , WEAK = safeSymbol('weak') , LEAK = safeSymbol('leak') , LAST = safeSymbol('last') , FIRST = safeSymbol('first') , SIZE = DESC ? safeSymbol('size') : 'size' , uid = 0 , tmp = {}; function getCollection(C, NAME, methods, commonMethods, isMap, isWeak){ var ADDER = isMap ? 'set' : 'add' , proto = C && C[PROTOTYPE] , O = {}; function initFromIterable(that, iterable){ if(iterable != undefined)forOf(iterable, isMap, that[ADDER], that); return that; } function fixSVZ(key, chain){ var method = proto[key]; if(framework)proto[key] = function(a, b){ var result = method.call(this, a === 0 ? 0 : a, b); return chain ? this : result; }; } if(!isNative(C) || !(isWeak || (!BUGGY_ITERATORS && has(proto, FOR_EACH) && has(proto, 'entries')))){ // create collection constructor C = isWeak ? function(iterable){ assertInstance(this, C, NAME); set(this, UID, uid++); initFromIterable(this, iterable); } : function(iterable){ var that = this; assertInstance(that, C, NAME); set(that, O1, create(null)); set(that, SIZE, 0); set(that, LAST, undefined); set(that, FIRST, undefined); initFromIterable(that, iterable); }; assignHidden(assignHidden(C[PROTOTYPE], methods), commonMethods); isWeak || defineProperty(C[PROTOTYPE], 'size', {get: function(){ return assertDefined(this[SIZE]); }}); } else { var Native = C , inst = new C , chain = inst[ADDER](isWeak ? {} : -0, 1) , buggyZero; // wrap to init collections from iterable if(!NATIVE_ITERATORS || !C.length){ C = function(iterable){ assertInstance(this, C, NAME); return initFromIterable(new Native, iterable); } C[PROTOTYPE] = proto; if(framework)proto[CONSTRUCTOR] = C; } isWeak || inst[FOR_EACH](function(val, key){ buggyZero = 1 / key === -Infinity; }); // fix converting -0 key to +0 if(buggyZero){ fixSVZ('delete'); fixSVZ('has'); isMap && fixSVZ('get'); } // + fix .add & .set for chaining if(buggyZero || chain !== inst)fixSVZ(ADDER, true); } setToStringTag(C, NAME); setSpecies(C); O[NAME] = C; $define(GLOBAL + WRAP + FORCED * !isNative(C), O); // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 isWeak || defineStdIterators(C, NAME, function(iterated, kind){ set(this, ITER, {o: iterated, k: kind}); }, function(){ var iter = this[ITER] , kind = iter.k , entry = iter.l; // revert to the last existing entry while(entry && entry.r)entry = entry.p; // get next entry if(!iter.o || !(iter.l = entry = entry ? entry.n : iter.o[FIRST])){ // or finish the iteration iter.o = undefined; return iterResult(1); } // return step by kind if(kind == KEY) return iterResult(0, entry.k); if(kind == VALUE)return iterResult(0, entry.v); return iterResult(0, [entry.k, entry.v]); }, isMap ? KEY+VALUE : VALUE, !isMap); return C; } function fastKey(it, create){ // return primitive with prefix if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it; // can't set id to frozen object if(isFrozen(it))return 'F'; if(!has(it, UID)){ // not necessary to add id if(!create)return 'E'; // add missing object id hidden(it, UID, ++uid); // return object id with prefix } return 'O' + it[UID]; } function getEntry(that, key){ // fast case var index = fastKey(key), entry; if(index != 'F')return that[O1][index]; // frozen object case for(entry = that[FIRST]; entry; entry = entry.n){ if(entry.k == key)return entry; } } function def(that, key, value){ var entry = getEntry(that, key) , prev, index; // change existing entry if(entry)entry.v = value; // create new entry else { that[LAST] = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that[LAST], // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if(!that[FIRST])that[FIRST] = entry; if(prev)prev.n = entry; that[SIZE]++; // add to index if(index != 'F')that[O1][index] = entry; } return that; } var collectionMethods = { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function(){ for(var that = this, data = that[O1], entry = that[FIRST]; entry; entry = entry.n){ entry.r = true; if(entry.p)entry.p = entry.p.n = undefined; delete data[entry.i]; } that[FIRST] = that[LAST] = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function(key){ var that = this , entry = getEntry(that, key); if(entry){ var next = entry.n , prev = entry.p; delete that[O1][entry.i]; entry.r = true; if(prev)prev.n = next; if(next)next.p = prev; if(that[FIRST] == entry)that[FIRST] = next; if(that[LAST] == entry)that[LAST] = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function(callbackfn /*, that = undefined */){ var f = ctx(callbackfn, arguments[1], 3) , entry; while(entry = entry ? entry.n : this[FIRST]){ f(entry.v, entry.k, this); // revert to the last existing entry while(entry && entry.r)entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function(key){ return !!getEntry(this, key); } } // 23.1 Map Objects Map = getCollection(Map, MAP, { // 23.1.3.6 Map.prototype.get(key) get: function(key){ var entry = getEntry(this, key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function(key, value){ return def(this, key === 0 ? 0 : key, value); } }, collectionMethods, true); // 23.2 Set Objects Set = getCollection(Set, SET, { // 23.2.3.1 Set.prototype.add(value) add: function(value){ return def(this, value = value === 0 ? 0 : value, value); } }, collectionMethods); function defWeak(that, key, value){ if(isFrozen(assertObject(key)))leakStore(that).set(key, value); else { has(key, WEAK) || hidden(key, WEAK, {}); key[WEAK][that[UID]] = value; } return that; } function leakStore(that){ return that[LEAK] || hidden(that, LEAK, new Map)[LEAK]; } var weakMethods = { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function(key){ if(!isObject(key))return false; if(isFrozen(key))return leakStore(this)['delete'](key); return has(key, WEAK) && has(key[WEAK], this[UID]) && delete key[WEAK][this[UID]]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function(key){ if(!isObject(key))return false; if(isFrozen(key))return leakStore(this).has(key); return has(key, WEAK) && has(key[WEAK], this[UID]); } }; // 23.3 WeakMap Objects WeakMap = getCollection(WeakMap, WEAKMAP, { // 23.3.3.3 WeakMap.prototype.get(key) get: function(key){ if(isObject(key)){ if(isFrozen(key))return leakStore(this).get(key); if(has(key, WEAK))return key[WEAK][this[UID]]; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function(key, value){ return defWeak(this, key, value); } }, weakMethods, true, true); // IE11 WeakMap frozen keys fix if(framework && new WeakMap().set(Object.freeze(tmp), 7).get(tmp) != 7){ forEach.call(array('delete,has,get,set'), function(key){ var method = WeakMap[PROTOTYPE][key]; WeakMap[PROTOTYPE][key] = function(a, b){ // store frozen objects on leaky map if(isObject(a) && isFrozen(a)){ var result = leakStore(this)[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }; }); } // 23.4 WeakSet Objects WeakSet = getCollection(WeakSet, WEAKSET, { // 23.4.3.1 WeakSet.prototype.add(value) add: function(value){ return defWeak(this, value, true); } }, weakMethods, false, true); }(); /****************************************************************************** * Module : es6.reflect * ******************************************************************************/ !function(){ function Enumerate(iterated){ var keys = [], key; for(key in iterated)keys.push(key); set(this, ITER, {o: iterated, a: keys, i: 0}); } createIterator(Enumerate, OBJECT, function(){ var iter = this[ITER] , keys = iter.a , key; do { if(iter.i >= keys.length)return iterResult(1); } while(!((key = keys[iter.i++]) in iter.o)); return iterResult(0, key); }); function wrap(fn){ return function(it){ assertObject(it); try { return fn.apply(undefined, arguments), true; } catch(e){ return false; } } } function reflectGet(target, propertyKey/*, receiver*/){ var receiver = arguments.length < 3 ? target : arguments[2] , desc = getOwnDescriptor(assertObject(target), propertyKey), proto; if(desc)return has(desc, 'value') ? desc.value : desc.get === undefined ? undefined : desc.get.call(receiver); return isObject(proto = getPrototypeOf(target)) ? reflectGet(proto, propertyKey, receiver) : undefined; } function reflectSet(target, propertyKey, V/*, receiver*/){ var receiver = arguments.length < 4 ? target : arguments[3] , ownDesc = getOwnDescriptor(assertObject(target), propertyKey) , existingDescriptor, proto; if(!ownDesc){ if(isObject(proto = getPrototypeOf(target))){ return reflectSet(proto, propertyKey, V, receiver); } ownDesc = descriptor(0); } if(has(ownDesc, 'value')){ if(ownDesc.writable === false || !isObject(receiver))return false; existingDescriptor = getOwnDescriptor(receiver, propertyKey) || descriptor(0); existingDescriptor.value = V; return defineProperty(receiver, propertyKey, existingDescriptor), true; } return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); } var isExtensible = Object.isExtensible || returnIt; var reflect = { // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) apply: ctx(call, apply, 3), // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) construct: construct, // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) defineProperty: wrap(defineProperty), // 26.1.4 Reflect.deleteProperty(target, propertyKey) deleteProperty: function(target, propertyKey){ var desc = getOwnDescriptor(assertObject(target), propertyKey); return desc && !desc.configurable ? false : delete target[propertyKey]; }, // 26.1.5 Reflect.enumerate(target) enumerate: function(target){ return new Enumerate(assertObject(target)); }, // 26.1.6 Reflect.get(target, propertyKey [, receiver]) get: reflectGet, // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) getOwnPropertyDescriptor: function(target, propertyKey){ return getOwnDescriptor(assertObject(target), propertyKey); }, // 26.1.8 Reflect.getPrototypeOf(target) getPrototypeOf: function(target){ return getPrototypeOf(assertObject(target)); }, // 26.1.9 Reflect.has(target, propertyKey) has: function(target, propertyKey){ return propertyKey in target; }, // 26.1.10 Reflect.isExtensible(target) isExtensible: function(target){ return !!isExtensible(assertObject(target)); }, // 26.1.11 Reflect.ownKeys(target) ownKeys: ownKeys, // 26.1.12 Reflect.preventExtensions(target) preventExtensions: wrap(Object.preventExtensions || returnIt), // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) set: reflectSet } // 26.1.14 Reflect.setPrototypeOf(target, proto) if(setPrototypeOf)reflect.setPrototypeOf = function(target, proto){ return setPrototypeOf(assertObject(target), proto), true; }; $define(GLOBAL, {Reflect: {}}); $define(STATIC, 'Reflect', reflect); }(); /****************************************************************************** * Module : es7.proposals * ******************************************************************************/ !function(){ $define(PROTO, ARRAY, { // https://github.com/domenic/Array.prototype.includes includes: createArrayContains(true) }); $define(PROTO, STRING, { // https://github.com/mathiasbynens/String.prototype.at at: createPointAt(true) }); function createObjectToArray(isEntries){ return function(object){ var O = toObject(object) , keys = getKeys(object) , length = keys.length , i = 0 , result = Array(length) , key; if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]]; else while(length > i)result[i] = O[keys[i++]]; return result; } } $define(STATIC, OBJECT, { // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-04/apr-9.md#51-objectentries-objectvalues values: createObjectToArray(false), entries: createObjectToArray(true) }); $define(STATIC, REGEXP, { // https://gist.github.com/kangax/9698100 escape: createReplacer(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true) }); }(); /****************************************************************************** * Module : es7.abstract-refs * ******************************************************************************/ // https://github.com/zenparsing/es-abstract-refs !function(REFERENCE){ REFERENCE_GET = getWellKnownSymbol(REFERENCE+'Get', true); var REFERENCE_SET = getWellKnownSymbol(REFERENCE+SET, true) , REFERENCE_DELETE = getWellKnownSymbol(REFERENCE+'Delete', true); $define(STATIC, SYMBOL, { referenceGet: REFERENCE_GET, referenceSet: REFERENCE_SET, referenceDelete: REFERENCE_DELETE }); hidden(FunctionProto, REFERENCE_GET, returnThis); function setMapMethods(Constructor){ if(Constructor){ var MapProto = Constructor[PROTOTYPE]; hidden(MapProto, REFERENCE_GET, MapProto.get); hidden(MapProto, REFERENCE_SET, MapProto.set); hidden(MapProto, REFERENCE_DELETE, MapProto['delete']); } } setMapMethods(Map); setMapMethods(WeakMap); }('reference'); /****************************************************************************** * Module : js.array.statics * ******************************************************************************/ // JavaScript 1.6 / Strawman array statics shim !function(arrayStatics){ function setArrayStatics(keys, length){ forEach.call(array(keys), function(key){ if(key in ArrayProto)arrayStatics[key] = ctx(call, ArrayProto[key], length); }); } setArrayStatics('pop,reverse,shift,keys,values,entries', 1); setArrayStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3); setArrayStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' + 'reduce,reduceRight,copyWithin,fill,turn'); $define(STATIC, ARRAY, arrayStatics); }({}); /****************************************************************************** * Module : web.dom.itarable * ******************************************************************************/ !function(NodeList){ if(framework && NodeList && !(SYMBOL_ITERATOR in NodeList[PROTOTYPE])){ hidden(NodeList[PROTOTYPE], SYMBOL_ITERATOR, Iterators[ARRAY]); } Iterators.NodeList = Iterators[ARRAY]; }(global.NodeList); /****************************************************************************** * Module : web.timers * ******************************************************************************/ // ie9- setTimeout & setInterval additional parameters fix !function(MSIE){ function wrap(set){ return MSIE ? function(fn, time /*, ...args */){ return set(invoke(part, slice.call(arguments, 2), isFunction(fn) ? fn : Function(fn)), time); } : set; } $define(GLOBAL + BIND + FORCED * MSIE, { setTimeout: setTimeout = wrap(setTimeout), setInterval: wrap(setInterval) }); // ie9- dirty check }(!!navigator && /MSIE .\./.test(navigator.userAgent)); /****************************************************************************** * Module : web.console * ******************************************************************************/ !function(cap){ forEach.call(array(CONSOLE_METHODS), function(key){ cap[key] = function(){}; }); $define(GLOBAL, {console: {}}); $define(STATIC + SIMPLE, 'console', cap); }({}); }(typeof self != 'undefined' && self.Math === Math ? self : Function('return this')(), true);
ajax/libs/yasr/2.4.13/yasr.bundled.min.js
narikei/cdnjs
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.YASR=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e){e.exports=t("./main.js")},{"./main.js":39}],2:[function(e,n,r){(function(n,i,o){(function(n){"use strict";"function"==typeof t&&t.amd?t("datatables",["jquery"],n):"object"==typeof r?n(e("jquery")):jQuery&&!jQuery.fn.dataTable&&n(jQuery)})(function(t){"use strict";function e(n){var r,i,o="a aa ai ao as b fn i m o s ",a={};t.each(n,function(t){r=t.match(/^([^A-Z]+?)([A-Z])/);if(r&&-1!==o.indexOf(r[1]+" ")){i=t.replace(r[0],r[2].toLowerCase());a[i]=t;"o"===r[1]&&e(n[t])}});n._hungarianMap=a}function r(n,i,a){n._hungarianMap||e(n);var s;t.each(i,function(e){s=n._hungarianMap[e];if(s!==o&&(a||i[s]===o))if("o"===s.charAt(0)){i[s]||(i[s]={});t.extend(!0,i[s],i[e]);r(n[s],i[s],a)}else i[s]=i[e]})}function a(t){var e=$e.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&Oe(t,t,"sZeroRecords","sEmptyTable");!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&Oe(t,t,"sZeroRecords","sLoadingRecords");t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var r=t.sDecimal;r&&Xe(r)}function s(t){yn(t,"ordering","bSort");yn(t,"orderMulti","bSortMulti");yn(t,"orderClasses","bSortClasses");yn(t,"orderCellsTop","bSortCellsTop");yn(t,"order","aaSorting");yn(t,"orderFixed","aaSortingFixed");yn(t,"paging","bPaginate");yn(t,"pagingType","sPaginationType");yn(t,"pageLength","iDisplayLength");yn(t,"searching","bFilter");var e=t.aoSearchCols;if(e)for(var n=0,i=e.length;i>n;n++)e[n]&&r($e.models.oSearch,e[n])}function l(t){yn(t,"orderable","bSortable");yn(t,"orderData","aDataSort");yn(t,"orderSequence","asSorting");yn(t,"orderDataType","sortDataType")}function u(e){var n=e.oBrowser,r=t("<div/>").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(t("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(t('<div class="test"/>').css({width:"100%",height:10}))).appendTo("body"),i=r.find(".test");n.bScrollOversize=100===i[0].offsetWidth;n.bScrollbarLeft=1!==i.offset().left;r.remove()}function c(t,e,n,r,i,a){var s,l=r,u=!1;if(n!==o){s=n;u=!0}for(;l!==i;)if(t.hasOwnProperty(l)){s=u?e(s,t[l],l,t):t[l];u=!0;l+=a}return s}function f(e,n){var r=$e.defaults.column,o=e.aoColumns.length,a=t.extend({},$e.models.oColumn,r,{nTh:n?n:i.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[o],mData:r.mData?r.mData:o,idx:o});e.aoColumns.push(a);var s=e.aoPreSearchCols;s[o]=t.extend({},$e.models.oSearch,s[o]);h(e,o,null)}function h(e,n,i){var a=e.aoColumns[n],s=e.oClasses,u=t(a.nTh);if(!a.sWidthOrig){a.sWidthOrig=u.attr("width")||null;var c=(u.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);c&&(a.sWidthOrig=c[1])}if(i!==o&&null!==i){l(i);r($e.defaults.column,i);i.mDataProp===o||i.mData||(i.mData=i.mDataProp);i.sType&&(a._sManualType=i.sType);i.className&&!i.sClass&&(i.sClass=i.className);t.extend(a,i);Oe(a,i,"sWidth","sWidthOrig");"number"==typeof i.iDataSort&&(a.aDataSort=[i.iDataSort]);Oe(a,i,"aDataSort")}var f=a.mData,h=M(f),d=a.mRender?M(a.mRender):null,p=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};a._bAttrSrc=t.isPlainObject(f)&&(p(f.sort)||p(f.type)||p(f.filter));a.fnGetData=function(t,e,n){var r=h(t,e,o,n);return d&&e?d(r,e,t,n):r};a.fnSetData=function(t,e,n){return D(f)(t,e,n)};if(!e.oFeatures.bSort){a.bSortable=!1;u.addClass(s.sSortableNone)}var g=-1!==t.inArray("asc",a.asSorting),m=-1!==t.inArray("desc",a.asSorting);if(a.bSortable&&(g||m))if(g&&!m){a.sSortingClass=s.sSortableAsc;a.sSortingClassJUI=s.sSortJUIAscAllowed}else if(!g&&m){a.sSortingClass=s.sSortableDesc;a.sSortingClassJUI=s.sSortJUIDescAllowed}else{a.sSortingClass=s.sSortable;a.sSortingClassJUI=s.sSortJUI}else{a.sSortingClass=s.sSortableNone;a.sSortingClassJUI=""}}function d(t){if(t.oFeatures.bAutoWidth!==!1){var e=t.aoColumns;ye(t);for(var n=0,r=e.length;r>n;n++)e[n].nTh.style.width=e[n].sWidth}var i=t.oScroll;(""!==i.sY||""!==i.sX)&&me(t);ze(t,null,"column-sizing",[t])}function p(t,e){var n=v(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function g(e,n){var r=v(e,"bVisible"),i=t.inArray(n,r);return-1!==i?i:null}function m(t){return v(t,"bVisible").length}function v(e,n){var r=[];t.map(e.aoColumns,function(t,e){t[n]&&r.push(e)});return r}function y(t){var e,n,r,i,a,s,l,u,c,f=t.aoColumns,h=t.aoData,d=$e.ext.type.detect;for(e=0,n=f.length;n>e;e++){l=f[e];c=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,i=d.length;i>r;r++){for(a=0,s=h.length;s>a;a++){c[a]===o&&(c[a]=T(t,a,e,"type"));u=d[r](c[a],t);if(!u||"html"===u)break}if(u){l.sType=u;break}}l.sType||(l.sType="string")}}}function b(e,n,r,i){var a,s,l,u,c,h,d,p=e.aoColumns;if(n)for(a=n.length-1;a>=0;a--){d=n[a];var g=d.targets!==o?d.targets:d.aTargets;t.isArray(g)||(g=[g]);for(l=0,u=g.length;u>l;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)f(e);i(g[l],d)}else if("number"==typeof g[l]&&g[l]<0)i(p.length+g[l],d);else if("string"==typeof g[l])for(c=0,h=p.length;h>c;c++)("_all"==g[l]||t(p[c].nTh).hasClass(g[l]))&&i(c,d)}if(r)for(a=0,s=r.length;s>a;a++)i(a,r[a])}function x(e,n,r,i){var o=e.aoData.length,a=t.extend(!0,{},$e.models.oRow,{src:r?"dom":"data"});a._aData=n;e.aoData.push(a);for(var s=e.aoColumns,l=0,u=s.length;u>l;l++){r&&k(e,o,l,T(e,o,l));s[l].sType=null}e.aiDisplayMaster.push(o);(r||!e.oFeatures.bDeferRender)&&I(e,o,r,i);return o}function w(e,n){var r;n instanceof t||(n=t(n));return n.map(function(t,n){r=j(e,n);return x(e,r.data,n,r.cells)})}function C(t,e){return e._DT_RowIndex!==o?e._DT_RowIndex:null}function S(e,n,r){return t.inArray(r,e.aoData[n].anCells)}function T(t,e,n,r){var i=t.iDraw,a=t.aoColumns[n],s=t.aoData[e]._aData,l=a.sDefaultContent,u=a.fnGetData(s,r,{settings:t,row:e,col:n});if(u===o){if(t.iDrawError!=i&&null===l){He(t,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+e,4);t.iDrawError=i}return l}if(u!==s&&null!==u||null===l){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"==r?"":u}function k(t,e,n,r){var i=t.aoColumns[n],o=t.aoData[e]._aData;i.fnSetData(o,r,{settings:t,row:e,col:n})}function _(e){return t.map(e.match(/(\\.|[^\.])+/g),function(t){return t.replace(/\\./g,".")})}function M(e){if(t.isPlainObject(e)){var n={};t.each(e,function(t,e){e&&(n[t]=M(e))});return function(t,e,r,i){var a=n[e]||n._;return a!==o?a(t,e,r,i):t}}if(null===e)return function(t){return t};if("function"==typeof e)return function(t,n,r,i){return e(t,n,r,i)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t){return t[e]};var r=function(t,e,n){var i,a,s,l;if(""!==n)for(var u=_(n),c=0,f=u.length;f>c;c++){i=u[c].match(bn);a=u[c].match(xn);if(i){u[c]=u[c].replace(bn,"");""!==u[c]&&(t=t[u[c]]);s=[];u.splice(0,c+1);l=u.join(".");for(var h=0,d=t.length;d>h;h++)s.push(r(t[h],e,l));var p=i[0].substring(1,i[0].length-1);t=""===p?s:s.join(p);break}if(a){u[c]=u[c].replace(xn,"");t=t[u[c]]()}else{if(null===t||t[u[c]]===o)return o;t=t[u[c]]}}return t};return function(t,n){return r(t,n,e)}}function D(e){if(t.isPlainObject(e))return D(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,n,r){e(t,"set",n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){t[e]=n};var n=function(t,e,r){for(var i,a,s,l,u,c=_(r),f=c[c.length-1],h=0,d=c.length-1;d>h;h++){a=c[h].match(bn);s=c[h].match(xn);if(a){c[h]=c[h].replace(bn,"");t[c[h]]=[];i=c.slice();i.splice(0,h+1);u=i.join(".");for(var p=0,g=e.length;g>p;p++){l={};n(l,e[p],u);t[c[h]].push(l)}return}if(s){c[h]=c[h].replace(xn,"");t=t[c[h]](e)}(null===t[c[h]]||t[c[h]]===o)&&(t[c[h]]={});t=t[c[h]]}f.match(xn)?t=t[f.replace(xn,"")](e):t[f.replace(bn,"")]=e};return function(t,r){return n(t,r,e)}}function L(t){return dn(t.aoData,"_aData")}function A(t){t.aoData.length=0;t.aiDisplayMaster.length=0;t.aiDisplay.length=0}function N(t,e,n){for(var r=-1,i=0,a=t.length;a>i;i++)t[i]==e?r=i:t[i]>e&&t[i]--;-1!=r&&n===o&&t.splice(r,1)}function E(t,e,n,r){var i,a,s=t.aoData[e];if("dom"!==n&&(n&&"auto"!==n||"dom"!==s.src)){var l,u=s.anCells;if(u)for(i=0,a=u.length;a>i;i++){l=u[i];for(;l.childNodes.length;)l.removeChild(l.firstChild);u[i].innerHTML=T(t,e,i,"display")}}else s._aData=j(t,s).data;s._aSortData=null;s._aFilterData=null;var c=t.aoColumns;if(r!==o)c[r].sType=null;else for(i=0,a=c.length;a>i;i++)c[i].sType=null;P(s)}function j(e,n){var r,i,o,a,s=[],l=[],u=n.firstChild,c=0,f=e.aoColumns,h=function(t,e,n){if("string"==typeof t){var r=t.indexOf("@");if(-1!==r){var i=t.substring(r+1);o["@"+i]=n.getAttribute(i)}}},d=function(e){i=f[c];a=t.trim(e.innerHTML);if(i&&i._bAttrSrc){o={display:a};h(i.mData.sort,o,e);h(i.mData.type,o,e);h(i.mData.filter,o,e);s.push(o)}else s.push(a);c++};if(u)for(;u;){r=u.nodeName.toUpperCase();if("TD"==r||"TH"==r){d(u);l.push(u)}u=u.nextSibling}else{l=n.anCells;for(var p=0,g=l.length;g>p;p++)d(l[p])}return{data:s,cells:l}}function I(t,e,n,r){var o,a,s,l,u,c=t.aoData[e],f=c._aData,h=[];if(null===c.nTr){o=n||i.createElement("tr");c.nTr=o;c.anCells=h;o._DT_RowIndex=e;P(c);for(l=0,u=t.aoColumns.length;u>l;l++){s=t.aoColumns[l];a=n?r[l]:i.createElement(s.sCellType);h.push(a);(!n||s.mRender||s.mData!==l)&&(a.innerHTML=T(t,e,l,"display"));s.sClass&&(a.className+=" "+s.sClass);s.bVisible&&!n?o.appendChild(a):!s.bVisible&&n&&a.parentNode.removeChild(a);s.fnCreatedCell&&s.fnCreatedCell.call(t.oInstance,a,T(t,e,l),f,e,l)}ze(t,"aoRowCreatedCallback",null,[o,f,e])}c.nTr.setAttribute("role","row")}function P(e){var n=e.nTr,r=e._aData;if(n){r.DT_RowId&&(n.id=r.DT_RowId);if(r.DT_RowClass){var i=r.DT_RowClass.split(" ");e.__rowc=e.__rowc?vn(e.__rowc.concat(i)):i;t(n).removeClass(e.__rowc.join(" ")).addClass(r.DT_RowClass)}r.DT_RowData&&t(n).data(r.DT_RowData)}}function H(e){var n,r,i,o,a,s=e.nTHead,l=e.nTFoot,u=0===t("th, td",s).length,c=e.oClasses,f=e.aoColumns;u&&(o=t("<tr/>").appendTo(s));for(n=0,r=f.length;r>n;n++){a=f[n];i=t(a.nTh).addClass(a.sClass);u&&i.appendTo(o);if(e.oFeatures.bSort){i.addClass(a.sSortingClass);if(a.bSortable!==!1){i.attr("tabindex",e.iTabIndex).attr("aria-controls",e.sTableId);Ae(e,a.nTh,n)}}a.sTitle!=i.html()&&i.html(a.sTitle);Ue(e,"header")(e,i,a,c)}u&&z(e.aoHeader,s);t(s).find(">tr").attr("role","row");t(s).find(">tr>th, >tr>td").addClass(c.sHeaderTH);t(l).find(">tr>th, >tr>td").addClass(c.sFooterTH);if(null!==l){var h=e.aoFooter[0];for(n=0,r=h.length;r>n;n++){a=f[n];a.nTf=h[n].cell;a.sClass&&t(a.nTf).addClass(a.sClass)}}}function O(e,n,r){var i,a,s,l,u,c,f,h,d,p=[],g=[],m=e.aoColumns.length;if(n){r===o&&(r=!1);for(i=0,a=n.length;a>i;i++){p[i]=n[i].slice();p[i].nTr=n[i].nTr;for(s=m-1;s>=0;s--)e.aoColumns[s].bVisible||r||p[i].splice(s,1);g.push([])}for(i=0,a=p.length;a>i;i++){f=p[i].nTr;if(f)for(;c=f.firstChild;)f.removeChild(c);for(s=0,l=p[i].length;l>s;s++){h=1;d=1;if(g[i][s]===o){f.appendChild(p[i][s].cell);g[i][s]=1;for(;p[i+h]!==o&&p[i][s].cell==p[i+h][s].cell;){g[i+h][s]=1;h++}for(;p[i][s+d]!==o&&p[i][s].cell==p[i][s+d].cell;){for(u=0;h>u;u++)g[i+u][s+d]=1;d++}t(p[i][s].cell).attr("rowspan",h).attr("colspan",d)}}}}}function R(e){var n=ze(e,"aoPreDrawCallback","preDraw",[e]);if(-1===t.inArray(!1,n)){var r=[],i=0,a=e.asStripeClasses,s=a.length,l=(e.aoOpenRows.length,e.oLanguage),u=e.iInitDisplayStart,c="ssp"==Be(e),f=e.aiDisplay;e.bDrawing=!0;if(u!==o&&-1!==u){e._iDisplayStart=c?u:u>=e.fnRecordsDisplay()?0:u;e.iInitDisplayStart=-1}var h=e._iDisplayStart,d=e.fnDisplayEnd();if(e.bDeferLoading){e.bDeferLoading=!1;e.iDraw++;pe(e,!1)}else if(c){if(!e.bDestroying&&!B(e))return}else e.iDraw++;if(0!==f.length)for(var p=c?0:h,g=c?e.aoData.length:d,v=p;g>v;v++){var y=f[v],b=e.aoData[y];null===b.nTr&&I(e,y);var x=b.nTr;if(0!==s){var w=a[i%s];if(b._sRowStripe!=w){t(x).removeClass(b._sRowStripe).addClass(w);b._sRowStripe=w}}ze(e,"aoRowCallback",null,[x,b._aData,i,v]);r.push(x);i++}else{var C=l.sZeroRecords;1==e.iDraw&&"ajax"==Be(e)?C=l.sLoadingRecords:l.sEmptyTable&&0===e.fnRecordsTotal()&&(C=l.sEmptyTable);r[0]=t("<tr/>",{"class":s?a[0]:""}).append(t("<td />",{valign:"top",colSpan:m(e),"class":e.oClasses.sRowEmpty}).html(C))[0]}ze(e,"aoHeaderCallback","header",[t(e.nTHead).children("tr")[0],L(e),h,d,f]);ze(e,"aoFooterCallback","footer",[t(e.nTFoot).children("tr")[0],L(e),h,d,f]);var S=t(e.nTBody);S.children().detach();S.append(t(r));ze(e,"aoDrawCallback","draw",[e]);e.bSorted=!1;e.bFiltered=!1;e.bDrawing=!1}else pe(e,!1)}function F(t,e){var n=t.oFeatures,r=n.bSort,i=n.bFilter;r&&Me(t);i?Y(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice();e!==!0&&(t._iDisplayStart=0);t._drawHold=e;R(t);t._drawHold=!1}function W(e){var n=e.oClasses,r=t(e.nTable),i=t("<div/>").insertBefore(r),o=e.oFeatures,a=t("<div/>",{id:e.sTableId+"_wrapper","class":n.sWrapper+(e.nTFoot?"":" "+n.sNoFooter)});e.nHolding=i[0];e.nTableWrapper=a[0];e.nTableReinsertBefore=e.nTable.nextSibling;for(var s,l,u,c,f,h,d=e.sDom.split(""),p=0;p<d.length;p++){s=null;l=d[p];if("<"==l){u=t("<div/>")[0];c=d[p+1];if("'"==c||'"'==c){f="";h=2;for(;d[p+h]!=c;){f+=d[p+h];h++}"H"==f?f=n.sJUIHeader:"F"==f&&(f=n.sJUIFooter);if(-1!=f.indexOf(".")){var g=f.split(".");u.id=g[0].substr(1,g[0].length-1);u.className=g[1]}else"#"==f.charAt(0)?u.id=f.substr(1,f.length-1):u.className=f;p+=h}a.append(u);a=t(u)}else if(">"==l)a=a.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=ce(e);else if("f"==l&&o.bFilter)s=$(e);else if("r"==l&&o.bProcessing)s=de(e);else if("t"==l)s=ge(e);else if("i"==l&&o.bInfo)s=ie(e);else if("p"==l&&o.bPaginate)s=fe(e);else if(0!==$e.ext.feature.length)for(var m=$e.ext.feature,v=0,y=m.length;y>v;v++)if(l==m[v].cFeature){s=m[v].fnInit(e);break}if(s){var b=e.aanFeatures;b[l]||(b[l]=[]);b[l].push(s);a.append(s)}}i.replaceWith(a)}function z(e,n){var r,i,o,a,s,l,u,c,f,h,d,p=t(n).children("tr"),g=function(t,e,n){for(var r=t[e];r[n];)n++;return n};e.splice(0,e.length);for(o=0,l=p.length;l>o;o++)e.push([]);for(o=0,l=p.length;l>o;o++){r=p[o];c=0;i=r.firstChild;for(;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){f=1*i.getAttribute("colspan");h=1*i.getAttribute("rowspan");f=f&&0!==f&&1!==f?f:1;h=h&&0!==h&&1!==h?h:1;u=g(e,o,c);d=1===f?!0:!1;for(s=0;f>s;s++)for(a=0;h>a;a++){e[o+a][u+s]={cell:i,unique:d};e[o+a].nTr=r}}i=i.nextSibling}}}function q(t,e,n){var r=[];if(!n){n=t.aoHeader;if(e){n=[];z(n,e)}}for(var i=0,o=n.length;o>i;i++)for(var a=0,s=n[i].length;s>a;a++)!n[i][a].unique||r[a]&&t.bSortCellsTop||(r[a]=n[i][a].cell);return r}function U(e,n,r){ze(e,"aoServerParams","serverParams",[n]);if(n&&t.isArray(n)){var i={},o=/(.*?)\[\]$/;t.each(n,function(t,e){var n=e.name.match(o);if(n){var r=n[0];i[r]||(i[r]=[]);i[r].push(e.value)}else i[e.name]=e.value});n=i}var a,s=e.ajax,l=e.oInstance;if(t.isPlainObject(s)&&s.data){a=s.data;var u=t.isFunction(a)?a(n):a;n=t.isFunction(a)&&u?u:t.extend(!0,n,u);delete s.data}var c={data:n,success:function(t){var n=t.error||t.sError;n&&e.oApi._fnLog(e,0,n);e.json=t;ze(e,null,"xhr",[e,t]);r(t)},dataType:"json",cache:!1,type:e.sServerMethod,error:function(t,n){var r=e.oApi._fnLog;"parsererror"==n?r(e,0,"Invalid JSON response",1):4===t.readyState&&r(e,0,"Ajax error",7);pe(e,!1)}};e.oAjaxData=n;ze(e,null,"preXhr",[e,n]);if(e.fnServerData)e.fnServerData.call(l,e.sAjaxSource,t.map(n,function(t,e){return{name:e,value:t}}),r,e);else if(e.sAjaxSource||"string"==typeof s)e.jqXHR=t.ajax(t.extend(c,{url:s||e.sAjaxSource}));else if(t.isFunction(s))e.jqXHR=s.call(l,n,r,e);else{e.jqXHR=t.ajax(t.extend(c,s));s.data=a}}function B(t){if(t.bAjaxDataGet){t.iDraw++;pe(t,!0);U(t,V(t),function(e){X(t,e)});return!1}return!0}function V(e){var n,r,i,o,a=e.aoColumns,s=a.length,l=e.oFeatures,u=e.oPreviousSearch,c=e.aoPreSearchCols,f=[],h=_e(e),d=e._iDisplayStart,p=l.bPaginate!==!1?e._iDisplayLength:-1,g=function(t,e){f.push({name:t,value:e})};g("sEcho",e.iDraw);g("iColumns",s);g("sColumns",dn(a,"sName").join(","));g("iDisplayStart",d);g("iDisplayLength",p);var m={draw:e.iDraw,columns:[],order:[],start:d,length:p,search:{value:u.sSearch,regex:u.bRegex}};for(n=0;s>n;n++){i=a[n];o=c[n];r="function"==typeof i.mData?"function":i.mData;m.columns.push({data:r,name:i.sName,searchable:i.bSearchable,orderable:i.bSortable,search:{value:o.sSearch,regex:o.bRegex}});g("mDataProp_"+n,r);if(l.bFilter){g("sSearch_"+n,o.sSearch);g("bRegex_"+n,o.bRegex);g("bSearchable_"+n,i.bSearchable)}l.bSort&&g("bSortable_"+n,i.bSortable)}if(l.bFilter){g("sSearch",u.sSearch);g("bRegex",u.bRegex)}if(l.bSort){t.each(h,function(t,e){m.order.push({column:e.col,dir:e.dir});g("iSortCol_"+t,e.col);g("sSortDir_"+t,e.dir)});g("iSortingCols",h.length)}var v=$e.ext.legacy.ajax;return null===v?e.sAjaxSource?f:m:v?f:m}function X(t,e){var n=function(t,n){return e[t]!==o?e[t]:e[n]},r=n("sEcho","draw"),i=n("iTotalRecords","recordsTotal"),a=n("iTotalDisplayRecords","recordsFiltered");if(r){if(1*r<t.iDraw)return;t.iDraw=1*r}A(t);t._iRecordsTotal=parseInt(i,10);t._iRecordsDisplay=parseInt(a,10);for(var s=G(t,e),l=0,u=s.length;u>l;l++)x(t,s[l]);t.aiDisplay=t.aiDisplayMaster.slice();t.bAjaxDataGet=!1;R(t);t._bInitComplete||le(t,e);t.bAjaxDataGet=!0;pe(t,!1)}function G(e,n){var r=t.isPlainObject(e.ajax)&&e.ajax.dataSrc!==o?e.ajax.dataSrc:e.sAjaxDataProp;return"data"===r?n.aaData||n[r]:""!==r?M(r)(n):n}function $(e){var n=e.oClasses,r=e.sTableId,o=e.oLanguage,a=e.oPreviousSearch,s=e.aanFeatures,l='<input type="search" class="'+n.sFilterInput+'"/>',u=o.sSearch;u=u.match(/_INPUT_/)?u.replace("_INPUT_",l):u+l;var c=t("<div/>",{id:s.f?null:r+"_filter","class":n.sFilter}).append(t("<label/>").append(u)),f=function(){var t=(s.f,this.value?this.value:"");if(t!=a.sSearch){Y(e,{sSearch:t,bRegex:a.bRegex,bSmart:a.bSmart,bCaseInsensitive:a.bCaseInsensitive});e._iDisplayStart=0;R(e)}},h=t("input",c).val(a.sSearch).attr("placeholder",o.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT","ssp"===Be(e)?be(f,400):f).bind("keypress.DT",function(t){return 13==t.keyCode?!1:void 0}).attr("aria-controls",r);t(e.nTable).on("search.dt.DT",function(t,n){if(e===n)try{h[0]!==i.activeElement&&h.val(a.sSearch)}catch(r){}});return c[0]}function Y(t,e,n){var r=t.oPreviousSearch,i=t.aoPreSearchCols,a=function(t){r.sSearch=t.sSearch;r.bRegex=t.bRegex;r.bSmart=t.bSmart;r.bCaseInsensitive=t.bCaseInsensitive},s=function(t){return t.bEscapeRegex!==o?!t.bEscapeRegex:t.bRegex};y(t);if("ssp"!=Be(t)){Z(t,e.sSearch,n,s(e),e.bSmart,e.bCaseInsensitive);a(e);for(var l=0;l<i.length;l++)K(t,i[l].sSearch,l,s(i[l]),i[l].bSmart,i[l].bCaseInsensitive);J(t)}else a(e);t.bFiltered=!0;ze(t,null,"search",[t])}function J(t){for(var e,n,r=$e.ext.search,i=t.aiDisplay,o=0,a=r.length;a>o;o++){for(var s=[],l=0,u=i.length;u>l;l++){n=i[l];e=t.aoData[n];r[o](t,e._aFilterData,n,e._aData,l)&&s.push(n)}i.length=0;i.push.apply(i,s)}}function K(t,e,n,r,i,o){if(""!==e)for(var a,s=t.aiDisplay,l=Q(e,r,i,o),u=s.length-1;u>=0;u--){a=t.aoData[s[u]]._aFilterData[n];l.test(a)||s.splice(u,1)}}function Z(t,e,n,r,i,o){var a,s,l,u=Q(e,r,i,o),c=t.oPreviousSearch.sSearch,f=t.aiDisplayMaster;0!==$e.ext.search.length&&(n=!0);s=ee(t);if(e.length<=0)t.aiDisplay=f.slice();else{(s||n||c.length>e.length||0!==e.indexOf(c)||t.bSorted)&&(t.aiDisplay=f.slice());a=t.aiDisplay;for(l=a.length-1;l>=0;l--)u.test(t.aoData[a[l]]._sFilterRow)||a.splice(l,1)}}function Q(e,n,r,i){e=n?e:te(e);if(r){var o=t.map(e.match(/"[^"]+"|[^ ]+/g)||"",function(t){return'"'===t.charAt(0)?t.match(/^"(.*)"$/)[1]:t});e="^(?=.*?"+o.join(")(?=.*?")+").*$"}return new RegExp(e,i?"i":"")}function te(t){return t.replace(on,"\\$1")}function ee(t){var e,n,r,i,o,a,s,l,u=t.aoColumns,c=$e.ext.type.search,f=!1;for(n=0,i=t.aoData.length;i>n;n++){l=t.aoData[n];if(!l._aFilterData){a=[];for(r=0,o=u.length;o>r;r++){e=u[r];if(e.bSearchable){s=T(t,n,r,"filter");c[e.sType]&&(s=c[e.sType](s));null===s&&(s="");"string"!=typeof s&&s.toString&&(s=s.toString())}else s="";if(s.indexOf&&-1!==s.indexOf("&")){wn.innerHTML=s;s=Cn?wn.textContent:wn.innerText}s.replace&&(s=s.replace(/[\r\n]/g,""));a.push(s)}l._aFilterData=a;l._sFilterRow=a.join(" ");f=!0}}return f}function ne(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function re(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function ie(e){var n=e.sTableId,r=e.aanFeatures.i,i=t("<div/>",{"class":e.oClasses.sInfo,id:r?null:n+"_info"});if(!r){e.aoDrawCallback.push({fn:oe,sName:"information"});i.attr("role","status").attr("aria-live","polite");t(e.nTable).attr("aria-describedby",n+"_info")}return i[0]}function oe(e){var n=e.aanFeatures.i;if(0!==n.length){var r=e.oLanguage,i=e._iDisplayStart+1,o=e.fnDisplayEnd(),a=e.fnRecordsTotal(),s=e.fnRecordsDisplay(),l=s?r.sInfo:r.sInfoEmpty;s!==a&&(l+=" "+r.sInfoFiltered);l+=r.sInfoPostFix;l=ae(e,l);var u=r.fnInfoCallback;null!==u&&(l=u.call(e.oInstance,e,i,o,a,s,l));t(n).html(l)}}function ae(t,e){var n=t.fnFormatNumber,r=t._iDisplayStart+1,i=t._iDisplayLength,o=t.fnRecordsDisplay(),a=-1===i;return e.replace(/_START_/g,n.call(t,r)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,o)).replace(/_PAGE_/g,n.call(t,a?1:Math.ceil(r/i))).replace(/_PAGES_/g,n.call(t,a?1:Math.ceil(o/i)))}function se(t){var e,n,r,i=t.iInitDisplayStart,o=t.aoColumns,a=t.oFeatures;if(t.bInitialised){W(t);H(t);O(t,t.aoHeader);O(t,t.aoFooter);pe(t,!0);a.bAutoWidth&&ye(t);for(e=0,n=o.length;n>e;e++){r=o[e];r.sWidth&&(r.nTh.style.width=Te(r.sWidth))}F(t);var s=Be(t);if("ssp"!=s)if("ajax"==s)U(t,[],function(n){var r=G(t,n);for(e=0;e<r.length;e++)x(t,r[e]);t.iInitDisplayStart=i;F(t);pe(t,!1);le(t,n)},t);else{pe(t,!1);le(t)}}else setTimeout(function(){se(t)},200)}function le(t,e){t._bInitComplete=!0;e&&d(t);ze(t,"aoInitComplete","init",[t,e])}function ue(t,e){var n=parseInt(e,10);t._iDisplayLength=n;qe(t);ze(t,null,"length",[t,n])}function ce(e){for(var n=e.oClasses,r=e.sTableId,i=e.aLengthMenu,o=t.isArray(i[0]),a=o?i[0]:i,s=o?i[1]:i,l=t("<select/>",{name:r+"_length","aria-controls":r,"class":n.sLengthSelect}),u=0,c=a.length;c>u;u++)l[0][u]=new Option(s[u],a[u]);var f=t("<div><label/></div>").addClass(n.sLength);e.aanFeatures.l||(f[0].id=r+"_length");f.children().append(e.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML));t("select",f).val(e._iDisplayLength).bind("change.DT",function(){ue(e,t(this).val());R(e)});t(e.nTable).bind("length.dt.DT",function(n,r,i){e===r&&t("select",f).val(i)});return f[0]}function fe(e){var n=e.sPaginationType,r=$e.ext.pager[n],i="function"==typeof r,o=function(t){R(t)},a=t("<div/>").addClass(e.oClasses.sPaging+n)[0],s=e.aanFeatures;i||r.fnInit(e,a,o);if(!s.p){a.id=e.sTableId+"_paginate";e.aoDrawCallback.push({fn:function(t){if(i){var e,n,a=t._iDisplayStart,l=t._iDisplayLength,u=t.fnRecordsDisplay(),c=-1===l,f=c?0:Math.ceil(a/l),h=c?1:Math.ceil(u/l),d=r(f,h);for(e=0,n=s.p.length;n>e;e++)Ue(t,"pageButton")(t,s.p[e],e,d,f,h)}else r.fnUpdate(t,o)},sName:"pagination"})}return a}function he(t,e,n){var r=t._iDisplayStart,i=t._iDisplayLength,o=t.fnRecordsDisplay();if(0===o||-1===i)r=0;else if("number"==typeof e){r=e*i;r>o&&(r=0)}else if("first"==e)r=0;else if("previous"==e){r=i>=0?r-i:0;0>r&&(r=0)}else"next"==e?o>r+i&&(r+=i):"last"==e?r=Math.floor((o-1)/i)*i:He(t,0,"Unknown paging action: "+e,5);var a=t._iDisplayStart!==r;t._iDisplayStart=r;if(a){ze(t,null,"page",[t]);n&&R(t)}return a}function de(e){return t("<div/>",{id:e.aanFeatures.r?null:e.sTableId+"_processing","class":e.oClasses.sProcessing}).html(e.oLanguage.sProcessing).insertBefore(e.nTable)[0]}function pe(e,n){e.oFeatures.bProcessing&&t(e.aanFeatures.r).css("display",n?"block":"none");ze(e,null,"processing",[e,n])}function ge(e){var n=t(e.nTable);n.attr("role","grid");var r=e.oScroll;if(""===r.sX&&""===r.sY)return e.nTable;var i=r.sX,o=r.sY,a=e.oClasses,s=n.children("caption"),l=s.length?s[0]._captionSide:null,u=t(n[0].cloneNode(!1)),c=t(n[0].cloneNode(!1)),f=n.children("tfoot"),h="<div/>",d=function(t){return t?Te(t):null};r.sX&&"100%"===n.attr("width")&&n.removeAttr("width");f.length||(f=null);var p=t(h,{"class":a.sScrollWrapper}).append(t(h,{"class":a.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:i?d(i):"100%"}).append(t(h,{"class":a.sScrollHeadInner}).css({"box-sizing":"content-box",width:r.sXInner||"100%"}).append(u.removeAttr("id").css("margin-left",0).append(n.children("thead")))).append("top"===l?s:null)).append(t(h,{"class":a.sScrollBody}).css({overflow:"auto",height:d(o),width:d(i)}).append(n));f&&p.append(t(h,{"class":a.sScrollFoot}).css({overflow:"hidden",border:0,width:i?d(i):"100%"}).append(t(h,{"class":a.sScrollFootInner}).append(c.removeAttr("id").css("margin-left",0).append(n.children("tfoot")))).append("bottom"===l?s:null));var g=p.children(),m=g[0],v=g[1],y=f?g[2]:null;i&&t(v).scroll(function(){var t=this.scrollLeft;m.scrollLeft=t;f&&(y.scrollLeft=t)});e.nScrollHead=m;e.nScrollBody=v;e.nScrollFoot=y;e.aoDrawCallback.push({fn:me,sName:"scrolling"});return p[0]}function me(e){var n,r,i,o,a,s,l,u,c,f=e.oScroll,h=f.sX,d=f.sXInner,g=f.sY,m=f.iBarWidth,v=t(e.nScrollHead),y=v[0].style,b=v.children("div"),x=b[0].style,w=b.children("table"),C=e.nScrollBody,S=t(C),T=C.style,k=t(e.nScrollFoot),_=k.children("div"),M=_.children("table"),D=t(e.nTHead),L=t(e.nTable),A=L[0],N=A.style,E=e.nTFoot?t(e.nTFoot):null,j=e.oBrowser,I=j.bScrollOversize,P=[],H=[],O=[],R=function(t){var e=t.style;e.paddingTop="0";e.paddingBottom="0";e.borderTopWidth="0";e.borderBottomWidth="0";e.height=0};L.children("thead, tfoot").remove();a=D.clone().prependTo(L);n=D.find("tr");i=a.find("tr");a.find("th, td").removeAttr("tabindex");if(E){s=E.clone().prependTo(L);r=E.find("tr");o=s.find("tr")}if(!h){T.width="100%";v[0].style.width="100%"}t.each(q(e,a),function(t,n){l=p(e,t);n.style.width=e.aoColumns[l].sWidth});E&&ve(function(t){t.style.width=""},o);f.bCollapse&&""!==g&&(T.height=S[0].offsetHeight+D[0].offsetHeight+"px");c=L.outerWidth();if(""===h){N.width="100%";I&&(L.find("tbody").height()>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(N.width=Te(L.outerWidth()-m))}else if(""!==d)N.width=Te(d);else if(c==S.width()&&S.height()<L.height()){N.width=Te(c-m);L.outerWidth()>c-m&&(N.width=Te(c))}else N.width=Te(c);c=L.outerWidth();ve(R,i);ve(function(e){O.push(e.innerHTML);P.push(Te(t(e).css("width")))},i);ve(function(t,e){t.style.width=P[e]},n);t(i).height(0);if(E){ve(R,o);ve(function(e){H.push(Te(t(e).css("width")))},o);ve(function(t,e){t.style.width=H[e]},r);t(o).height(0)}ve(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+O[e]+"</div>";t.style.width=P[e]},i);E&&ve(function(t,e){t.innerHTML="";t.style.width=H[e]},o);if(L.outerWidth()<c){u=C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y")?c+m:c;I&&(C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(N.width=Te(u-m));(""===h||""!==d)&&He(e,1,"Possible column misalignment",6)}else u="100%";T.width=Te(u);y.width=Te(u);E&&(e.nScrollFoot.style.width=Te(u));g||I&&(T.height=Te(A.offsetHeight+m));if(g&&f.bCollapse){T.height=Te(g);var F=h&&A.offsetWidth>C.offsetWidth?m:0;A.offsetHeight<C.offsetHeight&&(T.height=Te(A.offsetHeight+F))}var W=L.outerWidth();w[0].style.width=Te(W);x.width=Te(W);var z=L.height()>C.clientHeight||"scroll"==S.css("overflow-y"),U="padding"+(j.bScrollbarLeft?"Left":"Right");x[U]=z?m+"px":"0px";if(E){M[0].style.width=Te(W);_[0].style.width=Te(W);_[0].style[U]=z?m+"px":"0px"}S.scroll();!e.bSorted&&!e.bFiltered||e._drawHold||(C.scrollTop=0)}function ve(t,e,n){for(var r,i,o=0,a=0,s=e.length;s>a;){r=e[a].firstChild;i=n?n[a].firstChild:null;for(;r;){if(1===r.nodeType){n?t(r,i,o):t(r,o);o++}r=r.nextSibling;i=n?i.nextSibling:null}a++}}function ye(e){var r,i,o,a,s,l=e.nTable,u=e.aoColumns,c=e.oScroll,f=c.sY,h=c.sX,p=c.sXInner,g=u.length,y=v(e,"bVisible"),b=t("th",e.nTHead),x=l.getAttribute("width"),w=l.parentNode,C=!1;for(r=0;r<y.length;r++){i=u[y[r]];if(null!==i.sWidth){i.sWidth=xe(i.sWidthOrig,w);C=!0}}if(C||h||f||g!=m(e)||g!=b.length){var S=t(l).clone().empty().css("visibility","hidden").removeAttr("id").append(t(e.nTHead).clone(!1)).append(t(e.nTFoot).clone(!1)).append(t("<tbody><tr/></tbody>"));S.find("tfoot th, tfoot td").css("width","");var T=S.find("tbody tr");b=q(e,S.find("thead")[0]);for(r=0;r<y.length;r++){i=u[y[r]];b[r].style.width=null!==i.sWidthOrig&&""!==i.sWidthOrig?Te(i.sWidthOrig):""}if(e.aoData.length)for(r=0;r<y.length;r++){o=y[r];i=u[o];t(Ce(e,o)).clone(!1).append(i.sContentPadding).appendTo(T)}S.appendTo(w);if(h&&p)S.width(p);else if(h){S.css("width","auto");S.width()<w.offsetWidth&&S.width(w.offsetWidth)}else f?S.width(w.offsetWidth):x&&S.width(x);we(e,S[0]);if(h){var k=0;for(r=0;r<y.length;r++){i=u[y[r]];s=t(b[r]).outerWidth();k+=null===i.sWidthOrig?s:parseInt(i.sWidth,10)+s-t(b[r]).width()}S.width(Te(k));l.style.width=Te(k)}for(r=0;r<y.length;r++){i=u[y[r]];a=t(b[r]).width();a&&(i.sWidth=Te(a))}l.style.width=Te(S.css("width"));S.remove()}else for(r=0;g>r;r++)u[r].sWidth=Te(b.eq(r).width());x&&(l.style.width=Te(x));if((x||h)&&!e._reszEvt){t(n).bind("resize.DT-"+e.sInstance,be(function(){d(e)}));e._reszEvt=!0}}function be(t,e){var n,r,i=e||200;return function(){var e=this,a=+new Date,s=arguments;if(n&&n+i>a){clearTimeout(r);r=setTimeout(function(){n=o;t.apply(e,s)},i)}else if(n){n=a;t.apply(e,s)}else n=a}}function xe(e,n){if(!e)return 0;var r=t("<div/>").css("width",Te(e)).appendTo(n||i.body),o=r[0].offsetWidth;r.remove();return o}function we(e,n){var r=e.oScroll;if(r.sX||r.sY){var i=r.sX?0:r.iBarWidth;n.style.width=Te(t(n).outerWidth()-i)}}function Ce(e,n){var r=Se(e,n);if(0>r)return null;var i=e.aoData[r];return i.nTr?i.anCells[n]:t("<td/>").html(T(e,r,n,"display"))[0]}function Se(t,e){for(var n,r=-1,i=-1,o=0,a=t.aoData.length;a>o;o++){n=T(t,o,e,"display")+"";n=n.replace(Sn,"");if(n.length>r){r=n.length;i=o}}return i}function Te(t){return null===t?"0px":"number"==typeof t?0>t?"0px":t+"px":t.match(/\d$/)?t+"px":t}function ke(){if(!$e.__scrollbarWidth){var e=t("<p/>").css({width:"100%",height:200,padding:0})[0],n=t("<div/>").css({position:"absolute",top:0,left:0,width:200,height:150,padding:0,overflow:"hidden",visibility:"hidden"}).append(e).appendTo("body"),r=e.offsetWidth;n.css("overflow","scroll");var i=e.offsetWidth;r===i&&(i=n[0].clientWidth);n.remove();$e.__scrollbarWidth=r-i}return $e.__scrollbarWidth}function _e(e){var n,r,i,o,a,s,l,u=[],c=e.aoColumns,f=e.aaSortingFixed,h=t.isPlainObject(f),d=[],p=function(e){e.length&&!t.isArray(e[0])?d.push(e):d.push.apply(d,e)};t.isArray(f)&&p(f);h&&f.pre&&p(f.pre);p(e.aaSorting);h&&f.post&&p(f.post);for(n=0;n<d.length;n++){l=d[n][0];o=c[l].aDataSort;for(r=0,i=o.length;i>r;r++){a=o[r];s=c[a].sType||"string";u.push({src:l,col:a,dir:d[n][1],index:d[n][2],type:s,formatter:$e.ext.type.order[s+"-pre"]})}}return u}function Me(t){var e,n,r,i,o,a=[],s=$e.ext.type.order,l=t.aoData,u=(t.aoColumns,0),c=t.aiDisplayMaster;y(t);o=_e(t);for(e=0,n=o.length;n>e;e++){i=o[e];i.formatter&&u++;Ee(t,i.col)}if("ssp"!=Be(t)&&0!==o.length){for(e=0,r=c.length;r>e;e++)a[c[e]]=e;c.sort(u===o.length?function(t,e){var n,r,i,s,u,c=o.length,f=l[t]._aSortData,h=l[e]._aSortData;for(i=0;c>i;i++){u=o[i];n=f[u.col];r=h[u.col];s=r>n?-1:n>r?1:0;if(0!==s)return"asc"===u.dir?s:-s}n=a[t];r=a[e];return r>n?-1:n>r?1:0}:function(t,e){var n,r,i,u,c,f,h=o.length,d=l[t]._aSortData,p=l[e]._aSortData; for(i=0;h>i;i++){c=o[i];n=d[c.col];r=p[c.col];f=s[c.type+"-"+c.dir]||s["string-"+c.dir];u=f(n,r);if(0!==u)return u}n=a[t];r=a[e];return r>n?-1:n>r?1:0})}t.bSorted=!0}function De(t){for(var e,n,r=t.aoColumns,i=_e(t),o=t.oLanguage.oAria,a=0,s=r.length;s>a;a++){var l=r[a],u=l.asSorting,c=l.sTitle.replace(/<.*?>/g,""),f=l.nTh;f.removeAttribute("aria-sort");if(l.bSortable){if(i.length>0&&i[0].col==a){f.setAttribute("aria-sort","asc"==i[0].dir?"ascending":"descending");n=u[i[0].index+1]||u[0]}else n=u[0];e=c+("asc"===n?o.sSortAscending:o.sSortDescending)}else e=c;f.setAttribute("aria-label",e)}}function Le(e,n,r,i){var a,s=e.aoColumns[n],l=e.aaSorting,u=s.asSorting,c=function(e){var n=e._idx;n===o&&(n=t.inArray(e[1],u));return n+1>=u.length?0:n+1};"number"==typeof l[0]&&(l=e.aaSorting=[l]);if(r&&e.oFeatures.bSortMulti){var f=t.inArray(n,dn(l,"0"));if(-1!==f){a=c(l[f]);l[f][1]=u[a];l[f]._idx=a}else{l.push([n,u[0],0]);l[l.length-1]._idx=0}}else if(l.length&&l[0][0]==n){a=c(l[0]);l.length=1;l[0][1]=u[a];l[0]._idx=a}else{l.length=0;l.push([n,u[0]]);l[0]._idx=0}F(e);"function"==typeof i&&i(e)}function Ae(t,e,n,r){var i=t.aoColumns[n];Fe(e,{},function(e){if(i.bSortable!==!1)if(t.oFeatures.bProcessing){pe(t,!0);setTimeout(function(){Le(t,n,e.shiftKey,r);"ssp"!==Be(t)&&pe(t,!1)},0)}else Le(t,n,e.shiftKey,r)})}function Ne(e){var n,r,i,o=e.aLastSort,a=e.oClasses.sSortColumn,s=_e(e),l=e.oFeatures;if(l.bSort&&l.bSortClasses){for(n=0,r=o.length;r>n;n++){i=o[n].src;t(dn(e.aoData,"anCells",i)).removeClass(a+(2>n?n+1:3))}for(n=0,r=s.length;r>n;n++){i=s[n].src;t(dn(e.aoData,"anCells",i)).addClass(a+(2>n?n+1:3))}}e.aLastSort=s}function Ee(t,e){var n,r=t.aoColumns[e],i=$e.ext.order[r.sSortDataType];i&&(n=i.call(t.oInstance,t,e,g(t,e)));for(var o,a,s=$e.ext.type.order[r.sType+"-pre"],l=0,u=t.aoData.length;u>l;l++){o=t.aoData[l];o._aSortData||(o._aSortData=[]);if(!o._aSortData[e]||i){a=i?n[l]:T(t,l,e,"sort");o._aSortData[e]=s?s(a):a}}}function je(e){if(e.oFeatures.bStateSave&&!e.bDestroying){var n={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.extend(!0,[],e.aaSorting),search:ne(e.oPreviousSearch),columns:t.map(e.aoColumns,function(t,n){return{visible:t.bVisible,search:ne(e.aoPreSearchCols[n])}})};ze(e,"aoStateSaveParams","stateSaveParams",[e,n]);e.oSavedState=n;e.fnStateSaveCallback.call(e.oInstance,e,n)}}function Ie(e){var n,r,i=e.aoColumns;if(e.oFeatures.bStateSave){var o=e.fnStateLoadCallback.call(e.oInstance,e);if(o&&o.time){var a=ze(e,"aoStateLoadParams","stateLoadParams",[e,o]);if(-1===t.inArray(!1,a)){var s=e.iStateDuration;if(!(s>0&&o.time<+new Date-1e3*s)&&i.length===o.columns.length){e.oLoadedState=t.extend(!0,{},o);e._iDisplayStart=o.start;e.iInitDisplayStart=o.start;e._iDisplayLength=o.length;e.aaSorting=[];t.each(o.order,function(t,n){e.aaSorting.push(n[0]>=i.length?[0,n[1]]:n)});t.extend(e.oPreviousSearch,re(o.search));for(n=0,r=o.columns.length;r>n;n++){var l=o.columns[n];i[n].bVisible=l.visible;t.extend(e.aoPreSearchCols[n],re(l.search))}ze(e,"aoStateLoaded","stateLoaded",[e,o])}}}}}function Pe(e){var n=$e.settings,r=t.inArray(e,dn(n,"nTable"));return-1!==r?n[r]:null}function He(t,e,r,i){r="DataTables warning: "+(null!==t?"table id="+t.sTableId+" - ":"")+r;i&&(r+=". For more information about this error, please see http://datatables.net/tn/"+i);if(e)n.console&&console.log&&console.log(r);else{var o=$e.ext,a=o.sErrMode||o.errMode;if("alert"!=a)throw new Error(r);alert(r)}}function Oe(e,n,r,i){if(t.isArray(r))t.each(r,function(r,i){t.isArray(i)?Oe(e,n,i[0],i[1]):Oe(e,n,i)});else{i===o&&(i=r);n[r]!==o&&(e[i]=n[r])}}function Re(e,n,r){var i;for(var o in n)if(n.hasOwnProperty(o)){i=n[o];if(t.isPlainObject(i)){t.isPlainObject(e[o])||(e[o]={});t.extend(!0,e[o],i)}else e[o]=r&&"data"!==o&&"aaData"!==o&&t.isArray(i)?i.slice():i}return e}function Fe(e,n,r){t(e).bind("click.DT",n,function(t){e.blur();r(t)}).bind("keypress.DT",n,function(t){if(13===t.which){t.preventDefault();r(t)}}).bind("selectstart.DT",function(){return!1})}function We(t,e,n,r){n&&t[e].push({fn:n,sName:r})}function ze(e,n,r,i){var o=[];n&&(o=t.map(e[n].slice().reverse(),function(t){return t.fn.apply(e.oInstance,i)}));null!==r&&t(e.nTable).trigger(r+".dt",i);return o}function qe(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),r=t._iDisplayLength;n===t.fnRecordsDisplay()&&(e=n-r);(-1===r||0>e)&&(e=0);t._iDisplayStart=e}function Ue(e,n){var r=e.renderer,i=$e.ext.renderer[n];return t.isPlainObject(r)&&r[n]?i[r[n]]||i._:"string"==typeof r?i[r]||i._:i._}function Be(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}function Ve(t,e){var n=[],r=Vn.numbers_length,i=Math.floor(r/2);if(r>=e)n=gn(0,e);else if(i>=t){n=gn(0,r-2);n.push("ellipsis");n.push(e-1)}else if(t>=e-1-i){n=gn(e-(r-2),e);n.splice(0,0,"ellipsis");n.splice(0,0,0)}else{n=gn(t-1,t+2);n.push("ellipsis");n.push(e-1);n.splice(0,0,"ellipsis");n.splice(0,0,0)}n.DT_el="span";return n}function Xe(e){t.each({num:function(t){return Xn(t,e)},"num-fmt":function(t){return Xn(t,e,an)},"html-num":function(t){return Xn(t,e,en)},"html-num-fmt":function(t){return Xn(t,e,en,an)}},function(t,n){Ye.type.order[t+e+"-pre"]=n})}function Ge(t){return function(){var e=[Pe(this[$e.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return $e.ext.internal[t].apply(this,e)}}var $e,Ye,Je,Ke,Ze,Qe={},tn=/[\r\n]/g,en=/<.*?>/g,nn=/^[\w\+\-]/,rn=/[\w\+\-]$/,on=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),an=/[',$£€¥%\u2009\u202F]/g,sn=function(t){return t&&t!==!0&&"-"!==t?!1:!0},ln=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null},un=function(t,e){Qe[e]||(Qe[e]=new RegExp(te(e),"g"));return"string"==typeof t?t.replace(/\./g,"").replace(Qe[e],"."):t},cn=function(t,e,n){var r="string"==typeof t;e&&r&&(t=un(t,e));n&&r&&(t=t.replace(an,""));return sn(t)||!isNaN(parseFloat(t))&&isFinite(t)},fn=function(t){return sn(t)||"string"==typeof t},hn=function(t,e,n){if(sn(t))return!0;var r=fn(t);return r&&cn(mn(t),e,n)?!0:null},dn=function(t,e,n){var r=[],i=0,a=t.length;if(n!==o)for(;a>i;i++)t[i]&&t[i][e]&&r.push(t[i][e][n]);else for(;a>i;i++)t[i]&&r.push(t[i][e]);return r},pn=function(t,e,n,r){var i=[],a=0,s=e.length;if(r!==o)for(;s>a;a++)i.push(t[e[a]][n][r]);else for(;s>a;a++)i.push(t[e[a]][n]);return i},gn=function(t,e){var n,r=[];if(e===o){e=0;n=t}else{n=e;e=t}for(var i=e;n>i;i++)r.push(i);return r},mn=function(t){return t.replace(en,"")},vn=function(t){var e,n,r,i=[],o=t.length,a=0;t:for(n=0;o>n;n++){e=t[n];for(r=0;a>r;r++)if(i[r]===e)continue t;i.push(e);a++}return i},yn=function(t,e,n){t[e]!==o&&(t[n]=t[e])},bn=/\[.*?\]$/,xn=/\(\)$/,wn=t("<div>")[0],Cn=wn.textContent!==o,Sn=/<.*?>/g;$e=function(e){this.$=function(t,e){return this.api(!0).$(t,e)};this._=function(t,e){return this.api(!0).rows(t,e).data()};this.api=function(t){return new Je(t?Pe(this[Ye.iApiIndex]):this)};this.fnAddData=function(e,n){var r=this.api(!0),i=t.isArray(e)&&(t.isArray(e[0])||t.isPlainObject(e[0]))?r.rows.add(e):r.row.add(e);(n===o||n)&&r.draw();return i.flatten().toArray()};this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),n=e.settings()[0],r=n.oScroll;t===o||t?e.draw(!1):(""!==r.sX||""!==r.sY)&&me(n)};this.fnClearTable=function(t){var e=this.api(!0).clear();(t===o||t)&&e.draw()};this.fnClose=function(t){this.api(!0).row(t).child.hide()};this.fnDeleteRow=function(t,e,n){var r=this.api(!0),i=r.rows(t),a=i.settings()[0],s=a.aoData[i[0][0]];i.remove();e&&e.call(this,a,s);(n===o||n)&&r.draw();return s};this.fnDestroy=function(t){this.api(!0).destroy(t)};this.fnDraw=function(t){this.api(!0).draw(!t)};this.fnFilter=function(t,e,n,r,i,a){var s=this.api(!0);null===e||e===o?s.search(t,n,r,a):s.column(e).search(t,n,r,a);s.draw()};this.fnGetData=function(t,e){var n=this.api(!0);if(t!==o){var r=t.nodeName?t.nodeName.toLowerCase():"";return e!==o||"td"==r||"th"==r?n.cell(t,e).data():n.row(t).data()||null}return n.data().toArray()};this.fnGetNodes=function(t){var e=this.api(!0);return t!==o?e.row(t).node():e.rows().nodes().flatten().toArray()};this.fnGetPosition=function(t){var e=this.api(!0),n=t.nodeName.toUpperCase();if("TR"==n)return e.row(t).index();if("TD"==n||"TH"==n){var r=e.cell(t).index();return[r.row,r.columnVisible,r.column]}return null};this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()};this.fnOpen=function(t,e,n){return this.api(!0).row(t).child(e,n).show().child()[0]};this.fnPageChange=function(t,e){var n=this.api(!0).page(t);(e===o||e)&&n.draw(!1)};this.fnSetColumnVis=function(t,e,n){var r=this.api(!0).column(t).visible(e);(n===o||n)&&r.columns.adjust().draw()};this.fnSettings=function(){return Pe(this[Ye.iApiIndex])};this.fnSort=function(t){this.api(!0).order(t).draw()};this.fnSortListener=function(t,e,n){this.api(!0).order.listener(t,e,n)};this.fnUpdate=function(t,e,n,r,i){var a=this.api(!0);n===o||null===n?a.row(e).data(t):a.cell(e,n).data(t);(i===o||i)&&a.columns.adjust();(r===o||r)&&a.draw();return 0};this.fnVersionCheck=Ye.fnVersionCheck;var n=this,i=e===o,c=this.length;i&&(e={});this.oApi=this.internal=Ye.internal;for(var d in $e.ext.internal)d&&(this[d]=Ge(d));this.each(function(){var d,p={},g=c>1?Re(p,e,!0):e,m=0,v=this.getAttribute("id"),y=!1,C=$e.defaults;if("table"==this.nodeName.toLowerCase()){s(C);l(C.column);r(C,C,!0);r(C.column,C.column,!0);r(C,g);var S=$e.settings;for(m=0,d=S.length;d>m;m++){if(S[m].nTable==this){var T=g.bRetrieve!==o?g.bRetrieve:C.bRetrieve,k=g.bDestroy!==o?g.bDestroy:C.bDestroy;if(i||T)return S[m].oInstance;if(k){S[m].oInstance.fnDestroy();break}He(S[m],0,"Cannot reinitialise DataTable",3);return}if(S[m].sTableId==this.id){S.splice(m,1);break}}if(null===v||""===v){v="DataTables_Table_"+$e.ext._unique++;this.id=v}var _=t.extend(!0,{},$e.models.oSettings,{nTable:this,oApi:n.internal,oInit:g,sDestroyWidth:t(this)[0].style.width,sInstance:v,sTableId:v});S.push(_);_.oInstance=1===n.length?n:t(this).dataTable();s(g);g.oLanguage&&a(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=t.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=Re(t.extend(!0,{},C),g);Oe(_.oFeatures,g,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]);Oe(_,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);Oe(_.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);Oe(_.oLanguage,g,"fnInfoCallback");We(_,"aoDrawCallback",g.fnDrawCallback,"user");We(_,"aoServerParams",g.fnServerParams,"user");We(_,"aoStateSaveParams",g.fnStateSaveParams,"user");We(_,"aoStateLoadParams",g.fnStateLoadParams,"user");We(_,"aoStateLoaded",g.fnStateLoaded,"user");We(_,"aoRowCallback",g.fnRowCallback,"user");We(_,"aoRowCreatedCallback",g.fnCreatedRow,"user");We(_,"aoHeaderCallback",g.fnHeaderCallback,"user");We(_,"aoFooterCallback",g.fnFooterCallback,"user");We(_,"aoInitComplete",g.fnInitComplete,"user");We(_,"aoPreDrawCallback",g.fnPreDrawCallback,"user");var M=_.oClasses;if(g.bJQueryUI){t.extend(M,$e.ext.oJUIClasses,g.oClasses);g.sDom===C.sDom&&"lfrtip"===C.sDom&&(_.sDom='<"H"lfr>t<"F"ip>');_.renderer?t.isPlainObject(_.renderer)&&!_.renderer.header&&(_.renderer.header="jqueryui"):_.renderer="jqueryui"}else t.extend(M,$e.ext.classes,g.oClasses);t(this).addClass(M.sTable);(""!==_.oScroll.sX||""!==_.oScroll.sY)&&(_.oScroll.iBarWidth=ke());_.oScroll.sX===!0&&(_.oScroll.sX="100%");if(_.iInitDisplayStart===o){_.iInitDisplayStart=g.iDisplayStart;_._iDisplayStart=g.iDisplayStart}if(null!==g.iDeferLoading){_.bDeferLoading=!0;var D=t.isArray(g.iDeferLoading);_._iRecordsDisplay=D?g.iDeferLoading[0]:g.iDeferLoading;_._iRecordsTotal=D?g.iDeferLoading[1]:g.iDeferLoading}if(""!==g.oLanguage.sUrl){_.oLanguage.sUrl=g.oLanguage.sUrl;t.getJSON(_.oLanguage.sUrl,null,function(e){a(e);r(C.oLanguage,e);t.extend(!0,_.oLanguage,g.oLanguage,e);se(_)});y=!0}else t.extend(!0,_.oLanguage,g.oLanguage);null===g.asStripeClasses&&(_.asStripeClasses=[M.sStripeOdd,M.sStripeEven]);var L=_.asStripeClasses,A=t("tbody tr:eq(0)",this);if(-1!==t.inArray(!0,t.map(L,function(t){return A.hasClass(t)}))){t("tbody tr",this).removeClass(L.join(" "));_.asDestroyStripes=L.slice()}var N,E=[],I=this.getElementsByTagName("thead");if(0!==I.length){z(_.aoHeader,I[0]);E=q(_)}if(null===g.aoColumns){N=[];for(m=0,d=E.length;d>m;m++)N.push(null)}else N=g.aoColumns;for(m=0,d=N.length;d>m;m++)f(_,E?E[m]:null);b(_,g.aoColumnDefs,N,function(t,e){h(_,t,e)});if(A.length){var P=function(t,e){return t.getAttribute("data-"+e)?e:null};t.each(j(_,A[0]).cells,function(t,e){var n=_.aoColumns[t];if(n.mData===t){var r=P(e,"sort")||P(e,"order"),i=P(e,"filter")||P(e,"search");if(null!==r||null!==i){n.mData={_:t+".display",sort:null!==r?t+".@data-"+r:o,type:null!==r?t+".@data-"+r:o,filter:null!==i?t+".@data-"+i:o};h(_,t)}}})}var H=_.oFeatures;if(g.bStateSave){H.bStateSave=!0;Ie(_,g);We(_,"aoDrawCallback",je,"state_save")}if(g.aaSorting===o){var O=_.aaSorting;for(m=0,d=O.length;d>m;m++)O[m][1]=_.aoColumns[m].asSorting[0]}Ne(_);H.bSort&&We(_,"aoDrawCallback",function(){if(_.bSorted){var e=_e(_),n={};t.each(e,function(t,e){n[e.src]=e.dir});ze(_,null,"order",[_,e,n]);De(_)}});We(_,"aoDrawCallback",function(){(_.bSorted||"ssp"===Be(_)||H.bDeferRender)&&Ne(_)},"sc");u(_);var R=t(this).children("caption").each(function(){this._captionSide=t(this).css("caption-side")}),F=t(this).children("thead");0===F.length&&(F=t("<thead/>").appendTo(this));_.nTHead=F[0];var W=t(this).children("tbody");0===W.length&&(W=t("<tbody/>").appendTo(this));_.nTBody=W[0];var U=t(this).children("tfoot");0===U.length&&R.length>0&&(""!==_.oScroll.sX||""!==_.oScroll.sY)&&(U=t("<tfoot/>").appendTo(this));if(0===U.length||0===U.children().length)t(this).addClass(M.sNoFooter);else if(U.length>0){_.nTFoot=U[0];z(_.aoFooter,_.nTFoot)}if(g.aaData)for(m=0;m<g.aaData.length;m++)x(_,g.aaData[m]);else(_.bDeferLoading||"dom"==Be(_))&&w(_,t(_.nTBody).children("tr"));_.aiDisplay=_.aiDisplayMaster.slice();_.bInitialised=!0;y===!1&&se(_)}else He(null,0,"Non-table node initialisation ("+this.nodeName+")",2)});n=null;return this};var Tn=[],kn=Array.prototype,_n=function(e){var n,r,i=$e.settings,o=t.map(i,function(t){return t.nTable});if(!e)return[];if(e.nTable&&e.oApi)return[e];if(e.nodeName&&"table"===e.nodeName.toLowerCase()){n=t.inArray(e,o);return-1!==n?[i[n]]:null}if(e&&"function"==typeof e.settings)return e.settings().toArray();"string"==typeof e?r=t(e):e instanceof t&&(r=e);return r?r.map(function(){n=t.inArray(this,o);return-1!==n?i[n]:null}).toArray():void 0};Je=function(e,n){if(!this instanceof Je)throw"DT API must be constructed as a new object";var r=[],i=function(t){var e=_n(t);e&&r.push.apply(r,e)};if(t.isArray(e))for(var o=0,a=e.length;a>o;o++)i(e[o]);else i(e);this.context=vn(r);n&&this.push.apply(this,n.toArray?n.toArray():n);this.selector={rows:null,cols:null,opts:null};Je.extend(this,this,Tn)};$e.Api=Je;Je.prototype={concat:kn.concat,context:[],each:function(t){for(var e=0,n=this.length;n>e;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new Je(e[t],this[t]):null},filter:function(t){var e=[];if(kn.filter)e=kn.filter.call(this,t,this);else for(var n=0,r=this.length;r>n;n++)t.call(this,this[n],n,this)&&e.push(this[n]);return new Je(this.context,e)},flatten:function(){var t=[];return new Je(this.context,t.concat.apply(t,this.toArray()))},join:kn.join,indexOf:kn.indexOf||function(t,e){for(var n=e||0,r=this.length;r>n;n++)if(this[n]===t)return n;return-1},iterator:function(t,e,n){var r,i,a,s,l,u,c,f,h=[],d=this.context,p=this.selector;if("string"==typeof t){n=e;e=t;t=!1}for(i=0,a=d.length;a>i;i++)if("table"===e){r=n(d[i],i);r!==o&&h.push(r)}else if("columns"===e||"rows"===e){r=n(d[i],this[i],i);r!==o&&h.push(r)}else if("column"===e||"column-rows"===e||"row"===e||"cell"===e){c=this[i];"column-rows"===e&&(u=En(d[i],p.opts));for(s=0,l=c.length;l>s;s++){f=c[s];r="cell"===e?n(d[i],f.row,f.column,i,s):n(d[i],f,i,s,u);r!==o&&h.push(r)}}if(h.length){var g=new Je(d,t?h.concat.apply([],h):h),m=g.selector;m.rows=p.rows;m.cols=p.cols;m.opts=p.opts;return g}return this},lastIndexOf:kn.lastIndexOf||function(){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(kn.map)e=kn.map.call(this,t,this);else for(var n=0,r=this.length;r>n;n++)e.push(t.call(this,this[n],n));return new Je(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:kn.pop,push:kn.push,reduce:kn.reduce||function(t,e){return c(this,t,e,0,this.length,1)},reduceRight:kn.reduceRight||function(t,e){return c(this,t,e,this.length-1,-1,-1)},reverse:kn.reverse,selector:null,shift:kn.shift,sort:kn.sort,splice:kn.splice,toArray:function(){return kn.slice.call(this)},to$:function(){return t(this)},toJQuery:function(){return t(this)},unique:function(){return new Je(this.context,vn(this))},unshift:kn.unshift};Je.extend=function(e,n,r){if(n&&(n instanceof Je||n.__dt_wrapper)){var i,o,a,s=function(t,e,n){return function(){var r=e.apply(t,arguments);Je.extend(r,r,n.methodExt);return r}};for(i=0,o=r.length;o>i;i++){a=r[i];n[a.name]="function"==typeof a.val?s(e,a.val,a):t.isPlainObject(a.val)?{}:a.val;n[a.name].__dt_wrapper=!0;Je.extend(e,n[a.name],a.propExt)}}};Je.register=Ke=function(e,n){if(t.isArray(e))for(var r=0,i=e.length;i>r;r++)Je.register(e[r],n);else{var o,a,s,l,u=e.split("."),c=Tn,f=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n].name===e)return t[n];return null};for(o=0,a=u.length;a>o;o++){l=-1!==u[o].indexOf("()");s=l?u[o].replace("()",""):u[o];var h=f(c,s);if(!h){h={name:s,val:{},methodExt:[],propExt:[]};c.push(h)}o===a-1?h.val=n:c=l?h.methodExt:h.propExt}}};Je.registerPlural=Ze=function(e,n,r){Je.register(e,r);Je.register(n,function(){var e=r.apply(this,arguments);return e===this?this:e instanceof Je?e.length?t.isArray(e[0])?new Je(e.context,e[0]):e[0]:o:e})};var Mn=function(e,n){if("number"==typeof e)return[n[e]];var r=t.map(n,function(t){return t.nTable});return t(r).filter(e).map(function(){var e=t.inArray(this,r);return n[e]}).toArray()};Ke("tables()",function(t){return t?new Je(Mn(t,this.context)):this});Ke("table()",function(t){var e=this.tables(t),n=e.context;return n.length?new Je(n[0]):e});Ze("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable})});Ze("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody})});Ze("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead})});Ze("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot})});Ze("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper})});Ke("draw()",function(t){return this.iterator("table",function(e){F(e,t===!1)})});Ke("page()",function(t){return t===o?this.page.info().page:this.iterator("table",function(e){he(e,t)})});Ke("page.info()",function(){if(0===this.context.length)return o;var t=this.context[0],e=t._iDisplayStart,n=t._iDisplayLength,r=t.fnRecordsDisplay(),i=-1===n;return{page:i?0:Math.floor(e/n),pages:i?1:Math.ceil(r/n),start:e,end:t.fnDisplayEnd(),length:n,recordsTotal:t.fnRecordsTotal(),recordsDisplay:r}});Ke("page.len()",function(t){return t===o?0!==this.context.length?this.context[0]._iDisplayLength:o:this.iterator("table",function(e){ue(e,t)})});var Dn=function(t,e,n){if("ssp"==Be(t))F(t,e);else{pe(t,!0);U(t,[],function(n){A(t);for(var r=G(t,n),i=0,o=r.length;o>i;i++)x(t,r[i]);F(t,e);pe(t,!1)})}if(n){var r=new Je(t);r.one("draw",function(){n(r.ajax.json())})}};Ke("ajax.json()",function(){var t=this.context;return t.length>0?t[0].json:void 0});Ke("ajax.params()",function(){var t=this.context;return t.length>0?t[0].oAjaxData:void 0});Ke("ajax.reload()",function(t,e){return this.iterator("table",function(n){Dn(n,e===!1,t)})});Ke("ajax.url()",function(e){var n=this.context;if(e===o){if(0===n.length)return o;n=n[0];return n.ajax?t.isPlainObject(n.ajax)?n.ajax.url:n.ajax:n.sAjaxSource}return this.iterator("table",function(n){t.isPlainObject(n.ajax)?n.ajax.url=e:n.ajax=e})});Ke("ajax.url().load()",function(t,e){return this.iterator("table",function(n){Dn(n,e===!1,t)})});var Ln=function(e,n){var r,i,a,s,l,u,c=[];e&&"string"!=typeof e&&e.length!==o||(e=[e]);for(a=0,s=e.length;s>a;a++){i=e[a]&&e[a].split?e[a].split(","):[e[a]];for(l=0,u=i.length;u>l;l++){r=n("string"==typeof i[l]?t.trim(i[l]):i[l]);r&&r.length&&c.push.apply(c,r)}}return c},An=function(t){t||(t={});t.filter&&!t.search&&(t.search=t.filter);return{search:t.search||"none",order:t.order||"current",page:t.page||"all"}},Nn=function(t){for(var e=0,n=t.length;n>e;e++)if(t[e].length>0){t[0]=t[e];t.length=1;t.context=[t.context[e]];return t}t.length=0;return t},En=function(e,n){var r,i,o,a=[],s=e.aiDisplay,l=e.aiDisplayMaster,u=n.search,c=n.order,f=n.page;if("ssp"==Be(e))return"removed"===u?[]:gn(0,l.length);if("current"==f)for(r=e._iDisplayStart,i=e.fnDisplayEnd();i>r;r++)a.push(s[r]);else if("current"==c||"applied"==c)a="none"==u?l.slice():"applied"==u?s.slice():t.map(l,function(e){return-1===t.inArray(e,s)?e:null});else if("index"==c||"original"==c)for(r=0,i=e.aoData.length;i>r;r++)if("none"==u)a.push(r);else{o=t.inArray(r,s);(-1===o&&"removed"==u||o>=0&&"applied"==u)&&a.push(r)}return a},jn=function(e,n,r){return Ln(n,function(n){var i=ln(n);if(null!==i&&!r)return[i];var o=En(e,r);if(null!==i&&-1!==t.inArray(i,o))return[i];if(!n)return o;for(var a=[],s=0,l=o.length;l>s;s++)a.push(e.aoData[o[s]].nTr);return n.nodeName&&-1!==t.inArray(n,a)?[n._DT_RowIndex]:t(a).filter(n).map(function(){return this._DT_RowIndex}).toArray()})};Ke("rows()",function(e,n){if(e===o)e="";else if(t.isPlainObject(e)){n=e;e=""}n=An(n);var r=this.iterator("table",function(t){return jn(t,e,n)});r.selector.rows=e;r.selector.opts=n;return r});Ke("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||o})});Ke("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return pn(t.aoData,e,"_aData")})});Ze("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,n){var r=e.aoData[n];return"search"===t?r._aFilterData:r._aSortData})});Ze("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,n){E(e,n,t)})});Ze("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e})});Ze("rows().remove()","row().remove()",function(){var e=this;return this.iterator("row",function(n,r,i){var o=n.aoData;o.splice(r,1);for(var a=0,s=o.length;s>a;a++)null!==o[a].nTr&&(o[a].nTr._DT_RowIndex=a);t.inArray(r,n.aiDisplay);N(n.aiDisplayMaster,r);N(n.aiDisplay,r);N(e[i],r,!1);qe(n)})});Ke("rows.add()",function(t){var e=this.iterator("table",function(e){var n,r,i,o=[];for(r=0,i=t.length;i>r;r++){n=t[r];o.push(n.nodeName&&"TR"===n.nodeName.toUpperCase()?w(e,n)[0]:x(e,n))}return o}),n=this.rows(-1);n.pop();n.push.apply(n,e.toArray());return n});Ke("row()",function(t,e){return Nn(this.rows(t,e))});Ke("row().data()",function(t){var e=this.context;if(t===o)return e.length&&this.length?e[0].aoData[this[0]]._aData:o;e[0].aoData[this[0]]._aData=t;E(e[0],this[0],"data");return this});Ke("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null});Ke("row.add()",function(e){e instanceof t&&e.length&&(e=e[0]);var n=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?w(t,e)[0]:x(t,e)});return this.row(n[0])});var In=function(e,n,r,i){var o=[],a=function(n,r){if(n.nodeName&&"tr"===n.nodeName.toLowerCase())o.push(n);else{var i=t("<tr><td/></tr>").addClass(r);t("td",i).addClass(r).html(n)[0].colSpan=m(e);o.push(i[0])}};if(t.isArray(r)||r instanceof t)for(var s=0,l=r.length;l>s;s++)a(r[s],i);else a(r,i);n._details&&n._details.remove();n._details=t(o);n._detailsShow&&n._details.insertAfter(n.nTr)},Pn=function(t){var e=t.context;if(e.length&&t.length){var n=e[0].aoData[t[0]];if(n._details){n._details.remove();n._detailsShow=o;n._details=o}}},Hn=function(t,e){var n=t.context;if(n.length&&t.length){var r=n[0].aoData[t[0]];if(r._details){r._detailsShow=e;e?r._details.insertAfter(r.nTr):r._details.detach();On(n[0])}}},On=function(t){var e=new Je(t),n=".dt.DT_details",r="draw"+n,i="column-visibility"+n,o="destroy"+n,a=t.aoData;e.off(r+" "+i+" "+o);if(dn(a,"_details").length>0){e.on(r,function(n,r){t===r&&e.rows({page:"current"}).eq(0).each(function(t){var e=a[t];e._detailsShow&&e._details.insertAfter(e.nTr)})});e.on(i,function(e,n){if(t===n)for(var r,i=m(n),o=0,s=a.length;s>o;o++){r=a[o];r._details&&r._details.children("td[colspan]").attr("colspan",i)}});e.on(o,function(e,n){if(t===n)for(var r=0,i=a.length;i>r;r++)a[r]._details&&Pn(a[r])})}},Rn="",Fn=Rn+"row().child",Wn=Fn+"()";Ke(Wn,function(t,e){var n=this.context;if(t===o)return n.length&&this.length?n[0].aoData[this[0]]._details:o;t===!0?this.child.show():t===!1?Pn(this):n.length&&this.length&&In(n[0],n[0].aoData[this[0]],t,e);return this});Ke([Fn+".show()",Wn+".show()"],function(){Hn(this,!0);return this});Ke([Fn+".hide()",Wn+".hide()"],function(){Hn(this,!1);return this});Ke([Fn+".remove()",Wn+".remove()"],function(){Pn(this);return this});Ke(Fn+".isShown()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]]._detailsShow||!1:!1});var zn=/^(.+):(name|visIdx|visible)$/,qn=function(e,n){var r=e.aoColumns,i=dn(r,"sName"),o=dn(r,"nTh");return Ln(n,function(n){var a=ln(n);if(""===n)return gn(r.length);if(null!==a)return[a>=0?a:r.length+a];var s="string"==typeof n?n.match(zn):"";if(!s)return t(o).filter(n).map(function(){return t.inArray(this,o)}).toArray();switch(s[2]){case"visIdx":case"visible":var l=parseInt(s[1],10);if(0>l){var u=t.map(r,function(t,e){return t.bVisible?e:null});return[u[u.length+l]]}return[p(e,l)];case"name":return t.map(i,function(t,e){return t===s[1]?e:null})}})},Un=function(e,n,r,i){var a,s,l,u,c=e.aoColumns,f=c[n],h=e.aoData;if(r===o)return f.bVisible;if(f.bVisible!==r){if(r){var p=t.inArray(!0,dn(c,"bVisible"),n+1);for(s=0,l=h.length;l>s;s++){u=h[s].nTr;a=h[s].anCells;u&&u.insertBefore(a[n],a[p]||null)}}else t(dn(e.aoData,"anCells",n)).detach();f.bVisible=r;O(e,e.aoHeader);O(e,e.aoFooter);if(i===o||i){d(e);(e.oScroll.sX||e.oScroll.sY)&&me(e)}ze(e,null,"column-visibility",[e,n,r]);je(e)}};Ke("columns()",function(e,n){if(e===o)e="";else if(t.isPlainObject(e)){n=e;e=""}n=An(n);var r=this.iterator("table",function(t){return qn(t,e,n)});r.selector.cols=e;r.selector.opts=n;return r});Ze("columns().header()","column().header()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh})});Ze("columns().footer()","column().footer()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf})});Ze("columns().data()","column().data()",function(){return this.iterator("column-rows",function(t,e,n,r,i){for(var o=[],a=0,s=i.length;s>a;a++)o.push(T(t,i[a],e,""));return o})});Ze("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,n,r,i,o){return pn(e.aoData,o,"search"===t?"_aFilterData":"_aSortData",n)})});Ze("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,r,i){return pn(t.aoData,i,"anCells",e)})});Ze("columns().visible()","column().visible()",function(t,e){return this.iterator("column",function(n,r){return t===o?n.aoColumns[r].bVisible:Un(n,r,t,e)})});Ze("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,n){return"visible"===t?g(e,n):n})});Ke("columns.adjust()",function(){return this.iterator("table",function(t){d(t)})});Ke("column.index()",function(t,e){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===t||"toData"===t)return p(n,e);if("fromData"===t||"toVisible"===t)return g(n,e)}});Ke("column()",function(t,e){return Nn(this.columns(t,e))});var Bn=function(e,n,r){var i,a,s,l,u,c=e.aoData,f=En(e,r),h=pn(c,f,"anCells"),d=t([].concat.apply([],h)),p=e.aoColumns.length;return Ln(n,function(e){if(null===e||e===o){a=[];for(s=0,l=f.length;l>s;s++){i=f[s];for(u=0;p>u;u++)a.push({row:i,column:u})}return a}return t.isPlainObject(e)?[e]:d.filter(e).map(function(e,n){i=n.parentNode._DT_RowIndex;return{row:i,column:t.inArray(n,c[i].anCells)}}).toArray()})};Ke("cells()",function(e,n,r){if(t.isPlainObject(e))if(typeof e.row!==o){r=n;n=null}else{r=e;e=null}if(t.isPlainObject(n)){r=n;n=null}if(null===n||n===o)return this.iterator("table",function(t){return Bn(t,e,An(r))});var i,a,s,l,u,c=this.columns(n,r),f=this.rows(e,r),h=this.iterator("table",function(t,e){i=[];for(a=0,s=f[e].length;s>a;a++)for(l=0,u=c[e].length;u>l;l++)i.push({row:f[e][a],column:c[e][l]});return i});t.extend(h.selector,{cols:n,rows:e,opts:r});return h});Ze("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,n){return t.aoData[e].anCells[n]})});Ke("cells().data()",function(){return this.iterator("cell",function(t,e,n){return T(t,e,n)})});Ze("cells().cache()","cell().cache()",function(t){t="search"===t?"_aFilterData":"_aSortData";return this.iterator("cell",function(e,n,r){return e.aoData[n][t][r]})});Ze("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:g(t,n)}})});Ke(["cells().invalidate()","cell().invalidate()"],function(t){var e=this.selector;this.rows(e.rows,e.opts).invalidate(t);return this});Ke("cell()",function(t,e,n){return Nn(this.cells(t,e,n))});Ke("cell().data()",function(t){var e=this.context,n=this[0];if(t===o)return e.length&&n.length?T(e[0],n[0].row,n[0].column):o;k(e[0],n[0].row,n[0].column,t);E(e[0],n[0].row,"data",n[0].column);return this});Ke("order()",function(e,n){var r=this.context;if(e===o)return 0!==r.length?r[0].aaSorting:o;"number"==typeof e?e=[[e,n]]:t.isArray(e[0])||(e=Array.prototype.slice.call(arguments));return this.iterator("table",function(t){t.aaSorting=e.slice()})});Ke("order.listener()",function(t,e,n){return this.iterator("table",function(r){Ae(r,t,e,n)})});Ke(["columns().order()","column().order()"],function(e){var n=this;return this.iterator("table",function(r,i){var o=[];t.each(n[i],function(t,n){o.push([n,e])});r.aaSorting=o})});Ke("search()",function(e,n,r,i){var a=this.context;return e===o?0!==a.length?a[0].oPreviousSearch.sSearch:o:this.iterator("table",function(o){o.oFeatures.bFilter&&Y(o,t.extend({},o.oPreviousSearch,{sSearch:e+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i}),1)})});Ze("columns().search()","column().search()",function(e,n,r,i){return this.iterator("column",function(a,s){var l=a.aoPreSearchCols;if(e===o)return l[s].sSearch;if(a.oFeatures.bFilter){t.extend(l[s],{sSearch:e+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i});Y(a,a.oPreviousSearch,1)}})});Ke("state()",function(){return this.context.length?this.context[0].oSavedState:null});Ke("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})});Ke("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});Ke("state.save()",function(){return this.iterator("table",function(t){je(t)})});$e.versionCheck=$e.fnVersionCheck=function(t){for(var e,n,r=$e.version.split("."),i=t.split("."),o=0,a=i.length;a>o;o++){e=parseInt(r[o],10)||0;n=parseInt(i[o],10)||0;if(e!==n)return e>n}return!0};$e.isDataTable=$e.fnIsDataTable=function(e){var n=t(e).get(0),r=!1; t.each($e.settings,function(t,e){(e.nTable===n||e.nScrollHead===n||e.nScrollFoot===n)&&(r=!0)});return r};$e.tables=$e.fnTables=function(e){return jQuery.map($e.settings,function(n){return!e||e&&t(n.nTable).is(":visible")?n.nTable:void 0})};$e.camelToHungarian=r;Ke("$()",function(e,n){var r=this.rows(n).nodes(),i=t(r);return t([].concat(i.filter(e).toArray(),i.find(e).toArray()))});t.each(["on","one","off"],function(e,n){Ke(n+"()",function(){var e=Array.prototype.slice.call(arguments);e[0].match(/\.dt\b/)||(e[0]+=".dt");var r=t(this.tables().nodes());r[n].apply(r,e);return this})});Ke("clear()",function(){return this.iterator("table",function(t){A(t)})});Ke("settings()",function(){return new Je(this.context,this.context)});Ke("data()",function(){return this.iterator("table",function(t){return dn(t.aoData,"_aData")}).flatten()});Ke("destroy()",function(e){e=e||!1;return this.iterator("table",function(r){var i,o=r.nTableWrapper.parentNode,a=r.oClasses,s=r.nTable,l=r.nTBody,u=r.nTHead,c=r.nTFoot,f=t(s),h=t(l),d=t(r.nTableWrapper),p=t.map(r.aoData,function(t){return t.nTr});r.bDestroying=!0;ze(r,"aoDestroyCallback","destroy",[r]);e||new Je(r).columns().visible(!0);d.unbind(".DT").find(":not(tbody *)").unbind(".DT");t(n).unbind(".DT-"+r.sInstance);if(s!=u.parentNode){f.children("thead").detach();f.append(u)}if(c&&s!=c.parentNode){f.children("tfoot").detach();f.append(c)}f.detach();d.detach();r.aaSorting=[];r.aaSortingFixed=[];Ne(r);t(p).removeClass(r.asStripeClasses.join(" "));t("th, td",u).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone);if(r.bJUI){t("th span."+a.sSortIcon+", td span."+a.sSortIcon,u).detach();t("th, td",u).each(function(){var e=t("div."+a.sSortJUIWrapper,this);t(this).append(e.contents());e.detach()})}!e&&o&&o.insertBefore(s,r.nTableReinsertBefore);h.children().detach();h.append(p);f.css("width",r.sDestroyWidth).removeClass(a.sTable);i=r.asDestroyStripes.length;i&&h.children().each(function(e){t(this).addClass(r.asDestroyStripes[e%i])});var g=t.inArray(r,$e.settings);-1!==g&&$e.settings.splice(g,1)})});$e.version="1.10.2";$e.settings=[];$e.models={};$e.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};$e.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null};$e.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};$e.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(e){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(n){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:t.extend({},$e.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null};e($e.defaults);$e.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};e($e.defaults.column);$e.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:o,oAjaxData:o,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Be(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Be(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,r=this.aiDisplay.length,i=this.oFeatures,o=i.bPaginate;return i.bServerSide?o===!1||-1===t?e+r:Math.min(e+t,this._iRecordsDisplay):!o||n>r||-1===t?r:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}};$e.ext=Ye={classes:{},errMode:"alert",feature:[],search:[],internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:$e.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:$e.version};t.extend(Ye,{afnFiltering:Ye.search,aTypes:Ye.type.detect,ofnSearch:Ye.type.search,oSort:Ye.type.order,afnSortData:Ye.order,aoFeatures:Ye.feature,oApi:Ye.internal,oStdClasses:Ye.classes,oPagination:Ye.pager});t.extend($e.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});(function(){var e="";e="";var n=e+"ui-state-default",r=e+"css_right ui-icon ui-icon-",i=e+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";t.extend($e.ext.oJUIClasses,$e.ext.classes,{sPageButton:"fg-button ui-button "+n,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:n+" sorting_asc",sSortDesc:n+" sorting_desc",sSortable:n+" sorting",sSortableAsc:n+" sorting_asc_disabled",sSortableDesc:n+" sorting_desc_disabled",sSortableNone:n+" sorting_disabled",sSortJUIAsc:r+"triangle-1-n",sSortJUIDesc:r+"triangle-1-s",sSortJUI:r+"carat-2-n-s",sSortJUIAscAllowed:r+"carat-1-n",sSortJUIDescAllowed:r+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+n,sScrollFoot:"dataTables_scrollFoot "+n,sHeaderTH:n,sFooterTH:n,sJUIHeader:i+" ui-corner-tl ui-corner-tr",sJUIFooter:i+" ui-corner-bl ui-corner-br"})})();var Vn=$e.ext.pager;t.extend(Vn,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},simple_numbers:function(t,e){return["previous",Ve(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Ve(t,e),"next","last"]},_numbers:Ve,numbers_length:7});t.extend(!0,$e.ext.renderer,{pageButton:{_:function(e,n,r,o,a,s){var l,u,c=e.oClasses,f=e.oLanguage.oPaginate,h=0,d=function(n,i){var o,p,g,m,v=function(t){he(e,t.data.action,!0)};for(o=0,p=i.length;p>o;o++){m=i[o];if(t.isArray(m)){var y=t("<"+(m.DT_el||"div")+"/>").appendTo(n);d(y,m)}else{l="";u="";switch(m){case"ellipsis":n.append("<span>&hellip;</span>");break;case"first":l=f.sFirst;u=m+(a>0?"":" "+c.sPageButtonDisabled);break;case"previous":l=f.sPrevious;u=m+(a>0?"":" "+c.sPageButtonDisabled);break;case"next":l=f.sNext;u=m+(s-1>a?"":" "+c.sPageButtonDisabled);break;case"last":l=f.sLast;u=m+(s-1>a?"":" "+c.sPageButtonDisabled);break;default:l=m+1;u=a===m?c.sPageButtonActive:""}if(l){g=t("<a>",{"class":c.sPageButton+" "+u,"aria-controls":e.sTableId,"data-dt-idx":h,tabindex:e.iTabIndex,id:0===r&&"string"==typeof m?e.sTableId+"_"+m:null}).html(l).appendTo(n);Fe(g,{action:m},v);h++}}}};try{var p=t(i.activeElement).data("dt-idx");d(t(n).empty(),o);null!==p&&t(n).find("[data-dt-idx="+p+"]").focus()}catch(g){}}}});var Xn=function(t,e,n,r){if(!t||"-"===t)return-1/0;e&&(t=un(t,e));if(t.replace){n&&(t=t.replace(n,""));r&&(t=t.replace(r,""))}return 1*t};t.extend(Ye.type.order,{"date-pre":function(t){return Date.parse(t)||0},"html-pre":function(t){return sn(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return sn(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return e>t?-1:t>e?1:0},"string-desc":function(t,e){return e>t?1:t>e?-1:0}});Xe("");t.extend($e.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return cn(t,n)?"num"+n:null},function(t){if(t&&(!nn.test(t)||!rn.test(t)))return null;var e=Date.parse(t);return null!==e&&!isNaN(e)||sn(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return cn(t,n,!0)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return hn(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return hn(t,n,!0)?"html-num-fmt"+n:null},function(t){return sn(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]);t.extend($e.ext.type.search,{html:function(t){return sn(t)?t:"string"==typeof t?t.replace(tn," ").replace(en,""):""},string:function(t){return sn(t)?t:"string"==typeof t?t.replace(tn," "):t}});t.extend(!0,$e.ext.renderer,{header:{_:function(e,n,r,i){t(e.nTable).on("order.dt.DT",function(t,o,a,s){if(e===o){var l=r.idx;n.removeClass(r.sSortingClass+" "+i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[l]?i.sSortAsc:"desc"==s[l]?i.sSortDesc:r.sSortingClass)}})},jqueryui:function(e,n,r,i){var o=r.idx;t("<div/>").addClass(i.sSortJUIWrapper).append(n.contents()).append(t("<span/>").addClass(i.sSortIcon+" "+r.sSortingClassJUI)).appendTo(n);t(e.nTable).on("order.dt.DT",function(t,a,s,l){if(e===a){n.removeClass(i.sSortAsc+" "+i.sSortDesc).addClass("asc"==l[o]?i.sSortAsc:"desc"==l[o]?i.sSortDesc:r.sSortingClass);n.find("span."+i.sSortIcon).removeClass(i.sSortJUIAsc+" "+i.sSortJUIDesc+" "+i.sSortJUI+" "+i.sSortJUIAscAllowed+" "+i.sSortJUIDescAllowed).addClass("asc"==l[o]?i.sSortJUIAsc:"desc"==l[o]?i.sSortJUIDesc:r.sSortingClassJUI)}})}}});$e.render={number:function(t,e,n,r){return{display:function(i){var o=0>i?"-":"";i=Math.abs(parseFloat(i));var a=parseInt(i,10),s=n?e+(i-a).toFixed(n).substring(2):"";return o+(r||"")+a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+s}}}};t.extend($e.ext.internal,{_fnExternApiFunc:Ge,_fnBuildAjax:U,_fnAjaxUpdate:B,_fnAjaxParameters:V,_fnAjaxUpdateDraw:X,_fnAjaxDataSrc:G,_fnAddColumn:f,_fnColumnOptions:h,_fnAdjustColumnSizing:d,_fnVisibleToColumnIndex:p,_fnColumnIndexToVisible:g,_fnVisbleColumns:m,_fnGetColumns:v,_fnColumnTypes:y,_fnApplyColumnDefs:b,_fnHungarianMap:e,_fnCamelToHungarian:r,_fnLanguageCompat:a,_fnBrowserDetect:u,_fnAddData:x,_fnAddTr:w,_fnNodeToDataIndex:C,_fnNodeToColumnIndex:S,_fnGetCellData:T,_fnSetCellData:k,_fnSplitObjNotation:_,_fnGetObjectDataFn:M,_fnSetObjectDataFn:D,_fnGetDataMaster:L,_fnClearTable:A,_fnDeleteIndex:N,_fnInvalidateRow:E,_fnGetRowElements:j,_fnCreateTr:I,_fnBuildHead:H,_fnDrawHead:O,_fnDraw:R,_fnReDraw:F,_fnAddOptionsHtml:W,_fnDetectHeader:z,_fnGetUniqueThs:q,_fnFeatureHtmlFilter:$,_fnFilterComplete:Y,_fnFilterCustom:J,_fnFilterColumn:K,_fnFilter:Z,_fnFilterCreateSearch:Q,_fnEscapeRegex:te,_fnFilterData:ee,_fnFeatureHtmlInfo:ie,_fnUpdateInfo:oe,_fnInfoMacros:ae,_fnInitialise:se,_fnInitComplete:le,_fnLengthChange:ue,_fnFeatureHtmlLength:ce,_fnFeatureHtmlPaginate:fe,_fnPageChange:he,_fnFeatureHtmlProcessing:de,_fnProcessingDisplay:pe,_fnFeatureHtmlTable:ge,_fnScrollDraw:me,_fnApplyToChildren:ve,_fnCalculateColumnWidths:ye,_fnThrottle:be,_fnConvertToWidth:xe,_fnScrollingWidthAdjust:we,_fnGetWidestNode:Ce,_fnGetMaxLenString:Se,_fnStringToCss:Te,_fnScrollBarWidth:ke,_fnSortFlatten:_e,_fnSort:Me,_fnSortAria:De,_fnSortListener:Le,_fnSortAttachListener:Ae,_fnSortingClasses:Ne,_fnSortData:Ee,_fnSaveState:je,_fnLoadState:Ie,_fnSettingsFromNode:Pe,_fnLog:He,_fnMap:Oe,_fnBindAction:Fe,_fnCallbackReg:We,_fnCallbackFire:ze,_fnLengthOverflow:qe,_fnRenderer:Ue,_fnDataSource:Be,_fnRowAttributes:P,_fnCalculateEnd:function(){}});t.fn.dataTable=$e;t.fn.dataTableSettings=$e.settings;t.fn.dataTableExt=$e.ext;t.fn.DataTable=function(e){return t(this).dataTable(e).api()};t.each($e,function(e,n){t.fn.DataTable[e]=n});return t.fn.dataTable})})(window,document)},{jquery:19}],3:[function(t){var e,n=t("jquery"),r=n(document),i=n("head"),o=null,a=[],s=0,l="id",u="px",c="JColResizer",f=parseInt,h=Math,d=navigator.userAgent.indexOf("Trident/4.0")>0;try{e=sessionStorage}catch(p){}i.append("<style type='text/css'> .JColResizer{table-layout:fixed;} .JColResizer td, .JColResizer th{overflow:hidden;padding-left:0!important; padding-right:0!important;} .JCLRgrips{ height:0px; position:relative;} .JCLRgrip{margin-left:-5px; position:absolute; z-index:5; } .JCLRgrip .JColResizer{position:absolute;background-color:red;filter:alpha(opacity=1);opacity:0;width:10px;height:100%;top:0px} .JCLRLastGrip{position:absolute; width:1px; } .JCLRgripDrag{ border-left:1px dotted black; }</style>");var g=function(t,e){var r=n(t);if(e.disable)return m(r);var i=r.id=r.attr(l)||c+s++;r.p=e.postbackSafe;if(r.is("table")&&!a[i]){r.addClass(c).attr(l,i).before('<div class="JCLRgrips"/>');r.opt=e;r.g=[];r.c=[];r.w=r.width();r.gc=r.prev();e.marginLeft&&r.gc.css("marginLeft",e.marginLeft);e.marginRight&&r.gc.css("marginRight",e.marginRight);r.cs=f(d?t.cellSpacing||t.currentStyle.borderSpacing:r.css("border-spacing"))||2;r.b=f(d?t.border||t.currentStyle.borderLeftWidth:r.css("border-left-width"))||1;a[i]=r;v(r)}},m=function(t){var e=t.attr(l),t=a[e];if(t&&t.is("table")){t.removeClass(c).gc.remove();delete a[e]}},v=function(t){var r=t.find(">thead>tr>th,>thead>tr>td");r.length||(r=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"));t.cg=t.find("col");t.ln=r.length;t.p&&e&&e[t.id]&&y(t,r);r.each(function(e){var r=n(this),i=n(t.gc.append('<div class="JCLRgrip"></div>')[0].lastChild);i.t=t;i.i=e;i.c=r;r.w=r.width();t.g.push(i);t.c.push(r);r.width(r.w).removeAttr("width");e<t.ln-1?i.bind("touchstart mousedown",S).append(t.opt.gripInnerHtml).append('<div class="'+c+'" style="cursor:'+t.opt.hoverCursor+'"></div>'):i.addClass("JCLRLastGrip").removeClass("JCLRgrip");i.data(c,{i:e,t:t.attr(l)})});t.cg.removeAttr("width");b(t);t.find("td, th").not(r).not("table th, table td").each(function(){n(this).removeAttr("width")})},y=function(t,n){var r,i=0,o=0,a=[];if(n){t.cg.removeAttr("width");if(t.opt.flush){e[t.id]="";return}r=e[t.id].split(";");for(;o<t.ln;o++){a.push(100*r[o]/r[t.ln]+"%");n.eq(o).css("width",a[o])}for(o=0;o<t.ln;o++)t.cg.eq(o).css("width",a[o])}else{e[t.id]="";for(;o<t.c.length;o++){r=t.c[o].width();e[t.id]+=r+";";i+=r}e[t.id]+=i}},b=function(t){t.gc.width(t.w);for(var e=0;e<t.ln;e++){var n=t.c[e];t.g[e].css({left:n.offset().left-t.offset().left+n.outerWidth(!1)+t.cs/2+u,height:t.opt.headerOnly?t.c[0].outerHeight(!1):t.outerHeight(!1)})}},x=function(t,e,n){var r=o.x-o.l,i=t.c[e],a=t.c[e+1],s=i.w+r,l=a.w-r;i.width(s+u);a.width(l+u);t.cg.eq(e).width(s+u);t.cg.eq(e+1).width(l+u);if(n){i.w=s;a.w=l}},w=function(t){if(o){var e=o.t;if(t.originalEvent.touches)var n=t.originalEvent.touches[0].pageX-o.ox+o.l;else var n=t.pageX-o.ox+o.l;var r=e.opt.minWidth,i=o.i,a=1.5*e.cs+r+e.b,s=i==e.ln-1?e.w-a:e.g[i+1].position().left-e.cs-r,l=i?e.g[i-1].position().left+e.cs+r:a;n=h.max(l,h.min(s,n));o.x=n;o.css("left",n+u);if(e.opt.liveDrag){x(e,i);b(e);var c=e.opt.onDrag;if(c){t.currentTarget=e[0];c(t)}}return!1}},C=function(t){r.unbind("touchend."+c+" mouseup."+c).unbind("touchmove."+c+" mousemove."+c);n("head :last-child").remove();if(o){o.removeClass(o.t.opt.draggingClass);var i=o.t,a=i.opt.onResize;if(o.x){x(i,o.i,!0);b(i);if(a){t.currentTarget=i[0];a(t)}}i.p&&e&&y(i);o=null}},S=function(t){var e=n(this).data(c),s=a[e.t],l=s.g[e.i];l.ox=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX;l.l=l.position().left;r.bind("touchmove."+c+" mousemove."+c,w).bind("touchend."+c+" mouseup."+c,C);i.append("<style type='text/css'>*{cursor:"+s.opt.dragCursor+"!important}</style>");l.addClass(s.opt.draggingClass);o=l;if(s.c[e.i].l)for(var u,f=0;f<s.ln;f++){u=s.c[f];u.l=!1;u.w=u.width()}return!1},T=function(){for(e in a){var t,e=a[e],n=0;e.removeClass(c);if(e.w!=e.width()){e.w=e.width();for(t=0;t<e.ln;t++)n+=e.c[t].w;for(t=0;t<e.ln;t++)e.c[t].css("width",h.round(1e3*e.c[t].w/n)/10+"%").l=!0}b(e.addClass(c))}};n(window).bind("resize."+c,T);n.fn.extend({colResizable:function(t){var e={draggingClass:"JCLRgripDrag",gripInnerHtml:"",liveDrag:!1,minWidth:15,headerOnly:!1,hoverCursor:"e-resize",dragCursor:"e-resize",postbackSafe:!1,flush:!1,marginLeft:null,marginRight:null,disable:!1,onDrag:null,onResize:null},t=n.extend(e,t);return this.each(function(){g(this,t)})}})},{jquery:19}],4:[function(t){RegExp.escape=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};var e=t("jquery");e.csv={defaults:{separator:",",delimiter:'"',headers:!0},hooks:{castToScalar:function(t){var e=/\./;if(isNaN(t))return t;if(e.test(t))return parseFloat(t);var n=parseInt(t);return isNaN(n)?null:n}},parsers:{parse:function(t,e){function n(){l=0;u="";if(e.start&&e.state.rowNum<e.start){s=[];e.state.rowNum++;e.state.colNum=1}else{if(void 0===e.onParseEntry)a.push(s);else{var t=e.onParseEntry(s,e.state);t!==!1&&a.push(t)}s=[];e.end&&e.state.rowNum>=e.end&&(c=!0);e.state.rowNum++;e.state.colNum=1}}function r(){if(void 0===e.onParseValue)s.push(u);else{var t=e.onParseValue(u,e.state);t!==!1&&s.push(t)}u="";l=0;e.state.colNum++}var i=e.separator,o=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var a=[],s=[],l=0,u="",c=!1,f=RegExp.escape(i),h=RegExp.escape(o),d=/(D|S|\n|\r|[^DS\r\n]+)/,p=d.source;p=p.replace(/S/g,f);p=p.replace(/D/g,h);d=RegExp(p,"gm");t.replace(d,function(t){if(!c)switch(l){case 0:if(t===i){u+="";r();break}if(t===o){l=1;break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;u+=t;l=3;break;case 1:if(t===o){l=2;break}u+=t;l=1;break;case 2:if(t===o){u+=t;l=1;break}if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;if(t===o)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});if(0!==s.length){r();n()}return a},splitLines:function(t,e){function n(){a=0;if(e.start&&e.state.rowNum<e.start){s="";e.state.rowNum++}else{if(void 0===e.onParseEntry)o.push(s);else{var t=e.onParseEntry(s,e.state);t!==!1&&o.push(t)}s="";e.end&&e.state.rowNum>=e.end&&(l=!0);e.state.rowNum++}}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);var o=[],a=0,s="",l=!1,u=RegExp.escape(r),c=RegExp.escape(i),f=/(D|S|\n|\r|[^DS\r\n]+)/,h=f.source;h=h.replace(/S/g,u);h=h.replace(/D/g,c);f=RegExp(h,"gm");t.replace(f,function(t){if(!l)switch(a){case 0:if(t===r){s+=t;a=0;break}if(t===i){s+=t;a=1;break}if("\n"===t){n();break}if(/^\r$/.test(t))break;s+=t;a=3;break;case 1:if(t===i){s+=t;a=2;break}s+=t;a=1;break;case 2:var o=s.substr(s.length-1);if(t===i&&o===i){s+=t;a=1;break}if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");case 3:if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal quote [Row:"+e.state.rowNum+"]");throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");default:throw new Error("CSVDataError: Unknown state [Row:"+e.state.rowNum+"]")}});""!==s&&n();return o},parseEntry:function(t,e){function n(){if(void 0===e.onParseValue)o.push(s);else{var t=e.onParseValue(s,e.state);t!==!1&&o.push(t)}s="";a=0;e.state.colNum++}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var o=[],a=0,s="";if(!e.match){var l=RegExp.escape(r),u=RegExp.escape(i),c=/(D|S|\n|\r|[^DS\r\n]+)/,f=c.source;f=f.replace(/S/g,l);f=f.replace(/D/g,u);e.match=RegExp(f,"gm")}t.replace(e.match,function(t){switch(a){case 0:if(t===r){s+="";n();break}if(t===i){a=1;break}if("\n"===t||"\r"===t)break;s+=t;a=3;break;case 1:if(t===i){a=2;break}s+=t;a=1;break;case 2:if(t===i){s+=t;a=1;break}if(t===r){n();break}if("\n"===t||"\r"===t)break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===r){n();break}if("\n"===t||"\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});n();return o}},toArray:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;var o=void 0!==n.state?n.state:{},n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,state:o},a=e.csv.parsers.parseEntry(t,n);if(!i.callback)return a;i.callback("",a);return void 0},toArrays:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;var o=[],n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,start:n.start,end:n.end,state:{rowNum:1,colNum:1}};o=e.csv.parsers.parse(t,n);if(!i.callback)return o;i.callback("",o);return void 0},toObjects:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;i.headers="headers"in n?n.headers:e.csv.defaults.headers;n.start="start"in n?n.start:1;i.headers&&n.start++;n.end&&i.headers&&n.end++;var o=[],a=[],n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,start:n.start,end:n.end,state:{rowNum:1,colNum:1},match:!1},s={delimiter:i.delimiter,separator:i.separator,start:1,end:1,state:{rowNum:1,colNum:1}},l=e.csv.parsers.splitLines(t,s),u=e.csv.toArray(l[0],n),o=e.csv.parsers.splitLines(t,n);n.state.colNum=1;n.state.rowNum=u?2:1;for(var c=0,f=o.length;f>c;c++){var h=e.csv.toArray(o[c],n),d={};for(var p in u)d[u[p]]=h[p];a.push(d);n.state.rowNum++}if(!i.callback)return a;i.callback("",a);return void 0},fromArrays:function(t,n,r){var n=void 0!==n?n:{},o={};o.callback=void 0!==r&&"function"==typeof r?r:!1;o.separator="separator"in n?n.separator:e.csv.defaults.separator;o.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;o.escaper="escaper"in n?n.escaper:e.csv.defaults.escaper;o.experimental="experimental"in n?n.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(t[i]);if(!o.callback)return a;o.callback("",a);return void 0},fromObjects2CSV:function(t,n,r){var n=void 0!==n?n:{},o={};o.callback=void 0!==r&&"function"==typeof r?r:!1;o.separator="separator"in n?n.separator:e.csv.defaults.separator;o.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;o.experimental="experimental"in n?n.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(arrays[i]);if(!o.callback)return a;o.callback("",a);return void 0}};e.csvEntry2Array=e.csv.toArray;e.csv2Array=e.csv.toArrays;e.csv2Dictionary=e.csv.toObjects},{jquery:19}],5:[function(t,e){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}e.exports=n;n.EventEmitter=n;n.prototype._events=void 0;n.prototype._maxListeners=void 0;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");this._maxListeners=t;return this};n.prototype.emit=function(t){var e,n,i,s,l,u;this._events||(this._events={});if("error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){e=arguments[1];if(e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}n=this._events[t];if(a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;s=new Array(i-1);for(l=1;i>l;l++)s[l-1]=arguments[l];n.apply(this,s)}else if(o(n)){i=arguments.length;s=new Array(i-1);for(l=1;i>l;l++)s[l-1]=arguments[l];u=n.slice();i=u.length;for(l=0;i>l;l++)u[l].apply(this,s)}return!0};n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");this._events||(this._events={});this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e);this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e;if(o(this._events[t])&&!this._events[t].warned){var i;i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners;if(i&&i>0&&this._events[t].length>i){this._events[t].warned=!0;console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length);"function"==typeof console.trace&&console.trace()}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(t,e){function n(){this.removeListener(t,n);if(!i){i=!0;e.apply(this,arguments)}}if(!r(e))throw TypeError("listener must be a function");var i=!1;n.listener=e;this.on(t,n);return this};n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;n=this._events[t];a=n.length;i=-1;if(n===e||r(n.listener)&&n.listener===e){delete this._events[t];this._events.removeListener&&this.emit("removeListener",t,e)}else if(o(n)){for(s=a;s-->0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;if(1===n.length){n.length=0;delete this._events[t]}else n.splice(i,1);this._events.removeListener&&this.emit("removeListener",t,e)}return this};n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener){0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this}if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener");this._events={};return this}n=this._events[t];if(r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t];return this};n.prototype.listeners=function(t){var e;e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[];return e};n.listenerCount=function(t,e){var n;n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0;return n}},{}],6:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){function e(t,e,r,i){var o=t.getLineHandle(e.line),l=e.ch-1,u=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(r&&c>0!=(l==e.ch))return null;var f=t.getTokenTypeAt(a(e.line,l+1)),h=n(t,a(e.line,l+(c>0?1:0)),c,f||null,i);return null==h?null:{from:a(e.line,l),to:h&&h.pos,match:h&&h.ch==u.charAt(0),forward:c>0}}function n(t,e,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,u=[],c=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),h=e.line;h!=f;h+=n){var d=t.getLine(h);if(d){var p=n>0?0:d.length-1,g=n>0?d.length:-1;if(!(d.length>o)){h==e.line&&(p=e.ch-(0>n?1:0));for(;p!=g;p+=n){var m=d.charAt(p);if(c.test(m)&&(void 0===r||t.getTokenTypeAt(a(h,p+1))==r)){var v=s[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:a(h,p),ch:m};u.pop()}}}}}}return h-n==(n>0?t.lastLine():t.firstLine())?!1:null}function r(t,n,r){for(var i=t.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=t.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&e(t,l[u].head,!1,r);if(c&&t.getLine(c.from.line).length<=i){var f=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(t.markText(c.from,a(c.from.line,c.from.ch+1),{className:f}));c.to&&t.getLine(c.to.line).length<=i&&s.push(t.markText(c.to,a(c.to.line,c.to.ch+1),{className:f}))}}if(s.length){o&&t.state.focused&&t.display.input.focus(); var h=function(){t.operation(function(){for(var t=0;t<s.length;t++)s[t].clear()})};if(!n)return h;setTimeout(h,800)}}function i(t){t.operation(function(){if(l){l();l=null}l=r(t,!1,t.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=t.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;t.defineOption("matchBrackets",!1,function(e,n,r){r&&r!=t.Init&&e.off("cursorActivity",i);if(n){e.state.matchBrackets="object"==typeof n?n:{};e.on("cursorActivity",i)}});t.defineExtension("matchBrackets",function(){r(this,!0)});t.defineExtension("findMatchingBracket",function(t,n,r){return e(this,t,n,r)});t.defineExtension("scanForBracket",function(t,e,r,i){return n(this,t,e,r,i)})})},{"../../lib/codemirror":11}],7:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.registerHelper("fold","brace",function(e,n){function r(r){for(var i=n.ch,l=0;;){var u=0>=i?-1:s.lastIndexOf(r,i-1);if(-1!=u){if(1==l&&u<n.ch)break;o=e.getTokenTypeAt(t.Pos(a,u+1));if(!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==l)break;l=1;i=s.length}}}var i,o,a=n.line,s=e.getLine(a),l="{",u="}",i=r("{");if(null==i){l="[",u="]";i=r("[")}if(null!=i){var c,f,h=1,d=e.lastLine();t:for(var p=a;d>=p;++p)for(var g=e.getLine(p),m=p==a?i:0;;){var v=g.indexOf(l,m),y=g.indexOf(u,m);0>v&&(v=g.length);0>y&&(y=g.length);m=Math.min(v,y);if(m==g.length)break;if(e.getTokenTypeAt(t.Pos(p,m+1))==o)if(m==v)++h;else if(!--h){c=p;f=m;break t}++m}if(null!=c&&(a!=c||f!=i))return{from:t.Pos(a,i),to:t.Pos(c,f)}}});t.registerHelper("fold","import",function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));if("keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(e.lastLine(),n+10);o>=i;++i){var a=e.getLine(i),s=a.indexOf(";");if(-1!=s)return{startCh:r.end,end:t.Pos(i,s)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var s=r(a.line+1);if(null==s)break;a=s.end}return{from:e.clipPos(t.Pos(n,o.startCh+1)),to:a}});t.registerHelper("fold","include",function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));return"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:t.Pos(n,i+1),to:e.clipPos(t.Pos(o))}})})},{"../../lib/codemirror":11}],8:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(e,i,o,a){function s(t){var n=l(e,i);if(!n||n.to.line-n.from.line<u)return null;for(var r=e.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!t)return null;n.cleared=!0;r[o].clear()}return n}if(o&&o.call){var l=o;o=null}else var l=r(e,o,"rangeFinder");"number"==typeof i&&(i=t.Pos(i,0));var u=r(e,o,"minFoldSize"),c=s(!0);if(r(e,o,"scanUp"))for(;!c&&i.line>e.firstLine();){i=t.Pos(i.line-1,0);c=s(!1)}if(c&&!c.cleared&&"unfold"!==a){var f=n(e,o);t.on(f,"mousedown",function(e){h.clear();t.e_preventDefault(e)});var h=e.markText(c.from,c.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(n,r){t.signal(e,"unfold",e,n,r)});t.signal(e,"fold",e,c.from,c.to)}}function n(t,e){var n=r(t,e,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span");n.appendChild(i);n.className="CodeMirror-foldmarker"}return n}function r(t,e,n){if(e&&void 0!==e[n])return e[n];var r=t.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}t.newFoldFunction=function(t,n){return function(r,i){e(r,i,{rangeFinder:t,widget:n})}};t.defineExtension("foldCode",function(t,n,r){e(this,t,n,r)});t.defineExtension("isFolded",function(t){for(var e=this.findMarksAt(t),n=0;n<e.length;++n)if(e[n].__isFold)return!0});t.commands.toggleFold=function(t){t.foldCode(t.getCursor())};t.commands.fold=function(t){t.foldCode(t.getCursor(),null,"fold")};t.commands.unfold=function(t){t.foldCode(t.getCursor(),null,"unfold")};t.commands.foldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"fold")})};t.commands.unfoldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"unfold")})};t.registerHelper("fold","combine",function(){var t=Array.prototype.slice.call(arguments,0);return function(e,n){for(var r=0;r<t.length;++r){var i=t[r](e,n);if(i)return i}}});t.registerHelper("fold","auto",function(t,e){for(var n=t.getHelpers(e,"fold"),r=0;r<n.length;r++){var i=n[r](t,e);if(i)return i}});var i={rangeFinder:t.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};t.defineOption("foldOptions",null);t.defineExtension("foldOption",function(t,e){return r(this,t,e)})})},{"../../lib/codemirror":11}],9:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror"),e("./foldcode")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","./foldcode"],i):i(CodeMirror)})(function(t){"use strict";function e(t){this.options=t;this.from=this.to=0}function n(t){t===!0&&(t={});null==t.gutter&&(t.gutter="CodeMirror-foldgutter");null==t.indicatorOpen&&(t.indicatorOpen="CodeMirror-foldgutter-open");null==t.indicatorFolded&&(t.indicatorFolded="CodeMirror-foldgutter-folded");return t}function r(t,e){for(var n=t.findMarksAt(f(e)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==e)return!0}function i(t){if("string"==typeof t){var e=document.createElement("div");e.className=t+" CodeMirror-guttermarker-subtle";return e}return t.cloneNode(!0)}function o(t,e,n){var o=t.state.foldGutter.options,a=e,s=t.foldOption(o,"minFoldSize"),l=t.foldOption(o,"rangeFinder");t.eachLine(e,n,function(e){var n=null;if(r(t,a))n=i(o.indicatorFolded);else{var u=f(a,0),c=l&&l(t,u);c&&c.to.line-c.from.line>=s&&(n=i(o.indicatorOpen))}t.setGutterMarker(e,o.gutter,n);++a})}function a(t){var e=t.getViewport(),n=t.state.foldGutter;if(n){t.operation(function(){o(t,e.from,e.to)});n.from=e.from;n.to=e.to}}function s(t,e,n){var r=t.state.foldGutter.options;n==r.gutter&&t.foldCode(f(e,0),r.rangeFinder)}function l(t){var e=t.state.foldGutter,n=t.state.foldGutter.options;e.from=e.to=0;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){a(t)},n.foldOnChangeTimeSpan||600)}function u(t){var e=t.state.foldGutter,n=t.state.foldGutter.options;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?a(t):t.operation(function(){if(n.from<e.from){o(t,n.from,e.from);e.from=n.from}if(n.to>e.to){o(t,e.to,n.to);e.to=n.to}})},n.updateViewportTimeSpan||400)}function c(t,e){var n=t.state.foldGutter,r=e.line;r>=n.from&&r<n.to&&o(t,r,r+1)}t.defineOption("foldGutter",!1,function(r,i,o){if(o&&o!=t.Init){r.clearGutter(r.state.foldGutter.options.gutter);r.state.foldGutter=null;r.off("gutterClick",s);r.off("change",l);r.off("viewportChange",u);r.off("fold",c);r.off("unfold",c);r.off("swapDoc",a)}if(i){r.state.foldGutter=new e(n(i));a(r);r.on("gutterClick",s);r.on("change",l);r.on("viewportChange",u);r.on("fold",c);r.on("unfold",c);r.on("swapDoc",a)}});var f=t.Pos})},{"../../lib/codemirror":11,"./foldcode":8}],10:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(t,e){return t.line-e.line||t.ch-e.ch}function n(t,e,n,r){this.line=e;this.ch=n;this.cm=t;this.text=t.getLine(e);this.min=r?r.from:t.firstLine();this.max=r?r.to-1:t.lastLine()}function r(t,e){var n=t.cm.getTokenTypeAt(h(t.line,e));return n&&/\btag\b/.test(n)}function i(t){if(!(t.line>=t.max)){t.ch=0;t.text=t.cm.getLine(++t.line);return!0}}function o(t){if(!(t.line<=t.min)){t.text=t.cm.getLine(--t.line);t.ch=t.text.length;return!0}}function a(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(i(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),o=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return o?"selfClose":"regular"}t.ch=e+1}}function s(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){g.lastIndex=e;t.ch=e;var n=g.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function l(t){for(;;){g.lastIndex=t.ch;var e=g.exec(t.text);if(!e){if(i(t))continue;return}if(r(t,e.index+1)){t.ch=e.index+e[0].length;return e}t.ch=e.index+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return i?"selfClose":"regular"}t.ch=e}}function c(t,e){for(var n=[];;){var r,i=l(t),o=t.line,s=t.ch-(i?i[0].length:0);if(!i||!(r=a(t)))return;if("selfClose"!=r)if(i[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==i[2]){n.length=u;break}if(0>u&&(!e||e==i[2]))return{tag:i[2],from:h(o,s),to:h(t.line,t.ch)}}else n.push(i[2])}}function f(t,e){for(var n=[];;){var r=u(t);if(!r)return;if("selfClose"!=r){var i=t.line,o=t.ch,a=s(t);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!e||e==a[2]))return{tag:a[2],from:h(t.line,t.ch),to:h(i,o)}}}else s(t)}}var h=t.Pos,d="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");t.registerHelper("fold","xml",function(t,e){for(var r=new n(t,e.line,0);;){var i,o=l(r);if(!o||r.line!=e.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var e=h(r.line,r.ch),s=c(r,o[2]);return s&&{from:e,to:s.from}}}});t.findMatchingTag=function(t,r,i){var o=new n(t,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=a(o),u=l&&h(o.line,o.ch),d=l&&s(o);if(l&&d&&!(e(o,r)>0)){var p={from:h(o.line,o.ch),to:u,tag:d[2]};if("selfClose"==l)return{open:p,close:null,at:"open"};if(d[1])return{open:f(o,d[2]),close:p,at:"close"};o=new n(t,u.line,u.ch,i);return{open:p,close:c(o,d[2]),at:"open"}}}};t.findEnclosingTag=function(t,e,r){for(var i=new n(t,e.line,e.ch,r);;){var o=f(i);if(!o)break;var a=new n(t,e.line,e.ch,r),s=c(a,o.tag);if(s)return{open:o,close:s}}};t.scanForClosingTag=function(t,e,r,i){var o=new n(t,e.line,e.ch,i?{from:0,to:i}:null);return c(o,r)}})},{"../../lib/codemirror":11}],11:[function(e,n,r){(function(e){if("object"==typeof r&&"object"==typeof n)n.exports=e();else{if("function"==typeof t&&t.amd)return t([],e);this.CodeMirror=e()}})(function(){"use strict";function t(n,r){if(!(this instanceof t))return new t(n,r);this.options=r=r?To(r):{};To(Fa,r,!1);d(r);var i=r.value;"string"==typeof i&&(i=new us(i,r.mode));this.doc=i;var o=this.display=new e(n,i);o.wrapper.CodeMirror=this;u(this);s(this);r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");r.autofocus&&!ga&&Nn(this);v(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new vo,keySeq:null};ia&&11>oa&&setTimeout(ko(An,this,!0),20);In(this);Oo();on(this);this.curOp.forceUpdate=!0;Oi(this,i);r.autofocus&&!ga||jo()==o.input?setTimeout(ko(ir,this),20):or(this);for(var a in Wa)Wa.hasOwnProperty(a)&&Wa[a](this,r[a],za);C(this);for(var l=0;l<Va.length;++l)Va[l](this);sn(this);aa&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function e(t,e){var n=this,r=n.input=Lo("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");aa?r.style.width="1000px":r.setAttribute("wrap","off");pa&&(r.style.border="1px solid black");r.setAttribute("autocorrect","off");r.setAttribute("autocapitalize","off");r.setAttribute("spellcheck","false");n.inputDiv=Lo("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");n.scrollbarFiller=Lo("div",null,"CodeMirror-scrollbar-filler");n.scrollbarFiller.setAttribute("not-content","true");n.gutterFiller=Lo("div",null,"CodeMirror-gutter-filler");n.gutterFiller.setAttribute("not-content","true");n.lineDiv=Lo("div",null,"CodeMirror-code");n.selectionDiv=Lo("div",null,null,"position: relative; z-index: 1");n.cursorDiv=Lo("div",null,"CodeMirror-cursors");n.measure=Lo("div",null,"CodeMirror-measure");n.lineMeasure=Lo("div",null,"CodeMirror-measure");n.lineSpace=Lo("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");n.mover=Lo("div",[Lo("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative");n.sizer=Lo("div",[n.mover],"CodeMirror-sizer");n.sizerWidth=null;n.heightForcer=Lo("div",null,null,"position: absolute; height: "+bs+"px; width: 1px;");n.gutters=Lo("div",null,"CodeMirror-gutters");n.lineGutter=null;n.scroller=Lo("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll");n.scroller.setAttribute("tabIndex","-1");n.wrapper=Lo("div",[n.inputDiv,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror");if(ia&&8>oa){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0}pa&&(r.style.width="0px");aa||(n.scroller.draggable=!0);if(fa){n.inputDiv.style.height="1px";n.inputDiv.style.position="absolute"}t&&(t.appendChild?t.appendChild(n.wrapper):t(n.wrapper));n.viewFrom=n.viewTo=e.first;n.reportedViewFrom=n.reportedViewTo=e.first;n.view=[];n.renderedView=null;n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.nativeBarWidth=n.barHeight=n.barWidth=0;n.scrollbarsClipped=!1;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.prevInput="";n.alignWidgets=!1;n.pollingFast=!1;n.poll=new vo;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.inaccurateSelection=!1;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null}function n(e){e.doc.mode=t.getMode(e.options,e.doc.modeOption);r(e)}function r(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null)});t.doc.frontier=t.doc.first;Te(t,100);t.state.modeGen++;t.curOp&&xn(t)}function i(t){if(t.options.lineWrapping){Is(t.display.wrapper,"CodeMirror-wrap");t.display.sizer.style.minWidth="";t.display.sizerWidth=null}else{js(t.display.wrapper,"CodeMirror-wrap");h(t)}a(t);xn(t);Ve(t);setTimeout(function(){y(t)},100)}function o(t){var e=nn(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/rn(t.display)-3);return function(i){if(ui(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function a(t){var e=t.doc,n=o(t);e.iter(function(t){var e=n(t);e!=t.height&&zi(t,e)})}function s(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-");Ve(t)}function l(t){u(t);xn(t);setTimeout(function(){w(t)},20)}function u(t){var e=t.display.gutters,n=t.options.gutters;Ao(e);for(var r=0;r<n.length;++r){var i=n[r],o=e.appendChild(Lo("div",null,"CodeMirror-gutter "+i));if("CodeMirror-linenumbers"==i){t.display.lineGutter=o;o.style.width=(t.display.lineNumWidth||1)+"px"}}e.style.display=r?"":"none";c(t)}function c(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function f(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=ni(r);){var i=e.find(0,!0);r=i.from.line;n+=i.from.ch-i.to.ch}r=t;for(;e=ri(r);){var i=e.find(0,!0);n-=r.text.length-i.from.ch;r=i.to.line;n+=r.text.length-i.to.ch}return n}function h(t){var e=t.display,n=t.doc;e.maxLine=Ri(n,n.first);e.maxLineLength=f(e.maxLine);e.maxLineChanged=!0;n.iter(function(t){var n=f(t);if(n>e.maxLineLength){e.maxLineLength=n;e.maxLine=t}})}function d(t){var e=wo(t.gutters,"CodeMirror-linenumbers");if(-1==e&&t.lineNumbers)t.gutters=t.gutters.concat(["CodeMirror-linenumbers"]);else if(e>-1&&!t.lineNumbers){t.gutters=t.gutters.slice(0);t.gutters.splice(e,1)}}function p(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Le(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ne(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function g(t,e,n){this.cm=n;var r=this.vert=Lo("div",[Lo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Lo("div",[Lo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(r);t(i);gs(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")});gs(i,"scroll",function(){i.clientWidth&&e(i.scrollLeft,"horizontal")});this.checkedOverlay=!1;ia&&8>oa&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function m(){}function v(e){if(e.display.scrollbars){e.display.scrollbars.clear();e.display.scrollbars.addClass&&js(e.display.wrapper,e.display.scrollbars.addClass)}e.display.scrollbars=new t.scrollbarModel[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);gs(t,"mousedown",function(){e.state.focused&&setTimeout(ko(Nn,e),0)});t.setAttribute("not-content","true")},function(t,n){"horizontal"==n?Gn(e,t):Xn(e,t)},e);e.display.scrollbars.addClass&&Is(e.display.wrapper,e.display.scrollbars.addClass)}function y(t,e){e||(e=p(t));var n=t.display.barWidth,r=t.display.barHeight;b(t,e);for(var i=0;4>i&&n!=t.display.barWidth||r!=t.display.barHeight;i++){n!=t.display.barWidth&&t.options.lineWrapping&&N(t);b(t,p(t));n=t.display.barWidth;r=t.display.barHeight}}function b(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px";if(r.right&&r.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=r.bottom+"px";n.scrollbarFiller.style.width=r.right+"px"}else n.scrollbarFiller.style.display="";if(r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=r.bottom+"px";n.gutterFiller.style.width=e.gutterWidth+"px"}else n.gutterFiller.style.display=""}function x(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-De(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=Ui(e,r),a=Ui(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(o>s){o=s;a=Ui(e,Bi(Ri(e,s))+t.wrapper.clientHeight)}else if(Math.min(l,e.lastLine())>=a){o=Ui(e,Bi(Ri(e,l))-t.wrapper.clientHeight);a=l}}return{from:o,to:Math.max(a,o+1)}}function w(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=T(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function C(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=S(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Lo("div",[Lo("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;r.lineGutter.style.width="";r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a);r.lineNumWidth=r.lineNumInnerWidth+a;r.lineNumChars=r.lineNumInnerWidth?n.length:-1;r.lineGutter.style.width=r.lineNumWidth+"px";c(t);return!0}return!1}function S(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function T(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function k(t,e,n){var r=t.display;this.viewport=e;this.visible=x(r,t.doc,e);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=Ee(t);this.force=n;this.dims=j(t)}function _(t){var e=t.display;if(!e.scrollbarsClipped&&e.scroller.offsetWidth){e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth;e.heightForcer.style.height=Ne(t)+"px";e.sizer.style.marginBottom=-e.nativeBarWidth+"px";e.sizer.style.borderRightWidth=Ne(t)+"px";e.scrollbarsClipped=!0}}function M(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden){Cn(t);return!1}if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==_n(t))return!1;if(C(t)){Cn(t);e.dims=j(t)}var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom));n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo));if(Ca){o=si(t.doc,o);a=li(t.doc,a)}var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;kn(t,o,a);n.viewOffset=Bi(Ri(t.doc,n.viewFrom));t.display.mover.style.top=n.viewOffset+"px";var l=_n(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=jo();l>4&&(n.lineDiv.style.display="none");I(t,n.updateLineNumbers,e.dims);l>4&&(n.lineDiv.style.display="");n.renderedView=n.view;u&&jo()!=u&&u.offsetHeight&&u.focus();Ao(n.cursorDiv);Ao(n.selectionDiv);n.gutters.style.height=0;if(s){n.lastWrapHeight=e.wrapperHeight;n.lastWrapWidth=e.wrapperWidth;Te(t,400)}n.updateLineNumbers=null;return!0}function D(t,e){for(var n=e.force,r=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Ee(t))n=!0;else{n=!1;r&&null!=r.top&&(r={top:Math.min(t.doc.height+Le(t.display)-je(t),r.top)});e.visible=x(t.display,t.doc,r);if(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break}if(!M(t,e))break;N(t);var o=p(t);xe(t);A(t,o);y(t,o)}co(t,"update",t);if(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo){co(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo);t.display.reportedViewFrom=t.display.viewFrom;t.display.reportedViewTo=t.display.viewTo}}function L(t,e){var n=new k(t,e);if(M(t,n)){N(t);D(t,n);var r=p(t);xe(t);A(t,r);y(t,r)}}function A(t,e){t.display.sizer.style.minHeight=e.docHeight+"px";var n=e.docHeight+t.display.barHeight;t.display.heightForcer.style.top=n+"px";t.display.gutters.style.height=Math.max(n+Ne(t),e.clientHeight)+"px"}function N(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r<e.view.length;r++){var i,o=e.view[r];if(!o.hidden){if(ia&&8>oa){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n;n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var l=o.line.height-i;2>i&&(i=nn(e));if(l>.001||-.001>l){zi(o.line,i);E(o.line);if(o.rest)for(var u=0;u<o.rest.length;u++)E(o.rest[u])}}}}function E(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e)t.widgets[e].height=t.widgets[e].node.offsetHeight}function j(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){n[t.options.gutters[a]]=o.offsetLeft+o.clientLeft+i;r[t.options.gutters[a]]=o.clientWidth}return{fixedPos:T(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function I(t,e,n){function r(e){var n=e.nextSibling;aa&&ma&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e);return n}for(var i=t.display,o=t.options.lineNumbers,a=i.lineDiv,s=a.firstChild,l=i.view,u=i.viewFrom,c=0;c<l.length;c++){var f=l[c];if(f.hidden);else if(f.node){for(;s!=f.node;)s=r(s);var h=o&&null!=e&&u>=e&&f.lineNumber;if(f.changes){wo(f.changes,"gutter")>-1&&(h=!1);P(t,f,u,n)}if(h){Ao(f.lineNumber);f.lineNumber.appendChild(document.createTextNode(S(t.options,u)))}s=f.node.nextSibling}else{var d=U(t,f,u,n);a.insertBefore(d,s)}u+=f.size}for(;s;)s=r(s)}function P(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?F(t,e):"gutter"==o?z(t,e,n,r):"class"==o?W(e):"widget"==o&&q(e,r)}e.changes=null}function H(t){if(t.node==t.text){t.node=Lo("div",null,null,"position: relative");t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text);t.node.appendChild(t.text);ia&&8>oa&&(t.node.style.zIndex=2)}return t.node}function O(t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;e&&(e+=" CodeMirror-linebackground");if(t.background)if(e)t.background.className=e;else{t.background.parentNode.removeChild(t.background);t.background=null}else if(e){var n=H(t);t.background=n.insertBefore(Lo("div",null,e),n.firstChild)}}function R(t,e){var n=t.display.externalMeasured;if(n&&n.line==e.line){t.display.externalMeasured=null;e.measure=n.measure;return n.built}return ki(t,e)}function F(t,e){var n=e.text.className,r=R(t,e);e.text==e.node&&(e.node=r.pre);e.text.parentNode.replaceChild(r.pre,e.text);e.text=r.pre;if(r.bgClass!=e.bgClass||r.textClass!=e.textClass){e.bgClass=r.bgClass;e.textClass=r.textClass;W(e)}else n&&(e.text.className=n)}function W(t){O(t);t.line.wrapClass?H(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var e=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=e||""}function z(t,e,n,r){if(e.gutter){e.node.removeChild(e.gutter);e.gutter=null}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var o=H(e),a=e.gutter=o.insertBefore(Lo("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.text);e.line.gutterClass&&(a.className+=" "+e.line.gutterClass);!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(Lo("div",S(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px")));if(i)for(var s=0;s<t.options.gutters.length;++s){var l=t.options.gutters[s],u=i.hasOwnProperty(l)&&i[l];u&&a.appendChild(Lo("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function q(t,e){t.alignable&&(t.alignable=null);for(var n,r=t.node.firstChild;r;r=n){var n=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}B(t,e)}function U(t,e,n,r){var i=R(t,e);e.text=e.node=i.pre;i.bgClass&&(e.bgClass=i.bgClass);i.textClass&&(e.textClass=i.textClass);W(e);z(t,e,n,r);B(e,r);return e.node}function B(t,e){V(t.line,t,e,!0);if(t.rest)for(var n=0;n<t.rest.length;n++)V(t.rest[n],t,e,!1)}function V(t,e,n,r){if(t.widgets)for(var i=H(e),o=0,a=t.widgets;o<a.length;++o){var s=a[o],l=Lo("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||l.setAttribute("cm-ignore-events","true");X(s,l,e,n);r&&s.above?i.insertBefore(l,e.gutter||e.text):i.appendChild(l);co(s,"redraw")}}function X(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px";if(!t.coverGutter){i-=r.gutterTotalWidth;e.style.paddingLeft=r.gutterTotalWidth+"px"}e.style.width=i+"px"}if(t.coverGutter){e.style.zIndex=5;e.style.position="relative";t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px")}}function G(t){return Sa(t.line,t.ch)}function $(t,e){return Ta(t,e)<0?e:t}function Y(t,e){return Ta(t,e)<0?t:e}function J(t,e){this.ranges=t;this.primIndex=e}function K(t,e){this.anchor=t;this.head=e}function Z(t,e){var n=t[e];t.sort(function(t,e){return Ta(t.from(),e.from())});e=wo(t,n);for(var r=1;r<t.length;r++){var i=t[r],o=t[r-1];if(Ta(o.to(),i.from())>=0){var a=Y(o.from(),i.from()),s=$(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;e>=r&&--e;t.splice(--r,2,new K(l?s:a,l?a:s))}}return new J(t,e)}function Q(t,e){return new J([new K(t,e||t)],0)}function te(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ee(t,e){if(e.line<t.first)return Sa(t.first,0);var n=t.first+t.size-1;return e.line>n?Sa(n,Ri(t,n).text.length):ne(e,Ri(t,e.line).text.length)}function ne(t,e){var n=t.ch;return null==n||n>e?Sa(t.line,e):0>n?Sa(t.line,0):t}function re(t,e){return e>=t.first&&e<t.first+t.size}function ie(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=ee(t,e[r]);return n}function oe(t,e,n,r){if(t.cm&&t.cm.display.shift||t.extend){var i=e.anchor;if(r){var o=Ta(n,i)<0;if(o!=Ta(r,i)<0){i=n;n=r}else o!=Ta(n,r)<0&&(n=r)}return new K(i,n)}return new K(r||n,n)}function ae(t,e,n,r){he(t,new J([oe(t,t.sel.primary(),e,n)],0),r)}function se(t,e,n){for(var r=[],i=0;i<t.sel.ranges.length;i++)r[i]=oe(t,t.sel.ranges[i],e[i],null);var o=Z(r,t.sel.primIndex);he(t,o,n)}function le(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n;he(t,Z(i,t.sel.primIndex),r)}function ue(t,e,n,r){he(t,Q(e,n),r)}function ce(t,e){var n={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new K(ee(t,e[n].anchor),ee(t,e[n].head))}};vs(t,"beforeSelectionChange",t,n);t.cm&&vs(t.cm,"beforeSelectionChange",t.cm,n);return n.ranges!=e.ranges?Z(n.ranges,n.ranges.length-1):e}function fe(t,e,n){var r=t.history.done,i=xo(r);if(i&&i.ranges){r[r.length-1]=e;de(t,e,n)}else he(t,e,n)}function he(t,e,n){de(t,e,n);Zi(t,t.sel,t.cm?t.cm.curOp.id:0/0,n)}function de(t,e,n){(go(t,"beforeSelectionChange")||t.cm&&go(t.cm,"beforeSelectionChange"))&&(e=ce(t,e));var r=n&&n.bias||(Ta(e.primary().head,t.sel.primary().head)<0?-1:1);pe(t,me(t,e,r,!0));n&&n.scroll===!1||!t.cm||kr(t.cm)}function pe(t,e){if(!e.equals(t.sel)){t.sel=e;if(t.cm){t.cm.curOp.updateInput=t.cm.curOp.selectionChanged=!0;po(t.cm)}co(t,"cursorActivity",t)}}function ge(t){pe(t,me(t,t.sel,null,!1),ws)}function me(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=ve(t,a.anchor,n,r),l=ve(t,a.head,n,r);if(i||s!=a.anchor||l!=a.head){i||(i=e.ranges.slice(0,o));i[o]=new K(s,l)}}return i?Z(i,e.primIndex):e}function ve(t,e,n,r){var i=!1,o=e,a=n||1;t.cantEdit=!1;t:for(;;){var s=Ri(t,o.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var u=s.markedSpans[l],c=u.marker;if((null==u.from||(c.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(c.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(r){vs(c,"beforeCursorEnter");if(c.explicitlyCleared){if(s.markedSpans){--l;continue}break}}if(!c.atomic)continue;var f=c.find(0>a?-1:1);if(0==Ta(f,o)){f.ch+=a;f.ch<0?f=f.line>t.first?ee(t,Sa(f.line-1)):null:f.ch>s.text.length&&(f=f.line<t.first+t.size-1?Sa(f.line+1,0):null);if(!f){if(i){if(!r)return ve(t,e,n,!0);t.cantEdit=!0;return Sa(t.first,0)}i=!0;f=e;a=-a}}o=f;continue t}}return o}}function ye(t){for(var e=t.display,n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){var s=n.sel.ranges[a],l=s.empty();(l||t.options.showCursorWhenSelecting)&&we(t,s,i);l||Ce(t,s,o)}if(t.options.moveInputWithCursor){var u=Ke(t,n.sel.primary().head,"div"),c=e.wrapper.getBoundingClientRect(),f=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,u.top+f.top-c.top));r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,u.left+f.left-c.left))}return r}function be(t,e){No(t.display.cursorDiv,e.cursors);No(t.display.selectionDiv,e.selection);if(null!=e.teTop){t.display.inputDiv.style.top=e.teTop+"px";t.display.inputDiv.style.left=e.teLeft+"px"}}function xe(t){be(t,ye(t))}function we(t,e,n){var r=Ke(t,e.head,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(Lo("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px";i.style.top=r.top+"px";i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px";if(r.other){var o=n.appendChild(Lo("div"," ","CodeMirror-cursor CodeMirror-secondarycursor")); o.style.display="";o.style.left=r.other.left+"px";o.style.top=r.other.top+"px";o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Ce(t,e,n){function r(t,e,n,r){0>e&&(e=0);e=Math.round(e);r=Math.round(r);s.appendChild(Lo("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px; top: "+e+"px; width: "+(null==n?c-t:n)+"px; height: "+(r-e)+"px"))}function i(e,n,i){function o(n,r){return Je(t,Sa(e,n),"div",f,r)}var s,l,f=Ri(a,e),h=f.text.length;qo(Vi(f),n||0,null==i?h:i,function(t,e,a){var f,d,p,g=o(t,"left");if(t==e){f=g;d=p=g.left}else{f=o(e-1,"right");if("rtl"==a){var m=g;g=f;f=m}d=g.left;p=f.right}null==n&&0==t&&(d=u);if(f.top-g.top>3){r(d,g.top,null,g.bottom);d=u;g.bottom<f.top&&r(d,g.bottom,null,f.top)}null==i&&e==h&&(p=c);(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g);(!l||f.bottom>l.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f);u+1>d&&(d=u);r(d,f.top,p-d,f.bottom)});return{start:s,end:l}}var o=t.display,a=t.doc,s=document.createDocumentFragment(),l=Ae(t.display),u=l.left,c=Math.max(o.sizerWidth,Ee(t)-o.sizer.offsetLeft)-l.right,f=e.from(),h=e.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Ri(a,f.line),p=Ri(a,h.line),g=oi(d)==oi(p),m=i(f.line,f.ch,g?d.text.length+1:null).end,v=i(h.line,g?0:null,h.ch).start;if(g)if(m.top<v.top-2){r(m.right,m.top,null,m.bottom);r(u,v.top,v.left,v.bottom)}else r(m.right,m.top,v.left-m.right,m.bottom);m.bottom<v.top&&r(u,m.bottom,null,v.top)}n.appendChild(s)}function Se(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="";t.options.cursorBlinkRate>0?e.blinker=setInterval(function(){e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Te(t,e){t.doc.mode.startState&&t.doc.frontier<t.display.viewTo&&t.state.highlight.set(e,ko(ke,t))}function ke(t){var e=t.doc;e.frontier<e.first&&(e.frontier=e.first);if(!(e.frontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Ga(e.mode,Me(t,e.frontier)),i=[];e.iter(e.frontier,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(e.frontier>=t.display.viewFrom){var a=o.styles,s=wi(t,o,r,!0);o.styles=s.styles;var l=o.styleClasses,u=s.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!c&&f<a.length;++f)c=a[f]!=o.styles[f];c&&i.push(e.frontier);o.stateAfter=Ga(e.mode,r)}else{Si(t,o.text,r);o.stateAfter=e.frontier%5==0?Ga(e.mode,r):null}++e.frontier;if(+new Date>n){Te(t,t.options.workDelay);return!0}});i.length&&pn(t,function(){for(var e=0;e<i.length;e++)wn(t,i[e],"text")})}}function _e(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Ri(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var u=Ts(l.text,null,t.options.tabSize);if(null==i||r>u){i=s-1;r=u}}return i}function Me(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return!0;var o=_e(t,e,n),a=o>r.first&&Ri(r,o-1).stateAfter;a=a?Ga(r.mode,a):$a(r.mode);r.iter(o,e,function(n){Si(t,n.text,a);var s=o==e-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=s?Ga(r.mode,a):null;++o});n&&(r.frontier=o);return a}function De(t){return t.lineSpace.offsetTop}function Le(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Ae(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=No(t.measure,Lo("pre","x")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r);return r}function Ne(t){return bs-t.display.nativeBarWidth}function Ee(t){return t.display.scroller.clientWidth-Ne(t)-t.display.barWidth}function je(t){return t.display.scroller.clientHeight-Ne(t)-t.display.barHeight}function Ie(t,e,n){var r=t.options.lineWrapping,i=r&&Ee(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Pe(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var r=0;r<t.rest.length;r++)if(qi(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function He(t,e){e=oi(e);var n=qi(e),r=t.display.externalMeasured=new yn(t.doc,e,n);r.lineN=n;var i=r.built=ki(t,r);r.text=i.pre;No(t.display.lineMeasure,i.pre);return r}function Oe(t,e,n,r){return We(t,Fe(t,e),n,r)}function Re(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Sn(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Fe(t,e){var n=qi(e),r=Re(t,n);r&&!r.text?r=null:r&&r.changes&&P(t,r,n,j(t));r||(r=He(t,e));var i=Pe(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function We(t,e,n,r,i){e.before&&(n=-1);var o,a=n+(r||"");if(e.cache.hasOwnProperty(a))o=e.cache[a];else{e.rect||(e.rect=e.view.text.getBoundingClientRect());if(!e.hasHeights){Ie(t,e.view,e.rect);e.hasHeights=!0}o=ze(t,e,n,r);o.bogus||(e.cache[a]=o)}return{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function ze(t,e,n,r){for(var i,o,a,s,l=e.map,u=0;u<l.length;u+=3){var c=l[u],f=l[u+1];if(c>n){o=0;a=1;s="left"}else if(f>n){o=n-c;a=o+1}else if(u==l.length-3||n==f&&l[u+3]>n){a=f-c;o=a-1;n>=f&&(s="right")}if(null!=o){i=l[u+2];c==f&&r==(i.insertLeft?"left":"right")&&(s=r);if("left"==r&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;){i=l[(u-=3)+2];s="left"}if("right"==r&&o==f-c)for(;u<l.length-3&&l[u+3]==l[u+4]&&!l[u+5].insertLeft;){i=l[(u+=3)+2];s="right"}break}}var h;if(3==i.nodeType){for(var u=0;4>u;u++){for(;o&&Do(e.line.text.charAt(c+o));)--o;for(;f>c+a&&Do(e.line.text.charAt(c+a));)++a;if(ia&&9>oa&&0==o&&a==f-c)h=i.parentNode.getBoundingClientRect();else if(ia&&t.options.lineWrapping){var d=Ms(i,o,a).getClientRects();h=d.length?d["right"==r?d.length-1:0]:Da}else h=Ms(i,o,a).getBoundingClientRect()||Da;if(h.left||h.right||0==o)break;a=o;o-=1;s="right"}ia&&11>oa&&(h=qe(t.display.measure,h))}else{o>0&&(s=r="right");var d;h=t.options.lineWrapping&&(d=i.getClientRects()).length>1?d["right"==r?d.length-1:0]:i.getBoundingClientRect()}if(ia&&9>oa&&!o&&(!h||!h.left&&!h.right)){var p=i.parentNode.getClientRects()[0];h=p?{left:p.left,right:p.left+rn(t.display),top:p.top,bottom:p.bottom}:Da}for(var g=h.top-e.rect.top,m=h.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,u=0;u<y.length-1&&!(v<y[u]);u++);var b=u?y[u-1]:0,x=y[u],w={left:("right"==s?h.right:h.left)-e.rect.left,right:("left"==s?h.left:h.right)-e.rect.left,top:b,bottom:x};h.left||h.right||(w.bogus=!0);if(!t.options.singleCursorHeightPerLine){w.rtop=g;w.rbottom=m}return w}function qe(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!zo(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}function Ue(t){if(t.measure){t.measure.cache={};t.measure.heights=null;if(t.rest)for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}}function Be(t){t.display.externalMeasure=null;Ao(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Ue(t.display.view[e])}function Ve(t){Be(t);t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null;t.options.lineWrapping||(t.display.maxLineChanged=!0);t.display.lineNumChars=null}function Xe(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ge(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function $e(t,e,n,r){if(e.widgets)for(var i=0;i<e.widgets.length;++i)if(e.widgets[i].above){var o=hi(e.widgets[i]);n.top+=o;n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Bi(e);"local"==r?a+=De(t.display):a-=t.display.viewOffset;if("page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Ge());var l=s.left+("window"==r?0:Xe());n.left+=l;n.right+=l}n.top+=a;n.bottom+=a;return n}function Ye(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n){r-=Xe();i-=Ge()}else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left;i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Je(t,e,n,r,i){r||(r=Ri(t.doc,e.line));return $e(t,r,Oe(t,r,e.ch,i),n)}function Ke(t,e,n,r,i,o){function a(e,a){var s=We(t,i,e,a?"right":"left",o);a?s.left=s.right:s.right=s.left;return $e(t,r,s,n)}function s(t,e){var n=l[e],r=n.level%2;if(t==Uo(n)&&e&&n.level<l[e-1].level){n=l[--e];t=Bo(n)-(n.level%2?0:1);r=!0}else if(t==Bo(n)&&e<l.length-1&&n.level<l[e+1].level){n=l[++e];t=Uo(n)-n.level%2;r=!1}return r&&t==n.to&&t>n.from?a(t-1):a(t,r)}r=r||Ri(t.doc,e.line);i||(i=Fe(t,r));var l=Vi(r),u=e.ch;if(!l)return a(u);var c=Ko(l,u),f=s(u,c);null!=qs&&(f.other=s(u,qs));return f}function Ze(t,e){var n=0,e=ee(t.doc,e);t.options.lineWrapping||(n=rn(t.display)*e.ch);var r=Ri(t.doc,e.line),i=Bi(r)+De(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Qe(t,e,n,r){var i=Sa(t,e);i.xRel=r;n&&(i.outside=!0);return i}function tn(t,e,n){var r=t.doc;n+=t.display.viewOffset;if(0>n)return Qe(r.first,0,!0,-1);var i=Ui(r,n),o=r.first+r.size-1;if(i>o)return Qe(r.first+r.size-1,Ri(r,o).text.length,!0,1);0>e&&(e=0);for(var a=Ri(r,i);;){var s=en(t,a,i,e,n),l=ri(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=qi(a=u.to.line)}}function en(t,e,n,r,i){function o(r){var i=Ke(t,Sa(n,r),"line",e,u);s=!0;if(a>i.bottom)return i.left-l;if(a<i.top)return i.left+l;s=!1;return i.left}var a=i-Bi(e),s=!1,l=2*t.display.wrapper.clientWidth,u=Fe(t,e),c=Vi(e),f=e.text.length,h=Vo(e),d=Xo(e),p=o(h),g=s,m=o(d),v=s;if(r>m)return Qe(n,d,v,1);for(;;){if(c?d==h||d==Qo(e,h,1):1>=d-h){for(var y=p>r||m-r>=r-p?h:d,b=r-(y==h?p:m);Do(e.text.charAt(y));)++y;var x=Qe(n,y,y==h?g:v,-1>b?-1:b>1?1:0);return x}var w=Math.ceil(f/2),C=h+w;if(c){C=h;for(var S=0;w>S;++S)C=Qo(e,C,1)}var T=o(C);if(T>r){d=C;m=T;(v=s)&&(m+=1e3);f=w}else{h=C;p=T;g=s;f-=w}}}function nn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ka){ka=Lo("pre");for(var e=0;49>e;++e){ka.appendChild(document.createTextNode("x"));ka.appendChild(Lo("br"))}ka.appendChild(document.createTextNode("x"))}No(t.measure,ka);var n=ka.offsetHeight/50;n>3&&(t.cachedTextHeight=n);Ao(t.measure);return n||1}function rn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=Lo("span","xxxxxxxxxx"),n=Lo("pre",[e]);No(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;i>2&&(t.cachedCharWidth=i);return i||10}function on(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Aa};La?La.ops.push(t.curOp):t.curOp.ownsGroup=La={ops:[t.curOp],delayedCallbacks:[]}}function an(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n]();for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<e.length)}function sn(t){var e=t.curOp,n=e.ownsGroup;if(n)try{an(n)}finally{La=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;ln(n)}}function ln(t){for(var e=t.ops,n=0;n<e.length;n++)un(e[n]);for(var n=0;n<e.length;n++)cn(e[n]);for(var n=0;n<e.length;n++)fn(e[n]);for(var n=0;n<e.length;n++)hn(e[n]);for(var n=0;n<e.length;n++)dn(e[n])}function un(t){var e=t.cm,n=e.display;_(e);t.updateMaxLine&&h(e);t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping;t.update=t.mustUpdate&&new k(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function cn(t){t.updatedDisplay=t.mustUpdate&&M(t.cm,t.update)}function fn(t){var e=t.cm,n=e.display;t.updatedDisplay&&N(e);t.barMeasure=p(e);if(n.maxLineChanged&&!e.options.lineWrapping){t.adjustWidthTo=Oe(e,n.maxLine,n.maxLine.text.length).left+3;e.display.sizerWidth=t.adjustWidthTo;t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Ne(e)+e.display.barWidth);t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Ee(e))}(t.updatedDisplay||t.selectionChanged)&&(t.newSelectionNodes=ye(e))}function hn(t){var e=t.cm;if(null!=t.adjustWidthTo){e.display.sizer.style.minWidth=t.adjustWidthTo+"px";t.maxScrollLeft<e.doc.scrollLeft&&Gn(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0);e.display.maxLineChanged=!1}t.newSelectionNodes&&be(e,t.newSelectionNodes);t.updatedDisplay&&A(e,t.barMeasure);(t.updatedDisplay||t.startHeight!=e.doc.height)&&y(e,t.barMeasure);t.selectionChanged&&Se(e);e.state.focused&&t.updateInput&&An(e,t.typing)}function dn(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&D(e,t.update);null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null);if(null!=t.scrollTop&&(n.scroller.scrollTop!=t.scrollTop||t.forceScroll)){r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,t.scrollTop));n.scrollbars.setScrollTop(r.scrollTop);n.scroller.scrollTop=r.scrollTop}if(null!=t.scrollLeft&&(n.scroller.scrollLeft!=t.scrollLeft||t.forceScroll)){r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Ee(e),t.scrollLeft));n.scrollbars.setScrollLeft(r.scrollLeft);n.scroller.scrollLeft=r.scrollLeft;w(e)}if(t.scrollToPos){var i=wr(e,ee(r,t.scrollToPos.from),ee(r,t.scrollToPos.to),t.scrollToPos.margin);t.scrollToPos.isCursor&&e.state.focused&&xr(e,i)}var o=t.maybeHiddenMarkers,a=t.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||vs(o[s],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&vs(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop);t.changeObjs&&vs(e,"changes",e,t.changeObjs)}function pn(t,e){if(t.curOp)return e();on(t);try{return e()}finally{sn(t)}}function gn(t,e){return function(){if(t.curOp)return e.apply(t,arguments);on(t);try{return e.apply(t,arguments)}finally{sn(t)}}}function mn(t){return function(){if(this.curOp)return t.apply(this,arguments);on(this);try{return t.apply(this,arguments)}finally{sn(this)}}}function vn(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);on(e);try{return t.apply(this,arguments)}finally{sn(e)}}}function yn(t,e,n){this.line=e;this.rest=ai(e);this.size=this.rest?qi(xo(this.rest))-n+1:1;this.node=this.text=null;this.hidden=ui(t,e)}function bn(t,e,n){for(var r,i=[],o=e;n>o;o=r){var a=new yn(t.doc,Ri(t.doc,o),o);r=o+a.size;i.push(a)}return i}function xn(t,e,n,r){null==e&&(e=t.doc.first);null==n&&(n=t.doc.first+t.doc.size);r||(r=0);var i=t.display;r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e);t.curOp.viewChanged=!0;if(e>=i.viewTo)Ca&&si(t.doc,e)<i.viewTo&&Cn(t);else if(n<=i.viewFrom)if(Ca&&li(t.doc,n+r)>i.viewFrom)Cn(t);else{i.viewFrom+=r;i.viewTo+=r}else if(e<=i.viewFrom&&n>=i.viewTo)Cn(t);else if(e<=i.viewFrom){var o=Tn(t,n,n+r,1);if(o){i.view=i.view.slice(o.index);i.viewFrom=o.lineN;i.viewTo+=r}else Cn(t)}else if(n>=i.viewTo){var o=Tn(t,e,e,-1);if(o){i.view=i.view.slice(0,o.index);i.viewTo=o.lineN}else Cn(t)}else{var a=Tn(t,e,e,-1),s=Tn(t,n,n+r,1);if(a&&s){i.view=i.view.slice(0,a.index).concat(bn(t,a.lineN,s.lineN)).concat(i.view.slice(s.index));i.viewTo+=r}else Cn(t)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:e<l.lineN+l.size&&(i.externalMeasured=null))}function wn(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null);if(!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[Sn(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==wo(a,n)&&a.push(n)}}}function Cn(t){t.display.viewFrom=t.display.viewTo=t.doc.first;t.display.view=[];t.display.viewOffset=0}function Sn(t,e){if(e>=t.display.viewTo)return null;e-=t.display.viewFrom;if(0>e)return null;for(var n=t.display.view,r=0;r<n.length;r++){e-=n[r].size;if(0>e)return r}}function Tn(t,e,n,r){var i,o=Sn(t,e),a=t.display.view;if(!Ca||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=0,l=t.display.viewFrom;o>s;s++)l+=a[s].size;if(l!=e){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-e;o++}else i=l-e;e+=i;n+=i}for(;si(t.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size;o+=r}return{index:o,lineN:n}}function kn(t,e,n){var r=t.display,i=r.view;if(0==i.length||e>=r.viewTo||n<=r.viewFrom){r.view=bn(t,e,n);r.viewFrom=e}else{r.viewFrom>e?r.view=bn(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Sn(t,e)));r.viewFrom=e;r.viewTo<n?r.view=r.view.concat(bn(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Sn(t,n)))}r.viewTo=n}function _n(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function Mn(t){t.display.pollingFast||t.display.poll.set(t.options.pollInterval,function(){Ln(t);t.state.focused&&Mn(t)})}function Dn(t){function e(){var r=Ln(t);if(r||n){t.display.pollingFast=!1;Mn(t)}else{n=!0;t.display.poll.set(60,e)}}var n=!1;t.display.pollingFast=!0;t.display.poll.set(20,e)}function Ln(t){var e=t.display.input,n=t.display.prevInput,r=t.doc;if(!t.state.focused||Rs(e)&&!n||jn(t)||t.options.disableInput||t.state.keySeq)return!1;if(t.state.pasteIncoming&&t.state.fakedLastChar){e.value=e.value.substring(0,e.value.length-1);t.state.fakedLastChar=!1}var i=e.value;if(i==n&&!t.somethingSelected())return!1;if(ia&&oa>=9&&t.display.inputHasSelection===i||ma&&/[\uf700-\uf7ff]/.test(i)){An(t);return!1}var o=!t.curOp;o&&on(t);t.display.shift=!1;8203!=i.charCodeAt(0)||r.sel!=t.display.selForContextMenu||n||(n="​");for(var a=0,s=Math.min(n.length,i.length);s>a&&n.charCodeAt(a)==i.charCodeAt(a);)++a;var l=i.slice(a),u=Os(l),c=null;t.state.pasteIncoming&&r.sel.ranges.length>1&&(Na&&Na.join("\n")==l?c=r.sel.ranges.length%Na.length==0&&Co(Na,Os):u.length==r.sel.ranges.length&&(c=Co(u,function(t){return[t]})));for(var f=r.sel.ranges.length-1;f>=0;f--){var h=r.sel.ranges[f],d=h.from(),p=h.to();a<n.length?d=Sa(d.line,d.ch-(n.length-a)):t.state.overwrite&&h.empty()&&!t.state.pasteIncoming&&(p=Sa(p.line,Math.min(Ri(r,p.line).text.length,p.ch+xo(u).length)));var g=t.curOp.updateInput,m={from:d,to:p,text:c?c[f%c.length]:u,origin:t.state.pasteIncoming?"paste":t.state.cutIncoming?"cut":"+input"};dr(t.doc,m);co(t,"inputRead",t,m);if(l&&!t.state.pasteIncoming&&t.options.electricChars&&t.options.smartIndent&&h.head.ch<100&&(!f||r.sel.ranges[f-1].head.line!=h.head.line)){var v=t.getModeAt(h.head),y=Ra(m);if(v.electricChars){for(var b=0;b<v.electricChars.length;b++)if(l.indexOf(v.electricChars.charAt(b))>-1){Mr(t,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Ri(r,y.line).text.slice(0,y.ch))&&Mr(t,y.line,"smart")}}kr(t);t.curOp.updateInput=g;t.curOp.typing=!0;i.length>1e3||i.indexOf("\n")>-1?e.value=t.display.prevInput="":t.display.prevInput=i;o&&sn(t);t.state.pasteIncoming=t.state.cutIncoming=!1;return!0}function An(t,e){if(!t.display.contextMenuPending){var n,r,i=t.doc;if(t.somethingSelected()){t.display.prevInput="";var o=i.sel.primary();n=Fs&&(o.to().line-o.from().line>100||(r=t.getSelection()).length>1e3);var a=n?"-":r||t.getSelection();t.display.input.value=a;t.state.focused&&_s(t.display.input);ia&&oa>=9&&(t.display.inputHasSelection=a)}else if(!e){t.display.prevInput=t.display.input.value="";ia&&oa>=9&&(t.display.inputHasSelection=null)}t.display.inaccurateSelection=n}}function Nn(t){"nocursor"==t.options.readOnly||ga&&jo()==t.display.input||t.display.input.focus()}function En(t){if(!t.state.focused){Nn(t);ir(t)}}function jn(t){return t.options.readOnly||t.doc.cantEdit}function In(t){function e(e){ho(t,e)||ps(e)}function n(e){if(t.somethingSelected()){Na=t.getSelections();if(r.inaccurateSelection){r.prevInput="";r.inaccurateSelection=!1;r.input.value=Na.join("\n");_s(r.input)}}else{for(var n=[],i=[],o=0;o<t.doc.sel.ranges.length;o++){var a=t.doc.sel.ranges[o].head.line,s={anchor:Sa(a,0),head:Sa(a+1,0)};i.push(s);n.push(t.getRange(s.anchor,s.head))}if("cut"==e.type)t.setSelections(i,null,ws);else{r.prevInput="";r.input.value=n.join("\n");_s(r.input)}Na=n}"cut"==e.type&&(t.state.cutIncoming=!0)}var r=t.display;gs(r.scroller,"mousedown",gn(t,Rn));ia&&11>oa?gs(r.scroller,"dblclick",gn(t,function(e){if(!ho(t,e)){var n=On(t,e);if(n&&!Un(t,e)&&!Hn(t.display,e)){hs(e);var r=t.findWordAt(n);ae(t.doc,r.anchor,r.head)}}})):gs(r.scroller,"dblclick",function(e){ho(t,e)||hs(e)});gs(r.lineSpace,"selectstart",function(t){Hn(r,t)||hs(t)});xa||gs(r.scroller,"contextmenu",function(e){ar(t,e)});gs(r.scroller,"scroll",function(){if(r.scroller.clientHeight){Xn(t,r.scroller.scrollTop);Gn(t,r.scroller.scrollLeft,!0);vs(t,"scroll",t)}});gs(r.scroller,"mousewheel",function(e){$n(t,e)});gs(r.scroller,"DOMMouseScroll",function(e){$n(t,e)});gs(r.wrapper,"scroll",function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0});gs(r.input,"keyup",function(e){nr.call(t,e)});gs(r.input,"input",function(){ia&&oa>=9&&t.display.inputHasSelection&&(t.display.inputHasSelection=null);Ln(t)});gs(r.input,"keydown",gn(t,tr));gs(r.input,"keypress",gn(t,rr));gs(r.input,"focus",ko(ir,t));gs(r.input,"blur",ko(or,t));if(t.options.dragDrop){gs(r.scroller,"dragstart",function(e){Vn(t,e)});gs(r.scroller,"dragenter",e);gs(r.scroller,"dragover",e);gs(r.scroller,"drop",gn(t,Bn))}gs(r.scroller,"paste",function(e){if(!Hn(r,e)){t.state.pasteIncoming=!0;Nn(t);Dn(t)}});gs(r.input,"paste",function(){if(aa&&!t.state.fakedLastChar&&!(new Date-t.state.lastMiddleDown<200)){var e=r.input.selectionStart,n=r.input.selectionEnd;r.input.value+="$";r.input.selectionEnd=n;r.input.selectionStart=e;t.state.fakedLastChar=!0}t.state.pasteIncoming=!0;Dn(t)});gs(r.input,"cut",n);gs(r.input,"copy",n);fa&&gs(r.sizer,"mouseup",function(){jo()==r.input&&r.input.blur();Nn(t)})}function Pn(t){var e=t.display;if(e.lastWrapHeight!=e.wrapper.clientHeight||e.lastWrapWidth!=e.wrapper.clientWidth){e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null;e.scrollbarsClipped=!1;t.setSize()}}function Hn(t,e){for(var n=lo(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function On(t,e,n,r){var i=t.display;if(!n&&"true"==lo(e).getAttribute("not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left;a=e.clientY-s.top}catch(e){return null}var l,u=tn(t,o,a);if(r&&1==u.xRel&&(l=Ri(t.doc,u.line).text).length==u.ch){var c=Ts(l,l.length,t.options.tabSize)-l.length;u=Sa(u.line,Math.max(0,Math.round((o-Ae(t.display).left)/rn(t.display))-c))}return u}function Rn(t){if(!ho(this,t)){var e=this,n=e.display;n.shift=t.shiftKey;if(Hn(n,t)){if(!aa){n.scroller.draggable=!1;setTimeout(function(){n.scroller.draggable=!0},100)}}else if(!Un(e,t)){var r=On(e,t);window.focus();switch(uo(t)){case 1:r?Fn(e,t,r):lo(t)==n.scroller&&hs(t);break;case 2:aa&&(e.state.lastMiddleDown=+new Date);r&&ae(e.doc,r);setTimeout(ko(Nn,e),20);hs(t);break;case 3:xa&&ar(e,t)}}}}function Fn(t,e,n){setTimeout(ko(En,t),0);var r,i=+new Date;if(Ma&&Ma.time>i-400&&0==Ta(Ma.pos,n))r="triple";else if(_a&&_a.time>i-400&&0==Ta(_a.pos,n)){r="double";Ma={time:i,pos:n}}else{r="single";_a={time:i,pos:n}}var o,a=t.doc.sel,s=ma?e.metaKey:e.ctrlKey;t.options.dragDrop&&Hs&&!jn(t)&&"single"==r&&(o=a.contains(n))>-1&&!a.ranges[o].empty()?Wn(t,e,n,s):zn(t,e,n,r,s)}function Wn(t,e,n,r){var i=t.display,o=gn(t,function(a){aa&&(i.scroller.draggable=!1);t.state.draggingText=!1;ms(document,"mouseup",o);ms(i.scroller,"drop",o);if(Math.abs(e.clientX-a.clientX)+Math.abs(e.clientY-a.clientY)<10){hs(a);r||ae(t.doc,n);Nn(t);ia&&9==oa&&setTimeout(function(){document.body.focus();Nn(t)},20)}});aa&&(i.scroller.draggable=!0);t.state.draggingText=o;i.scroller.dragDrop&&i.scroller.dragDrop();gs(document,"mouseup",o);gs(i.scroller,"drop",o)}function zn(t,e,n,r,i){function o(e){if(0!=Ta(m,e)){m=e;if("rect"==r){for(var i=[],o=t.options.tabSize,a=Ts(Ri(u,n.line).text,n.ch,o),s=Ts(Ri(u,e.line).text,e.ch,o),l=Math.min(a,s),d=Math.max(a,s),p=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));g>=p;p++){var v=Ri(u,p).text,y=yo(v,l,o);l==d?i.push(new K(Sa(p,y),Sa(p,y))):v.length>y&&i.push(new K(Sa(p,y),Sa(p,yo(v,d,o))))}i.length||i.push(new K(n,n));he(u,Z(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1});t.scrollIntoView(e)}else{var b=c,x=b.anchor,w=e;if("single"!=r){if("double"==r)var C=t.findWordAt(e);else var C=new K(Sa(e.line,0),ee(u,Sa(e.line+1,0)));if(Ta(C.anchor,x)>0){w=C.head;x=Y(b.from(),C.anchor)}else{w=C.anchor;x=$(b.to(),C.head)}}var i=h.ranges.slice(0);i[f]=new K(ee(u,x),w);he(u,Z(i,f),Cs)}}}function a(e){var n=++y,i=On(t,e,!0,"rect"==r);if(i)if(0!=Ta(i,m)){En(t);o(i);var s=x(l,u);(i.line>=s.to||i.line<s.from)&&setTimeout(gn(t,function(){y==n&&a(e)}),150)}else{var c=e.clientY<v.top?-20:e.clientY>v.bottom?20:0;c&&setTimeout(gn(t,function(){if(y==n){l.scroller.scrollTop+=c;a(e)}}),50)}}function s(e){y=1/0;hs(e);Nn(t);ms(document,"mousemove",b);ms(document,"mouseup",w);u.history.lastSelOrigin=null}var l=t.display,u=t.doc;hs(e);var c,f,h=u.sel,d=h.ranges;if(i&&!e.shiftKey){f=u.sel.contains(n);c=f>-1?d[f]:new K(n,n)}else c=u.sel.primary();if(e.altKey){r="rect";i||(c=new K(n,n));n=On(t,e,!0,!0);f=-1}else if("double"==r){var p=t.findWordAt(n);c=t.display.shift||u.extend?oe(u,c,p.anchor,p.head):p}else if("triple"==r){var g=new K(Sa(n.line,0),ee(u,Sa(n.line+1,0)));c=t.display.shift||u.extend?oe(u,c,g.anchor,g.head):g}else c=oe(u,c,n);if(i)if(-1==f){f=d.length;he(u,Z(d.concat([c]),f),{scroll:!1,origin:"*mouse"})}else if(d.length>1&&d[f].empty()&&"single"==r){he(u,Z(d.slice(0,f).concat(d.slice(f+1)),0));h=u.sel}else le(u,f,c,Cs);else{f=0;he(u,new J([c],0),Cs);h=u.sel}var m=n,v=l.wrapper.getBoundingClientRect(),y=0,b=gn(t,function(t){uo(t)?a(t):s(t)}),w=gn(t,s);gs(document,"mousemove",b);gs(document,"mouseup",w)}function qn(t,e,n,r,i){try{var o=e.clientX,a=e.clientY}catch(e){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&hs(e);var s=t.display,l=s.lineDiv.getBoundingClientRect();if(a>l.bottom||!go(t,n))return so(e);a-=l.top-s.viewOffset;for(var u=0;u<t.options.gutters.length;++u){var c=s.gutters.childNodes[u];if(c&&c.getBoundingClientRect().right>=o){var f=Ui(t.doc,a),h=t.options.gutters[u];i(t,n,t,f,h,e);return so(e)}}}function Un(t,e){return qn(t,e,"gutterClick",!0,co)}function Bn(t){var e=this;if(!ho(e,t)&&!Hn(e.display,t)){hs(t);ia&&(Ea=+new Date);var n=On(e,t,!0),r=t.dataTransfer.files;if(n&&!jn(e))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(t,r){var s=new FileReader;s.onload=gn(e,function(){o[r]=s.result;if(++a==i){n=ee(e.doc,n);var t={from:n,to:n,text:Os(o.join("\n")),origin:"paste"};dr(e.doc,t);fe(e.doc,Q(n,Ra(t)))}});s.readAsText(t)},l=0;i>l;++l)s(r[l],l);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1){e.state.draggingText(t);setTimeout(ko(Nn,e),20);return}try{var o=t.dataTransfer.getData("Text");if(o){if(e.state.draggingText&&!(ma?t.metaKey:t.ctrlKey))var u=e.listSelections();de(e.doc,Q(n,n));if(u)for(var l=0;l<u.length;++l)br(e.doc,"",u[l].anchor,u[l].head,"drag");e.replaceSelection(o,"around","paste");Nn(e)}}catch(t){}}}}function Vn(t,e){if(ia&&(!t.state.draggingText||+new Date-Ea<100))ps(e);else if(!ho(t,e)&&!Hn(t.display,e)){e.dataTransfer.setData("Text",t.getSelection());if(e.dataTransfer.setDragImage&&!ca){var n=Lo("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(ua){n.width=n.height=1;t.display.wrapper.appendChild(n);n._top=n.offsetTop}e.dataTransfer.setDragImage(n,0,0);ua&&n.parentNode.removeChild(n)}}}function Xn(t,e){if(!(Math.abs(t.doc.scrollTop-e)<2)){t.doc.scrollTop=e;ea||L(t,{top:e});t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e);t.display.scrollbars.setScrollTop(e);ea&&L(t);Te(t,100)}}function Gn(t,e,n){if(!(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth);t.doc.scrollLeft=e;w(t);t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e);t.display.scrollbars.setScrollLeft(e)}}function $n(t,e){var n=Pa(e),r=n.x,i=n.y,o=t.display,a=o.scroller;if(r&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&ma&&aa)t:for(var s=e.target,l=o.view;s!=a;s=s.parentNode)for(var u=0;u<l.length;u++)if(l[u].node==s){t.display.currentWheelTarget=s;break t}if(!r||ea||ua||null==Ia){if(i&&null!=Ia){var c=i*Ia,f=t.doc.scrollTop,h=f+o.wrapper.clientHeight;0>c?f=Math.max(0,f+c-50):h=Math.min(t.doc.height,h+c+50);L(t,{top:f,bottom:h})}if(20>ja)if(null==o.wheelStartX){o.wheelStartX=a.scrollLeft;o.wheelStartY=a.scrollTop;o.wheelDX=r;o.wheelDY=i;setTimeout(function(){if(null!=o.wheelStartX){var t=a.scrollLeft-o.wheelStartX,e=a.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(n){Ia=(Ia*ja+n)/(ja+1);++ja}}},200)}else{o.wheelDX+=r;o.wheelDY+=i}}else{i&&Xn(t,Math.max(0,Math.min(a.scrollTop+i*Ia,a.scrollHeight-a.clientHeight)));Gn(t,Math.max(0,Math.min(a.scrollLeft+r*Ia,a.scrollWidth-a.clientWidth)));hs(e);o.wheelStartX=null}}}function Yn(t,e,n){if("string"==typeof e){e=Ya[e];if(!e)return!1}t.display.pollingFast&&Ln(t)&&(t.display.pollingFast=!1);var r=t.display.shift,i=!1;try{jn(t)&&(t.state.suppressEdits=!0);n&&(t.display.shift=!1);i=e(t)!=xs}finally{t.display.shift=r;t.state.suppressEdits=!1}return i}function Jn(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Ka(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Ka(e,t.options.extraKeys,n,t)||Ka(e,t.options.keyMap,n,t)}function Kn(t,e,n,r){var i=t.state.keySeq;if(i){if(Za(e))return"handled";Ha.set(50,function(){if(t.state.keySeq==i){t.state.keySeq=null;An(t)}});e=i+" "+e}var o=Jn(t,e,r);"multi"==o&&(t.state.keySeq=e);"handled"==o&&co(t,"keyHandled",t,e,n);if("handled"==o||"multi"==o){hs(n);Se(t)}if(i&&!o&&/\'$/.test(e)){hs(n);return!0}return!!o}function Zn(t,e){var n=Qa(e,!0);return n?e.shiftKey&&!t.state.keySeq?Kn(t,"Shift-"+n,e,function(e){return Yn(t,e,!0)})||Kn(t,n,e,function(e){return("string"==typeof e?/^go[A-Z]/.test(e):e.motion)?Yn(t,e):void 0}):Kn(t,n,e,function(e){return Yn(t,e)}):!1}function Qn(t,e,n){return Kn(t,"'"+n+"'",e,function(e){return Yn(t,e,!0)})}function tr(t){var e=this;En(e);if(!ho(e,t)){ia&&11>oa&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var r=Zn(e,t);if(ua){Oa=r?n:null;!r&&88==n&&!Fs&&(ma?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")}18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||er(e)}}function er(t){function e(t){if(18==t.keyCode||!t.altKey){js(n,"CodeMirror-crosshair");ms(document,"keyup",e);ms(document,"mouseover",e)}}var n=t.display.lineDiv;Is(n,"CodeMirror-crosshair");gs(document,"keyup",e);gs(document,"mouseover",e)}function nr(t){16==t.keyCode&&(this.doc.sel.shift=!1);ho(this,t)}function rr(t){var e=this;if(!(ho(e,t)||t.ctrlKey&&!t.altKey||ma&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(ua&&n==Oa){Oa=null;hs(t)}else if(!(ua&&(!t.which||t.which<10)||fa)||!Zn(e,t)){var i=String.fromCharCode(null==r?n:r);if(!Qn(e,t,i)){ia&&oa>=9&&(e.display.inputHasSelection=null);Dn(e)}}}}function ir(t){if("nocursor"!=t.options.readOnly){if(!t.state.focused){vs(t,"focus",t);t.state.focused=!0;Is(t.display.wrapper,"CodeMirror-focused");if(!t.curOp&&t.display.selForContextMenu!=t.doc.sel){An(t); aa&&setTimeout(ko(An,t,!0),0)}}Mn(t);Se(t)}}function or(t){if(t.state.focused){vs(t,"blur",t);t.state.focused=!1;js(t.display.wrapper,"CodeMirror-focused")}clearInterval(t.display.blinker);setTimeout(function(){t.state.focused||(t.display.shift=!1)},150)}function ar(t,e){function n(){if(null!=i.input.selectionStart){var e=t.somethingSelected(),n=i.input.value="​"+(e?i.input.value:"");i.prevInput=e?"":"​";i.input.selectionStart=1;i.input.selectionEnd=n.length;i.selForContextMenu=t.doc.sel}}function r(){i.contextMenuPending=!1;i.inputDiv.style.position="relative";i.input.style.cssText=l;ia&&9>oa&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a);Mn(t);if(null!=i.input.selectionStart){(!ia||ia&&9>oa)&&n();var e=0,r=function(){i.selForContextMenu==t.doc.sel&&0==i.input.selectionStart?gn(t,Ya.selectAll)(t):e++<10?i.detectingSelectAll=setTimeout(r,500):An(t)};i.detectingSelectAll=setTimeout(r,200)}}if(!ho(t,e,"contextmenu")){var i=t.display;if(!Hn(i,e)&&!sr(t,e)){var o=On(t,e),a=i.scroller.scrollTop;if(o&&!ua){var s=t.options.resetSelectionOnContextMenu;s&&-1==t.doc.sel.contains(o)&&gn(t,he)(t.doc,Q(o),ws);var l=i.input.style.cssText;i.inputDiv.style.position="absolute";i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(ia?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(aa)var u=window.scrollY;Nn(t);aa&&window.scrollTo(null,u);An(t);t.somethingSelected()||(i.input.value=i.prevInput=" ");i.contextMenuPending=!0;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);ia&&oa>=9&&n();if(xa){ps(e);var c=function(){ms(window,"mouseup",c);setTimeout(r,20)};gs(window,"mouseup",c)}else setTimeout(r,50)}}}}function sr(t,e){return go(t,"gutterContextMenu")?qn(t,e,"gutterContextMenu",!1,vs):!1}function lr(t,e){if(Ta(t,e.from)<0)return t;if(Ta(t,e.to)<=0)return Ra(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;t.line==e.to.line&&(r+=Ra(e).ch-e.to.ch);return Sa(n,r)}function ur(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new K(lr(i.anchor,e),lr(i.head,e)))}return Z(n,t.sel.primIndex)}function cr(t,e,n){return t.line==e.line?Sa(n.line,t.ch-e.ch+n.ch):Sa(n.line+(t.line-e.line),t.ch)}function fr(t,e,n){for(var r=[],i=Sa(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],l=cr(s.from,i,o),u=cr(Ra(s),i,o);i=s.to;o=u;if("around"==n){var c=t.sel.ranges[a],f=Ta(c.head,c.anchor)<0;r[a]=new K(f?u:l,f?l:u)}else r[a]=new K(l,l)}return new J(r,t.sel.primIndex)}function hr(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){this.canceled=!0}};n&&(r.update=function(e,n,r,i){e&&(this.from=ee(t,e));n&&(this.to=ee(t,n));r&&(this.text=r);void 0!==i&&(this.origin=i)});vs(t,"beforeChange",t,r);t.cm&&vs(t.cm,"beforeChange",t.cm,r);return r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function dr(t,e,n){if(t.cm){if(!t.cm.curOp)return gn(t.cm,dr)(t,e,n);if(t.cm.state.suppressEdits)return}if(go(t,"beforeChange")||t.cm&&go(t.cm,"beforeChange")){e=hr(t,e,!0);if(!e)return}var r=wa&&!n&&Yr(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)pr(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text});else pr(t,e)}function pr(t,e){if(1!=e.text.length||""!=e.text[0]||0!=Ta(e.from,e.to)){var n=ur(t,e);Ji(t,e,n,t.cm?t.cm.curOp.id:0/0);vr(t,e,n,Xr(t,e));var r=[];Hi(t,function(t,n){if(!n&&-1==wo(r,t.history)){ao(t.history,e);r.push(t.history)}vr(t,e,null,Xr(t,e))})}}function gr(t,e,n){if(!t.cm||!t.cm.state.suppressEdits){for(var r,i=t.history,o=t.sel,a="undo"==e?i.done:i.undone,s="undo"==e?i.undone:i.done,l=0;l<a.length;l++){r=a[l];if(n?r.ranges&&!r.equals(t.sel):!r.ranges)break}if(l!=a.length){i.lastOrigin=i.lastSelOrigin=null;for(;;){r=a.pop();if(!r.ranges)break;Qi(r,s);if(n&&!r.equals(t.sel)){he(t,r,{clearRedo:!1});return}o=r}var u=[];Qi(o,s);s.push({changes:u,generation:i.generation});i.generation=r.generation||++i.maxGeneration;for(var c=go(t,"beforeChange")||t.cm&&go(t.cm,"beforeChange"),l=r.changes.length-1;l>=0;--l){var f=r.changes[l];f.origin=e;if(c&&!hr(t,f,!1)){a.length=0;return}u.push(Gi(t,f));var h=l?ur(t,f):xo(a);vr(t,f,h,$r(t,f));!l&&t.cm&&t.cm.scrollIntoView({from:f.from,to:Ra(f)});var d=[];Hi(t,function(t,e){if(!e&&-1==wo(d,t.history)){ao(t.history,f);d.push(t.history)}vr(t,f,null,$r(t,f))})}}}}function mr(t,e){if(0!=e){t.first+=e;t.sel=new J(Co(t.sel.ranges,function(t){return new K(Sa(t.anchor.line+e,t.anchor.ch),Sa(t.head.line+e,t.head.ch))}),t.sel.primIndex);if(t.cm){xn(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)wn(t.cm,r,"gutter")}}}function vr(t,e,n,r){if(t.cm&&!t.cm.curOp)return gn(t.cm,vr)(t,e,n,r);if(e.to.line<t.first)mr(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);mr(t,i);e={from:Sa(t.first,0),to:Sa(e.to.line+i,e.to.ch),text:[xo(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:Sa(o,Ri(t,o).text.length),text:[e.text[0]],origin:e.origin});e.removed=Fi(t,e.from,e.to);n||(n=ur(t,e));t.cm?yr(t.cm,e,r):ji(t,e,r);de(t,n,ws)}}function yr(t,e,n){var r=t.doc,i=t.display,a=e.from,s=e.to,l=!1,u=a.line;if(!t.options.lineWrapping){u=qi(oi(Ri(r,a.line)));r.iter(u,s.line+1,function(t){if(t==i.maxLine){l=!0;return!0}})}r.sel.contains(e.from,e.to)>-1&&po(t);ji(r,e,n,o(t));if(!t.options.lineWrapping){r.iter(u,a.line+e.text.length,function(t){var e=f(t);if(e>i.maxLineLength){i.maxLine=t;i.maxLineLength=e;i.maxLineChanged=!0;l=!1}});l&&(t.curOp.updateMaxLine=!0)}r.frontier=Math.min(r.frontier,a.line);Te(t,400);var c=e.text.length-(s.line-a.line)-1;e.full?xn(t):a.line!=s.line||1!=e.text.length||Ei(t.doc,e)?xn(t,a.line,s.line+1,c):wn(t,a.line,"text");var h=go(t,"changes"),d=go(t,"change");if(d||h){var p={from:a,to:s,text:e.text,removed:e.removed,origin:e.origin};d&&co(t,"change",t,p);h&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}function br(t,e,n,r,i){r||(r=n);if(Ta(r,n)<0){var o=r;r=n;n=o}"string"==typeof e&&(e=Os(e));dr(t,{from:n,to:r,text:e,origin:i})}function xr(t,e){if(!ho(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(null!=i&&!da){var o=Lo("div","​",null,"position: absolute; top: "+(e.top-n.viewOffset-De(t.display))+"px; height: "+(e.bottom-e.top+Ne(t)+n.barHeight)+"px; left: "+e.left+"px; width: 2px;");t.display.lineSpace.appendChild(o);o.scrollIntoView(i);t.display.lineSpace.removeChild(o)}}}function wr(t,e,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=Ke(t,e),s=n&&n!=e?Ke(t,n):a,l=Sr(t,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),u=t.doc.scrollTop,c=t.doc.scrollLeft;if(null!=l.scrollTop){Xn(t,l.scrollTop);Math.abs(t.doc.scrollTop-u)>1&&(o=!0)}if(null!=l.scrollLeft){Gn(t,l.scrollLeft);Math.abs(t.doc.scrollLeft-c)>1&&(o=!0)}if(!o)break}return a}function Cr(t,e,n,r,i){var o=Sr(t,e,n,r,i);null!=o.scrollTop&&Xn(t,o.scrollTop);null!=o.scrollLeft&&Gn(t,o.scrollLeft)}function Sr(t,e,n,r,i){var o=t.display,a=nn(t.display);0>n&&(n=0);var s=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:o.scroller.scrollTop,l=je(t),u={};i-n>l&&(i=n+l);var c=t.doc.height+Le(o),f=a>n,h=i>c-a;if(s>n)u.scrollTop=f?0:n;else if(i>s+l){var d=Math.min(n,(h?c:i)-l);d!=s&&(u.scrollTop=d)}var p=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:o.scroller.scrollLeft,g=Ee(t)-(t.options.fixedGutter?o.gutters.offsetWidth:0),m=r-e>g;m&&(r=e+g);10>e?u.scrollLeft=0:p>e?u.scrollLeft=Math.max(0,e-(m?0:10)):r>g+p-3&&(u.scrollLeft=r+(m?0:10)-g);return u}function Tr(t,e,n){(null!=e||null!=n)&&_r(t);null!=e&&(t.curOp.scrollLeft=(null==t.curOp.scrollLeft?t.doc.scrollLeft:t.curOp.scrollLeft)+e);null!=n&&(t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+n)}function kr(t){_r(t);var e=t.getCursor(),n=e,r=e;if(!t.options.lineWrapping){n=e.ch?Sa(e.line,e.ch-1):e;r=Sa(e.line,e.ch+1)}t.curOp.scrollToPos={from:n,to:r,margin:t.options.cursorScrollMargin,isCursor:!0}}function _r(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Ze(t,e.from),r=Ze(t,e.to),i=Sr(t,Math.min(n.left,r.left),Math.min(n.top,r.top)-e.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+e.margin);t.scrollTo(i.scrollLeft,i.scrollTop)}}function Mr(t,e,n,r){var i,o=t.doc;null==n&&(n="add");"smart"==n&&(o.mode.indent?i=Me(t,e):n="prev");var a=t.options.tabSize,s=Ri(o,e),l=Ts(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n){u=o.mode.indent(i,s.text.slice(c.length),s.text);if(u==xs||u>150){if(!r)return;n="prev"}}}else{u=0;n="not"}"prev"==n?u=e>o.first?Ts(Ri(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n);u=Math.max(0,u);var f="",h=0;if(t.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d){h+=a;f+=" "}u>h&&(f+=bo(u-h));if(f!=c)br(o,f,Sa(e,0),Sa(e,c.length),"+input");else for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==e&&p.head.ch<c.length){var h=Sa(e,c.length);le(o,d,new K(h,h));break}}s.stateAfter=null}function Dr(t,e,n,r){var i=e,o=e;"number"==typeof e?o=Ri(t,te(t,e)):i=qi(e);if(null==i)return null;r(o,i)&&t.cm&&wn(t.cm,i,n);return o}function Lr(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&Ta(o.from,xo(r).to)<=0;){var a=r.pop();if(Ta(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}pn(t,function(){for(var e=r.length-1;e>=0;e--)br(t.doc,"",r[e].from,r[e].to,"+delete");kr(t)})}function Ar(t,e,n,r,i){function o(){var e=s+n;if(e<t.first||e>=t.first+t.size)return f=!1;s=e;return c=Ri(t,e)}function a(t){var e=(i?Qo:ta)(c,l,n,!0);if(null==e){if(t||!o())return f=!1;l=i?(0>n?Xo:Vo)(c):0>n?c.text.length:0}else l=e;return!0}var s=e.line,l=e.ch,u=n,c=Ri(t,s),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var h=null,d="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),g=!0;!(0>n)||a(!g);g=!1){var m=c.text.charAt(l)||"\n",v=_o(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";!d||g||v||(v="s");if(h&&h!=v){if(0>n){n=1;a()}break}v&&(h=v);if(n>0&&!a(!g))break}var y=ve(t,Sa(s,l),u,!0);f||(y.hitSide=!0);return y}function Nr(t,e,n,r){var i,o=t.doc,a=e.left;if("page"==r){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=e.top+n*(s-(0>n?1.5:.5)*nn(t.display))}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;;){var l=tn(t,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function Er(e,n,r,i){t.defaults[e]=n;r&&(Wa[e]=i?function(t,e,n){n!=za&&r(t,e,n)}:r)}function jr(t){for(var e,n,r,i,o=t.split(/-(?!$)/),t=o[o.length-1],a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}e&&(t="Alt-"+t);n&&(t="Ctrl-"+t);i&&(t="Cmd-"+t);r&&(t="Shift-"+t);return t}function Ir(t){return"string"==typeof t?Ja[t]:t}function Pr(t,e,n,r,i){if(r&&r.shared)return Hr(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return gn(t.cm,Pr)(t,e,n,r,i);var o=new es(t,i),a=Ta(e,n);r&&To(r,o,!1);if(a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith){o.collapsed=!0;o.widgetNode=Lo("span",[o.replacedWith],"CodeMirror-widget");r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true");r.insertLeft&&(o.widgetNode.insertLeft=!0)}if(o.collapsed){if(ii(t,e.line,e,n,o)||e.line!=n.line&&ii(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ca=!0}o.addToHistory&&Ji(t,{from:e,to:n,origin:"markText"},t.sel,0/0);var s,l=e.line,u=t.cm;t.iter(l,n.line+1,function(t){u&&o.collapsed&&!u.options.lineWrapping&&oi(t)==u.display.maxLine&&(s=!0);o.collapsed&&l!=e.line&&zi(t,0);Ur(t,new Wr(o,l==e.line?e.ch:null,l==n.line?n.ch:null));++l});o.collapsed&&t.iter(e.line,n.line+1,function(e){ui(t,e)&&zi(e,0)});o.clearOnEnter&&gs(o,"beforeCursorEnter",function(){o.clear()});if(o.readOnly){wa=!0;(t.history.done.length||t.history.undone.length)&&t.clearHistory()}if(o.collapsed){o.id=++ns;o.atomic=!0}if(u){s&&(u.curOp.updateMaxLine=!0);if(o.collapsed)xn(u,e.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=e.line;c<=n.line;c++)wn(u,c,"text");o.atomic&&ge(u.doc);co(u,"markerAdded",u,o)}return o}function Hr(t,e,n,r,i){r=To(r);r.shared=!1;var o=[Pr(t,e,n,r,i)],a=o[0],s=r.widgetNode;Hi(t,function(t){s&&(r.widgetNode=s.cloneNode(!0));o.push(Pr(t,ee(t,e),ee(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=xo(o)});return new rs(o,a)}function Or(t){return t.findMarks(Sa(t.first,0),t.clipPos(Sa(t.lastLine())),function(t){return t.parent})}function Rr(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(Ta(o,a)){var s=Pr(t,o,a,r.primary,r.primary.type);r.markers.push(s);s.parent=r}}}function Fr(t){for(var e=0;e<t.length;e++){var n=t[e],r=[n.primary.doc];Hi(n.primary.doc,function(t){r.push(t)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];if(-1==wo(r,o.doc)){o.parent=null;n.markers.splice(i--,1)}}}}function Wr(t,e,n){this.marker=t;this.from=e;this.to=n}function zr(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function qr(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Ur(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e];e.marker.attachLine(t)}function Br(t,e,n){if(t)for(var r,i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);if(s||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new Wr(a,o.from,l?null:o.to))}}return r}function Vr(t,e,n){if(t)for(var r,i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);if(s||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new Wr(a,l?null:o.from-e,null==o.to?null:o.to-e))}}return r}function Xr(t,e){if(e.full)return null;var n=re(t,e.from.line)&&Ri(t,e.from.line).markedSpans,r=re(t,e.to.line)&&Ri(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,a=0==Ta(e.from,e.to),s=Br(n,i,a),l=Vr(r,o,a),u=1==e.text.length,c=xo(e.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=zr(l,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(l)for(var f=0;f<l.length;++f){var h=l[f];null!=h.to&&(h.to+=c);if(null==h.from){var d=zr(s,h.marker);if(!d){h.from=c;u&&(s||(s=[])).push(h)}}else{h.from+=c;u&&(s||(s=[])).push(h)}}s&&(s=Gr(s));l&&l!=s&&(l=Gr(l));var p=[s];if(!u){var g,m=e.text.length-2;if(m>0&&s)for(var f=0;f<s.length;++f)null==s[f].to&&(g||(g=[])).push(new Wr(s[f].marker,null,null));for(var f=0;m>f;++f)p.push(g);p.push(l)}return p}function Gr(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&t.splice(e--,1)}return t.length?t:null}function $r(t,e){var n=no(t,e),r=Xr(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue t;o.push(l)}else a&&(n[i]=a)}return n}function Yr(t,e,n){var r=null;t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=wo(r,n)||(r||(r=[])).push(n)}});if(!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(Ta(u.to,s.from)<0||Ta(u.from,s.to)>0)){var c=[l,1],f=Ta(u.from,s.from),h=Ta(u.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from});(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to});i.splice.apply(i,c);l+=c.length-1}}return i}function Jr(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Kr(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Zr(t){return t.inclusiveLeft?-1:0}function Qr(t){return t.inclusiveRight?1:0}function ti(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=Ta(r.from,i.from)||Zr(t)-Zr(e);if(o)return-o;var a=Ta(r.to,i.to)||Qr(t)-Qr(e);return a?a:e.id-t.id}function ei(t,e){var n,r=Ca&&t.markedSpans;if(r)for(var i,o=0;o<r.length;++o){i=r[o];i.marker.collapsed&&null==(e?i.from:i.to)&&(!n||ti(n,i.marker)<0)&&(n=i.marker)}return n}function ni(t){return ei(t,!0)}function ri(t){return ei(t,!1)}function ii(t,e,n,r,i){var o=Ri(t,e),a=Ca&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=Ta(u.from,n)||Zr(l.marker)-Zr(i),f=Ta(u.to,r)||Qr(l.marker)-Qr(i);if(!(c>=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Ta(u.to,n)>0||l.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Ta(u.from,r)<0||l.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function oi(t){for(var e;e=ni(t);)t=e.find(-1,!0).line;return t}function ai(t){for(var e,n;e=ri(t);){t=e.find(1,!0).line;(n||(n=[])).push(t)}return n}function si(t,e){var n=Ri(t,e),r=oi(n);return n==r?e:qi(r)}function li(t,e){if(e>t.lastLine())return e;var n,r=Ri(t,e);if(!ui(t,r))return e;for(;n=ri(r);)r=n.find(1,!0).line;return qi(r)+1}function ui(t,e){var n=Ca&&e.markedSpans;if(n)for(var r,i=0;i<n.length;++i){r=n[i];if(r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ci(t,e,r))return!0}}}function ci(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return ci(t,r.line,zr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i,o=0;o<e.markedSpans.length;++o){i=e.markedSpans[o];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ci(t,e,i))return!0}}function fi(t,e,n){Bi(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Tr(t,null,n)}function hi(t){if(null!=t.height)return t.height;if(!Eo(document.body,t.node)){var e="position: relative;";t.coverGutter&&(e+="margin-left: -"+t.cm.display.gutters.offsetWidth+"px;");t.noHScroll&&(e+="width: "+t.cm.display.wrapper.clientWidth+"px;");No(t.cm.display.measure,Lo("div",[t.node],null,e))}return t.height=t.node.offsetHeight}function di(t,e,n,r){var i=new is(t,n,r);i.noHScroll&&(t.display.alignWidgets=!0);Dr(t.doc,e,"widget",function(e){var n=e.widgets||(e.widgets=[]);null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i);i.line=e;if(!ui(t.doc,e)){var r=Bi(e)<t.doc.scrollTop;zi(e,e.height+hi(i));r&&Tr(t,null,i.height);t.curOp.forceUpdate=!0}return!0});return i}function pi(t,e,n,r){t.text=e;t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null);null!=t.order&&(t.order=null);Jr(t);Kr(t,n);var i=r?r(t):1;i!=t.height&&zi(t,i)}function gi(t){t.parent=null;Jr(t)}function mi(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(e[r])||(e[r]+=" "+n[2])}return t}function vi(e,n){if(e.blankLine)return e.blankLine(n);if(e.innerMode){var r=t.innerMode(e,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function yi(e,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=t.innerMode(e,r).mode);var a=e.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}function bi(t,e,n,r){function i(t){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:t?Ga(a.mode,c):c}}var o,a=t.doc,s=a.mode;e=ee(a,e);var l,u=Ri(a,e.line),c=Me(t,e.line,n),f=new ts(u.text,t.options.tabSize);r&&(l=[]);for(;(r||f.pos<e.ch)&&!f.eol();){f.start=f.pos;o=yi(s,f,c);r&&l.push(i(!0))}return r?l:i()}function xi(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,u=0,c=null,f=new ts(e,t.options.tabSize),h=t.options.addModeClass&&[null];""==e&&mi(vi(n,r),o);for(;!f.eol();){if(f.pos>t.options.maxHighlightLength){s=!1;a&&Si(t,e,r,f.pos);f.pos=e.length;l=null}else l=mi(yi(n,f,r,h),o);if(h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u<f.start;){u=Math.min(f.start,u+5e4);i(u,c)}c=l}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e4);i(p,c);u=p}}function wi(t,e,n,r){var i=[t.state.modeGen],o={};xi(t,e.text,t.doc.mode,n,function(t,e){i.push(t,e)},o,r);for(var a=0;a<t.state.overlays.length;++a){var s=t.state.overlays[a],l=1,u=0;xi(t,e.text,s.mode,!0,function(t,e){for(var n=l;t>u;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r);l+=2;u=Math.min(t,r)}if(e)if(s.opaque){i.splice(n,l-n,t,"cm-overlay "+e);l=n+2}else for(;l>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+e}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ci(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=wi(t,e,e.stateAfter=Me(t,qi(e)));e.styles=r.styles;r.classes?e.styleClasses=r.classes:e.styleClasses&&(e.styleClasses=null);n===t.doc.frontier&&t.doc.frontier++}return e.styles}function Si(t,e,n,r){var i=t.doc.mode,o=new ts(e,t.options.tabSize);o.start=o.pos=r||0;""==e&&vi(i,n);for(;!o.eol()&&o.pos<=t.options.maxHighlightLength;){yi(i,o,n);o.start=o.pos}}function Ti(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?ss:as;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function ki(t,e){var n=Lo("span",null,null,aa?"padding-right: .1px":null),r={pre:Lo("pre",[n]),content:n,col:0,pos:0,cm:t};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o,a=i?e.rest[i-1]:e.line;r.pos=0;r.addToken=Mi;(ia||aa)&&t.getOption("lineWrapping")&&(r.addToken=Di(r.addToken));Wo(t.display.measure)&&(o=Vi(a))&&(r.addToken=Li(r.addToken,o));r.map=[];var s=e!=t.display.externalMeasured&&qi(a);Ni(a,r,Ci(t,a,s));if(a.styleClasses){a.styleClasses.bgClass&&(r.bgClass=Po(a.styleClasses.bgClass,r.bgClass||""));a.styleClasses.textClass&&(r.textClass=Po(a.styleClasses.textClass,r.textClass||""))}0==r.map.length&&r.map.push(0,0,r.content.appendChild(Fo(t.display.measure)));if(0==i){e.measure.map=r.map;e.measure.cache={}}else{(e.measure.maps||(e.measure.maps=[])).push(r.map);(e.measure.caches||(e.measure.caches=[])).push({})}}aa&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack");vs(t,"renderLine",t,e.line,r.pre);r.pre.className&&(r.textClass=Po(r.pre.className,r.textClass||""));return r}function _i(t){var e=Lo("span","•","cm-invalidchar");e.title="\\u"+t.charCodeAt(0).toString(16);return e}function Mi(t,e,n,r,i,o,a){if(e){var s=t.cm.options.specialChars,l=!1;if(s.test(e))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(e),h=f?f.index-c:e.length-c;if(h){var d=document.createTextNode(e.slice(c,c+h));u.appendChild(ia&&9>oa?Lo("span",[d]):d);t.map.push(t.pos,t.pos+h,d);t.col+=h;t.pos+=h}if(!f)break;c+=h+1;if(" "==f[0]){var p=t.cm.options.tabSize,g=p-t.col%p,d=u.appendChild(Lo("span",bo(g),"cm-tab"));t.col+=g}else{var d=t.cm.options.specialCharPlaceholder(f[0]);u.appendChild(ia&&9>oa?Lo("span",[d]):d);t.col+=1}t.map.push(t.pos,t.pos+1,d);t.pos++}else{t.col+=e.length;var u=document.createTextNode(e);t.map.push(t.pos,t.pos+e.length,u);ia&&9>oa&&(l=!0);t.pos+=e.length}if(n||r||i||l||a){var m=n||"";r&&(m+=r);i&&(m+=i);var v=Lo("span",[u],m,a);o&&(v.title=o);return t.content.appendChild(v)}t.content.appendChild(u)}}function Di(t){function e(t){for(var e=" ",n=0;n<t.length-2;++n)e+=n%2?" ":" ";e+=" ";return e}return function(n,r,i,o,a,s){t(n,r.replace(/ {3,}/g,e),i,o,a,s)}}function Li(t,e){return function(n,r,i,o,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,u=l+r.length;;){for(var c=0;c<e.length;c++){var f=e[c];if(f.to>l&&f.from<=l)break}if(f.to>=u)return t(n,r,i,o,a,s);t(n,r.slice(0,f.to-l),i,o,null,s);o=null;r=r.slice(f.to-l);l=f.to}}}function Ai(t,e,n,r){var i=!r&&n.widgetNode;if(i){t.map.push(t.pos,t.pos+e,i);t.content.appendChild(i)}t.pos+=e}function Ni(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=f=s="";h=null;v=1/0;for(var y=[],b=0;b<r.length;++b){var x=r[b],w=x.marker;if(x.from<=p&&(null==x.to||x.to>p)){if(null!=x.to&&v>x.to){v=x.to;u=""}w.className&&(l+=" "+w.className);w.css&&(s=w.css);w.startStyle&&x.from==p&&(c+=" "+w.startStyle);w.endStyle&&x.to==v&&(u+=" "+w.endStyle);w.title&&!f&&(f=w.title);w.collapsed&&(!h||ti(h.marker,w)<0)&&(h=x)}else x.from>p&&v>x.from&&(v=x.from);"bookmark"==w.type&&x.from==p&&w.widgetNode&&y.push(w)}if(h&&(h.from||0)==p){Ai(e,(null==h.to?d+1:h.to)-p,h.marker,null==h.from);if(null==h.to)return}if(!h&&y.length)for(var b=0;b<y.length;++b)Ai(e,0,y[b])}if(p>=d)break;for(var C=Math.min(d,v);;){if(m){var S=p+m.length;if(!h){var T=S>C?m.slice(0,C-p):m;e.addToken(e,T,a?a+l:l,c,p+T.length==v?u:"",f,s)}if(S>=C){m=m.slice(C-p);p=C;break}p=S;c=""}m=i.slice(o,o=n[g++]);a=Ti(n[g++],e.cm.options)}}else for(var g=1;g<n.length;g+=2)e.addToken(e,i.slice(o,o=n[g]),Ti(n[g+1],e.cm.options))}function Ei(t,e){return 0==e.from.ch&&0==e.to.ch&&""==xo(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function ji(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){pi(t,n,i,r);co(t,"change",t,e)}function a(t,e){for(var n=t,o=[];e>n;++n)o.push(new os(u[n],i(n),r));return o}var s=e.from,l=e.to,u=e.text,c=Ri(t,s.line),f=Ri(t,l.line),h=xo(u),d=i(u.length-1),p=l.line-s.line;if(e.full){t.insert(0,a(0,u.length));t.remove(u.length,t.size-u.length)}else if(Ei(t,e)){var g=a(0,u.length-1);o(f,f.text,d);p&&t.remove(s.line,p);g.length&&t.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(l.ch),d);else{var g=a(1,u.length-1);g.push(new os(h+c.text.slice(l.ch),d,r));o(c,c.text.slice(0,s.ch)+u[0],i(0));t.insert(s.line+1,g)}else if(1==u.length){o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0));t.remove(s.line+1,p)}else{o(c,c.text.slice(0,s.ch)+u[0],i(0));o(f,h+f.text.slice(l.ch),d);var g=a(1,u.length-1);p>1&&t.remove(s.line+1,p-1);t.insert(s.line+1,g)}co(t,"change",t,e)}function Ii(t){this.lines=t;this.parent=null;for(var e=0,n=0;e<t.length;++e){t[e].parent=this;n+=t[e].height}this.height=n}function Pi(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize();n+=i.height;i.parent=this}this.size=e;this.height=n;this.parent=null}function Hi(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;if(!n||l){e(s.doc,l);r(s.doc,t,l)}}}}r(t,null,!0)}function Oi(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e;e.cm=t;a(t);n(t);t.options.lineWrapping||h(t);t.options.mode=e.modeOption;xn(t)}function Ri(t,e){e-=t.first;if(0>e||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>e){n=i;break}e-=o}return n.lines[e]}function Fi(t,e,n){var r=[],i=e.line;t.iter(e.line,n.line+1,function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch));i==e.line&&(o=o.slice(e.ch));r.push(o);++i});return r}function Wi(t,e,n){var r=[];t.iter(e,n,function(t){r.push(t.text)});return r}function zi(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function qi(t){if(null==t.parent)return null;for(var e=t.parent,n=wo(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Ui(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(o>e){t=i;continue t}e-=o;n+=i.chunkSize()}return n}while(!t.lines);for(var r=0;r<t.lines.length;++r){var a=t.lines[r],s=a.height;if(s>e)break;e-=s}return n+r}function Bi(t){t=oi(t);for(var e=0,n=t.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;e+=a.height}return e}function Vi(t){var e=t.order;null==e&&(e=t.order=Us(t.text));return e}function Xi(t){this.done=[];this.undone=[];this.undoDepth=1/0;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=t||1}function Gi(t,e){var n={from:G(e.from),to:Ra(e),text:Fi(t,e.from,e.to)};to(t,n,e.from.line,e.to.line+1);Hi(t,function(t){to(t,n,e.from.line,e.to.line+1)},!0);return n}function $i(t){for(;t.length;){var e=xo(t);if(!e.ranges)break;t.pop()}}function Yi(t,e){if(e){$i(t.done);return xo(t.done)}if(t.done.length&&!xo(t.done).ranges)return xo(t.done);if(t.done.length>1&&!t.done[t.done.length-2].ranges){t.done.pop();return xo(t.done)}}function Ji(t,e,n,r){var i=t.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&i.lastModTime>a-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=Yi(i,i.lastOp==r))){var s=xo(o.changes);0==Ta(e.from,e.to)&&0==Ta(e.from,s.to)?s.to=Ra(e):o.changes.push(Gi(t,e))}else{var l=xo(i.done);l&&l.ranges||Qi(t.sel,i.done);o={changes:[Gi(t,e)],generation:i.generation};i.done.push(o);for(;i.done.length>i.undoDepth;){i.done.shift();i.done[0].ranges||i.done.shift()}}i.done.push(n);i.generation=++i.maxGeneration;i.lastModTime=i.lastSelTime=a;i.lastOp=i.lastSelOp=r;i.lastOrigin=i.lastSelOrigin=e.origin;s||vs(t,"historyAdded")}function Ki(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Zi(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ki(t,o,xo(i.done),e))?i.done[i.done.length-1]=e:Qi(e,i.done);i.lastSelTime=+new Date;i.lastSelOrigin=o;i.lastSelOp=n;r&&r.clearRedo!==!1&&$i(i.undone)}function Qi(t,e){var n=xo(e);n&&n.ranges&&n.equals(t)||e.push(t)}function to(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans);++o})}function eo(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function no(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=0,i=[];r<e.text.length;++r)i.push(eo(n[r]));return i}function ro(t,e,n){for(var r=0,i=[];r<t.length;++r){var o=t[r];if(o.ranges)i.push(n?J.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var u,c=a[l];s.push({from:c.from,to:c.to,text:c.text});if(e)for(var f in c)if((u=f.match(/^spans_(\d+)$/))&&wo(e,Number(u[1]))>-1){xo(s)[f]=c[f];delete c[f]}}}}return i}function io(t,e,n,r){if(n<t.line)t.line+=r;else if(e<t.line){t.line=e;t.ch=0}}function oo(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){if(!o.copied){o=t[i]=o.deepCopy();o.copied=!0}for(var s=0;s<o.ranges.length;s++){io(o.ranges[s].anchor,e,n,r);io(o.ranges[s].head,e,n,r)}}else{for(var s=0;s<o.changes.length;++s){var l=o.changes[s];if(n<l.from.line){l.from=Sa(l.from.line+r,l.from.ch);l.to=Sa(l.to.line+r,l.to.ch)}else if(e<=l.to.line){a=!1;break}}if(!a){t.splice(0,i+1);i=0}}}}function ao(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;oo(t.done,n,r,i);oo(t.undone,n,r,i)}function so(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function lo(t){return t.target||t.srcElement}function uo(t){var e=t.which;null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2));ma&&t.ctrlKey&&1==e&&(e=3);return e}function co(t,e){function n(t){return function(){t.apply(null,o)}}var r=t._handlers&&t._handlers[e]; if(r){var i,o=Array.prototype.slice.call(arguments,2);if(La)i=La.delayedCallbacks;else if(ys)i=ys;else{i=ys=[];setTimeout(fo,0)}for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function fo(){var t=ys;ys=null;for(var e=0;e<t.length;++e)t[e]()}function ho(t,e,n){"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}});vs(t,n||e.type,t,e);return so(e)||e.codemirrorIgnore}function po(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==wo(n,e[r])&&n.push(e[r])}function go(t,e){var n=t._handlers&&t._handlers[e];return n&&n.length>0}function mo(t){t.prototype.on=function(t,e){gs(this,t,e)};t.prototype.off=function(t,e){ms(this,t,e)}}function vo(){this.id=null}function yo(t,e,n){for(var r=0,i=0;;){var o=t.indexOf(" ",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);i+=o-r;i+=n-i%n;r=o+1;if(i>=e)return r}}function bo(t){for(;ks.length<=t;)ks.push(xo(ks)+" ");return ks[t]}function xo(t){return t[t.length-1]}function wo(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}function Co(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function So(t,e){var n;if(Object.create)n=Object.create(t);else{var r=function(){};r.prototype=t;n=new r}e&&To(e,n);return n}function To(t,e,n){e||(e={});for(var r in t)!t.hasOwnProperty(r)||n===!1&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function ko(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function _o(t,e){return e?e.source.indexOf("\\w")>-1&&Ls(t)?!0:e.test(t):Ls(t)}function Mo(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function Do(t){return t.charCodeAt(0)>=768&&As.test(t)}function Lo(t,e,n,r){var i=document.createElement(t);n&&(i.className=n);r&&(i.style.cssText=r);if("string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function Ao(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function No(t,e){return Ao(t).appendChild(e)}function Eo(t,e){if(t.contains)return t.contains(e);for(;e=e.parentNode;)if(e==t)return!0}function jo(){return document.activeElement}function Io(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function Po(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!Io(n[r]).test(e)&&(e+=" "+n[r]);return e}function Ho(t){if(document.body.getElementsByClassName)for(var e=document.body.getElementsByClassName("CodeMirror"),n=0;n<e.length;n++){var r=e[n].CodeMirror;r&&t(r)}}function Oo(){if(!Ps){Ro();Ps=!0}}function Ro(){var t;gs(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null;Ho(Pn)},100))});gs(window,"blur",function(){Ho(or)})}function Fo(t){if(null==Ns){var e=Lo("span","​");No(t,Lo("span",[e,document.createTextNode("x")]));0!=t.firstChild.offsetHeight&&(Ns=e.offsetWidth<=1&&e.offsetHeight>2&&!(ia&&8>oa))}return Ns?Lo("span","​"):Lo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Wo(t){if(null!=Es)return Es;var e=No(t,document.createTextNode("AخA")),n=Ms(e,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ms(e,1,2).getBoundingClientRect();return Es=r.right-n.right<3}function zo(t){if(null!=Ws)return Ws;var e=No(t,Lo("span","x")),n=e.getBoundingClientRect(),r=Ms(e,0,1).getBoundingClientRect();return Ws=Math.abs(n.left-r.left)>1}function qo(t,e,n,r){if(!t)return r(e,n,"ltr");for(var i=!1,o=0;o<t.length;++o){var a=t[o];if(a.from<n&&a.to>e||e==n&&a.to==e){r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr");i=!0}}i||r(e,n,"ltr")}function Uo(t){return t.level%2?t.to:t.from}function Bo(t){return t.level%2?t.from:t.to}function Vo(t){var e=Vi(t);return e?Uo(e[0]):0}function Xo(t){var e=Vi(t);return e?Bo(xo(e)):t.text.length}function Go(t,e){var n=Ri(t.doc,e),r=oi(n);r!=n&&(e=qi(r));var i=Vi(r),o=i?i[0].level%2?Xo(r):Vo(r):0;return Sa(e,o)}function $o(t,e){for(var n,r=Ri(t.doc,e);n=ri(r);){r=n.find(1,!0).line;e=null}var i=Vi(r),o=i?i[0].level%2?Vo(r):Xo(r):r.text.length;return Sa(null==e?qi(r):e,o)}function Yo(t,e){var n=Go(t,e.line),r=Ri(t.doc,n.line),i=Vi(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return Sa(n.line,a?0:o)}return n}function Jo(t,e,n){var r=t[0].level;return e==r?!0:n==r?!1:n>e}function Ko(t,e){qs=null;for(var n,r=0;r<t.length;++r){var i=t[r];if(i.from<e&&i.to>e)return r;if(i.from==e||i.to==e){if(null!=n){if(Jo(t,i.level,t[n].level)){i.from!=i.to&&(qs=n);return r}i.from!=i.to&&(qs=r);return n}n=r}}return n}function Zo(t,e,n,r){if(!r)return e+n;do e+=n;while(e>0&&Do(t.text.charAt(e)));return e}function Qo(t,e,n,r){var i=Vi(t);if(!i)return ta(t,e,n,r);for(var o=Ko(i,e),a=i[o],s=Zo(t,e,a.level%2?-n:n,r);;){if(s>a.from&&s<a.to)return s;if(s==a.from||s==a.to){if(Ko(i,s)==o)return s;a=i[o+=n];return n>0==a.level%2?a.to:a.from}a=i[o+=n];if(!a)return null;s=n>0==a.level%2?Zo(t,a.to,-1,r):Zo(t,a.from,1,r)}}function ta(t,e,n,r){var i=e+n;if(r)for(;i>0&&Do(t.text.charAt(i));)i+=n;return 0>i||i>t.text.length?null:i}var ea=/gecko\/\d/i.test(navigator.userAgent),na=/MSIE \d/.test(navigator.userAgent),ra=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ia=na||ra,oa=ia&&(na?document.documentMode||6:ra[1]),aa=/WebKit\//.test(navigator.userAgent),sa=aa&&/Qt\/\d+\.\d+/.test(navigator.userAgent),la=/Chrome\//.test(navigator.userAgent),ua=/Opera\//.test(navigator.userAgent),ca=/Apple Computer/.test(navigator.vendor),fa=/KHTML\//.test(navigator.userAgent),ha=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),da=/PhantomJS/.test(navigator.userAgent),pa=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ga=pa||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ma=pa||/Mac/.test(navigator.platform),va=/win/i.test(navigator.platform),ya=ua&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);ya&&(ya=Number(ya[1]));if(ya&&ya>=15){ua=!1;aa=!0}var ba=ma&&(sa||ua&&(null==ya||12.11>ya)),xa=ea||ia&&oa>=9,wa=!1,Ca=!1;g.prototype=To({update:function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(e){this.horiz.style.display="block";this.horiz.style.right=n?r+"px":"0";this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=t.scrollWidth-t.clientWidth+o+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&t.clientHeight>0){0==r&&this.overlayHack();this.checkedOverlay=!0}return{right:n?r:0,bottom:e?r:0}},setScrollLeft:function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t)},setScrollTop:function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t)},overlayHack:function(){var t=ma&&!ha?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=t;var e=this,n=function(t){lo(t)!=e.vert&&lo(t)!=e.horiz&&gn(e.cm,Rn)(t)};gs(this.vert,"mousedown",n);gs(this.horiz,"mousedown",n)},clear:function(){var t=this.horiz.parentNode;t.removeChild(this.horiz);t.removeChild(this.vert)}},g.prototype);m.prototype=To({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype);t.scrollbarModel={"native":g,"null":m};var Sa=t.Pos=function(t,e){if(!(this instanceof Sa))return new Sa(t,e);this.line=t;this.ch=e},Ta=t.cmpPos=function(t,e){return t.line-e.line||t.ch-e.ch};J.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(0!=Ta(n.anchor,r.anchor)||0!=Ta(n.head,r.head))return!1}return!0},deepCopy:function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new K(G(this.ranges[e].anchor),G(this.ranges[e].head));return new J(t,this.primIndex)},somethingSelected:function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},contains:function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ta(e,r.from())>=0&&Ta(t,r.to())<=0)return n}return-1}};K.prototype={from:function(){return Y(this.anchor,this.head)},to:function(){return $(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var ka,_a,Ma,Da={left:0,right:0,top:0,bottom:0},La=null,Aa=0,Na=null,Ea=0,ja=0,Ia=null;ia?Ia=-.53:ea?Ia=15:la?Ia=-.7:ca&&(Ia=-1/3);var Pa=function(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail);null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta);return{x:e,y:n}};t.wheelEventPixels=function(t){var e=Pa(t);e.x*=Ia;e.y*=Ia;return e};var Ha=new vo,Oa=null,Ra=t.changeEnd=function(t){return t.text?Sa(t.from.line+t.text.length-1,xo(t.text).length+(1==t.text.length?t.from.ch:0)):t.to};t.prototype={constructor:t,focus:function(){window.focus();Nn(this);Dn(this)},setOption:function(t,e){var n=this.options,r=n[t];if(n[t]!=e||"mode"==t){n[t]=e;Wa.hasOwnProperty(t)&&gn(this,Wa[t])(this,e,r)}},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Ir(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t){e.splice(n,1);return!0}},addOverlay:mn(function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:e,opaque:n&&n.opaque});this.state.modeGen++;xn(this)}),removeOverlay:mn(function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t){e.splice(n,1);this.state.modeGen++;xn(this);return}}}),indentLine:mn(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract");re(this.doc,t)&&Mr(this,t,e,n)}),indentSelection:mn(function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty()){if(i.head.line>n){Mr(this,i.head.line,t,!0);n=i.head.line;r==this.doc.sel.primIndex&&kr(this)}}else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;n>l;++l)Mr(this,l,t);var u=this.doc.sel.ranges;0==o.ch&&e.length==u.length&&u[r].from().ch>0&&le(this.doc,r,new K(o,u[r].to()),ws)}}}),getTokenAt:function(t,e){return bi(this,t,e)},getLineTokens:function(t,e){return bi(this,Sa(t),e,!0)},getTokenTypeAt:function(t){t=ee(this.doc,t);var e,n=Ci(this,Ri(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}r=a+1}}var s=e?e.indexOf("cm-overlay "):-1;return 0>s?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var n=[];if(!Xa.hasOwnProperty(e))return Xa;var r=Xa[e],i=this.getModeAt(t);if("string"==typeof i[e])r[i[e]]&&n.push(r[i[e]]);else if(i[e])for(var o=0;o<i[e].length;o++){var a=r[i[e][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var s=r._global[o];s.pred(i,this)&&-1==wo(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(t,e){var n=this.doc;t=te(n,null==t?n.first+n.size-1:t);return Me(this,t+1,e)},cursorCoords:function(t,e){var n,r=this.doc.sel.primary();n=null==t?r.head:"object"==typeof t?ee(this.doc,t):t?r.from():r.to();return Ke(this,n,e||"page")},charCoords:function(t,e){return Je(this,ee(this.doc,t),e||"page")},coordsChar:function(t,e){t=Ye(this,t,e||"page");return tn(this,t.left,t.top)},lineAtHeight:function(t,e){t=Ye(this,{top:t,left:0},e||"page").top;return Ui(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e){var n=!1,r=this.doc.first+this.doc.size-1;if(t<this.doc.first)t=this.doc.first;else if(t>r){t=r;n=!0}var i=Ri(this.doc,t);return $e(this,i,{top:0,left:0},e||"page").top+(n?this.doc.height-Bi(i):0)},defaultTextHeight:function(){return nn(this.display)},defaultCharWidth:function(){return rn(this.display)},setGutterMarker:mn(function(t,e,n){return Dr(this.doc,t,"gutter",function(t){var r=t.gutterMarkers||(t.gutterMarkers={});r[e]=n;!n&&Mo(r)&&(t.gutterMarkers=null);return!0})}),clearGutter:mn(function(t){var e=this,n=e.doc,r=n.first;n.iter(function(n){if(n.gutterMarkers&&n.gutterMarkers[t]){n.gutterMarkers[t]=null;wn(e,r,"gutter");Mo(n.gutterMarkers)&&(n.gutterMarkers=null)}++r})}),addLineWidget:mn(function(t,e,n){return di(this,t,e,n)}),removeLineWidget:function(t){t.clear()},lineInfo:function(t){if("number"==typeof t){if(!re(this.doc,t))return null;var e=t;t=Ri(this.doc,t);if(!t)return null}else{var e=qi(t);if(null==e)return null}return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=Ke(this,ee(this.doc,t));var a=t.bottom,s=t.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");o.sizer.appendChild(e);if("over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom);s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px";e.style.left=e.style.right="";if("right"==i){s=o.sizer.clientWidth-e.offsetWidth;e.style.right="0px"}else{"left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2);e.style.left=s+"px"}n&&Cr(this,s,a,s+e.offsetWidth,a+e.offsetHeight)},triggerOnKeyDown:mn(tr),triggerOnKeyPress:mn(rr),triggerOnKeyUp:nr,execCommand:function(t){return Ya.hasOwnProperty(t)?Ya[t](this):void 0},findPosH:function(t,e,n,r){var i=1;if(0>e){i=-1;e=-e}for(var o=0,a=ee(this.doc,t);e>o;++o){a=Ar(this.doc,a,i,n,r);if(a.hitSide)break}return a},moveH:mn(function(t,e){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Ar(n.doc,r.head,t,e,n.options.rtlMoveVisually):0>t?r.from():r.to()},Ss)}),deleteH:mn(function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Lr(this,function(n){var i=Ar(r,n.head,t,e,!1);return 0>t?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(t,e,n,r){var i=1,o=r;if(0>e){i=-1;e=-e}for(var a=0,s=ee(this.doc,t);e>a;++a){var l=Ke(this,s,"div");null==o?o=l.left:l.left=o;s=Nr(this,l,i,n);if(s.hitSide)break}return s},moveV:mn(function(t,e){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(a){if(o)return 0>t?a.from():a.to();var s=Ke(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn);i.push(s.left);var l=Nr(n,s,t,e);"page"==e&&a==r.sel.primary()&&Tr(n,null,Je(n,l,"div").top-s.top);return l},Ss);if(i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(t){var e=this.doc,n=Ri(e,t.line).text,r=t.ch,i=t.ch;if(n){var o=this.getHelper(t,"wordChars");(t.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),s=_o(a,o)?function(t){return _o(t,o)}:/\s/.test(a)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!_o(t)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new K(Sa(t.line,r),Sa(t.line,i))},toggleOverwrite:function(t){if(null==t||t!=this.state.overwrite){(this.state.overwrite=!this.state.overwrite)?Is(this.display.cursorDiv,"CodeMirror-overwrite"):js(this.display.cursorDiv,"CodeMirror-overwrite");vs(this,"overwriteToggle",this,this.state.overwrite)}},hasFocus:function(){return jo()==this.display.input},scrollTo:mn(function(t,e){(null!=t||null!=e)&&_r(this);null!=t&&(this.curOp.scrollLeft=t);null!=e&&(this.curOp.scrollTop=e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Ne(this)-this.display.barHeight,width:t.scrollWidth-Ne(this)-this.display.barWidth,clientHeight:je(this),clientWidth:Ee(this)}},scrollIntoView:mn(function(t,e){if(null==t){t={from:this.doc.sel.primary().head,to:null};null==e&&(e=this.options.cursorScrollMargin)}else"number"==typeof t?t={from:Sa(t,0),to:null}:null==t.from&&(t={from:t,to:null});t.to||(t.to=t.from);t.margin=e||0;if(null!=t.from.line){_r(this);this.curOp.scrollToPos=t}else{var n=Sr(this,Math.min(t.from.left,t.to.left),Math.min(t.from.top,t.to.top)-t.margin,Math.max(t.from.right,t.to.right),Math.max(t.from.bottom,t.to.bottom)+t.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:mn(function(t,e){function n(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t}var r=this;null!=t&&(r.display.wrapper.style.width=n(t));null!=e&&(r.display.wrapper.style.height=n(e));r.options.lineWrapping&&Be(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){wn(r,i,"widget");break}++i});r.curOp.forceUpdate=!0;vs(r,"refresh",this)}),operation:function(t){return pn(this,t)},refresh:mn(function(){var t=this.display.cachedTextHeight;xn(this);this.curOp.forceUpdate=!0;Ve(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);c(this);(null==t||Math.abs(t-nn(this.display))>.5)&&a(this);vs(this,"refresh",this)}),swapDoc:mn(function(t){var e=this.doc;e.cm=null;Oi(this,t);Ve(this);An(this);this.scrollTo(t.scrollLeft,t.scrollTop);this.curOp.forceScroll=!0;co(this,"swapDoc",this,e);return e}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};mo(t);var Fa=t.defaults={},Wa=t.optionHandlers={},za=t.Init={toString:function(){return"CodeMirror.Init"}};Er("value","",function(t,e){t.setValue(e)},!0);Er("mode",null,function(t,e){t.doc.modeOption=e;n(t)},!0);Er("indentUnit",2,n,!0);Er("indentWithTabs",!1);Er("smartIndent",!0);Er("tabSize",4,function(t){r(t);Ve(t);xn(t)},!0);Er("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e){t.options.specialChars=new RegExp(e.source+(e.test(" ")?"":"| "),"g");t.refresh()},!0);Er("specialCharPlaceholder",_i,function(t){t.refresh()},!0);Er("electricChars",!0);Er("rtlMoveVisually",!va);Er("wholeLineUpdateBefore",!0);Er("theme","default",function(t){s(t);l(t)},!0);Er("keyMap","default",function(e,n,r){var i=Ir(n),o=r!=t.Init&&Ir(r);o&&o.detach&&o.detach(e,i);i.attach&&i.attach(e,o||null)});Er("extraKeys",null);Er("lineWrapping",!1,i,!0);Er("gutters",[],function(t){d(t.options);l(t)},!0);Er("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?T(t.display)+"px":"0";t.refresh()},!0);Er("coverGutterNextToScrollbar",!1,function(t){y(t)},!0);Er("scrollbarStyle","native",function(t){v(t);y(t);t.display.scrollbars.setScrollTop(t.doc.scrollTop);t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0);Er("lineNumbers",!1,function(t){d(t.options);l(t)},!0);Er("firstLineNumber",1,l,!0);Er("lineNumberFormatter",function(t){return t},l,!0);Er("showCursorWhenSelecting",!1,xe,!0);Er("resetSelectionOnContextMenu",!0);Er("readOnly",!1,function(t,e){if("nocursor"==e){or(t);t.display.input.blur();t.display.disabled=!0}else{t.display.disabled=!1;e||An(t)}});Er("disableInput",!1,function(t,e){e||An(t)},!0);Er("dragDrop",!0);Er("cursorBlinkRate",530);Er("cursorScrollMargin",0);Er("cursorHeight",1,xe,!0);Er("singleCursorHeightPerLine",!0,xe,!0);Er("workTime",100);Er("workDelay",100);Er("flattenSpans",!0,r,!0);Er("addModeClass",!1,r,!0);Er("pollInterval",100);Er("undoDepth",200,function(t,e){t.doc.history.undoDepth=e});Er("historyEventDelay",1250);Er("viewportMargin",10,function(t){t.refresh()},!0);Er("maxHighlightLength",1e4,r,!0);Er("moveInputWithCursor",!0,function(t,e){e||(t.display.inputDiv.style.top=t.display.inputDiv.style.left=0)});Er("tabindex",null,function(t,e){t.display.input.tabIndex=e||""});Er("autofocus",null);var qa=t.modes={},Ua=t.mimeModes={};t.defineMode=function(e,n){t.defaults.mode||"null"==e||(t.defaults.mode=e);arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2));qa[e]=n};t.defineMIME=function(t,e){Ua[t]=e};t.resolveMode=function(e){if("string"==typeof e&&Ua.hasOwnProperty(e))e=Ua[e];else if(e&&"string"==typeof e.name&&Ua.hasOwnProperty(e.name)){var n=Ua[e.name];"string"==typeof n&&(n={name:n});e=So(n,e);e.name=n.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return t.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}};t.getMode=function(e,n){var n=t.resolveMode(n),r=qa[n.name];if(!r)return t.getMode(e,"text/plain");var i=r(e,n);if(Ba.hasOwnProperty(n.name)){var o=Ba[n.name];for(var a in o)if(o.hasOwnProperty(a)){i.hasOwnProperty(a)&&(i["_"+a]=i[a]);i[a]=o[a]}}i.name=n.name;n.helperType&&(i.helperType=n.helperType);if(n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i};t.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}});t.defineMIME("text/plain","null");var Ba=t.modeExtensions={};t.extendMode=function(t,e){var n=Ba.hasOwnProperty(t)?Ba[t]:Ba[t]={};To(e,n)};t.defineExtension=function(e,n){t.prototype[e]=n};t.defineDocExtension=function(t,e){us.prototype[t]=e};t.defineOption=Er;var Va=[];t.defineInitHook=function(t){Va.push(t)};var Xa=t.helpers={};t.registerHelper=function(e,n,r){Xa.hasOwnProperty(e)||(Xa[e]=t[e]={_global:[]});Xa[e][n]=r};t.registerGlobalHelper=function(e,n,r,i){t.registerHelper(e,n,i);Xa[e]._global.push({pred:r,val:i})};var Ga=t.copyState=function(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([]));n[r]=i}return n},$a=t.startState=function(t,e,n){return t.startState?t.startState(e,n):!0};t.innerMode=function(t,e){for(;t.innerMode;){var n=t.innerMode(e);if(!n||n.mode==t)break;e=n.state;t=n.mode}return n||{mode:t,state:e}};var Ya=t.commands={selectAll:function(t){t.setSelection(Sa(t.firstLine(),0),Sa(t.lastLine()),ws)},singleSelection:function(t){t.setSelection(t.getCursor("anchor"),t.getCursor("head"),ws)},killLine:function(t){Lr(t,function(e){if(e.empty()){var n=Ri(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:Sa(e.head.line+1,0)}:{from:e.head,to:Sa(e.head.line,n)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){Lr(t,function(e){return{from:Sa(e.from().line,0),to:ee(t.doc,Sa(e.to().line+1,0))}})},delLineLeft:function(t){Lr(t,function(t){return{from:Sa(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(t){Lr(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return{from:r,to:e.from()}})},delWrappedLineRight:function(t){Lr(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}})},undo:function(t){t.undo()},redo:function(t){t.redo()},undoSelection:function(t){t.undoSelection()},redoSelection:function(t){t.redoSelection()},goDocStart:function(t){t.extendSelection(Sa(t.firstLine(),0))},goDocEnd:function(t){t.extendSelection(Sa(t.lastLine()))},goLineStart:function(t){t.extendSelectionsBy(function(e){return Go(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){t.extendSelectionsBy(function(e){return Yo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){t.extendSelectionsBy(function(e){return $o(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")},Ss)},goLineLeft:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")},Ss)},goLineLeftSmart:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?Yo(t,e.head):r},Ss)},goLineUp:function(t){t.moveV(-1,"line")},goLineDown:function(t){t.moveV(1,"line")},goPageUp:function(t){t.moveV(-1,"page")},goPageDown:function(t){t.moveV(1,"page")},goCharLeft:function(t){t.moveH(-1,"char")},goCharRight:function(t){t.moveH(1,"char")},goColumnLeft:function(t){t.moveH(-1,"column")},goColumnRight:function(t){t.moveH(1,"column")},goWordLeft:function(t){t.moveH(-1,"word")},goGroupRight:function(t){t.moveH(1,"group")},goGroupLeft:function(t){t.moveH(-1,"group")},goWordRight:function(t){t.moveH(1,"word")},delCharBefore:function(t){t.deleteH(-1,"char")},delCharAfter:function(t){t.deleteH(1,"char")},delWordBefore:function(t){t.deleteH(-1,"word")},delWordAfter:function(t){t.deleteH(1,"word")},delGroupBefore:function(t){t.deleteH(-1,"group")},delGroupAfter:function(t){t.deleteH(1,"group")},indentAuto:function(t){t.indentSelection("smart")},indentMore:function(t){t.indentSelection("add")},indentLess:function(t){t.indentSelection("subtract")},insertTab:function(t){t.replaceSelection(" ")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Ts(t.getLine(o.line),o.ch,r);e.push(new Array(r-a%r+1).join(" "))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){pn(t,function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++){var i=e[r].head,o=Ri(t.doc,i.line).text;if(o){i.ch==o.length&&(i=new Sa(i.line,i.ch-1));if(i.ch>0){i=new Sa(i.line,i.ch+1);t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Sa(i.line,i.ch-2),i,"+transpose")}else if(i.line>t.doc.first){var a=Ri(t.doc,i.line-1).text;a&&t.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Sa(i.line-1,a.length-1),Sa(i.line,1),"+transpose")}}n.push(new K(i,i))}t.setSelections(n)})},newlineAndIndent:function(t){pn(t,function(){for(var e=t.listSelections().length,n=0;e>n;n++){var r=t.listSelections()[n];t.replaceRange("\n",r.anchor,r.head,"+input");t.indentLine(r.from().line+1,null,!0);kr(t)}})},toggleOverwrite:function(t){t.toggleOverwrite()}},Ja=t.keyMap={};Ja.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Ja.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Ja.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};Ja.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Ja["default"]=ma?Ja.macDefault:Ja.pcDefault;t.normalizeKeyMap=function(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=Co(n.split(" "),jr),o=0;o<i.length;o++){var a,s;if(o==i.length-1){s=n;a=r}else{s=i.slice(0,o+1).join(" ");a="..."}var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var u in e)t[u]=e[u];return t};var Ka=t.lookupKey=function(t,e,n,r){e=Ir(e);var i=e.call?e.call(t,r):e[t];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Ka(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=Ka(t,e.fallthrough[o],n,r);if(a)return a}}},Za=t.isModifierKey=function(t){var e="string"==typeof t?t:zs[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e},Qa=t.keyName=function(t,e){if(ua&&34==t.keyCode&&t["char"])return!1;var n=zs[t.keyCode],r=n;if(null==r||t.altGraphKey)return!1;t.altKey&&"Alt"!=n&&(r="Alt-"+r);(ba?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r);(ba?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r);!e&&t.shiftKey&&"Shift"!=n&&(r="Shift-"+r);return r};t.fromTextArea=function(e,n){function r(){e.value=u.getValue()}n||(n={});n.value=e.value;!n.tabindex&&e.tabindex&&(n.tabindex=e.tabindex);!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder);if(null==n.autofocus){var i=jo();n.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}if(e.form){gs(e.form,"submit",r);if(!n.leaveSubmitMethodAlone){var o=e.form,a=o.submit;try{var s=o.submit=function(){r();o.submit=a;o.submit();o.submit=s}}catch(l){}}}e.style.display="none";var u=t(function(t){e.parentNode.insertBefore(t,e.nextSibling)},n);u.save=r;u.getTextArea=function(){return e};u.toTextArea=function(){u.toTextArea=isNaN;r();e.parentNode.removeChild(u.getWrapperElement());e.style.display="";if(e.form){ms(e.form,"submit",r);"function"==typeof e.form.submit&&(e.form.submit=a)}};return u};var ts=t.StringStream=function(t,e){this.pos=this.start=0;this.string=t;this.tabSize=e||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};ts.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(t){var e=this.string.charAt(this.pos);if("string"==typeof t)var n=e==t;else var n=e&&(t.test?t.test(e):t(e));if(n){++this.pos;return e}},eatWhile:function(t){for(var e=this.pos;this.eat(t););return this.pos>e},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1){this.pos=e;return!0}},backUp:function(t){this.pos-=t},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=Ts(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue); this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?Ts(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Ts(this.string,null,this.tabSize)-(this.lineStart?Ts(this.string,this.lineStart,this.tabSize):0)},match:function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);if(r&&r.index>0)return null;r&&e!==!1&&(this.pos+=r[0].length);return r}var i=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(i(o)==i(t)){e!==!1&&(this.pos+=t.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}};var es=t.TextMarker=function(t,e){this.lines=[];this.type=e;this.doc=t};mo(es);es.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;e&&on(t);if(go(this,"clear")){var n=this.find();n&&co(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=zr(a.markedSpans,this);if(t&&!this.collapsed)wn(t,qi(a),"text");else if(t){null!=s.to&&(i=qi(a));null!=s.from&&(r=qi(a))}a.markedSpans=qr(a.markedSpans,s);null==s.from&&this.collapsed&&!ui(this.doc,a)&&t&&zi(a,nn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=oi(this.lines[o]),u=f(l);if(u>t.display.maxLineLength){t.display.maxLine=l;t.display.maxLineLength=u;t.display.maxLineChanged=!0}}null!=r&&t&&this.collapsed&&xn(t,r,i+1);this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;t&&ge(t.doc)}t&&co(t,"markerCleared",t,this);e&&sn(t);this.parent&&this.parent.clear()}};es.prototype.find=function(t,e){null==t&&"bookmark"==this.type&&(t=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=zr(o.markedSpans,this);if(null!=a.from){n=Sa(e?o:qi(o),a.from);if(-1==t)return n}if(null!=a.to){r=Sa(e?o:qi(o),a.to);if(1==t)return r}}return n&&{from:n,to:r}};es.prototype.changed=function(){var t=this.find(-1,!0),e=this,n=this.doc.cm;t&&n&&pn(n,function(){var r=t.line,i=qi(t.line),o=Re(n,i);if(o){Ue(o);n.curOp.selectionChanged=n.curOp.forceUpdate=!0}n.curOp.updateMaxLine=!0;if(!ui(e.doc,r)&&null!=e.height){var a=e.height;e.height=null;var s=hi(e)-a;s&&zi(r,r.height+s)}})};es.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=wo(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)};es.prototype.detachLine=function(t){this.lines.splice(wo(this.lines,t),1);if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}};var ns=0,rs=t.SharedTextMarker=function(t,e){this.markers=t;this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};mo(rs);rs.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();co(this,"clear")}};rs.prototype.find=function(t,e){return this.primary.find(t,e)};var is=t.LineWidget=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.cm=t;this.node=e};mo(is);is.prototype.clear=function(){var t=this.cm,e=this.line.widgets,n=this.line,r=qi(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=hi(this);pn(t,function(){fi(t,n,-o);wn(t,r,"widget");zi(n,Math.max(0,n.height-o))})}};is.prototype.changed=function(){var t=this.height,e=this.cm,n=this.line;this.height=null;var r=hi(this)-t;r&&pn(e,function(){e.curOp.forceUpdate=!0;fi(e,n,r);zi(n,n.height+r)})};var os=t.Line=function(t,e,n){this.text=t;Kr(this,e);this.height=n?n(this):1};mo(os);os.prototype.lineNo=function(){return qi(this)};var as={},ss={};Ii.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;r>n;++n){var i=this.lines[n];this.height-=i.height;gi(i);co(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n;this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;r>t;++t)if(n(this.lines[t]))return!0}};Pi.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>t){var o=Math.min(e,i-t),a=r.height;r.removeInner(t,o);this.height-=a-r.height;if(i==o){this.children.splice(n--,1);r.parent=null}if(0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof Ii))){var s=[];this.collapse(s);this.children=[new Ii(s)];this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length;this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=t){i.insertInner(t,e,n);if(i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new Ii(a);i.height-=s.height;this.children.splice(r+1,0,s);s.parent=this}this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new Pi(e);if(t.parent){t.size-=n.size;t.height-=n.height;var r=wo(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new Pi(t.children);i.parent=t;t.children=[i,n];t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>t){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var ls=0,us=t.Doc=function(t,e,n){if(!(this instanceof us))return new us(t,e,n);null==n&&(n=0);Pi.call(this,[new Ii([new os("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=n;var r=Sa(n,0);this.sel=Q(r);this.history=new Xi(null);this.id=++ls;this.modeOption=e;"string"==typeof t&&(t=Os(t));ji(this,{from:r,to:r,text:t});he(this,Q(r),ws)};us.prototype=So(Pi.prototype,{constructor:us,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Wi(this,this.first,this.first+this.size);return t===!1?e:e.join(t||"\n")},setValue:vn(function(t){var e=Sa(this.first,0),n=this.first+this.size-1;dr(this,{from:e,to:Sa(n,Ri(this,n).text.length),text:Os(t),origin:"setValue",full:!0},!0);he(this,Q(e))}),replaceRange:function(t,e,n,r){e=ee(this,e);n=n?ee(this,n):e;br(this,t,e,n,r)},getRange:function(t,e,n){var r=Fi(this,ee(this,t),ee(this,e));return n===!1?r:r.join(n||"\n")},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){return re(this,t)?Ri(this,t):void 0},getLineNumber:function(t){return qi(t)},getLineHandleVisualStart:function(t){"number"==typeof t&&(t=Ri(this,t));return oi(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ee(this,t)},getCursor:function(t){var e,n=this.sel.primary();e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||"to"==t||t===!1?n.to():n.from();return e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vn(function(t,e,n){ue(this,ee(this,"number"==typeof t?Sa(t,e||0):t),null,n)}),setSelection:vn(function(t,e,n){ue(this,ee(this,t),ee(this,e||t),n)}),extendSelection:vn(function(t,e,n){ae(this,ee(this,t),e&&ee(this,e),n)}),extendSelections:vn(function(t,e){se(this,ie(this,t,e))}),extendSelectionsBy:vn(function(t,e){se(this,Co(this.sel.ranges,t),e)}),setSelections:vn(function(t,e,n){if(t.length){for(var r=0,i=[];r<t.length;r++)i[r]=new K(ee(this,t[r].anchor),ee(this,t[r].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex));he(this,Z(i,e),n)}}),addSelection:vn(function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new K(ee(this,t),ee(this,e||t)));he(this,Z(r,r.length-1),n)}),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=Fi(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return t===!1?e:e.join(t||"\n")},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Fi(this,n[r].from(),n[r].to());t!==!1&&(i=i.join(t||"\n"));e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:vn(function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Os(t[o]),origin:n}}for(var s=e&&"end"!=e&&fr(this,r,e),o=r.length-1;o>=0;o--)dr(this,r[o]);s?fe(this,s):this.cm&&kr(this.cm)}),undo:vn(function(){gr(this,"undo")}),redo:vn(function(){gr(this,"redo")}),undoSelection:vn(function(){gr(this,"undo",!0)}),redoSelection:vn(function(){gr(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){this.history=new Xi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:ro(this.history.done),undone:ro(this.history.undone)}},setHistory:function(t){var e=this.history=new Xi(this.history.maxGeneration);e.done=ro(t.done.slice(0),null,!0);e.undone=ro(t.undone.slice(0),null,!0)},addLineClass:vn(function(t,e,n){return Dr(this,t,"gutter"==e?"gutter":"class",function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(Io(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0})}),removeLineClass:vn(function(t,e,n){return Dr(this,t,"gutter"==e?"gutter":"class",function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(Io(n));if(!o)return!1;var a=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),markText:function(t,e,n){return Pr(this,ee(this,t),ee(this,e),n,"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared};t=ee(this,t);return Pr(this,t,t,n,"bookmark")},findMarksAt:function(t){t=ee(this,t);var e=[],n=Ri(this,t.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=ee(this,t);e=ee(this,e);var r=[],i=t.line;this.iter(t.line,e.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];i==t.line&&t.ch>l.to||null==l.from&&i!=t.line||i==e.line&&l.from>e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i});return r},getAllMarks:function(){var t=[];this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)});return t},posFromIndex:function(t){var e,n=this.first;this.iter(function(r){var i=r.text.length+1;if(i>t){e=t;return!0}t-=i;++n});return ee(this,Sa(n,e))},indexFromPos:function(t){t=ee(this,t);var e=t.ch;if(t.line<this.first||t.ch<0)return 0;this.iter(this.first,t.line,function(t){e+=t.text.length+1});return e},copy:function(t){var e=new us(Wi(this,this.first,this.first+this.size),this.modeOption,this.first);e.scrollTop=this.scrollTop;e.scrollLeft=this.scrollLeft;e.sel=this.sel;e.extend=!1;if(t){e.history.undoDepth=this.history.undoDepth;e.setHistory(this.getHistory())}return e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from);null!=t.to&&t.to<n&&(n=t.to);var r=new us(Wi(this,e,n),t.mode||this.modeOption,e);t.sharedHist&&(r.history=this.history);(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist});r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}];Rr(r,Or(this));return r},unlinkDoc:function(e){e instanceof t&&(e=e.doc);if(this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==e){this.linked.splice(n,1);e.unlinkDoc(this);Fr(Or(this));break}}if(e.history==this.history){var i=[e.id];Hi(e,function(t){i.push(t.id)},!0);e.history=new Xi(null);e.history.done=ro(this.history.done,i);e.history.undone=ro(this.history.undone,i)}},iterLinkedDocs:function(t){Hi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});us.prototype.eachLine=us.prototype.iter;var cs="iter insert remove copy getEditor".split(" ");for(var fs in us.prototype)us.prototype.hasOwnProperty(fs)&&wo(cs,fs)<0&&(t.prototype[fs]=function(t){return function(){return t.apply(this.doc,arguments)}}(us.prototype[fs]));mo(us);var hs=t.e_preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},ds=t.e_stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},ps=t.e_stop=function(t){hs(t);ds(t)},gs=t.on=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={}),i=r[e]||(r[e]=[]);i.push(n)}},ms=t.off=function(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers&&t._handlers[e];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},vs=t.signal=function(t,e){var n=t._handlers&&t._handlers[e];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},ys=null,bs=30,xs=t.Pass={toString:function(){return"CodeMirror.Pass"}},ws={scroll:!1},Cs={origin:"*mouse"},Ss={origin:"+move"};vo.prototype.set=function(t,e){clearTimeout(this.id);this.id=setTimeout(e,t)};var Ts=t.countColumn=function(t,e,n,r,i){if(null==e){e=t.search(/[^\s\u00a0]/);-1==e&&(e=t.length)}for(var o=r||0,a=i||0;;){var s=t.indexOf(" ",o);if(0>s||s>=e)return a+(e-o);a+=s-o;a+=n-a%n;o=s+1}},ks=[""],_s=function(t){t.select()};pa?_s=function(t){t.selectionStart=0;t.selectionEnd=t.value.length}:ia&&(_s=function(t){try{t.select()}catch(e){}});var Ms,Ds=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ls=t.isWordChar=function(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||Ds.test(t))},As=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ms=document.createRange?function(t,e,n){var r=document.createRange();r.setEnd(t,n);r.setStart(t,e);return r}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(i){return r}r.collapse(!0);r.moveEnd("character",n);r.moveStart("character",e);return r};ia&&11>oa&&(jo=function(){try{return document.activeElement}catch(t){return document.body}});var Ns,Es,js=t.rmClass=function(t,e){var n=t.className,r=Io(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Is=t.addClass=function(t,e){var n=t.className;Io(e).test(n)||(t.className+=(n?" ":"")+e)},Ps=!1,Hs=function(){if(ia&&9>oa)return!1;var t=Lo("div");return"draggable"in t||"dragDrop"in t}(),Os=t.splitLines=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;r>=e;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");if(-1!=a){n.push(o.slice(0,a));e+=a+1}else{n.push(o);e=i+1}}return n}:function(t){return t.split(/\r\n?|\n/)},Rs=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){try{var e=t.ownerDocument.selection.createRange()}catch(n){}return e&&e.parentElement()==t?0!=e.compareEndPoints("StartToEnd",e):!1},Fs=function(){var t=Lo("div");if("oncopy"in t)return!0;t.setAttribute("oncopy","return;");return"function"==typeof t.oncopy}(),Ws=null,zs={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};t.keyNames=zs;(function(){for(var t=0;10>t;t++)zs[t+48]=zs[t+96]=String(t);for(var t=65;90>=t;t++)zs[t]=String.fromCharCode(t);for(var t=1;12>=t;t++)zs[t+111]=zs[t+63235]="F"+t})();var qs,Us=function(){function t(t){return 247>=t?n.charAt(t):t>=1424&&1524>=t?"R":t>=1536&&1773>=t?r.charAt(t-1536):t>=1774&&2220>=t?"r":t>=8192&&8203>=t?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t;this.from=e;this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,u="L";return function(n){if(!i.test(n))return!1;for(var r,c=n.length,f=[],h=0;c>h;++h)f.push(r=t(n.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=u;c>h;++h){var r=f[h];if("1"==r&&"r"==p)f[h]="n";else if(a.test(r)){p=r;"r"==r&&(f[h]="R")}}for(var h=1,d=f[0];c-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d);d=r}for(var h=0;c>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var g=h+1;c>g&&"%"==f[g];++g);for(var m=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",v=h;g>v;++v)f[v]=m;h=g-1}}for(var h=0,p=u;c>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),m=y||b?"L":"R",v=h;g>v;++v)f[v]=m;h=g-1}for(var x,w=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);w.push(new e(0,C,h))}else{var S=h,T=w.length;for(++h;c>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(l.test(f[v])){v>S&&w.splice(T,0,new e(1,S,v));var k=v;for(++v;h>v&&l.test(f[v]);++v);w.splice(T,0,new e(2,k,v));S=v}else++v;h>S&&w.splice(T,0,new e(1,S,h))}if(1==w[0].level&&(x=n.match(/^\s+/))){w[0].from=x[0].length;w.unshift(new e(0,0,x[0].length))}if(1==xo(w).level&&(x=n.match(/\s+$/))){xo(w).to-=x[0].length;w.push(new e(0,c-x[0].length,c))}w[0].level!=xo(w).level&&w.push(new e(w[0].level,c,c));return w}}();t.version="4.12.0";return t})},{}],12:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("javascript",function(e,n){function r(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function i(t,e,n){ge=t;me=n;return e}function o(t,e){var n=t.next();if('"'==n||"'"==n){e.tokenize=a(n);return e.tokenize(t,e)}if("."==n&&t.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&t.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&t.eat(">"))return i("=>","operator");if("0"==n&&t.eat(/x/i)){t.eatWhile(/[\da-f]/i);return i("number","number")}if(/\d/.test(n)){t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return i("number","number")}if("/"==n){if(t.eat("*")){e.tokenize=s;return s(t,e)}if(t.eat("/")){t.skipToEnd();return i("comment","comment")}if("operator"==e.lastType||"keyword c"==e.lastType||"sof"==e.lastType||/^[\[{}\(,;:]$/.test(e.lastType)){r(t);t.eatWhile(/[gimy]/);return i("regexp","string-2")}t.eatWhile(Te);return i("operator","operator",t.current())}if("`"==n){e.tokenize=l;return l(t,e)}if("#"==n){t.skipToEnd();return i("error","error")}if(Te.test(n)){t.eatWhile(Te);return i("operator","operator",t.current())}if(Ce.test(n)){t.eatWhile(Ce);var o=t.current(),u=Se.propertyIsEnumerable(o)&&Se[o];return u&&"."!=e.lastType?i(u.type,u.style,o):i("variable","variable",o)}}function a(t){return function(e,n){var r,a=!1;if(be&&"@"==e.peek()&&e.match(ke)){n.tokenize=o;return i("jsonld-keyword","meta")}for(;null!=(r=e.next())&&(r!=t||a);)a=!a&&"\\"==r;a||(n.tokenize=o);return i("string","string")}}function s(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",t.current())}function u(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=t.string.charAt(o),s=_e.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Ce.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(e.fatArrowAt=o)}}function c(t,e,n,r,i,o){this.indented=t;this.column=e;this.type=n;this.prev=i;this.info=o;null!=r&&(this.align=r)}function f(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==e)return!0}function h(t,e,n,r,i){var o=t.cc;De.state=t;De.stream=i;De.marked=null,De.cc=o;De.style=e;t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);for(;;){var a=o.length?o.pop():xe?C:w;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return De.marked?De.marked:"variable"==n&&f(t,r)?"variable-2":e}}}function d(){for(var t=arguments.length-1;t>=0;t--)De.cc.push(arguments[t])}function p(){d.apply(null,arguments);return!0}function g(t){function e(e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}var r=De.state;if(r.context){De.marked="def";if(e(r.localVars))return;r.localVars={name:t,next:r.localVars}}else{if(e(r.globalVars))return;n.globalVars&&(r.globalVars={name:t,next:r.globalVars})}}function m(){De.state.context={prev:De.state.context,vars:De.state.localVars};De.state.localVars=Le}function v(){De.state.localVars=De.state.context.vars;De.state.context=De.state.context.prev}function y(t,e){var n=function(){var n=De.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new c(r,De.stream.column(),t,null,n.lexical,e)};n.lex=!0;return n}function b(){var t=De.state;if(t.lexical.prev){")"==t.lexical.type&&(t.indented=t.lexical.indented);t.lexical=t.lexical.prev}}function x(t){function e(n){return n==t?p():";"==t?d():p(e)}return e}function w(t,e){if("var"==t)return p(y("vardef",e.length),U,x(";"),b);if("keyword a"==t)return p(y("form"),C,w,b);if("keyword b"==t)return p(y("form"),w,b);if("{"==t)return p(y("}"),W,b);if(";"==t)return p();if("if"==t){"else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==b&&De.state.cc.pop()();return p(y("form"),C,w,b,$)}return"function"==t?p(te):"for"==t?p(y("form"),Y,w,b):"variable"==t?p(y("stat"),j):"switch"==t?p(y("form"),C,y("}","switch"),x("{"),W,b,b):"case"==t?p(C,x(":")):"default"==t?p(x(":")):"catch"==t?p(y("form"),m,x("("),ee,x(")"),w,b,v):"module"==t?p(y("form"),m,ae,v,b):"class"==t?p(y("form"),ne,b):"export"==t?p(y("form"),se,b):"import"==t?p(y("form"),le,b):d(y("stat"),C,x(";"),b)}function C(t){return T(t,!1)}function S(t){return T(t,!0)}function T(t,e){if(De.state.fatArrowAt==De.stream.start){var n=e?E:N;if("("==t)return p(m,y(")"),R(B,")"),b,x("=>"),n,v);if("variable"==t)return d(m,B,x("=>"),n,v)}var r=e?D:M;return Me.hasOwnProperty(t)?p(r):"function"==t?p(te,r):"keyword c"==t?p(e?_:k):"("==t?p(y(")"),k,de,x(")"),b,r):"operator"==t||"spread"==t?p(e?S:C):"["==t?p(y("]"),fe,b,r):"{"==t?F(P,"}",null,r):"quasi"==t?d(L,r):p()}function k(t){return t.match(/[;\}\)\],]/)?d():d(C)}function _(t){return t.match(/[;\}\)\],]/)?d():d(S)}function M(t,e){return","==t?p(C):D(t,e,!1)}function D(t,e,n){var r=0==n?M:D,i=0==n?C:S;return"=>"==t?p(m,n?E:N,v):"operator"==t?/\+\+|--/.test(e)?p(r):"?"==e?p(C,x(":"),i):p(i):"quasi"==t?d(L,r):";"!=t?"("==t?F(S,")","call",r):"."==t?p(I,r):"["==t?p(y("]"),k,x("]"),b,r):void 0:void 0}function L(t,e){return"quasi"!=t?d():"${"!=e.slice(e.length-2)?p(L):p(C,A)}function A(t){if("}"==t){De.marked="string-2";De.state.tokenize=l;return p(L)}}function N(t){u(De.stream,De.state);return d("{"==t?w:C)}function E(t){u(De.stream,De.state);return d("{"==t?w:S)}function j(t){return":"==t?p(b,w):d(M,x(";"),b)}function I(t){if("variable"==t){De.marked="property";return p()}}function P(t,e){if("variable"==t||"keyword"==De.style){De.marked="property";return p("get"==e||"set"==e?H:O)}if("number"==t||"string"==t){De.marked=be?"property":De.style+" property";return p(O)}return"jsonld-keyword"==t?p(O):"["==t?p(C,x("]"),O):void 0}function H(t){if("variable"!=t)return d(O);De.marked="property";return p(te)}function O(t){return":"==t?p(S):"("==t?d(te):void 0}function R(t,e){function n(r){if(","==r){var i=De.state.lexical;"call"==i.info&&(i.pos=(i.pos||0)+1);return p(t,n)}return r==e?p():p(x(e))}return function(r){return r==e?p():d(t,n)}}function F(t,e,n){for(var r=3;r<arguments.length;r++)De.cc.push(arguments[r]);return p(y(e,n),R(t,e),b)}function W(t){return"}"==t?p():d(w,W)}function z(t){return we&&":"==t?p(q):void 0}function q(t){if("variable"==t){De.marked="variable-3";return p()}}function U(){return d(B,z,X,G)}function B(t,e){if("variable"==t){g(e);return p()}return"["==t?F(B,"]"):"{"==t?F(V,"}"):void 0}function V(t,e){if("variable"==t&&!De.stream.match(/^\s*:/,!1)){g(e);return p(X)}"variable"==t&&(De.marked="property");return p(x(":"),B,X)}function X(t,e){return"="==e?p(S):void 0}function G(t){return","==t?p(U):void 0}function $(t,e){return"keyword b"==t&&"else"==e?p(y("form","else"),w,b):void 0}function Y(t){return"("==t?p(y(")"),J,x(")"),b):void 0}function J(t){return"var"==t?p(U,x(";"),Z):";"==t?p(Z):"variable"==t?p(K):d(C,x(";"),Z)}function K(t,e){if("in"==e||"of"==e){De.marked="keyword";return p(C)}return p(M,Z)}function Z(t,e){if(";"==t)return p(Q);if("in"==e||"of"==e){De.marked="keyword";return p(C)}return d(C,x(";"),Q)}function Q(t){")"!=t&&p(C)}function te(t,e){if("*"==e){De.marked="keyword";return p(te)}if("variable"==t){g(e);return p(te)}return"("==t?p(m,y(")"),R(ee,")"),b,w,v):void 0}function ee(t){return"spread"==t?p(ee):d(B,z)}function ne(t,e){if("variable"==t){g(e);return p(re)}}function re(t,e){return"extends"==e?p(C,re):"{"==t?p(y("}"),ie,b):void 0}function ie(t,e){if("variable"==t||"keyword"==De.style){De.marked="property";return"get"==e||"set"==e?p(oe,te,ie):p(te,ie)}if("*"==e){De.marked="keyword";return p(ie)}return";"==t?p(ie):"}"==t?p():void 0}function oe(t){if("variable"!=t)return d();De.marked="property";return p()}function ae(t,e){if("string"==t)return p(w);if("variable"==t){g(e);return p(ce)}}function se(t,e){if("*"==e){De.marked="keyword";return p(ce,x(";"))}if("default"==e){De.marked="keyword";return p(C,x(";"))}return d(w)}function le(t){return"string"==t?p():d(ue,ce)}function ue(t,e){if("{"==t)return F(ue,"}");"variable"==t&&g(e);return p()}function ce(t,e){if("from"==e){De.marked="keyword";return p(C)}}function fe(t){return"]"==t?p():d(S,he)}function he(t){return"for"==t?d(de,x("]")):","==t?p(R(_,"]")):d(R(S,"]"))}function de(t){return"for"==t?p(Y,de):"if"==t?p(C,de):void 0}function pe(t,e){return"operator"==t.lastType||","==t.lastType||Te.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}var ge,me,ve=e.indentUnit,ye=n.statementIndent,be=n.jsonld,xe=n.json||be,we=n.typescript,Ce=n.wordCharacters||/[\w$\xa1-\uffff]/,Se=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("operator"),o={type:"atom",style:"atom"},a={"if":t("if"),"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":t("var"),"const":t("var"),let:t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":t("this"),module:t("module"),"class":t("class"),"super":t("atom"),"yield":r,"export":t("export"),"import":t("import"),"extends":r};if(we){var s={type:"variable",style:"variable-3"},l={"interface":t("interface"),"extends":t("extends"),constructor:t("constructor"),"public":t("public"),"private":t("private"),"protected":t("protected"),"static":t("static"),string:s,number:s,bool:s,any:s};for(var u in l)a[u]=l[u]}return a}(),Te=/[+\-*&%=<>!?|~^]/,ke=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,_e="([{}])",Me={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},Le={name:"this",next:{name:"arguments"}};b.lex=!0;return{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new c((t||0)-ve,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars);return e},token:function(t,e){if(t.sol()){e.lexical.hasOwnProperty("align")||(e.lexical.align=!1);e.indented=t.indentation(); u(t,e)}if(e.tokenize!=s&&t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"==ge)return n;e.lastType="operator"!=ge||"++"!=me&&"--"!=me?ge:"incdec";return h(e,n,ge,me,t)},indent:function(e,r){if(e.tokenize==s)return t.Pass;if(e.tokenize!=o)return 0;var i=r&&r.charAt(0),a=e.lexical;if(!/^\s*else\b/.test(r))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==b)a=a.prev;else if(u!=$)break}"stat"==a.type&&"}"==i&&(a=a.prev);ye&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var c=a.type,f=i==c;return"vardef"==c?a.indented+("operator"==e.lastType||","==e.lastType?a.info+1:0):"form"==c&&"{"==i?a.indented:"form"==c?a.indented+ve:"stat"==c?a.indented+(pe(e,r)?ye||ve:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:ve):a.indented+(/^(?:case|default)\b/.test(r)?ve:2*ve)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:xe?null:"/*",blockCommentEnd:xe?null:"*/",lineComment:xe?null:"//",fold:"brace",helperType:xe?"json":"javascript",jsonldMode:be,jsonMode:xe}});t.registerHelper("wordChars","javascript",/[\w$]/);t.defineMIME("text/javascript","javascript");t.defineMIME("text/ecmascript","javascript");t.defineMIME("application/javascript","javascript");t.defineMIME("application/x-javascript","javascript");t.defineMIME("application/ecmascript","javascript");t.defineMIME("application/json",{name:"javascript",json:!0});t.defineMIME("application/x-json",{name:"javascript",json:!0});t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});t.defineMIME("text/typescript",{name:"javascript",typescript:!0});t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":11}],13:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){e.tokenize=n;return n(t,e)}var r=t.next();if("<"==r){if(t.eat("!")){if(t.eat("["))return t.match("CDATA[")?n(a("atom","]]>")):null;if(t.match("--"))return n(a("comment","-->"));if(t.match("DOCTYPE",!0,!0)){t.eatWhile(/[\w\._\-]/);return n(s(1))}return null}if(t.eat("?")){t.eatWhile(/[\w\._\-]/);e.tokenize=a("meta","?>");return"meta"}S=t.eat("/")?"closeTag":"openTag";e.tokenize=i;return"tag bracket"}if("&"==r){var o;o=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";");return o?"atom":"error"}t.eatWhile(/[^&<]/);return null}function i(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">")){e.tokenize=r;S=">"==n?"endTag":"selfcloseTag";return"tag bracket"}if("="==n){S="equals";return null}if("<"==n){e.tokenize=r;e.state=f;e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}if(/[\'\"]/.test(n)){e.tokenize=o(n);e.stringStartCol=t.column();return e.tokenize(t,e)}t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function o(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=i;break}return"string"};e.isInAttribute=!0;return e}function a(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=r;break}n.next()}return t}}function s(t){return function(e,n){for(var i;null!=(i=e.next());){if("<"==i){n.tokenize=s(t+1);return n.tokenize(e,n)}if(">"==i){if(1==t){n.tokenize=r;break}n.tokenize=s(t-1);return n.tokenize(e,n)}}return"meta"}}function l(t,e,n){this.prev=t.context;this.tagName=e;this.indent=t.indented;this.startOfLine=n;(k.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function u(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;n=t.context.tagName;if(!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(e))return;u(t)}}function f(t,e,n){if("openTag"==t){n.tagStart=e.column();return h}return"closeTag"==t?d:f}function h(t,e,n){if("word"==t){n.tagName=e.current();T="tag";return m}T="error";return h}function d(t,e,n){if("word"==t){var r=e.current();n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n);if(n.context&&n.context.tagName==r){T="tag";return p}T="tag error";return g}T="error";return g}function p(t,e,n){if("endTag"!=t){T="error";return p}u(n);return f}function g(t,e,n){T="error";return p(t,e,n)}function m(t,e,n){if("word"==t){T="attribute";return v}if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;n.tagName=n.tagStart=null;if("selfcloseTag"==t||k.autoSelfClosers.hasOwnProperty(r))c(n,r);else{c(n,r);n.context=new l(n,r,i==n.indented)}return f}T="error";return m}function v(t,e,n){if("equals"==t)return y;k.allowMissing||(T="error");return m(t,e,n)}function y(t,e,n){if("string"==t)return b;if("word"==t&&k.allowUnquoted){T="string";return m}T="error";return m(t,e,n)}function b(t,e,n){return"string"==t?b:m(t,e,n)}var x=e.indentUnit,w=n.multilineTagIndentFactor||1,C=n.multilineTagIndentPastTag;null==C&&(C=!0);var S,T,k=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},_=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){!e.tagName&&t.sol()&&(e.indented=t.indentation());if(t.eatSpace())return null;S=null;var n=e.tokenize(t,e);if((n||S)&&"comment"!=n){T=null;e.state=e.state(S||n,t,e);T&&(n="error"==T?n+" error":T)}return n},indent:function(e,n,o){var a=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+x;if(a&&a.noIndent)return t.Pass;if(e.tokenize!=i&&e.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(e.tagName)return C?e.tagStart+e.tagName.length+2:e.tagStart+x*w;if(_&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;a;){if(a.tagName==s[2]){a=a.prev;break}if(!k.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(s)for(;a;){var l=k.contextGrabbers[a.tagName];if(!l||!l.hasOwnProperty(s[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+x:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}});t.defineMIME("text/xml","xml");t.defineMIME("application/xml","xml");t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":11}],14:[function(e,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function s(t){return{left:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===vs||t[0]===ys?ys+t:t}function d(t){return(t+="")[0]===ys?t.slice(1):t}function p(t){return h(t)in this._}function g(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function w(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function C(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=bs.length;r>n;++n){var i=bs[n]+e;if(i in t)return i}}function S(){}function T(){}function k(t){function e(){for(var e,r=n,i=-1,o=r.length;++i<o;)(e=r[i].on)&&e.apply(this,arguments);return t}var n=[],r=new f;e.on=function(e,i){var o,a=r.get(e);if(arguments.length<2)return a&&a.on;if(a){a.on=null;n=n.slice(0,o=n.indexOf(a)).concat(n.slice(o+1));r.remove(e)}i&&n.push(r.set(e,{on:i}));return t};return e}function _(){is.event.preventDefault()}function M(){for(var t,e=is.event;t=e.sourceEvent;)e=t;return e}function D(t){for(var e=new T,n=0,r=arguments.length;++n<r;)e[arguments[n]]=k(e);e.of=function(n,r){return function(i){try{var o=i.sourceEvent=is.event;i.target=t;is.event=i;e[i.type].apply(n,r)}finally{is.event=o}}};return e}function L(t){ws(t,ks);return t}function A(t){return"function"==typeof t?t:function(){return Cs(t,this)}}function N(t){return"function"==typeof t?t:function(){return Ss(t,this)}}function E(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function s(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}t=is.ns.qualify(t);return null==e?t.local?r:n:"function"==typeof e?t.local?s:a:t.local?o:i}function j(t){return t.trim().replace(/\s+/g," ")}function I(t){return new RegExp("(?:^|\\s+)"+is.requote(t)+"(?:\\s+|$)","g")}function P(t){return(t+"").trim().split(/^|\s+/)}function H(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=P(t).map(O);var i=t.length;return"function"==typeof e?r:n}function O(t){var e=I(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.getAttribute("class")||"";if(r){e.lastIndex=0;e.test(i)||n.setAttribute("class",j(i+" "+t))}else n.setAttribute("class",j(i.replace(e," ")))}}function R(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?o:i}function F(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?i:r}function W(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=is.ns.qualify(t)).local?n:e}function z(){var t=this.parentNode;t&&t.removeChild(this)}function q(t){return{__data__:t}}function U(t){return function(){return Ts(this,t)}}function B(t){arguments.length||(t=i);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function V(t,e){for(var n=0,r=t.length;r>n;n++)for(var i,o=t[n],a=0,s=o.length;s>a;a++)(i=o[a])&&e(i,a,n);return t}function X(t){ws(t,Ms);return t}function G(t){var e,n;return function(r,i,o){var a,s=t[o].update,l=s.length;o!=n&&(n=o,e=0);i>=e&&(e=i+1);for(;!(a=s[e])&&++e<l;);return a}}function $(t,e,n){function r(){var e=this[a];if(e){this.removeEventListener(t,e,e.$);delete this[a]}}function i(){var i=l(e,as(arguments));r.call(this);this.addEventListener(t,this[a]=i,i.$=n);i._=e}function o(){var e,n=new RegExp("^__on([^.]+)"+is.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];this.removeEventListener(e[1],i,i.$);delete this[r]}}var a="__on"+t,s=t.indexOf("."),l=Y;s>0&&(t=t.slice(0,s));var u=Ds.get(t);u&&(t=u,l=J);return s?e?i:r:e?S:o}function Y(t,e){return function(n){var r=is.event;is.event=n;e[0]=this.__data__;try{t.apply(this,e)}finally{is.event=r}}}function J(t,e){var n=Y(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function K(t){var n=".dragsuppress-"+ ++As,i="click"+n,o=is.select(r(t)).on("touchmove"+n,_).on("dragstart"+n,_).on("selectstart"+n,_);null==Ls&&(Ls="onselectstart"in t?!1:C(t.style,"userSelect"));if(Ls){var a=e(t).style,s=a[Ls];a[Ls]="none"}return function(t){o.on(n,null);Ls&&(a[Ls]=s);if(t){var e=function(){o.on(i,null)};o.on(i,function(){_();e()},!0);setTimeout(e,0)}}}function Z(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(0>Ns){var o=r(t);if(o.scrollX||o.scrollY){n=is.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=n[0][0].getScreenCTM();Ns=!(a.f||a.e);n.remove()}}Ns?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY);i=i.matrixTransform(t.getScreenCTM().inverse());return[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function Q(){return is.event.changedTouches[0].identifier}function te(t){return t>0?1:0>t?-1:0}function ee(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function ne(t){return t>1?0:-1>t?Is:Math.acos(t)}function re(t){return t>1?Os:-1>t?-Os:Math.asin(t)}function ie(t){return((t=Math.exp(t))-1/t)/2}function oe(t){return((t=Math.exp(t))+1/t)/2}function ae(t){return((t=Math.exp(2*t))-1)/(t+1)}function se(t){return(t=Math.sin(t/2))*t}function le(){}function ue(t,e,n){return this instanceof ue?void(this.h=+t,this.s=+e,this.l=+n):arguments.length<2?t instanceof ue?new ue(t.h,t.s,t.l):Se(""+t,Te,ue):new ue(t,e,n)}function ce(t,e,n){function r(t){t>360?t-=360:0>t&&(t+=360);return 60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;t=isNaN(t)?0:(t%=360)<0?t+360:t;e=isNaN(e)?0:0>e?0:e>1?1:e;n=0>n?0:n>1?1:n;a=.5>=n?n*(1+e):n+e-n*e;o=2*n-a;return new be(i(t+120),i(t),i(t-120))}function fe(t,e,n){return this instanceof fe?void(this.h=+t,this.c=+e,this.l=+n):arguments.length<2?t instanceof fe?new fe(t.h,t.c,t.l):t instanceof de?ge(t.l,t.a,t.b):ge((t=ke((t=is.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new fe(t,e,n)}function he(t,e,n){isNaN(t)&&(t=0);isNaN(e)&&(e=0);return new de(n,Math.cos(t*=Rs)*e,Math.sin(t)*e)}function de(t,e,n){return this instanceof de?void(this.l=+t,this.a=+e,this.b=+n):arguments.length<2?t instanceof de?new de(t.l,t.a,t.b):t instanceof fe?he(t.h,t.c,t.l):ke((t=be(t)).r,t.g,t.b):new de(t,e,n)}function pe(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;i=me(i)*Ys;r=me(r)*Js;o=me(o)*Ks;return new be(ye(3.2404542*i-1.5371385*r-.4985314*o),ye(-.969266*i+1.8760108*r+.041556*o),ye(.0556434*i-.2040259*r+1.0572252*o))}function ge(t,e,n){return t>0?new fe(Math.atan2(n,e)*Fs,Math.sqrt(e*e+n*n),t):new fe(0/0,0/0,t)}function me(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ve(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ye(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function be(t,e,n){return this instanceof be?void(this.r=~~t,this.g=~~e,this.b=~~n):arguments.length<2?t instanceof be?new be(t.r,t.g,t.b):Se(""+t,be,ce):new be(t,e,n)}function xe(t){return new be(t>>16,t>>8&255,255&t)}function we(t){return xe(t)+""}function Ce(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Se(t,e,n){var r,i,o,a=0,s=0,l=0;r=/([a-z]+)\((.*)\)/i.exec(t);if(r){i=r[2].split(",");switch(r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Me(i[0]),Me(i[1]),Me(i[2]))}}if(o=tl.get(t.toLowerCase()))return e(o.r,o.g,o.b);if(null!=t&&"#"===t.charAt(0)&&!isNaN(o=parseInt(t.slice(1),16)))if(4===t.length){a=(3840&o)>>4;a=a>>4|a;s=240&o;s=s>>4|s;l=15&o;l=l<<4|l}else if(7===t.length){a=(16711680&o)>>16;s=(65280&o)>>8;l=255&o}return e(a,s,l)}function Te(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;if(s){i=.5>l?s/(a+o):s/(2-a-o);r=t==a?(e-n)/s+(n>e?6:0):e==a?(n-t)/s+2:(t-e)/s+4;r*=60}else{r=0/0;i=l>0&&1>l?0:r}return new ue(r,i,l)}function ke(t,e,n){t=_e(t);e=_e(e);n=_e(n);var r=ve((.4124564*t+.3575761*e+.1804375*n)/Ys),i=ve((.2126729*t+.7151522*e+.072175*n)/Js),o=ve((.0193339*t+.119192*e+.9503041*n)/Ks);return de(116*i-16,500*(r-i),200*(i-o))}function _e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Me(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function De(t){return"function"==typeof t?t:function(){return t}}function Le(t){return function(e,n,r){2===arguments.length&&"function"==typeof n&&(r=n,n=null);return Ae(e,n,t,r)}}function Ae(t,e,n,r){function i(){var t,e=l.status;if(!e&&Ee(l)||e>=200&&300>e||304===e){try{t=n.call(o,l)}catch(r){a.error.call(o,r);return}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=is.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest);"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()};l.onprogress=function(t){var e=is.event;is.event=t;try{a.progress.call(o,l)}finally{is.event=e}};o.header=function(t,e){t=(t+"").toLowerCase();if(arguments.length<2)return s[t];null==e?delete s[t]:s[t]=e+"";return o};o.mimeType=function(t){if(!arguments.length)return e;e=null==t?null:t+"";return o};o.responseType=function(t){if(!arguments.length)return u;u=t;return o};o.response=function(t){n=t;return o};["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(as(arguments)))}});o.send=function(n,r,i){2===arguments.length&&"function"==typeof r&&(i=r,r=null);l.open(n,t,!0);null==e||"accept"in s||(s.accept=e+",*/*");if(l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);null!=e&&l.overrideMimeType&&l.overrideMimeType(e);null!=u&&(l.responseType=u);null!=i&&o.on("error",i).on("load",function(t){i(null,t)});a.beforesend.call(o,l);l.send(null==r?null:r);return o};o.abort=function(){l.abort();return o};is.rebind(o,a,"on");return null==r?o:o.get(Ne(r))}function Ne(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ee(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function je(){var t=Ie(),e=Pe()-t;if(e>24){if(isFinite(e)){clearTimeout(il);il=setTimeout(je,e)}rl=0}else{rl=1;al(je)}}function Ie(){var t=Date.now();ol=el;for(;ol;){t>=ol.t&&(ol.f=ol.c(t-ol.t));ol=ol.n}return t}function Pe(){for(var t,e=el,n=1/0;e;)if(e.f)e=t?t.n=e.n:el=e.n;else{e.t<n&&(n=e.t);e=(t=e).n}nl=t;return n}function He(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Oe(t,e){var n=Math.pow(10,3*ms(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Re(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,o=r&&n?function(t,e){for(var i=t.length,o=[],a=0,s=r[0],l=0;i>0&&s>0;){l+s+1>e&&(s=Math.max(1,e-l));o.push(t.substring(i-=s,i+s));if((l+=s+1)>e)break;s=r[a=(a+1)%r.length]}return o.reverse().join(n)}:x;return function(t){var n=ll.exec(t),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",l=n[4]||"",u=n[5],c=+n[6],f=n[7],h=n[8],d=n[9],p=1,g="",m="",v=!1,y=!0;h&&(h=+h.substring(1));if(u||"0"===r&&"="===a){u=r="0";a="="}switch(d){case"n":f=!0;d="g";break;case"%":p=100;m="%";d="f";break;case"p":p=100;m="%";d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0;h=0;break;case"s":p=-1;d="r"}"$"===l&&(g=i[0],m=i[1]);"r"!=d||h||(d="g");null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):("e"==d||"f"==d)&&(h=Math.max(0,Math.min(20,h))));d=ul.get(d)||Fe;var b=u&&f;return function(t){var n=m;if(v&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var l=is.formatPrefix(t,h);t=l.scale(t);n=l.symbol+m}else t*=p;t=d(t,h);var x,w,C=t.lastIndexOf(".");if(0>C){var S=y?t.lastIndexOf("e"):-1;0>S?(x=t,w=""):(x=t.substring(0,S),w=t.substring(S))}else{x=t.substring(0,C);w=e+t.substring(C+1)}!u&&f&&(x=o(x,1/0));var T=g.length+x.length+w.length+(b?0:i.length),k=c>T?new Array(T=c-T+1).join(r):"";b&&(x=o(k+x,k.length?c-w.length:1/0));i+=g;t=x+w;return("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,T>>=1)+i+t+k.substring(T):i+(b?t:k+t))+n}}}function Fe(t){return t+""}function We(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function ze(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){e(n=t(new fl(n-1)),1);return n}function o(t,n){e(t=new fl(+t),n);return t}function a(t,r,o){var a=i(t),s=[];if(o>1)for(;r>a;){n(a)%o||s.push(new Date(+a));e(a,1)}else for(;r>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,n){try{fl=We;var r=new We;r._=t;return a(r,e,n)}finally{fl=Date}}t.floor=t;t.round=r;t.ceil=i;t.offset=o;t.range=a;var l=t.utc=qe(t);l.floor=l;l.round=qe(r);l.ceil=qe(i);l.offset=qe(o);l.range=s;return t}function qe(t){return function(e,n){try{fl=We;var r=new We;r._=e;return t(r,n)._}finally{fl=Date}}}function Ue(t){function e(t){function e(e){for(var n,i,o,a=[],s=-1,l=0;++s<r;)if(37===t.charCodeAt(s)){a.push(t.slice(l,s));null!=(i=dl[n=t.charAt(++s)])&&(n=t.charAt(++s));(o=D[n])&&(n=o(e,null==i?"e"===n?" ":"0":i));a.push(n);l=s+1}a.push(t.slice(l,s));return a.join("")}var r=t.length;e.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=n(r,t,e,0);if(i!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var o=null!=r.Z&&fl!==We,a=new(o?We:fl);if("j"in r)a.setFullYear(r.y,0,r.j);else if("w"in r&&("W"in r||"U"in r)){a.setFullYear(r.y,0,1);a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)}else a.setFullYear(r.y,r.m,r.d);a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L);return o?a._:a};e.toString=function(){return t};return e}function n(t,e,n,r){for(var i,o,a,s=0,l=e.length,u=n.length;l>s;){if(r>=u)return-1;i=e.charCodeAt(s++);if(37===i){a=e.charAt(s++);o=L[a in dl?e.charAt(s++):a];if(!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){C.lastIndex=0;var r=C.exec(e.slice(n));return r?(t.w=S.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.w=w.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.m=M.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){T.lastIndex=0;var r=T.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,r){return n(t,D.c.toString(),e,r)}function l(t,e,r){return n(t,D.x.toString(),e,r)}function u(t,e,r){return n(t,D.X.toString(),e,r)}function c(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,m=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{fl=We;var e=new fl;e._=t;return r(e)}finally{fl=Date}}var r=e(t);n.parse=function(t){try{fl=We;var e=r.parse(t);return e&&e._}finally{fl=Date}};n.toString=r.toString;return n};e.multi=e.utc.multi=cn;var b=is.map(),x=Ve(g),w=Xe(g),C=Ve(m),S=Xe(m),T=Ve(v),k=Xe(v),_=Ve(y),M=Xe(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var D={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Be(t.getDate(),e,2)},e:function(t,e){return Be(t.getDate(),e,2)},H:function(t,e){return Be(t.getHours(),e,2)},I:function(t,e){return Be(t.getHours()%12||12,e,2)},j:function(t,e){return Be(1+cl.dayOfYear(t),e,3)},L:function(t,e){return Be(t.getMilliseconds(),e,3)},m:function(t,e){return Be(t.getMonth()+1,e,2)},M:function(t,e){return Be(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Be(t.getSeconds(),e,2)},U:function(t,e){return Be(cl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Be(cl.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Be(t.getFullYear()%100,e,2)},Y:function(t,e){return Be(t.getFullYear()%1e4,e,4)},Z:ln,"%":function(){return"%"}},L={a:r,A:i,b:o,B:a,c:s,d:en,e:en,H:rn,I:rn,j:nn,L:sn,m:tn,M:on,p:c,S:an,U:$e,w:Ge,W:Ye,x:l,X:u,y:Ke,Y:Je,Z:Ze,"%":un};return e}function Be(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(e)+i:i)}function Ve(t){return new RegExp("^(?:"+t.map(is.requote).join("|")+")","i")}function Xe(t){for(var e=new f,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function Ge(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function $e(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function Ye(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function Je(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Ke(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.y=Qe(+r[0]),n+r[0].length):-1}function Ze(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Qe(t){return t+(t>68?1900:2e3)}function tn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function en(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function nn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function rn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function on(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function an(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function sn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ln(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=ms(e)/60|0,i=ms(e)%60;return n+Be(r,"0",2)+Be(i,"0",2)}function un(t,e,n){gl.lastIndex=0;var r=gl.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}function fn(){}function hn(t,e,n){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function dn(t,e){t&&bl.hasOwnProperty(t.type)&&bl[t.type](t,e)}function pn(t,e,n){var r,i=-1,o=t.length-n;e.lineStart();for(;++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function gn(t,e){var n=-1,r=t.length;e.polygonStart();for(;++n<r;)pn(t[n],e,1);e.polygonEnd()}function mn(){function t(t,e){t*=Rs;e=e*Rs/2+Is/4;var n=t-r,a=n>=0?1:-1,s=a*n,l=Math.cos(e),u=Math.sin(e),c=o*u,f=i*l+c*Math.cos(s),h=c*a*Math.sin(s);wl.add(Math.atan2(h,f));r=t,i=l,o=u}var e,n,r,i,o;Cl.point=function(a,s){Cl.point=t;r=(e=a)*Rs,i=Math.cos(s=(n=s)*Rs/2+Is/4),o=Math.sin(s)};Cl.lineEnd=function(){t(e,n)}}function vn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function yn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xn(t,e){t[0]+=e[0];t[1]+=e[1];t[2]+=e[2]}function wn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Cn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e;t[1]/=e;t[2]/=e}function Sn(t){return[Math.atan2(t[1],t[0]),re(t[2])]}function Tn(t,e){return ms(t[0]-e[0])<Es&&ms(t[1]-e[1])<Es}function kn(t,e){t*=Rs;var n=Math.cos(e*=Rs);_n(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function _n(t,e,n){++Sl;kl+=(t-kl)/Sl;_l+=(e-_l)/Sl;Ml+=(n-Ml)/Sl}function Mn(){function t(t,i){t*=Rs;var o=Math.cos(i*=Rs),a=o*Math.cos(t),s=o*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=n*l-r*s)*u+(u=r*a-e*l)*u+(u=e*s-n*a)*u),e*a+n*s+r*l);Tl+=u;Dl+=u*(e+(e=a));Ll+=u*(n+(n=s));Al+=u*(r+(r=l));_n(e,n,r)}var e,n,r;Il.point=function(i,o){i*=Rs;var a=Math.cos(o*=Rs);e=a*Math.cos(i);n=a*Math.sin(i);r=Math.sin(o);Il.point=t;_n(e,n,r)}}function Dn(){Il.point=kn}function Ln(){function t(t,e){t*=Rs;var n=Math.cos(e*=Rs),a=n*Math.cos(t),s=n*Math.sin(t),l=Math.sin(e),u=i*l-o*s,c=o*a-r*l,f=r*s-i*a,h=Math.sqrt(u*u+c*c+f*f),d=r*a+i*s+o*l,p=h&&-ne(d)/h,g=Math.atan2(h,d);Nl+=p*u;El+=p*c;jl+=p*f;Tl+=g;Dl+=g*(r+(r=a));Ll+=g*(i+(i=s));Al+=g*(o+(o=l));_n(r,i,o)}var e,n,r,i,o;Il.point=function(a,s){e=a,n=s;Il.point=t;a*=Rs;var l=Math.cos(s*=Rs);r=l*Math.cos(a);i=l*Math.sin(a);o=Math.sin(s);_n(r,i,o)};Il.lineEnd=function(){t(e,n);Il.lineEnd=Dn;Il.point=kn}}function An(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])});return n}function Nn(){return!0}function En(t,e,n,r,i){var o=[],a=[];t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(Tn(n,r)){i.lineStart();for(var s=0;e>s;++s)i.point((n=t[s])[0],n[1]);i.lineEnd()}else{var l=new In(n,t,null,!0),u=new In(n,null,l,!1);l.o=u;o.push(l);a.push(u);l=new In(r,t,null,!1);u=new In(r,null,l,!0);l.o=u;o.push(l);a.push(u)}}});a.sort(e);jn(o);jn(a);if(o.length){for(var s=0,l=n,u=a.length;u>s;++s)a[s].e=l=!l;for(var c,f,h=o[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;c=d.z;i.lineStart();do{d.v=d.o.v=!0;if(d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((f=c[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o;c=d.z;p=!p}while(!d.v);i.lineEnd()}}}function jn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;){i.n=n=t[r];n.p=i;i=n}i.n=n=t[0];n.p=i}}function In(t,e,n,r){this.x=t;this.z=e;this.o=n;this.e=r;this.v=!1;this.n=this.p=null}function Pn(t,e,n,r){return function(i,o){function a(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function s(t,e){var n=i(t,e);m.point(n[0],n[1])}function l(){y.point=s;m.lineStart()}function u(){y.point=a;m.lineEnd()}function c(t,e){g.push([t,e]);var n=i(t,e);x.point(n[0],n[1])}function f(){x.lineStart();g=[]}function h(){c(g[0][0],g[0][1]);x.lineEnd();var t,e=x.clean(),n=b.buffer(),r=n.length;g.pop();p.push(g);g=null;if(r)if(1&e){t=n[0];var i,r=t.length-1,a=-1;if(r>0){w||(o.polygonStart(),w=!0);o.lineStart();for(;++a<r;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else{r>1&&2&e&&n.push(n.pop().concat(n.shift()));d.push(n.filter(Hn))}}var d,p,g,m=e(o),v=i.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c;y.lineStart=f;y.lineEnd=h;d=[];p=[]},polygonEnd:function(){y.point=a;y.lineStart=l;y.lineEnd=u;d=is.merge(d);var t=qn(v,p);if(d.length){w||(o.polygonStart(),w=!0);En(d,Rn,t,n,o)}else if(t){w||(o.polygonStart(),w=!0);o.lineStart();n(null,null,1,o);o.lineEnd()}w&&(o.polygonEnd(),w=!1);d=p=null},sphere:function(){o.polygonStart();o.lineStart();n(null,null,1,o);o.lineEnd();o.polygonEnd()}},b=On(),x=e(b),w=!1;return y}}function Hn(t){return t.length>1}function On(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:S,buffer:function(){var n=e;e=[];t=null;return n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Rn(t,e){return((t=t.x)[0]<0?t[1]-Os-Es:Os-t[1])-((e=e.x)[0]<0?e[1]-Os-Es:Os-e[1])}function Fn(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart();e=1},point:function(o,a){var s=o>0?Is:-Is,l=ms(o-n);if(ms(l-Is)<Es){t.point(n,r=(r+a)/2>0?Os:-Os);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);t.point(o,r);e=0}else if(i!==s&&l>=Is){ms(n-i)<Es&&(n-=i*Es);ms(o-s)<Es&&(o-=s*Es); r=Wn(n,r,o,a);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);e=0}t.point(n=o,r=a);i=s},lineEnd:function(){t.lineEnd();n=r=0/0},clean:function(){return 2-e}}}function Wn(t,e,n,r){var i,o,a=Math.sin(t-n);return ms(a)>Es?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function zn(t,e,n,r){var i;if(null==t){i=n*Os;r.point(-Is,i);r.point(0,i);r.point(Is,i);r.point(Is,0);r.point(Is,-i);r.point(0,-i);r.point(-Is,-i);r.point(-Is,0);r.point(-Is,i)}else if(ms(t[0]-e[0])>Es){var o=t[0]<e[0]?Is:-Is;i=n*o/2;r.point(-o,i);r.point(0,i);r.point(o,i)}else r.point(e[0],e[1])}function qn(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;wl.reset();for(var s=0,l=e.length;l>s;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],h=f[0],d=f[1]/2+Is/4,p=Math.sin(d),g=Math.cos(d),m=1;;){m===c&&(m=0);t=u[m];var v=t[0],y=t[1]/2+Is/4,b=Math.sin(y),x=Math.cos(y),w=v-h,C=w>=0?1:-1,S=C*w,T=S>Is,k=p*b;wl.add(Math.atan2(k*C*Math.sin(S),g*x+k*Math.cos(S)));o+=T?w+C*Ps:w;if(T^h>=n^v>=n){var _=bn(vn(f),vn(t));Cn(_);var M=bn(i,_);Cn(M);var D=(T^w>=0?-1:1)*re(M[2]);(r>D||r===D&&(_[0]||_[1]))&&(a+=T^w>=0?1:-1)}if(!m++)break;h=v,p=b,g=x,f=t}}return(-Es>o||Es>o&&0>wl)^1&a}function Un(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,o,l,u,c;return{lineStart:function(){u=l=!1;c=1},point:function(f,h){var d,p=[f,h],g=e(f,h),m=a?g?0:i(f,h):g?i(f+(0>f?Is:-Is),h):0;!n&&(u=l=g)&&t.lineStart();if(g!==l){d=r(n,p);if(Tn(n,d)||Tn(p,d)){p[0]+=Es;p[1]+=Es;g=e(p[0],p[1])}}if(g!==l){c=0;if(g){t.lineStart();d=r(p,n);t.point(d[0],d[1])}else{d=r(n,p);t.point(d[0],d[1]);t.lineEnd()}n=d}else if(s&&n&&a^g){var v;if(!(m&o)&&(v=r(p,n,!0))){c=0;if(a){t.lineStart();t.point(v[0][0],v[0][1]);t.point(v[1][0],v[1][1]);t.lineEnd()}else{t.point(v[1][0],v[1][1]);t.lineEnd();t.lineStart();t.point(v[0][0],v[0][1])}}}!g||n&&Tn(n,p)||t.point(p[0],p[1]);n=p,l=g,o=m},lineEnd:function(){l&&t.lineEnd();n=null},clean:function(){return c|(u&&l)<<1}}}function r(t,e,n){var r=vn(t),i=vn(e),a=[1,0,0],s=bn(r,i),l=yn(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=o*l/c,h=-o*u/c,d=bn(a,s),p=wn(a,f),g=wn(s,h);xn(p,g);var m=d,v=yn(p,m),y=yn(m,m),b=v*v-y*(yn(p,p)-1);if(!(0>b)){var x=Math.sqrt(b),w=wn(m,(-v-x)/y);xn(w,p);w=Sn(w);if(!n)return w;var C,S=t[0],T=e[0],k=t[1],_=e[1];S>T&&(C=S,S=T,T=C);var M=T-S,D=ms(M-Is)<Es,L=D||Es>M;!D&&k>_&&(C=k,k=_,_=C);if(L?D?k+_>0^w[1]<(ms(w[0]-S)<Es?k:_):k<=w[1]&&w[1]<=_:M>Is^(S<=w[0]&&w[0]<=T)){var A=wn(m,(-v+x)/y);xn(A,p);return[w,Sn(A)]}}}function i(e,n){var r=a?t:Is-t,i=0;-r>e?i|=1:e>r&&(i|=2);-r>n?i|=4:n>r&&(i|=8);return i}var o=Math.cos(t),a=o>0,s=ms(o)>Es,l=mr(t,6*Rs);return Pn(e,n,l,a?[0,-t]:[-Is,t-Is])}function Bn(t,e,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=s.x,f=s.y,h=0,d=1,p=c-l,g=f-u;o=t-l;if(p||!(o>0)){o/=p;if(0>p){if(h>o)return;d>o&&(d=o)}else if(p>0){if(o>d)return;o>h&&(h=o)}o=n-l;if(p||!(0>o)){o/=p;if(0>p){if(o>d)return;o>h&&(h=o)}else if(p>0){if(h>o)return;d>o&&(d=o)}o=e-u;if(g||!(o>0)){o/=g;if(0>g){if(h>o)return;d>o&&(d=o)}else if(g>0){if(o>d)return;o>h&&(h=o)}o=r-u;if(g||!(0>o)){o/=g;if(0>g){if(o>d)return;o>h&&(h=o)}else if(g>0){if(h>o)return;d>o&&(d=o)}h>0&&(i.a={x:l+h*p,y:u+h*g});1>d&&(i.b={x:l+d*p,y:u+d*g});return i}}}}}}function Vn(t,e,n,r){function i(r,i){return ms(r[0]-t)<Es?i>0?0:3:ms(r[0]-n)<Es?i>0?2:1:ms(r[1]-e)<Es?i>0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,n=m.length,r=t[1],i=0;n>i;++i)for(var o,a=1,s=m[i],l=s.length,u=s[0];l>a;++a){o=s[a];u[1]<=r?o[1]>r&&ee(u,o,t)>0&&++e:o[1]<=r&&ee(u,o,t)<0&&--e;u=o}return 0!==e}function u(o,s,l,u){var c=0,f=0;if(null==o||(c=i(o,l))!==(f=i(s,l))||a(o,s)<0^l>0){do u.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,o){return i>=t&&n>=i&&o>=e&&r>=o}function f(t,e){c(t,e)&&s.point(t,e)}function h(){L.point=p;m&&m.push(v=[]);T=!0;S=!1;w=C=0/0}function d(){if(g){p(y,b);x&&S&&M.rejoin();g.push(M.buffer())}L.point=f;S&&s.lineEnd()}function p(t,e){t=Math.max(-Hl,Math.min(Hl,t));e=Math.max(-Hl,Math.min(Hl,e));var n=c(t,e);m&&v.push([t,e]);if(T){y=t,b=e,x=n;T=!1;if(n){s.lineStart();s.point(t,e)}}else if(n&&S)s.point(t,e);else{var r={a:{x:w,y:C},b:{x:t,y:e}};if(D(r)){if(!S){s.lineStart();s.point(r.a.x,r.a.y)}s.point(r.b.x,r.b.y);n||s.lineEnd();k=!1}else if(n){s.lineStart();s.point(t,e);k=!1}}w=t,C=e,S=n}var g,m,v,y,b,x,w,C,S,T,k,_=s,M=On(),D=Bn(t,e,n,r),L={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=M;g=[];m=[];k=!0},polygonEnd:function(){s=_;g=is.merge(g);var e=l([t,r]),n=k&&e,i=g.length;if(n||i){s.polygonStart();if(n){s.lineStart();u(null,null,1,s);s.lineEnd()}i&&En(g,o,e,u,s);s.polygonEnd()}g=m=v=null}};return L}}function Xn(t){var e=0,n=Is/3,r=lr(t),i=r(e,n);i.parallels=function(t){return arguments.length?r(e=t[0]*Is/180,n=t[1]*Is/180):[e/Is*180,n/Is*180]};return i}function Gn(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,re((o-(t*t+n*n)*i*i)/(2*i))]};return n}function $n(){function t(t,e){Rl+=i*t-r*e;r=t,i=e}var e,n,r,i;Ul.point=function(o,a){Ul.point=t;e=r=o,n=i=a};Ul.lineEnd=function(){t(e,n)}}function Yn(t,e){Fl>t&&(Fl=t);t>zl&&(zl=t);Wl>e&&(Wl=e);e>ql&&(ql=e)}function Jn(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e);s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function i(){a.push("Z")}var o=Kn(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r;s.point=t},pointRadius:function(t){o=Kn(t);return s},result:function(){if(a.length){var t=a.join("");a=[];return t}}};return s}function Kn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Zn(t,e){kl+=t;_l+=e;++Ml}function Qn(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);Dl+=a*(e+t)/2;Ll+=a*(n+r)/2;Al+=a;Zn(e=t,n=r)}var e,n;Vl.point=function(r,i){Vl.point=t;Zn(e=r,n=i)}}function tr(){Vl.point=Zn}function er(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);Dl+=a*(r+t)/2;Ll+=a*(i+e)/2;Al+=a;a=i*t-r*e;Nl+=a*(r+t);El+=a*(i+e);jl+=3*a;Zn(r=t,i=e)}var e,n,r,i;Vl.point=function(o,a){Vl.point=t;Zn(e=r=o,n=i=a)};Vl.lineEnd=function(){t(e,n)}}function nr(t){function e(e,n){t.moveTo(e+a,n);t.arc(e,n,a,0,Ps)}function n(e,n){t.moveTo(e,n);s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i;s.point=e},pointRadius:function(t){a=t;return s},result:S};return s}function rr(t){function e(t){return(s?r:n)(t)}function n(e){return ar(e,function(n,r){n=t(n,r);e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r);e.point(n[0],n[1])}function r(){b=0/0;T.point=o;e.lineStart()}function o(n,r){var o=vn([n,r]),a=t(n,r);i(b,x,y,w,C,S,b=a[0],x=a[1],y=n,w=o[0],C=o[1],S=o[2],s,e);e.point(b,x)}function a(){T.point=n;e.lineEnd()}function l(){r();T.point=u;T.lineEnd=c}function u(t,e){o(f=t,h=e),d=b,p=x,g=w,m=C,v=S;T.point=o}function c(){i(b,x,y,w,C,S,d,p,f,g,m,v,s,e);T.lineEnd=a;a()}var f,h,d,p,g,m,v,y,b,x,w,C,S,T={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart();T.lineStart=l},polygonEnd:function(){e.polygonEnd();T.lineStart=r}};return T}function i(e,n,r,s,l,u,c,f,h,d,p,g,m,v){var y=c-e,b=f-n,x=y*y+b*b;if(x>4*o&&m--){var w=s+d,C=l+p,S=u+g,T=Math.sqrt(w*w+C*C+S*S),k=Math.asin(S/=T),_=ms(ms(S)-1)<Es||ms(r-h)<Es?(r+h)/2:Math.atan2(C,w),M=t(_,k),D=M[0],L=M[1],A=D-e,N=L-n,E=b*A-y*N;if(E*E/x>o||ms((y*A+b*N)/x-.5)>.3||a>s*d+l*p+u*g){i(e,n,r,s,l,u,D,L,_,w/=T,C/=T,S,m,v);v.point(D,L);i(D,L,_,w,C,S,c,f,h,d,p,g,m,v)}}}var o=.5,a=Math.cos(30*Rs),s=16;e.precision=function(t){if(!arguments.length)return Math.sqrt(o);s=(o=t*t)>0&&16;return e};return e}function ir(t){var e=rr(function(e,n){return t([e*Fs,n*Fs])});return function(t){return ur(e(t))}}function or(t){this.stream=t}function ar(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sr(t){return lr(function(){return t})()}function lr(t){function e(t){t=s(t[0]*Rs,t[1]*Rs);return[t[0]*h+l,u-t[1]*h]}function n(t){t=s.invert((t[0]-l)/h,(u-t[1])/h);return t&&[t[0]*Fs,t[1]*Fs]}function r(){s=An(a=hr(v,y,b),o);var t=o(g,m);l=d-t[0]*h;u=p+t[1]*h;return i()}function i(){c&&(c.valid=!1,c=null);return e}var o,a,s,l,u,c,f=rr(function(t,e){t=o(t,e);return[t[0]*h+l,u-t[1]*h]}),h=150,d=480,p=250,g=0,m=0,v=0,y=0,b=0,w=Pl,C=x,S=null,T=null;e.stream=function(t){c&&(c.valid=!1);c=ur(w(a,f(C(t))));c.valid=!0;return c};e.clipAngle=function(t){if(!arguments.length)return S;w=null==t?(S=t,Pl):Un((S=+t)*Rs);return i()};e.clipExtent=function(t){if(!arguments.length)return T;T=t;C=t?Vn(t[0][0],t[0][1],t[1][0],t[1][1]):x;return i()};e.scale=function(t){if(!arguments.length)return h;h=+t;return r()};e.translate=function(t){if(!arguments.length)return[d,p];d=+t[0];p=+t[1];return r()};e.center=function(t){if(!arguments.length)return[g*Fs,m*Fs];g=t[0]%360*Rs;m=t[1]%360*Rs;return r()};e.rotate=function(t){if(!arguments.length)return[v*Fs,y*Fs,b*Fs];v=t[0]%360*Rs;y=t[1]%360*Rs;b=t.length>2?t[2]%360*Rs:0;return r()};is.rebind(e,f,"precision");return function(){o=t.apply(this,arguments);e.invert=o.invert&&n;return r()}}function ur(t){return ar(t,function(e,n){t.point(e*Rs,n*Rs)})}function cr(t,e){return[t,e]}function fr(t,e){return[t>Is?t-Ps:-Is>t?t+Ps:t,e]}function hr(t,e,n){return t?e||n?An(pr(t),gr(e,n)):pr(t):e||n?gr(e,n):fr}function dr(t){return function(e,n){return e+=t,[e>Is?e-Ps:-Is>e?e+Ps:e,n]}}function pr(t){var e=dr(t);e.invert=dr(-t);return e}function gr(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*r+s*i;return[Math.atan2(l*o-c*a,s*r-u*i),re(c*o+l*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*o-l*a;return[Math.atan2(l*o+u*a,s*r+c*i),re(c*r-s*i)]};return n}function mr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){var l=a*e;if(null!=i){i=vr(n,i);o=vr(n,o);(a>0?o>i:i>o)&&(i+=a*Ps)}else{i=t+a*Ps;o=t-.5*l}for(var u,c=i;a>0?c>o:o>c;c-=l)s.point((u=Sn([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function vr(t,e){var n=vn(e);n[0]-=t;Cn(n);var r=ne(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Es)%(2*Math.PI)}function yr(t,e,n){var r=is.range(t,e-Es,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function br(t,e,n){var r=is.range(t,e-Es,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function xr(t){return t.source}function wr(t){return t.target}function Cr(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),s=Math.sin(r),l=i*Math.cos(t),u=i*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(se(r-e)+i*a*se(n-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,n=Math.sin(h-t)*d,r=n*l+e*c,i=n*u+e*f,a=n*o+e*s;return[Math.atan2(i,r)*Fs,Math.atan2(a,Math.sqrt(r*r+i*i))*Fs]}:function(){return[t*Fs,e*Fs]};p.distance=h;return p}function Sr(){function t(t,i){var o=Math.sin(i*=Rs),a=Math.cos(i),s=ms((t*=Rs)-e),l=Math.cos(s);Xl+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*o-n*a*l)*s),n*o+r*a*l);e=t,n=o,r=a}var e,n,r;Gl.point=function(i,o){e=i*Rs,n=Math.sin(o*=Rs),r=Math.cos(o);Gl.point=t};Gl.lineEnd=function(){Gl.point=Gl.lineEnd=S}}function Tr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]};return n}function kr(t,e){function n(t,e){a>0?-Os+Es>e&&(e=-Os+Es):e>Os-Es&&(e=Os-Es);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Is/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;if(!o)return Mr;n.invert=function(t,e){var n=a-e,r=te(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-Os]};return n}function _r(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;if(ms(i)<Es)return cr;n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,o-te(i)*Math.sqrt(t*t+n*n)]};return n}function Mr(t,e){return[t,Math.log(Math.tan(Is/4+e/2))]}function Dr(t){var e,n=sr(t),r=n.scale,i=n.translate,o=n.clipExtent;n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t};n.translate=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t};n.clipExtent=function(t){var a=o.apply(n,arguments);if(a===n){if(e=null==t){var s=Is*r(),l=i();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(a=null);return a};return n.clipExtent(null)}function Lr(t,e){return[Math.log(Math.tan(Is/4+e/2)),-t]}function Ar(t){return t[0]}function Nr(t){return t[1]}function Er(t){for(var e=t.length,n=[0,1],r=2,i=2;e>i;i++){for(;r>1&&ee(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function jr(t,e){return t[0]-e[0]||t[1]-e[1]}function Ir(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Pr(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,s=r[0]-o,l=t[1],u=n[1],c=e[1]-l,f=r[1]-u,h=(s*(l-u)-f*(i-o))/(f*a-s*c);return[i+h*a,l+h*c]}function Hr(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Or(){ii(this);this.edge=this.site=this.circle=null}function Rr(t){var e=ou.pop()||new Or;e.site=t;return e}function Fr(t){Yr(t);nu.remove(t);ou.push(t);ii(t)}function Wr(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,s=[t];Fr(t);for(var l=o;l.circle&&ms(n-l.circle.x)<Es&&ms(r-l.circle.cy)<Es;){o=l.P;s.unshift(l);Fr(l);l=o}s.unshift(l);Yr(l);for(var u=a;u.circle&&ms(n-u.circle.x)<Es&&ms(r-u.circle.cy)<Es;){a=u.N;s.push(u);Fr(u);u=a}s.push(u);Yr(u);var c,f=s.length;for(c=1;f>c;++c){u=s[c];l=s[c-1];ei(u.edge,l.site,u.site,i)}l=s[0];u=s[f-1];u.edge=Qr(l.site,u.site,null,i);$r(l);$r(u)}function zr(t){for(var e,n,r,i,o=t.x,a=t.y,s=nu._;s;){r=qr(s,a)-o;if(r>Es)s=s.L;else{i=o-Ur(s,a);if(!(i>Es)){if(r>-Es){e=s.P;n=s}else if(i>-Es){e=s;n=s.N}else e=n=s;break}if(!s.R){e=s;break}s=s.R}}var l=Rr(t);nu.insert(e,l);if(e||n)if(e!==n)if(n){Yr(e);Yr(n);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=n.site,g=p.x-c,m=p.y-f,v=2*(h*m-d*g),y=h*h+d*d,b=g*g+m*m,x={x:(m*y-d*b)/v+c,y:(h*b-g*y)/v+f};ei(n.edge,u,p,x);l.edge=Qr(u,t,null,x);n.edge=Qr(t,p,null,x);$r(e);$r(n)}else l.edge=Qr(e.site,l.site);else{Yr(e);n=Rr(e.site);nu.insert(l,n);l.edge=n.edge=Qr(e.site,l.site);$r(e);$r(n)}}function qr(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;n=a.site;var s=n.x,l=n.y,u=l-e;if(!u)return s;var c=s-r,f=1/o-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-o/2)))/f+r:(r+s)/2}function Ur(t,e){var n=t.N;if(n)return qr(n,e);var r=t.site;return r.y===e?r.x:1/0}function Br(t){this.site=t;this.edges=[]}function Vr(t){for(var e,n,r,i,o,a,s,l,u,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=eu,m=g.length;m--;){o=g[m];if(o&&o.prepare()){s=o.edges;l=s.length;a=0;for(;l>a;){c=s[a].end(),r=c.x,i=c.y;u=s[++a%l].start(),e=u.x,n=u.y;if(ms(r-e)>Es||ms(i-n)>Es){s.splice(a,0,new ni(ti(o.site,c,ms(r-f)<Es&&p-i>Es?{x:f,y:ms(e-f)<Es?n:p}:ms(i-p)<Es&&h-r>Es?{x:ms(n-p)<Es?e:h,y:p}:ms(r-h)<Es&&i-d>Es?{x:h,y:ms(e-h)<Es?n:d}:ms(i-d)<Es&&r-f>Es?{x:ms(n-d)<Es?e:f,y:d}:null),o.site,null));++l}}}}}function Xr(t,e){return e.angle-t.angle}function Gr(){ii(this);this.x=this.y=this.arc=this.site=this.cy=null}function $r(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,s=i.y,l=r.x-a,u=r.y-s,c=o.x-a,f=o.y-s,h=2*(l*f-u*c);if(!(h>=-js)){var d=l*l+u*u,p=c*c+f*f,g=(f*d-u*p)/h,m=(l*p-c*d)/h,f=m+s,v=au.pop()||new Gr;v.arc=t;v.site=i;v.x=g+a;v.y=f+Math.sqrt(g*g+m*m);v.cy=f;t.circle=v;for(var y=null,b=iu._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}iu.insert(y,v);y||(ru=v)}}}}function Yr(t){var e=t.circle;if(e){e.P||(ru=e.N);iu.remove(e);au.push(e);ii(e);t.circle=null}}function Jr(t){for(var e,n=tu,r=Bn(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;){e=n[i];if(!Kr(e,t)||!r(e)||ms(e.a.x-e.b.x)<Es&&ms(e.a.y-e.b.y)<Es){e.a=e.b=null;n.splice(i,1)}}}function Kr(t,e){var n=t.b;if(n)return!0;var r,i,o=t.a,a=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,f=t.r,h=c.x,d=c.y,p=f.x,g=f.y,m=(h+p)/2,v=(d+g)/2;if(g===d){if(a>m||m>=s)return;if(h>p){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else{r=(h-p)/(g-d);i=v-r*m;if(-1>r||r>1)if(h>p){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(g>d){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.x<a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}}t.a=o;t.b=n;return!0}function Zr(t,e){this.l=t;this.r=e;this.a=this.b=null}function Qr(t,e,n,r){var i=new Zr(t,e);tu.push(i);n&&ei(i,t,e,n);r&&ei(i,e,t,r);eu[t.i].edges.push(new ni(i,t,e));eu[e.i].edges.push(new ni(i,e,t));return i}function ti(t,e,n){var r=new Zr(t,null);r.a=e;r.b=n;tu.push(r);return r}function ei(t,e,n,r){if(t.a||t.b)t.l===n?t.b=r:t.a=r;else{t.a=r;t.l=e;t.r=n}}function ni(t,e,n){var r=t.a,i=t.b;this.edge=t;this.site=e;this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function ri(){this._=null}function ii(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function oi(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r;r.U=i;n.U=r;n.R=r.L;n.R&&(n.R.U=n);r.L=n}function ai(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r;r.U=i;n.U=r;n.L=r.R;n.L&&(n.L.U=n);r.R=n}function si(t){for(;t.L;)t=t.L;return t}function li(t,e){var n,r,i,o=t.sort(ui).pop();tu=[];eu=new Array(t.length);nu=new ri;iu=new ri;for(;;){i=ru;if(o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x)){if(o.x!==n||o.y!==r){eu[o.i]=new Br(o);zr(o);n=o.x,r=o.y}o=t.pop()}else{if(!i)break;Wr(i.arc)}}e&&(Jr(e),Vr(e));var a={cells:eu,edges:tu};nu=iu=tu=eu=null;return a}function ui(t,e){return e.y-t.y||e.x-t.x}function ci(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function fi(t){return t.x}function hi(t){return t.y}function di(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pi(t,e,n,r,i,o){if(!t(e,n,r,i,o)){var a=.5*(n+i),s=.5*(r+o),l=e.nodes;l[0]&&pi(t,l[0],n,r,a,s);l[1]&&pi(t,l[1],a,r,i,s);l[2]&&pi(t,l[2],n,s,a,o);l[3]&&pi(t,l[3],a,s,i,o)}}function gi(t,e,n,r,i,o,a){var s,l=1/0;(function u(t,c,f,h,d){if(!(c>o||f>a||r>h||i>d)){if(p=t.point){var p,g=e-t.x,m=n-t.y,v=g*g+m*m;if(l>v){var y=Math.sqrt(l=v);r=e-y,i=n-y;o=e+y,a=n+y;s=p}}for(var b=t.nodes,x=.5*(c+h),w=.5*(f+d),C=e>=x,S=n>=w,T=S<<1|C,k=T+4;k>T;++T)if(t=b[3&T])switch(3&T){case 0:u(t,c,f,x,w);break;case 1:u(t,x,f,h,w);break;case 2:u(t,c,w,x,d);break;case 3:u(t,x,w,h,d)}}})(t,r,i,o,a);return s}function mi(t,e){t=is.rgb(t);e=is.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,s=e.b-i;return function(t){return"#"+Ce(Math.round(n+o*t))+Ce(Math.round(r+a*t))+Ce(Math.round(i+s*t))}}function vi(t,e){var n,r={},i={};for(n in t)n in e?r[n]=xi(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function yi(t,e){t=+t,e=+e;return function(n){return t*(1-n)+e*n}}function bi(t,e){var n,r,i,o=lu.lastIndex=uu.lastIndex=0,a=-1,s=[],l=[];t+="",e+="";for(;(n=lu.exec(t))&&(r=uu.exec(e));){if((i=r.index)>o){i=e.slice(o,i);s[a]?s[a]+=i:s[++a]=i}if((n=n[0])===(r=r[0]))s[a]?s[a]+=r:s[++a]=r;else{s[++a]=null;l.push({i:a,x:yi(n,r)})}o=uu.lastIndex}if(o<e.length){i=e.slice(o);s[a]?s[a]+=i:s[++a]=i}return s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var n,r=0;e>r;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}function xi(t,e){for(var n,r=is.interpolators.length;--r>=0&&!(n=is.interpolators[r](t,e)););return n}function wi(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;s>n;++n)r.push(xi(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;s>n;++n)i[n]=r[n](t);return i}}function Ci(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function Si(t){return function(e){return 1-t(1-e)}}function Ti(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function ki(t){return t*t}function _i(t){return t*t*t}function Mi(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Di(t){return function(e){return Math.pow(e,t)}}function Li(t){return 1-Math.cos(t*Os)}function Ai(t){return Math.pow(2,10*(t-1))}function Ni(t){return 1-Math.sqrt(1-t*t)}function Ei(t,e){var n;arguments.length<2&&(e=.45);arguments.length?n=e/Ps*Math.asin(1/t):(t=1,n=e/4);return function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Ps/e)}}function ji(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}}function Ii(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Pi(t,e){t=is.hcl(t);e=is.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.c:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return he(n+o*t,r+a*t,i+s*t)+""}}function Hi(t,e){t=is.hsl(t);e=is.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.s:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return ce(n+o*t,r+a*t,i+s*t)+""}}function Oi(t,e){t=is.lab(t);e=is.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,s=e.b-i;return function(t){return pe(n+o*t,r+a*t,i+s*t)+""}}function Ri(t,e){e-=t;return function(n){return Math.round(t+e*n)}}function Fi(t){var e=[t.a,t.b],n=[t.c,t.d],r=zi(e),i=Wi(e,n),o=zi(qi(n,e,-i))||0;if(e[0]*n[1]<n[0]*e[1]){e[0]*=-1;e[1]*=-1;r*=-1;i*=-1}this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Fs;this.translate=[t.e,t.f];this.scale=[r,o];this.skew=o?Math.atan2(i,o)*Fs:0}function Wi(t,e){return t[0]*e[0]+t[1]*e[1]}function zi(t){var e=Math.sqrt(Wi(t,t));if(e){t[0]/=e;t[1]/=e}return e}function qi(t,e,n){t[0]+=n*e[0];t[1]+=n*e[1];return t}function Ui(t,e){var n,r=[],i=[],o=is.transform(t),a=is.transform(e),s=o.translate,l=a.translate,u=o.rotate,c=a.rotate,f=o.skew,h=a.skew,d=o.scale,p=a.scale;if(s[0]!=l[0]||s[1]!=l[1]){r.push("translate(",null,",",null,")");i.push({i:1,x:yi(s[0],l[0])},{i:3,x:yi(s[1],l[1])})}else r.push(l[0]||l[1]?"translate("+l+")":"");if(u!=c){u-c>180?c+=360:c-u>180&&(u+=360);i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yi(u,c)})}else c&&r.push(r.pop()+"rotate("+c+")");f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yi(f,h)}):h&&r.push(r.pop()+"skewX("+h+")");if(d[0]!=p[0]||d[1]!=p[1]){n=r.push(r.pop()+"scale(",null,",",null,")");i.push({i:n-4,x:yi(d[0],p[0])},{i:n-2,x:yi(d[1],p[1])})}else(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")");n=i.length;return function(t){for(var e,o=-1;++o<n;)r[(e=i[o]).i]=e.x(t);return r.join("")}}function Bi(t,e){e=(e-=t=+t)||1/e;return function(n){return(n-t)/e}}function Vi(t,e){e=(e-=t=+t)||1/e;return function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function Xi(t){for(var e=t.source,n=t.target,r=$i(e,n),i=[e];e!==r;){e=e.parent;i.push(e)}for(var o=i.length;n!==r;){i.splice(o,0,n);n=n.parent}return i}function Gi(t){for(var e=[],n=t.parent;null!=n;){e.push(t);t=n;n=n.parent}e.push(t);return e}function $i(t,e){if(t===e)return t;for(var n=Gi(t),r=Gi(e),i=n.pop(),o=r.pop(),a=null;i===o;){a=i;i=n.pop();o=r.pop()}return a}function Yi(t){t.fixed|=2}function Ji(t){t.fixed&=-7}function Ki(t){t.fixed|=4;t.px=t.x,t.py=t.y}function Zi(t){t.fixed&=-5}function Qi(t,e,n){var r=0,i=0;t.charge=0;if(!t.leaf)for(var o,a=t.nodes,s=a.length,l=-1;++l<s;){o=a[l];if(null!=o){Qi(o,e,n);t.charge+=o.charge;r+=o.charge*o.cx;i+=o.charge*o.cy}}if(t.point){if(!t.leaf){t.point.x+=Math.random()-.5;t.point.y+=Math.random()-.5}var u=e*n[t.point.index];t.charge+=t.pointCharge=u;r+=u*t.point.x;i+=u*t.point.y}t.cx=r/t.charge;t.cy=i/t.charge}function to(t,e){is.rebind(t,e,"sort","children","value");t.nodes=t;t.links=ao;return t}function eo(t,e){for(var n=[t];null!=(t=n.pop());){e(t);if((i=t.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}}function no(t,e){for(var n=[t],r=[];null!=(t=n.pop());){r.push(t);if((o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a])}for(;null!=(t=r.pop());)e(t)}function ro(t){return t.children}function io(t){return t.value}function oo(t,e){return e.value-t.value}function ao(t){return is.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function so(t){return t.x}function lo(t){return t.y}function uo(t,e,n){t.y0=e;t.y=n}function co(t){return is.range(t.length)}function fo(t){for(var e=-1,n=t[0].length,r=[];++e<n;)r[e]=0;return r}function ho(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;o>n;++n)if((e=t[n][1])>i){r=n;i=e}return r}function po(t){return t.reduce(go,0)}function go(t,e){return t+e[1]}function mo(t,e){return vo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vo(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function yo(t){return[is.min(t),is.max(t)]}function bo(t,e){return t.value-e.value}function xo(t,e){var n=t._pack_next;t._pack_next=e;e._pack_prev=t;e._pack_next=n;n._pack_prev=e}function wo(t,e){t._pack_next=e;e._pack_prev=t}function Co(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function So(t){function e(t){c=Math.min(t.x-t.r,c);f=Math.max(t.x+t.r,f);h=Math.min(t.y-t.r,h);d=Math.max(t.y+t.r,d)}if((n=t.children)&&(u=n.length)){var n,r,i,o,a,s,l,u,c=1/0,f=-1/0,h=1/0,d=-1/0;n.forEach(To);r=n[0];r.x=-r.r;r.y=0;e(r);if(u>1){i=n[1];i.x=i.r;i.y=0;e(i);if(u>2){o=n[2];Mo(r,i,o);e(o);xo(r,o);r._pack_prev=o;xo(o,i);i=r._pack_next;for(a=3;u>a;a++){Mo(r,i,o=n[a]);var p=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(Co(s,o)){p=1;break}if(1==p)for(l=r._pack_prev;l!==s._pack_prev&&!Co(l,o);l=l._pack_prev,m++);if(p){m>g||g==m&&i.r<r.r?wo(r,i=s):wo(r=l,i);a--}else{xo(r,o);i=o;e(o)}}}}var v=(c+f)/2,y=(h+d)/2,b=0;for(a=0;u>a;a++){o=n[a];o.x-=v;o.y-=y;b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y))}t.r=b;n.forEach(ko)}}function To(t){t._pack_next=t._pack_prev=t}function ko(t){delete t._pack_next;delete t._pack_prev}function _o(t,e,n,r){var i=t.children;t.x=e+=r*t.x;t.y=n+=r*t.y;t.r*=r;if(i)for(var o=-1,a=i.length;++o<a;)_o(i[o],e,n,r)}function Mo(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,s=i*i+o*o;a*=a;r*=r;var l=.5+(r-a)/(2*s),u=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=t.x+l*i+u*o;n.y=t.y+l*o-u*i}else{n.x=t.x+r;n.y=t.y}}function Do(t,e){return t.parent==e.parent?1:2}function Lo(t){var e=t.children;return e.length?e[0]:t.t}function Ao(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function No(t,e,n){var r=n/(e.i-t.i);e.c-=r;e.s+=n;t.c+=r;e.z+=n;e.m+=n}function Eo(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;){e=i[o];e.z+=n;e.m+=n;n+=e.s+(r+=e.c)}}function jo(t,e,n){return t.a.parent===e.parent?t.a:n}function Io(t){return 1+is.max(t,function(t){return t.y})}function Po(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ho(t){var e=t.children;return e&&e.length?Ho(e[0]):t}function Oo(t){var e,n=t.children;return n&&(e=n.length)?Oo(n[e-1]):t}function Ro(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Fo(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];if(0>i){n+=i/2;i=0}if(0>o){r+=o/2;o=0}return{x:n,y:r,dx:i,dy:o}}function Wo(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function zo(t){return t.rangeExtent?t.rangeExtent():Wo(t.range())}function qo(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function Uo(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];if(o>a){n=r,r=i,i=n;n=o,o=a,a=n}t[r]=e.floor(o);t[i]=e.ceil(a);return t}function Bo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xu}function Vo(t,e,n,r){var i=[],o=[],a=0,s=Math.min(t.length,e.length)-1;if(t[s]<t[0]){t=t.slice().reverse();e=e.slice().reverse()}for(;++a<=s;){i.push(n(t[a-1],t[a]));o.push(r(e[a-1],e[a]))}return function(e){var n=is.bisect(t,e,1,s)-1;return o[n](i[n](e))}}function Xo(t,e,n,r){function i(){var i=Math.min(t.length,e.length)>2?Vo:qo,l=r?Vi:Bi;a=i(t,e,l,n);s=i(e,t,l,xi);return o}function o(t){return a(t)}var a,s;o.invert=function(t){return s(t)};o.domain=function(e){if(!arguments.length)return t;t=e.map(Number);return i()};o.range=function(t){if(!arguments.length)return e;e=t;return i()};o.rangeRound=function(t){return o.range(t).interpolate(Ri)};o.clamp=function(t){if(!arguments.length)return r;r=t;return i()};o.interpolate=function(t){if(!arguments.length)return n;n=t;return i()};o.ticks=function(e){return Jo(t,e)};o.tickFormat=function(e,n){return Ko(t,e,n)};o.nice=function(e){$o(t,e);return i()};o.copy=function(){return Xo(t,e,n,r)};return i()}function Go(t,e){return is.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $o(t,e){return Uo(t,Bo(Yo(t,e)[2]))}function Yo(t,e){null==e&&(e=10);var n=Wo(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2);n[0]=Math.ceil(n[0]/i)*i;n[1]=Math.floor(n[1]/i)*i+.5*i;n[2]=i;return n}function Jo(t,e){return is.range.apply(is,Yo(t,e))}function Ko(t,e,n){var r=Yo(t,e);if(n){var i=ll.exec(n);i.shift();if("s"===i[8]){var o=is.formatPrefix(Math.max(ms(r[0]),ms(r[1])));i[7]||(i[7]="."+Zo(o.scale(r[2])));i[8]="f";n=is.format(i.join(""));return function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Qo(i[8],r));n=i.join("")}else n=",."+Zo(r[2])+"f";return is.format(n)}function Zo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Qo(t,e){var n=Zo(e[2]);return t in wu?Math.abs(n-Zo(Math.max(ms(e[0]),ms(e[1]))))+ +("e"!==t):n-2*("%"===t)}function ta(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}a.invert=function(e){return o(t.invert(e))};a.domain=function(e){if(!arguments.length)return r;n=e[0]>=0;t.domain((r=e.map(Number)).map(i));return a};a.base=function(n){if(!arguments.length)return e;e=+n;t.domain(r.map(i));return a};a.nice=function(){var e=Uo(r.map(i),n?Math:Su);t.domain(e);r=e.map(o);return a};a.ticks=function(){var t=Wo(r),a=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(n){for(;c>u;u++)for(var h=1;f>h;h++)a.push(o(u)*h);a.push(o(u))}else{a.push(o(u));for(;u++<c;)for(var h=f-1;h>0;h--)a.push(o(u)*h)}for(u=0;a[u]<s;u++);for(c=a.length;a[c-1]>l;c--);a=a.slice(u,c)}return a};a.tickFormat=function(t,e){if(!arguments.length)return Cu;arguments.length<2?e=Cu:"function"!=typeof e&&(e=is.format(e));var r,s=Math.max(.1,t/a.ticks().length),l=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/o(l(i(t)+r))<=s?e(t):""}};a.copy=function(){return ta(t.copy(),e,n,r)};return Go(a,t)}function ea(t,e,n){function r(e){return t(i(e))}var i=na(e),o=na(1/e);r.invert=function(e){return o(t.invert(e))};r.domain=function(e){if(!arguments.length)return n;t.domain((n=e.map(Number)).map(i));return r};r.ticks=function(t){return Jo(n,t)};r.tickFormat=function(t,e){return Ko(n,t,e)};r.nice=function(t){return r.domain($o(n,t))};r.exponent=function(a){if(!arguments.length)return e;i=na(e=a);o=na(1/e);t.domain(n.map(i));return r};r.copy=function(){return ea(t.copy(),e,n)};return Go(r,t)}function na(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ra(t,e){function n(n){return o[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%o.length]}function r(e,n){return is.range(t.length).map(function(t){return e+n*t })}var i,o,a;n.domain=function(r){if(!arguments.length)return t;t=[];i=new f;for(var o,a=-1,s=r.length;++a<s;)i.has(o=r[a])||i.set(o,t.push(o));return n[e.t].apply(n,e.a)};n.range=function(t){if(!arguments.length)return o;o=t;a=0;e={t:"range",a:arguments};return n};n.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);o=r(l+c*s/2,c);a=0;e={t:"rangePoints",a:arguments};return n};n.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;o=r(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c);a=0;e={t:"rangeRoundPoints",a:arguments};return n};n.rangeBands=function(i,s,l){arguments.length<2&&(s=0);arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=(f-c)/(t.length-s+2*l);o=r(c+h*l,h);u&&o.reverse();a=h*(1-s);e={t:"rangeBands",a:arguments};return n};n.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0);arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=Math.floor((f-c)/(t.length-s+2*l));o=r(c+Math.round((f-c-(t.length-s)*h)/2),h);u&&o.reverse();a=Math.round(h*(1-s));e={t:"rangeRoundBands",a:arguments};return n};n.rangeBand=function(){return a};n.rangeExtent=function(){return Wo(e.a[0])};n.copy=function(){return ra(t,e)};return n.domain(t)}function ia(t,e){function n(){var n=0,i=e.length;s=[];for(;++n<i;)s[n-1]=is.quantile(t,n/i);return r}function r(t){return isNaN(t=+t)?void 0:e[is.bisect(s,t)]}var s;r.domain=function(e){if(!arguments.length)return t;t=e.map(o).filter(a).sort(i);return n()};r.range=function(t){if(!arguments.length)return e;e=t;return n()};r.quantiles=function(){return s};r.invertExtent=function(n){n=e.indexOf(n);return 0>n?[0/0,0/0]:[n>0?s[n-1]:t[0],n<s.length?s[n]:t[t.length-1]]};r.copy=function(){return ia(t,e)};return n()}function oa(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){o=n.length/(e-t);a=n.length-1;return r}var o,a;r.domain=function(n){if(!arguments.length)return[t,e];t=+n[0];e=+n[n.length-1];return i()};r.range=function(t){if(!arguments.length)return n;n=t;return i()};r.invertExtent=function(e){e=n.indexOf(e);e=0>e?0/0:e/o+t;return[e,e+1/o]};r.copy=function(){return oa(t,e,n)};return i()}function aa(t,e){function n(n){return n>=n?e[is.bisect(t,n)]:void 0}n.domain=function(e){if(!arguments.length)return t;t=e;return n};n.range=function(t){if(!arguments.length)return e;e=t;return n};n.invertExtent=function(n){n=e.indexOf(n);return[t[n-1],t[n]]};n.copy=function(){return aa(t,e)};return n}function sa(t){function e(t){return+t}e.invert=e;e.domain=e.range=function(n){if(!arguments.length)return t;t=n.map(e);return e};e.ticks=function(e){return Jo(t,e)};e.tickFormat=function(e,n){return Ko(t,e,n)};e.copy=function(){return sa(t)};return e}function la(){return 0}function ua(t){return t.innerRadius}function ca(t){return t.outerRadius}function fa(t){return t.startAngle}function ha(t){return t.endAngle}function da(t){return t&&t.padAngle}function pa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function ga(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,m=h-c,v=d-f,y=m*m+v*v,b=n-r,x=c*d-h*f,w=(0>v?-1:1)*Math.sqrt(b*b*y-x*x),C=(x*v-m*w)/y,S=(-x*m-v*w)/y,T=(x*v+m*w)/y,k=(-x*m+v*w)/y,_=C-p,M=S-g,D=T-p,L=k-g;_*_+M*M>D*D+L*L&&(C=T,S=k);return[[C-l,S-u],[C*n/b,S*n/b]]}function ma(t){function e(e){function a(){u.push("M",o(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,d=De(n),p=De(r);++f<h;)if(i.call(this,l=e[f],f))c.push([+d.call(this,l,f),+p.call(this,l,f)]);else if(c.length){a();c=[]}c.length&&a();return u.length?u.join(""):null}var n=Ar,r=Nr,i=Nn,o=va,a=o.key,s=.7;e.x=function(t){if(!arguments.length)return n;n=t;return e};e.y=function(t){if(!arguments.length)return r;r=t;return e};e.defined=function(t){if(!arguments.length)return i;i=t;return e};e.interpolate=function(t){if(!arguments.length)return a;a="function"==typeof t?o=t:(o=Lu.get(t)||va).key;return e};e.tension=function(t){if(!arguments.length)return s;s=t;return e};return e}function va(t){return t.join("L")}function ya(t){return va(t)+"Z"}function ba(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);n>1&&i.push("H",r[0]);return i.join("")}function xa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function wa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function Ca(t,e){return t.length<4?va(t):t[1]+ka(t.slice(1,-1),_a(t,e))}function Sa(t,e){return t.length<3?va(t):t[0]+ka((t.push(t[0]),t),_a([t[t.length-2]].concat(t,[t[1]]),e))}function Ta(t,e){return t.length<3?va(t):t[0]+ka(t,_a(t,e))}function ka(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return va(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],s=a,l=1;if(n){r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1];i=t[1];l=2}if(e.length>1){s=e[1];o=t[l];l++;r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<e.length;u++,l++){o=t[l];s=e[u];r+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}}if(n){var c=t[l];r+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function _a(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;){n=o;o=a;a=t[s];r.push([i*(a[0]-n[0]),i*(a[1]-n[1])])}return r}function Ma(t){if(t.length<3)return va(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],s=[o,o,o,r[1]],l=[i,",",o,"L",Na(Eu,a),",",Na(Eu,s)];t.push(t[n-1]);for(;++e<=n;){r=t[e];a.shift();a.push(r[0]);s.shift();s.push(r[1]);Ea(l,a,s)}t.pop();l.push("L",r);return l.join("")}function Da(t){if(t.length<4)return va(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;){e=t[r];o.push(e[0]);a.push(e[1])}n.push(Na(Eu,o)+","+Na(Eu,a));--r;for(;++r<i;){e=t[r];o.shift();o.push(e[0]);a.shift();a.push(e[1]);Ea(n,o,a)}return n.join("")}function La(t){for(var e,n,r=-1,i=t.length,o=i+4,a=[],s=[];++r<4;){n=t[r%i];a.push(n[0]);s.push(n[1])}e=[Na(Eu,a),",",Na(Eu,s)];--r;for(;++r<o;){n=t[r%i];a.shift();a.push(n[0]);s.shift();s.push(n[1]);Ea(e,a,s)}return e.join("")}function Aa(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],s=t[n][0]-o,l=t[n][1]-a,u=-1;++u<=n;){r=t[u];i=u/n;r[0]=e*r[0]+(1-e)*(o+i*s);r[1]=e*r[1]+(1-e)*(a+i*l)}return Ma(t)}function Na(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ea(t,e,n){t.push("C",Na(Au,e),",",Na(Au,n),",",Na(Nu,e),",",Na(Nu,n),",",Na(Eu,e),",",Na(Eu,n))}function ja(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ia(t){for(var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=ja(i,o);++e<n;)r[e]=(a+(a=ja(i=o,o=t[e+1])))/2;r[e]=a;return r}function Pa(t){for(var e,n,r,i,o=[],a=Ia(t),s=-1,l=t.length-1;++s<l;){e=ja(t[s],t[s+1]);if(ms(e)<Es)a[s]=a[s+1]=0;else{n=a[s]/e;r=a[s+1]/e;i=n*n+r*r;if(i>9){i=3*e/Math.sqrt(i);a[s]=i*n;a[s+1]=i*r}}}s=-1;for(;++s<=l;){i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s]));o.push([i||0,a[s]*i||0])}return o}function Ha(t){return t.length<3?va(t):t[0]+ka(t,Pa(t))}function Oa(t){for(var e,n,r,i=-1,o=t.length;++i<o;){e=t[i];n=e[0];r=e[1]-Os;e[0]=n*Math.cos(r);e[1]=n*Math.sin(r)}return t}function Ra(t){function e(e){function l(){g.push("M",s(t(v),f),c,u(t(m.reverse()),f),"Z")}for(var h,d,p,g=[],m=[],v=[],y=-1,b=e.length,x=De(n),w=De(i),C=n===r?function(){return d}:De(r),S=i===o?function(){return p}:De(o);++y<b;)if(a.call(this,h=e[y],y)){m.push([d=+x.call(this,h,y),p=+w.call(this,h,y)]);v.push([+C.call(this,h,y),+S.call(this,h,y)])}else if(m.length){l();m=[];v=[]}m.length&&l();return g.length?g.join(""):null}var n=Ar,r=Ar,i=0,o=Nr,a=Nn,s=va,l=s.key,u=s,c="L",f=.7;e.x=function(t){if(!arguments.length)return r;n=r=t;return e};e.x0=function(t){if(!arguments.length)return n;n=t;return e};e.x1=function(t){if(!arguments.length)return r;r=t;return e};e.y=function(t){if(!arguments.length)return o;i=o=t;return e};e.y0=function(t){if(!arguments.length)return i;i=t;return e};e.y1=function(t){if(!arguments.length)return o;o=t;return e};e.defined=function(t){if(!arguments.length)return a;a=t;return e};e.interpolate=function(t){if(!arguments.length)return l;l="function"==typeof t?s=t:(s=Lu.get(t)||va).key;u=s.reverse||s;c=s.closed?"M":"L";return e};e.tension=function(t){if(!arguments.length)return f;f=t;return e};return e}function Fa(t){return t.radius}function Wa(t){return[t.x,t.y]}function za(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Os;return[n*Math.cos(r),n*Math.sin(r)]}}function qa(){return 64}function Ua(){return"circle"}function Ba(t){var e=Math.sqrt(t/Is);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Va(t){return function(){var e,n;if((e=this[t])&&(n=e[e.active])){--e.count?delete e[e.active]:delete this[t];e.active+=.5;n.event&&n.event.interrupt.call(this,this.__data__,n.index)}}}function Xa(t,e,n){ws(t,Fu);t.namespace=e;t.id=n;return t}function Ga(t,e,n,r){var i=t.id,o=t.namespace;return V(t,"function"==typeof n?function(t,a,s){t[o][i].tween.set(e,r(n.call(t,t.__data__,a,s)))}:(n=r(n),function(t){t[o][i].tween.set(e,n)}))}function $a(t){null==t&&(t="");return function(){this.textContent=t}}function Ya(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ja(t,e,n,r,i){var o=t[n]||(t[n]={active:0,count:0}),a=o[r];if(!a){var s=i.time;a=o[r]={tween:new f,time:s,delay:i.delay,duration:i.duration,ease:i.ease,index:e};i=null;++o.count;is.timer(function(i){function l(n){if(o.active>r)return c();var i=o[o.active];if(i){--o.count;delete o[o.active];i.event&&i.event.interrupt.call(t,t.__data__,i.index)}o.active=r;a.event&&a.event.start.call(t,t.__data__,e);a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)});h=a.ease;f=a.duration;is.timer(function(){p.c=u(n||1)?Nn:u;return 1},0,s)}function u(n){if(o.active!==r)return 1;for(var i=n/f,s=h(i),l=g.length;l>0;)g[--l].call(t,s);if(i>=1){a.event&&a.event.end.call(t,t.__data__,e);return c()}}function c(){--o.count?delete o[r]:delete t[n];return 1}var f,h,d=a.delay,p=ol,g=[];p.t=d+s;if(i>=d)return l(i-d);p.c=l;return void 0},0,s)}}function Ka(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Qa(t){return t.toISOString()}function ts(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,o=is.bisect($u,i);return o==$u.length?[e.year,Yo(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/$u[o-1]<$u[o]/i?o-1:o]:[Ku,Yo(t,n)[2]]}r.invert=function(e){return es(t.invert(e))};r.domain=function(e){if(!arguments.length)return t.domain().map(es);t.domain(e);return r};r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,es(+n+1),e).length}var o=r.domain(),a=Wo(o),s=null==t?i(a,10):"number"==typeof t&&i(a,t);s&&(t=s[0],e=s[1]);return r.domain(Uo(o,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=es(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=es(+e+1);return e}}:t))};r.ticks=function(t,e){var n=Wo(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];o&&(t=o[0],e=o[1]);return t.range(n[0],es(+n[1]+1),1>e?1:e)};r.tickFormat=function(){return n};r.copy=function(){return ts(t.copy(),e,n)};return Go(r,t)}function es(t){return new Date(t)}function ns(t){return JSON.parse(t.responseText)}function rs(t){var e=ss.createRange();e.selectNode(ss.body);return e.createContextualFragment(t.responseText)}var is={version:"3.5.5"},os=[].slice,as=function(t){return os.call(t)},ss=this.document;if(ss)try{as(ss.documentElement.childNodes)[0].nodeType}catch(ls){as=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}Date.now||(Date.now=function(){return+new Date});if(ss)try{ss.createElement("DIV").style.setProperty("opacity",0,"")}catch(us){var cs=this.Element.prototype,fs=cs.setAttribute,hs=cs.setAttributeNS,ds=this.CSSStyleDeclaration.prototype,ps=ds.setProperty;cs.setAttribute=function(t,e){fs.call(this,t,e+"")};cs.setAttributeNS=function(t,e,n){hs.call(this,t,e,n+"")};ds.setProperty=function(t,e,n){ps.call(this,t,e+"",n)}}is.ascending=i;is.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0};is.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n};is.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n};is.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){n=i=r;break}for(;++o<a;)if(null!=(r=t[o])){n>r&&(n=r);r>i&&(i=r)}}else{for(;++o<a;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=i=r;break}for(;++o<a;)if(null!=(r=e.call(t,t[o],o))){n>r&&(n=r);r>i&&(i=r)}}return[n,i]};is.sum=function(t,e){var n,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)a(n=+t[o])&&(r+=n);else for(;++o<i;)a(n=+e.call(t,t[o],o))&&(r+=n);return r};is.mean=function(t,e){var n,r=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)a(n=o(t[s]))?r+=n:--l;else for(;++s<i;)a(n=o(e.call(t,t[s],s)))?r+=n:--l;return l?r/l:void 0};is.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i};is.median=function(t,e){var n,r=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)a(n=o(t[l]))&&r.push(n);else for(;++l<s;)a(n=o(e.call(t,t[l],l)))&&r.push(n);return r.length?is.quantile(r.sort(i),.5):void 0};is.variance=function(t,e){var n,r,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length){for(;++u<i;)if(a(n=o(t[u]))){r=n-s;s+=r/++c;l+=r*(n-s)}}else for(;++u<i;)if(a(n=o(e.call(t,t[u],u)))){r=n-s;s+=r/++c;l+=r*(n-s)}return c>1?l/(c-1):void 0};is.deviation=function(){var t=is.variance.apply(this,arguments);return t?Math.sqrt(t):t};var gs=s(i);is.bisectLeft=gs.left;is.bisect=is.bisectRight=gs.right;is.bisector=function(t){return s(1===t.length?function(e,n){return i(t(e),n)}:t)};is.shuffle=function(t,e,n){if((o=arguments.length)<3){n=t.length;2>o&&(e=0)}for(var r,i,o=n-e;o;){i=Math.random()*o--|0;r=t[o+e],t[o+e]=t[i+e],t[i+e]=r}return t};is.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r};is.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>n;)o[n]=[e=i,i=t[++n]];return o};is.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=is.min(arguments,l),n=new Array(e);++t<e;)for(var r,i=-1,o=n[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return n};is.transpose=function(t){return is.zip.apply(is,t)};is.keys=function(t){var e=[];for(var n in t)e.push(n);return e};is.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e};is.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e};is.merge=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;n=new Array(a);for(;--i>=0;){r=t[i];e=r.length;for(;--e>=0;)n[--a]=r[e]}return n};var ms=Math.abs;is.range=function(t,e,n){if(arguments.length<3){n=1;if(arguments.length<2){e=t;t=0}}if((e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=u(ms(n)),a=-1;t*=o,e*=o,n*=o;if(0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i};is.map=function(t,e){var n=new f;if(t instanceof f)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e.call(t,r=t[i],i),r)}else for(var a in t)n.set(a,t[a]);return n};var vs="__proto__",ys="\x00";c(f,{has:p,get:function(t){return this._[h(t)]},set:function(t,e){return this._[h(t)]=e},remove:g,keys:m,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}});is.nest=function(){function t(e,a,s){if(s>=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var l,u,c,h,d=-1,p=a.length,g=o[s++],m=new f;++d<p;)(h=m.get(l=g(u=a[d])))?h.push(u):m.set(l,[u]);if(e){u=e();c=function(n,r){u.set(n,t(e,r,s))}}else{u={};c=function(n,r){u[n]=t(e,r,s)}}m.forEach(c);return u}function e(t,n){if(n>=o.length)return t;var r=[],i=a[n++];t.forEach(function(t,i){r.push({key:t,values:e(i,n)})});return i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];i.map=function(e,n){return t(n,e,0)};i.entries=function(n){return e(t(is.map,n,0),0)};i.key=function(t){o.push(t);return i};i.sortKeys=function(t){a[o.length-1]=t;return i};i.sortValues=function(t){n=t;return i};i.rollup=function(t){r=t;return i};return i};is.set=function(t){var e=new b;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e};c(b,{has:p,add:function(t){this._[h(t+="")]=!0;return t},remove:g,values:m,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}});is.behavior={};is.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=w(t,e,e[n]);return t};var bs=["webkit","ms","moz","Moz","o","O"];is.dispatch=function(){for(var t=new T,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=k(t);return t};T.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0){r=t.slice(n+1);t=t.slice(0,n)}if(t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}};is.event=null;is.requote=function(t){return t.replace(xs,"\\$&")};var xs=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ws={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},Cs=function(t,e){return e.querySelector(t)},Ss=function(t,e){return e.querySelectorAll(t)},Ts=function(t,e){var n=t.matches||t[C(t,"matchesSelector")];Ts=function(t,e){return n.call(t,e)};return Ts(t,e)};if("function"==typeof Sizzle){Cs=function(t,e){return Sizzle(t,e)[0]||null};Ss=Sizzle;Ts=Sizzle.matchesSelector}is.selection=function(){return is.select(ss.documentElement)};var ks=is.selection.prototype=[];ks.select=function(t){var e,n,r,i,o=[];t=A(t);for(var a=-1,s=this.length;++a<s;){o.push(e=[]);e.parentNode=(r=this[a]).parentNode;for(var l=-1,u=r.length;++l<u;)if(i=r[l]){e.push(n=t.call(i,i.__data__,l,a));n&&"__data__"in i&&(n.__data__=i.__data__)}else e.push(null)}return L(o)};ks.selectAll=function(t){var e,n,r=[];t=N(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],s=-1,l=a.length;++s<l;)if(n=a[s]){r.push(e=as(t.call(n,n.__data__,s,i)));e.parentNode=n}return L(r)};var _s={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};is.ns={prefix:_s,qualify:function(t){var e=t.indexOf(":"),n=t;if(e>=0){n=t.slice(0,e);t=t.slice(e+1)}return _s.hasOwnProperty(n)?{space:_s[n],local:t}:t}};ks.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();t=is.ns.qualify(t);return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(E(e,t[e]));return this}return this.each(E(t,e))};ks.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=P(t)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else{e=n.getAttribute("class");for(;++i<r;)if(!I(t[i]).test(e))return!1}return!0}for(e in t)this.each(H(e,t[e]));return this}return this.each(H(t,e))};ks.style=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(n in t)this.each(R(n,t[n],e));return this}if(2>i){var o=this.node();return r(o).getComputedStyle(o,null).getPropertyValue(t)}n=""}return this.each(R(t,e,n))};ks.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))};ks.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent};ks.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML};ks.append=function(t){t=W(t);return this.select(function(){return this.appendChild(t.apply(this,arguments))})};ks.insert=function(t,e){t=W(t);e=A(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})};ks.remove=function(){return this.each(z)};ks.data=function(t,e){function n(t,n){var r,i,o,a=t.length,c=n.length,h=Math.min(a,c),d=new Array(c),p=new Array(c),g=new Array(a);if(e){var m,v=new f,y=new Array(a);for(r=-1;++r<a;){v.has(m=e.call(i=t[r],i.__data__,r))?g[r]=i:v.set(m,i);y[r]=m}for(r=-1;++r<c;){if(i=v.get(m=e.call(n,o=n[r],r))){if(i!==!0){d[r]=i;i.__data__=o}}else p[r]=q(o);v.set(m,!0)}for(r=-1;++r<a;)v.get(y[r])!==!0&&(g[r]=t[r])}else{for(r=-1;++r<h;){i=t[r];o=n[r];if(i){i.__data__=o;d[r]=i}else p[r]=q(o)}for(;c>r;++r)p[r]=q(n[r]);for(;a>r;++r)g[r]=t[r]}p.update=d;p.parentNode=d.parentNode=g.parentNode=t.parentNode;s.push(p);l.push(d);u.push(g)}var r,i,o=-1,a=this.length;if(!arguments.length){t=new Array(a=(r=this[0]).length);for(;++o<a;)(i=r[o])&&(t[o]=i.__data__);return t}var s=X([]),l=L([]),u=L([]);if("function"==typeof t)for(;++o<a;)n(r=this[o],t.call(r,r.parentNode.__data__,o));else for(;++o<a;)n(r=this[o],t);l.enter=function(){return s};l.exit=function(){return u};return l};ks.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")};ks.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=U(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);e.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return L(i)};ks.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)if(n=r[i]){o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o);o=n}return this};ks.sort=function(t){t=B.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()};ks.each=function(t){return V(this,function(e,n,r){t.call(e,e.__data__,n,r)})};ks.call=function(t){var e=as(arguments);t.apply(e[0]=this,e);return this};ks.empty=function(){return!this.node()};ks.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null};ks.size=function(){var t=0;V(this,function(){++t});return t};var Ms=[];is.selection.enter=X;is.selection.enter.prototype=Ms;Ms.append=ks.append;Ms.empty=ks.empty;Ms.node=ks.node;Ms.call=ks.call;Ms.size=ks.size;Ms.select=function(t){for(var e,n,r,i,o,a=[],s=-1,l=this.length;++s<l;){r=(i=this[s]).update;a.push(e=[]);e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)if(o=i[u]){e.push(r[u]=n=t.call(i.parentNode,o.__data__,u,s));n.__data__=o.__data__}else e.push(null)}return L(a)};Ms.insert=function(t,e){arguments.length<2&&(e=G(this));return ks.insert.call(this,t,e)};is.select=function(t){var n;if("string"==typeof t){n=[Cs(t,ss)];n.parentNode=ss.documentElement}else{n=[t];n.parentNode=e(t)}return L([n])};is.selectAll=function(t){var e;if("string"==typeof t){e=as(Ss(t,ss));e.parentNode=ss.documentElement}else{e=t;e.parentNode=null}return L([e])};ks.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each($(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each($(t,e,n))};var Ds=is.map({mouseenter:"mouseover",mouseleave:"mouseout"});ss&&Ds.forEach(function(t){"on"+t in ss&&Ds.remove(t)});var Ls,As=0;is.mouse=function(t){return Z(t,M())};var Ns=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;is.touch=function(t,e,n){arguments.length<3&&(n=e,e=M().changedTouches);if(e)for(var r,i=0,o=e.length;o>i;++i)if((r=e[i]).identifier===n)return Z(t,r)};is.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,r,o,a){return function(){function s(){var t,n,r=e(h,g);if(r){t=r[0]-b[0];n=r[1]-b[1];p|=t|n;b=r;d({type:"drag",x:r[0]+u[0],y:r[1]+u[1],dx:t,dy:n})}}function l(){if(e(h,g)){v.on(o+m,null).on(a+m,null);y(p&&is.event.target===f);d({type:"dragend"})}}var u,c=this,f=is.event.target,h=c.parentNode,d=n.of(c,arguments),p=0,g=t(),m=".drag"+(null==g?"":"-"+g),v=is.select(r(f)).on(o+m,s).on(a+m,l),y=K(f),b=e(h,g);if(i){u=i.apply(c,arguments);u=[u.x-b[0],u.y-b[1]]}else u=[0,0];d({type:"dragstart"})}}var n=D(t,"drag","dragstart","dragend"),i=null,o=e(S,is.mouse,r,"mousemove","mouseup"),a=e(Q,is.touch,x,"touchmove","touchend");t.origin=function(e){if(!arguments.length)return i;i=e;return t};return is.rebind(t,n,"on")};is.touches=function(t,e){arguments.length<2&&(e=M().touches);return e?as(e).map(function(e){var n=Z(t,e);n.identifier=e.identifier;return n}):[]};var Es=1e-6,js=Es*Es,Is=Math.PI,Ps=2*Is,Hs=Ps-Es,Os=Is/2,Rs=Is/180,Fs=180/Is,Ws=Math.SQRT2,zs=2,qs=4;is.interpolateZoom=function(t,e){function n(t){var e=t*y;if(v){var n=oe(g),a=o/(zs*h)*(n*ae(Ws*e+g)-ie(g));return[r+a*u,i+a*c,o*n/oe(Ws*e+g)]}return[r+t*u,i+t*c,o*Math.exp(Ws*e)]}var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],l=e[2],u=a-r,c=s-i,f=u*u+c*c,h=Math.sqrt(f),d=(l*l-o*o+qs*f)/(2*o*zs*h),p=(l*l-o*o-qs*f)/(2*l*zs*h),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(p*p+1)-p),v=m-g,y=(v||Math.log(l/o))/Ws;n.duration=1e3*y;return n};is.behavior.zoom=function(){function t(t){t.on(N,f).on(Bs+".zoom",d).on("dblclick.zoom",p).on(I,h)}function e(t){return[(t[0]-T.x)/T.k,(t[1]-T.y)/T.k]}function n(t){return[t[0]*T.k+T.x,t[1]*T.k+T.y]}function i(t){T.k=Math.max(M[0],Math.min(M[1],t))}function o(t,e){e=n(e);T.x+=t[0]-e[0];T.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:T.x,y:T.y,k:T.k};i(Math.pow(2,a));o(m=n,r);e=is.select(e);L>0&&(e=e.transition().duration(L));e.call(t.event)}function s(){w&&w.domain(x.range().map(function(t){return(t-T.x)/T.k}).map(x.invert));S&&S.domain(C.range().map(function(t){return(t-T.y)/T.k}).map(C.invert))}function l(t){A++||t({type:"zoomstart"})}function u(t){s();t({type:"zoom",scale:T.k,translate:[T.x,T.y]})}function c(t){--A||t({type:"zoomend"});m=null}function f(){function t(){f=1;o(is.mouse(i),d);u(s)}function n(){h.on(E,null).on(j,null);p(f&&is.event.target===a);c(s)}var i=this,a=is.event.target,s=P.of(i,arguments),f=0,h=is.select(r(i)).on(E,t).on(j,n),d=e(is.mouse(i)),p=K(i);Ru.call(i);l(s)}function h(){function t(){var t=is.touches(p);d=T.k;t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))});return t}function n(){var e=is.event.target;is.select(e).on(x,r).on(w,s);C.push(e);for(var n=is.event.changedTouches,i=0,o=n.length;o>i;++i)m[n[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];a(p,c,m[c.identifier],Math.floor(Math.log(T.k)/Math.LN2)+1);_()}b=u}else if(l.length>1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];v=h*h+d*d}}function r(){var t,e,n,r,a=is.touches(p);Ru.call(p);for(var s=0,l=a.length;l>s;++s,r=null){n=a[s];if(r=m[n.identifier]){if(e)break;t=n,e=r}}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=v&&Math.sqrt(c/v);t=[(t[0]+n[0])/2,(t[1]+n[1])/2];e=[(e[0]+r[0])/2,(e[1]+r[1])/2];i(f*d)}b=null;o(t,e);u(g)}function s(){if(is.event.touches.length){for(var e=is.event.changedTouches,n=0,r=e.length;r>n;++n)delete m[e[n].identifier];for(var i in m)return void t()}is.selectAll(C).on(y,null);S.on(N,f).on(I,h);k();c(g)}var d,p=this,g=P.of(p,arguments),m={},v=0,y=".zoom-"+is.event.changedTouches[0].identifier,x="touchmove"+y,w="touchend"+y,C=[],S=is.select(p),k=K(p);n();l(g);S.on(N,null).on(I,n)}function d(){var t=P.of(this,arguments);y?clearTimeout(y):(g=e(m=v||is.mouse(this)),Ru.call(this),l(t));y=setTimeout(function(){y=null;c(t)},50);_();i(Math.pow(2,.002*Us())*T.k);o(m,g);u(t)}function p(){var t=is.mouse(this),n=Math.log(T.k)/Math.LN2;a(this,t,e(t),is.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,m,v,y,b,x,w,C,S,T={x:0,y:0,k:1},k=[960,500],M=Vs,L=250,A=0,N="mousedown.zoom",E="mousemove.zoom",j="mouseup.zoom",I="touchstart.zoom",P=D(t,"zoomstart","zoom","zoomend");Bs||(Bs="onwheel"in ss?(Us=function(){return-is.event.deltaY*(is.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ss?(Us=function(){return is.event.wheelDelta},"mousewheel"):(Us=function(){return-is.event.detail},"MozMousePixelScroll"));t.event=function(t){t.each(function(){var t=P.of(this,arguments),e=T;if(Hu)is.select(this).transition().each("start.zoom",function(){T=this.__chart__||{x:0,y:0,k:1};l(t)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=m?m[0]:n/2,o=m?m[1]:r/2,a=is.interpolateZoom([(i-T.x)/T.k,(o-T.y)/T.k,n/T.k],[(i-e.x)/e.k,(o-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=T={x:i-r[0]*s,y:o-r[1]*s,k:s};u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)});else{this.__chart__=T;l(t);u(t);c(t)}})};t.translate=function(e){if(!arguments.length)return[T.x,T.y];T={x:+e[0],y:+e[1],k:T.k};s();return t};t.scale=function(e){if(!arguments.length)return T.k;T={x:T.x,y:T.y,k:+e};s();return t};t.scaleExtent=function(e){if(!arguments.length)return M;M=null==e?Vs:[+e[0],+e[1]];return t};t.center=function(e){if(!arguments.length)return v;v=e&&[+e[0],+e[1]];return t};t.size=function(e){if(!arguments.length)return k;k=e&&[+e[0],+e[1]];return t};t.duration=function(e){if(!arguments.length)return L;L=+e;return t};t.x=function(e){if(!arguments.length)return w;w=e;x=e.copy();T={x:0,y:0,k:1};return t};t.y=function(e){if(!arguments.length)return S;S=e;C=e.copy();T={x:0,y:0,k:1};return t};return is.rebind(t,P,"on")};var Us,Bs,Vs=[0,1/0];is.color=le;le.prototype.toString=function(){return this.rgb()+""};is.hsl=ue;var Xs=ue.prototype=new le;Xs.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);return new ue(this.h,this.s,this.l/t)};Xs.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new ue(this.h,this.s,t*this.l)};Xs.rgb=function(){return ce(this.h,this.s,this.l)};is.hcl=fe;var Gs=fe.prototype=new le;Gs.brighter=function(t){return new fe(this.h,this.c,Math.min(100,this.l+$s*(arguments.length?t:1)))};Gs.darker=function(t){return new fe(this.h,this.c,Math.max(0,this.l-$s*(arguments.length?t:1)))};Gs.rgb=function(){return he(this.h,this.c,this.l).rgb()};is.lab=de;var $s=18,Ys=.95047,Js=1,Ks=1.08883,Zs=de.prototype=new le;Zs.brighter=function(t){return new de(Math.min(100,this.l+$s*(arguments.length?t:1)),this.a,this.b)};Zs.darker=function(t){return new de(Math.max(0,this.l-$s*(arguments.length?t:1)),this.a,this.b)};Zs.rgb=function(){return pe(this.l,this.a,this.b)};is.rgb=be;var Qs=be.prototype=new le;Qs.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;if(!e&&!n&&!r)return new be(i,i,i);e&&i>e&&(e=i);n&&i>n&&(n=i);r&&i>r&&(r=i);return new be(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))};Qs.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new be(t*this.r,t*this.g,t*this.b)};Qs.hsl=function(){return Te(this.r,this.g,this.b)};Qs.toString=function(){return"#"+Ce(this.r)+Ce(this.g)+Ce(this.b)};var tl=is.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074}); tl.forEach(function(t,e){tl.set(t,xe(e))});is.functor=De;is.xhr=Le(x);is.dsv=function(t,e){function n(t,n,o){arguments.length<3&&(o=n,n=null);var a=Ae(t,e,null==n?r:i(n),o);a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n};return a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})};n.parseRows=function(t,e){function n(){if(c>=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++<u;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}c=n+2;var r=t.charCodeAt(n+1);if(13===r){i=!0;10===t.charCodeAt(n+2)&&++c}else 10===r&&(i=!0);return t.slice(e+1,n).replace(/""/g,'"')}for(;u>c;){var r=t.charCodeAt(c++),s=1;if(10===r)i=!0;else if(13===r){i=!0;10===t.charCodeAt(c)&&(++c,++s)}else if(r!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var r,i,o={},a={},s=[],u=t.length,c=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;){h.push(r);r=n()}e&&null==(h=e(h,f++))||s.push(h)}return s};n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new b,i=[];e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))});return[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")};n.formatRows=function(t){return t.map(o).join("\n")};return n};is.csv=is.dsv(",","text/csv");is.tsv=is.dsv(" ","text/tab-separated-values");var el,nl,rl,il,ol,al=this[C(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};is.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0);3>r&&(n=Date.now());var i=n+e,o={c:t,t:i,f:!1,n:null};nl?nl.n=o:el=o;nl=o;if(!rl){il=clearTimeout(il);rl=1;al(je)}};is.timer.flush=function(){Ie();Pe()};is.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var sl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Oe);is.formatPrefix=function(t,e){var n=0;if(t){0>t&&(t*=-1);e&&(t=is.round(t,He(t,e)));n=1+Math.floor(1e-12+Math.log(t)/Math.LN10);n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))}return sl[8+n/3]};var ll=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ul=is.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=is.round(t,He(t,e))).toFixed(Math.max(0,Math.min(20,He(t*(1+1e-15),e))))}}),cl=is.time={},fl=Date;We.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){hl.setUTCDate.apply(this._,arguments)},setDay:function(){hl.setUTCDay.apply(this._,arguments)},setFullYear:function(){hl.setUTCFullYear.apply(this._,arguments)},setHours:function(){hl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hl.setUTCSeconds.apply(this._,arguments)},setTime:function(){hl.setTime.apply(this._,arguments)}};var hl=Date.prototype;cl.year=ze(function(t){t=cl.day(t);t.setMonth(0,1);return t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()});cl.years=cl.year.range;cl.years.utc=cl.year.utc.range;cl.day=ze(function(t){var e=new fl(2e3,0);e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate());return e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1});cl.days=cl.day.range;cl.days.utc=cl.day.utc.range;cl.dayOfYear=function(t){var e=cl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)};["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=cl[t]=ze(function(t){(t=cl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7);return t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=cl.year(t).getDay();return Math.floor((cl.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});cl[t+"s"]=n.range;cl[t+"s"].utc=n.utc.range;cl[t+"OfYear"]=function(t){var n=cl.year(t).getDay();return Math.floor((cl.dayOfYear(t)+(n+e)%7)/7)}});cl.week=cl.sunday;cl.weeks=cl.sunday.range;cl.weeks.utc=cl.sunday.utc.range;cl.weekOfYear=cl.sundayOfYear;var dl={"-":"",_:" ",0:"0"},pl=/^\s*\d+/,gl=/^%/;is.locale=function(t){return{numberFormat:Re(t),timeFormat:Ue(t)}};var ml=is.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});is.format=ml.numberFormat;is.geo={};fn.prototype={s:0,t:0,add:function(t){hn(t,this.t,vl);hn(vl.s,this.s,this);this.s?this.t+=vl.t:this.s=vl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vl=new fn;is.geo.stream=function(t,e){t&&yl.hasOwnProperty(t.type)?yl[t.type](t,e):dn(t,e)};var yl={Feature:function(t,e){dn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)dn(n[r].geometry,e)}},bl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates;e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){pn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)pn(n[r],e,0)},Polygon:function(t,e){gn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)gn(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)dn(n[r],e)}};is.geo.area=function(t){xl=0;is.geo.stream(t,Cl);return xl};var xl,wl=new fn,Cl={sphere:function(){xl+=4*Is},point:S,lineStart:S,lineEnd:S,polygonStart:function(){wl.reset();Cl.lineStart=mn},polygonEnd:function(){var t=2*wl;xl+=0>t?4*Is+t:t;Cl.lineStart=Cl.lineEnd=Cl.point=S}};is.geo.bounds=function(){function t(t,e){b.push(x=[c=t,h=t]);f>e&&(f=e);e>d&&(d=e)}function e(e,n){var r=vn([e*Rs,n*Rs]);if(v){var i=bn(v,r),o=[i[1],-i[0],0],a=bn(o,i);Cn(a);a=Sn(a);var l=e-p,u=l>0?1:-1,g=a[0]*Fs*u,m=ms(l)>180;if(m^(g>u*p&&u*e>g)){var y=a[1]*Fs;y>d&&(d=y)}else if(g=(g+360)%360-180,m^(g>u*p&&u*e>g)){var y=-a[1]*Fs;f>y&&(f=y)}else{f>n&&(f=n);n>d&&(d=n)}if(m)p>e?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e);else if(h>=c){c>e&&(c=e);e>h&&(h=e)}else e>p?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,n);v=r,p=e}function n(){w.point=e}function r(){x[0]=c,x[1]=h;w.point=t;v=null}function i(t,n){if(v){var r=t-p;y+=ms(r)>180?r+(r>0?360:-360):r}else g=t,m=n;Cl.point(t,n);e(t,n)}function o(){Cl.lineStart()}function a(){i(g,m);Cl.lineEnd();ms(y)>Es&&(c=-(h=180));x[0]=c,x[1]=h;v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,h,d,p,g,m,v,y,b,x,w={point:t,lineStart:n,lineEnd:r,polygonStart:function(){w.point=i;w.lineStart=o;w.lineEnd=a;y=0;Cl.polygonStart()},polygonEnd:function(){Cl.polygonEnd();w.point=t;w.lineStart=n;w.lineEnd=r;0>wl?(c=-(h=180),f=-(d=90)):y>Es?d=90:-Es>y&&(f=-90);x[0]=c,x[1]=h}};return function(t){d=h=-(c=f=1/0);b=[];is.geo.stream(t,w);var e=b.length;if(e){b.sort(l);for(var n,r=1,i=b[0],o=[i];e>r;++r){n=b[r];if(u(n[0],i)||u(n[1],i)){s(i[0],n[1])>s(i[0],i[1])&&(i[1]=n[1]);s(n[0],i[1])>s(i[0],i[1])&&(i[0]=n[0])}else o.push(i=n)}for(var a,n,p=-1/0,e=o.length-1,r=0,i=o[e];e>=r;i=n,++r){n=o[r];(a=s(i[1],n[0]))>p&&(p=a,c=n[0],h=i[1])}}b=x=null;return 1/0===c||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[c,f],[h,d]]}}();is.geo.centroid=function(t){Sl=Tl=kl=_l=Ml=Dl=Ll=Al=Nl=El=jl=0;is.geo.stream(t,Il);var e=Nl,n=El,r=jl,i=e*e+n*n+r*r;if(js>i){e=Dl,n=Ll,r=Al;Es>Tl&&(e=kl,n=_l,r=Ml);i=e*e+n*n+r*r;if(js>i)return[0/0,0/0]}return[Math.atan2(n,e)*Fs,re(r/Math.sqrt(i))*Fs]};var Sl,Tl,kl,_l,Ml,Dl,Ll,Al,Nl,El,jl,Il={sphere:S,point:kn,lineStart:Mn,lineEnd:Dn,polygonStart:function(){Il.lineStart=Ln},polygonEnd:function(){Il.lineStart=Mn}},Pl=Pn(Nn,Fn,zn,[-Is,-Is/2]),Hl=1e9;is.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){i&&(i.valid=!1);i=o(t);i.valid=!0;return i},extent:function(s){if(!arguments.length)return[[t,e],[n,r]];o=Vn(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1]);i&&(i.valid=!1,i=null);return a}};return a.extent([[0,0],[960,500]])};(is.geo.conicEqualArea=function(){return Xn(Gn)}).raw=Gn;is.geo.albers=function(){return is.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};is.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];e=null;(n(o,a),e)||(r(o,a),e)||i(o,a);return e}var e,n,r,i,o=is.geo.albers(),a=is.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=is.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};t.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?s:o).invert(t)};t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i);n.point(t,i);r.point(t,i)},sphere:function(){e.sphere();n.sphere();r.sphere()},lineStart:function(){e.lineStart();n.lineStart();r.lineStart()},lineEnd:function(){e.lineEnd();n.lineEnd();r.lineEnd()},polygonStart:function(){e.polygonStart();n.polygonStart();r.polygonStart()},polygonEnd:function(){e.polygonEnd();n.polygonEnd();r.polygonEnd()}}};t.precision=function(e){if(!arguments.length)return o.precision();o.precision(e);a.precision(e);s.precision(e);return t};t.scale=function(e){if(!arguments.length)return o.scale();o.scale(e);a.scale(.35*e);s.scale(e);return t.translate(o.translate())};t.translate=function(e){if(!arguments.length)return o.translate();var u=o.scale(),c=+e[0],f=+e[1];n=o.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point;r=a.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+Es,f+.12*u+Es],[c-.214*u-Es,f+.234*u-Es]]).stream(l).point;i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+Es,f+.166*u+Es],[c-.115*u-Es,f+.234*u-Es]]).stream(l).point;return t};return t.scale(1070)};var Ol,Rl,Fl,Wl,zl,ql,Ul={point:S,lineStart:S,lineEnd:S,polygonStart:function(){Rl=0;Ul.lineStart=$n},polygonEnd:function(){Ul.lineStart=Ul.lineEnd=Ul.point=S;Ol+=ms(Rl/2)}},Bl={point:Yn,lineStart:S,lineEnd:S,polygonStart:S,polygonEnd:S},Vl={point:Zn,lineStart:Qn,lineEnd:tr,polygonStart:function(){Vl.lineStart=er},polygonEnd:function(){Vl.point=Zn;Vl.lineStart=Qn;Vl.lineEnd=tr}};is.geo.path=function(){function t(t){if(t){"function"==typeof s&&o.pointRadius(+s.apply(this,arguments));a&&a.valid||(a=i(o));is.geo.stream(t,a)}return o.result()}function e(){a=null;return t}var n,r,i,o,a,s=4.5;t.area=function(t){Ol=0;is.geo.stream(t,i(Ul));return Ol};t.centroid=function(t){kl=_l=Ml=Dl=Ll=Al=Nl=El=jl=0;is.geo.stream(t,i(Vl));return jl?[Nl/jl,El/jl]:Al?[Dl/Al,Ll/Al]:Ml?[kl/Ml,_l/Ml]:[0/0,0/0]};t.bounds=function(t){zl=ql=-(Fl=Wl=1/0);is.geo.stream(t,i(Bl));return[[Fl,Wl],[zl,ql]]};t.projection=function(t){if(!arguments.length)return n;i=(n=t)?t.stream||ir(t):x;return e()};t.context=function(t){if(!arguments.length)return r;o=null==(r=t)?new Jn:new nr(t);"function"!=typeof s&&o.pointRadius(s);return e()};t.pointRadius=function(e){if(!arguments.length)return s;s="function"==typeof e?e:(o.pointRadius(+e),+e);return t};return t.projection(is.geo.albersUsa()).context(null)};is.geo.transform=function(t){return{stream:function(e){var n=new or(e);for(var r in t)n[r]=t[r];return n}}};or.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};is.geo.projection=sr;is.geo.projectionMutator=lr;(is.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr;is.geo.rotation=function(t){function e(e){e=t(e[0]*Rs,e[1]*Rs);return e[0]*=Fs,e[1]*=Fs,e}t=hr(t[0]%360*Rs,t[1]*Rs,t.length>2?t[2]*Rs:0);e.invert=function(e){e=t.invert(e[0]*Rs,e[1]*Rs);return e[0]*=Fs,e[1]*=Fs,e};return e};fr.invert=cr;is.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hr(-t[0]*Rs,-t[1]*Rs,0).invert,i=[];n(null,null,1,{point:function(t,n){i.push(t=e(t,n));t[0]*=Fs,t[1]*=Fs}});return{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;t.origin=function(e){if(!arguments.length)return r;r=e;return t};t.angle=function(r){if(!arguments.length)return e;n=mr((e=+r)*Rs,i*Rs);return t};t.precision=function(r){if(!arguments.length)return i;n=mr(e*Rs,(i=+r)*Rs);return t};return t.angle(90)};is.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Rs,i=t[1]*Rs,o=e[1]*Rs,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=u*c-l*f*s)*n),l*c+u*f*s)};is.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return is.range(Math.ceil(o/m)*m,i,m).map(h).concat(is.range(Math.ceil(u/v)*v,l,v).map(d)).concat(is.range(Math.ceil(r/p)*p,n,p).filter(function(t){return ms(t%m)>Es}).map(c)).concat(is.range(Math.ceil(s/g)*g,a,g).filter(function(t){return ms(t%v)>Es}).map(f))}var n,r,i,o,a,s,l,u,c,f,h,d,p=10,g=p,m=90,v=360,y=2.5;t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})};t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(d(l).slice(1),h(i).reverse().slice(1),d(u).reverse().slice(1))]}};t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()};t.majorExtent=function(e){if(!arguments.length)return[[o,u],[i,l]];o=+e[0][0],i=+e[1][0];u=+e[0][1],l=+e[1][1];o>i&&(e=o,o=i,i=e);u>l&&(e=u,u=l,l=e);return t.precision(y)};t.minorExtent=function(e){if(!arguments.length)return[[r,s],[n,a]];r=+e[0][0],n=+e[1][0];s=+e[0][1],a=+e[1][1];r>n&&(e=r,r=n,n=e);s>a&&(e=s,s=a,a=e);return t.precision(y)};t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()};t.majorStep=function(e){if(!arguments.length)return[m,v];m=+e[0],v=+e[1];return t};t.minorStep=function(e){if(!arguments.length)return[p,g];p=+e[0],g=+e[1];return t};t.precision=function(e){if(!arguments.length)return y;y=+e;c=yr(s,a,90);f=br(r,n,y);h=yr(u,l,90);d=br(o,i,y);return t};return t.majorExtent([[-180,-90+Es],[180,90-Es]]).minorExtent([[-180,-80-Es],[180,80+Es]])};is.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=xr,i=wr;t.distance=function(){return is.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))};t.source=function(n){if(!arguments.length)return r;r=n,e="function"==typeof n?null:n;return t};t.target=function(e){if(!arguments.length)return i;i=e,n="function"==typeof e?null:e;return t};t.precision=function(){return arguments.length?t:0};return t};is.geo.interpolate=function(t,e){return Cr(t[0]*Rs,t[1]*Rs,e[0]*Rs,e[1]*Rs)};is.geo.length=function(t){Xl=0;is.geo.stream(t,Gl);return Xl};var Xl,Gl={sphere:S,point:S,lineStart:Sr,lineEnd:S,polygonStart:S,polygonEnd:S},$l=Tr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(is.geo.azimuthalEqualArea=function(){return sr($l)}).raw=$l;var Yl=Tr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(is.geo.azimuthalEquidistant=function(){return sr(Yl)}).raw=Yl;(is.geo.conicConformal=function(){return Xn(kr)}).raw=kr;(is.geo.conicEquidistant=function(){return Xn(_r)}).raw=_r;var Jl=Tr(function(t){return 1/t},Math.atan);(is.geo.gnomonic=function(){return sr(Jl)}).raw=Jl;Mr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Os]};(is.geo.mercator=function(){return Dr(Mr)}).raw=Mr;var Kl=Tr(function(){return 1},Math.asin);(is.geo.orthographic=function(){return sr(Kl)}).raw=Kl;var Zl=Tr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(is.geo.stereographic=function(){return sr(Zl)}).raw=Zl;Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Os]};(is.geo.transverseMercator=function(){var t=Dr(Lr),e=t.center,n=t.rotate;t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90])}).raw=Lr;is.geom={};is.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=De(n),o=De(r),a=t.length,s=[],l=[];for(e=0;a>e;e++)s.push([+i.call(this,t[e],e),+o.call(this,t[e],e),e]);s.sort(jr);for(e=0;a>e;e++)l.push([s[e][0],-s[e][1]]);var u=Er(s),c=Er(l),f=c[0]===u[0],h=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+f;e<c.length-h;++e)d.push(t[s[c[e]][2]]);return d}var n=Ar,r=Nr;if(arguments.length)return e(t);e.x=function(t){return arguments.length?(n=t,e):n};e.y=function(t){return arguments.length?(r=t,e):r};return e};is.geom.polygon=function(t){ws(t,Ql);return t};var Ql=is.geom.polygon.prototype=[];Ql.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],i=0;++e<n;){t=r;r=this[e];i+=t[1]*r[0]-t[0]*r[1]}return.5*i};Ql.centroid=function(t){var e,n,r=-1,i=this.length,o=0,a=0,s=this[i-1];arguments.length||(t=-1/(6*this.area()));for(;++r<i;){e=s;s=this[r];n=e[0]*s[1]-s[0]*e[1];o+=(e[0]+s[0])*n;a+=(e[1]+s[1])*n}return[o*t,a*t]};Ql.clip=function(t){for(var e,n,r,i,o,a,s=Hr(t),l=-1,u=this.length-Hr(this),c=this[u-1];++l<u;){e=t.slice();t.length=0;i=this[l];o=e[(r=e.length-s)-1];n=-1;for(;++n<r;){a=e[n];if(Ir(a,c,i)){Ir(o,c,i)||t.push(Pr(o,a,c,i));t.push(a)}else Ir(o,c,i)&&t.push(Pr(o,a,c,i));o=a}s&&t.push(t[0]);c=i}return t};var tu,eu,nu,ru,iu,ou=[],au=[];Br.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;){t=e[n].edge;t.b&&t.a||e.splice(n,1)}e.sort(Xr);return e.length};ni.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};ri.prototype={insert:function(t,e){var n,r,i;if(t){e.P=t;e.N=t.N;t.N&&(t.N.P=e);t.N=e;if(t.R){t=t.R;for(;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else if(this._){t=si(this._);e.P=null;e.N=t;t.P=t.L=e;n=t}else{e.P=e.N=null;this._=e;n=null}e.L=e.R=null;e.U=n;e.C=!0;t=e;for(;n&&n.C;){r=n.U;if(n===r.L){i=r.R;if(i&&i.C){n.C=i.C=!1;r.C=!0;t=r}else{if(t===n.R){oi(this,n);t=n;n=t.U}n.C=!1;r.C=!0;ai(this,r)}}else{i=r.L;if(i&&i.C){n.C=i.C=!1;r.C=!0;t=r}else{if(t===n.L){ai(this,n);t=n;n=t.U}n.C=!1;r.C=!0;oi(this,r)}}n=t.U}this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P);t.P&&(t.P.N=t.N);t.N=t.P=null;var e,n,r,i=t.U,o=t.L,a=t.R;n=o?a?si(a):o:a;i?i.L===t?i.L=n:i.R=n:this._=n;if(o&&a){r=n.C;n.C=t.C;n.L=o;o.U=n;if(n!==a){i=n.U;n.U=t.U;t=n.R;i.L=t;n.R=a;a.U=n}else{n.U=i;i=n;t=n.R}}else{r=t.C;t=n}t&&(t.U=i);if(!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){e=i.R;if(e.C){e.C=!1;i.C=!0;oi(this,i);e=i.R}if(e.L&&e.L.C||e.R&&e.R.C){if(!e.R||!e.R.C){e.L.C=!1;e.C=!0;ai(this,e);e=i.R}e.C=i.C;i.C=e.R.C=!1;oi(this,i);t=this._;break}}else{e=i.L;if(e.C){e.C=!1;i.C=!0;ai(this,i);e=i.L}if(e.L&&e.L.C||e.R&&e.R.C){if(!e.L||!e.L.C){e.R.C=!1;e.C=!0;oi(this,e);e=i.L}e.C=i.C;i.C=e.L.C=!1;ai(this,i);t=this._;break}}e.C=!0;t=i;i=i.U}while(!t.C);t&&(t.C=!1)}}};is.geom.voronoi=function(t){function e(t){var e=new Array(t.length),r=s[0][0],i=s[0][1],o=s[1][0],a=s[1][1];li(n(t),s).cells.forEach(function(n,s){var l=n.edges,u=n.site,c=e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=r&&u.x<=o&&u.y>=i&&u.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[];c.point=t[s]});return e}function n(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Es)*Es,y:Math.round(a(t,e)/Es)*Es,i:e}})}var r=Ar,i=Nr,o=r,a=i,s=su;if(t)return e(t);e.links=function(t){return li(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})};e.triangles=function(t){var e=[];li(n(t)).cells.forEach(function(n,r){for(var i,o,a=n.site,s=n.edges.sort(Xr),l=-1,u=s.length,c=s[u-1].edge,f=c.l===a?c.r:c.l;++l<u;){i=c;o=f;c=s[l].edge;f=c.l===a?c.r:c.l;r<o.i&&r<f.i&&ci(a,o,f)<0&&e.push([t[r],t[o.i],t[f.i]])}});return e};e.x=function(t){return arguments.length?(o=De(r=t),e):r};e.y=function(t){return arguments.length?(a=De(i=t),e):i};e.clipExtent=function(t){if(!arguments.length)return s===su?null:s;s=null==t?su:t;return e};e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===su?null:s&&s[1]};return e};var su=[[-1e6,-1e6],[1e6,1e6]];is.geom.delaunay=function(t){return is.geom.voronoi().triangles(t)};is.geom.quadtree=function(t,e,n,r,i){function o(t){function o(t,e,n,r,i,o,a,s){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(ms(l-n)+ms(c-r)<.01)u(t,e,n,r,i,o,a,s);else{var f=t.point;t.x=t.y=t.point=null;u(t,f,l,c,i,o,a,s);u(t,e,n,r,i,o,a,s)}else t.x=n,t.y=r,t.point=e}else u(t,e,n,r,i,o,a,s)}function u(t,e,n,r,i,a,s,l){var u=.5*(i+s),c=.5*(a+l),f=n>=u,h=r>=c,d=h<<1|f;t.leaf=!1;t=t.nodes[d]||(t.nodes[d]=di());f?i=u:s=u;h?a=c:l=c;o(t,e,n,r,i,a,s,l)}var c,f,h,d,p,g,m,v,y,b=De(s),x=De(l);if(null!=e)g=e,m=n,v=r,y=i;else{v=y=-(g=m=1/0);f=[],h=[];p=t.length;if(a)for(d=0;p>d;++d){c=t[d];c.x<g&&(g=c.x);c.y<m&&(m=c.y);c.x>v&&(v=c.x);c.y>y&&(y=c.y);f.push(c.x);h.push(c.y)}else for(d=0;p>d;++d){var w=+b(c=t[d],d),C=+x(c,d);g>w&&(g=w);m>C&&(m=C);w>v&&(v=w);C>y&&(y=C);f.push(w);h.push(C)}}var S=v-g,T=y-m;S>T?y=m+S:v=g+T;var k=di();k.add=function(t){o(k,t,+b(t,++d),+x(t,d),g,m,v,y)};k.visit=function(t){pi(t,k,g,m,v,y)};k.find=function(t){return gi(k,t[0],t[1],g,m,v,y)};d=-1;if(null==e){for(;++d<p;)o(k,t[d],f[d],h[d],g,m,v,y);--d}else t.forEach(k.add);f=h=t=c=null;return k}var a,s=Ar,l=Nr;if(a=arguments.length){s=fi;l=hi;if(3===a){i=n;r=e;n=e=0}return o(t)}o.x=function(t){return arguments.length?(s=t,o):s};o.y=function(t){return arguments.length?(l=t,o):l};o.extent=function(t){if(!arguments.length)return null==e?null:[[e,n],[r,i]];null==t?e=n=r=i=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]);return o};o.size=function(t){if(!arguments.length)return null==e?null:[r-e,i-n];null==t?e=n=r=i=null:(e=n=0,r=+t[0],i=+t[1]);return o};return o};is.interpolateRgb=mi;is.interpolateObject=vi;is.interpolateNumber=yi;is.interpolateString=bi;var lu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uu=new RegExp(lu.source,"g");is.interpolate=xi;is.interpolators=[function(t,e){var n=typeof e;return("string"===n?tl.has(e)||/^(#|rgb\(|hsl\()/.test(e)?mi:bi:e instanceof le?mi:Array.isArray(e)?wi:"object"===n&&isNaN(e)?vi:yi)(t,e)}];is.interpolateArray=wi;var cu=function(){return x},fu=is.map({linear:cu,poly:Di,quad:function(){return ki},cubic:function(){return _i},sin:function(){return Li},exp:function(){return Ai},circle:function(){return Ni},elastic:Ei,back:ji,bounce:function(){return Ii}}),hu=is.map({"in":x,out:Si,"in-out":Ti,"out-in":function(t){return Ti(Si(t))}});is.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";n=fu.get(n)||cu;r=hu.get(r)||x;return Ci(r(n.apply(null,os.call(arguments,1))))};is.interpolateHcl=Pi;is.interpolateHsl=Hi;is.interpolateLab=Oi;is.interpolateRound=Ri;is.transform=function(t){var e=ss.createElementNS(is.ns.prefix.svg,"g");return(is.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Fi(n?n.matrix:du)})(t)};Fi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var du={a:1,b:0,c:0,d:1,e:0,f:0};is.interpolateTransform=Ui;is.layout={};is.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Xi(t[n]));return e}};is.layout.chord=function(){function t(){var t,u,f,h,d,p={},g=[],m=is.range(o),v=[];n=[];r=[];t=0,h=-1;for(;++h<o;){u=0,d=-1;for(;++d<o;)u+=i[h][d];g.push(u);v.push(is.range(o));t+=u}a&&m.sort(function(t,e){return a(g[t],g[e])});s&&v.forEach(function(t,e){t.sort(function(t,n){return s(i[e][t],i[e][n])})});t=(Ps-c*o)/t;u=0,h=-1;for(;++h<o;){f=u,d=-1;for(;++d<o;){var y=m[h],b=v[y][d],x=i[y][b],w=u,C=u+=x*t;p[y+"-"+b]={index:y,subindex:b,startAngle:w,endAngle:C,value:x}}r[y]={index:y,startAngle:f,endAngle:u,value:(u-f)/t};u+=c}h=-1;for(;++h<o;){d=h-1;for(;++d<o;){var S=p[h+"-"+d],T=p[d+"-"+h];(S.value||T.value)&&n.push(S.value<T.value?{source:T,target:S}:{source:S,target:T})}}l&&e()}function e(){n.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,i,o,a,s,l,u={},c=0;u.matrix=function(t){if(!arguments.length)return i;o=(i=t)&&i.length;n=r=null;return u};u.padding=function(t){if(!arguments.length)return c;c=t;n=r=null;return u};u.sortGroups=function(t){if(!arguments.length)return a;a=t;n=r=null;return u};u.sortSubgroups=function(t){if(!arguments.length)return s;s=t;n=null;return u};u.sortChords=function(t){if(!arguments.length)return l;l=t;n&&e();return u};u.chords=function(){n||t();return n};u.groups=function(){r||t();return r};return u};is.layout.force=function(){function t(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,s=i-n,l=o*o+a*a;if(l>s*s/m){if(p>l){var u=e.charge/l;t.px-=o*u;t.py-=a*u}return!0}if(e.point&&l&&p>l){var u=e.pointCharge/l;t.px-=o*u;t.py-=a*u}}return!e.charge}}function e(t){t.px=is.event.x,t.py=is.event.y;s.resume()}var n,r,i,o,a,s={},l=is.dispatch("start","tick","end"),u=[1,1],c=.9,f=pu,h=gu,d=-30,p=mu,g=.1,m=.64,v=[],y=[];s.tick=function(){if((r*=.99)<.005){l.end({type:"end",alpha:r=0});return!0}var e,n,s,f,h,p,m,b,x,w=v.length,C=y.length;for(n=0;C>n;++n){s=y[n];f=s.source;h=s.target;b=h.x-f.x;x=h.y-f.y;if(p=b*b+x*x){p=r*o[n]*((p=Math.sqrt(p))-i[n])/p;b*=p;x*=p;h.x-=b*(m=f.weight/(h.weight+f.weight));h.y-=x*m;f.x+=b*(m=1-m);f.y+=x*m}}if(m=r*g){b=u[0]/2;x=u[1]/2;n=-1;if(m)for(;++n<w;){s=v[n];s.x+=(b-s.x)*m;s.y+=(x-s.y)*m}}if(d){Qi(e=is.geom.quadtree(v),r,a);n=-1;for(;++n<w;)(s=v[n]).fixed||e.visit(t(s))}n=-1;for(;++n<w;){s=v[n];if(s.fixed){s.x=s.px;s.y=s.py}else{s.x-=(s.px-(s.px=s.x))*c;s.y-=(s.py-(s.py=s.y))*c}}l.tick({type:"tick",alpha:r})};s.nodes=function(t){if(!arguments.length)return v;v=t;return s};s.links=function(t){if(!arguments.length)return y;y=t;return s};s.size=function(t){if(!arguments.length)return u;u=t;return s};s.linkDistance=function(t){if(!arguments.length)return f;f="function"==typeof t?t:+t;return s};s.distance=s.linkDistance;s.linkStrength=function(t){if(!arguments.length)return h;h="function"==typeof t?t:+t;return s};s.friction=function(t){if(!arguments.length)return c;c=+t;return s};s.charge=function(t){if(!arguments.length)return d;d="function"==typeof t?t:+t;return s};s.chargeDistance=function(t){if(!arguments.length)return Math.sqrt(p);p=t*t;return s};s.gravity=function(t){if(!arguments.length)return g;g=+t;return s};s.theta=function(t){if(!arguments.length)return Math.sqrt(m);m=t*t;return s};s.alpha=function(t){if(!arguments.length)return r;t=+t;if(r)r=t>0?t:0;else if(t>0){l.start({type:"start",alpha:r=t});is.timer(s.tick)}return s};s.start=function(){function t(t,r){if(!n){n=new Array(l);for(s=0;l>s;++s)n[s]=[];for(s=0;c>s;++s){var i=y[s];n[i.source.index].push(i.target);n[i.target.index].push(i.source)}}for(var o,a=n[e],s=-1,u=a.length;++s<u;)if(!isNaN(o=a[s][t]))return o;return Math.random()*r}var e,n,r,l=v.length,c=y.length,p=u[0],g=u[1];for(e=0;l>e;++e){(r=v[e]).index=e;r.weight=0}for(e=0;c>e;++e){r=y[e];"number"==typeof r.source&&(r.source=v[r.source]);"number"==typeof r.target&&(r.target=v[r.target]);++r.source.weight;++r.target.weight}for(e=0;l>e;++e){r=v[e];isNaN(r.x)&&(r.x=t("x",p));isNaN(r.y)&&(r.y=t("y",g));isNaN(r.px)&&(r.px=r.x);isNaN(r.py)&&(r.py=r.y)}i=[];if("function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;o=[];if("function"==typeof h)for(e=0;c>e;++e)o[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=h;a=[];if("function"==typeof d)for(e=0;l>e;++e)a[e]=+d.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=d;return s.resume()};s.resume=function(){return s.alpha(.1)};s.stop=function(){return s.alpha(0)};s.drag=function(){n||(n=is.behavior.drag().origin(x).on("dragstart.force",Yi).on("drag.force",e).on("dragend.force",Ji));if(!arguments.length)return n;this.on("mouseover.force",Ki).on("mouseout.force",Zi).call(n);return void 0};return is.rebind(s,l,"on")};var pu=20,gu=1,mu=1/0;is.layout.hierarchy=function(){function t(i){var o,a=[i],s=[];i.depth=0;for(;null!=(o=a.pop());){s.push(o);if((u=n.call(t,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;){a.push(c=u[l]);c.parent=o;c.depth=o.depth+1}r&&(o.value=0);o.children=u}else{r&&(o.value=+r.call(t,o,o.depth)||0);delete o.children}}no(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e);r&&(i=t.parent)&&(i.value+=t.value)});return s}var e=oo,n=ro,r=io;t.sort=function(n){if(!arguments.length)return e;e=n;return t};t.children=function(e){if(!arguments.length)return n;n=e;return t};t.value=function(e){if(!arguments.length)return r;r=e;return t};t.revalue=function(e){if(r){eo(e,function(t){t.children&&(t.value=0)});no(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0);(n=e.parent)&&(n.value+=e.value)})}return e};return t};is.layout.partition=function(){function t(e,n,r,i){var o=e.children;e.x=n;e.y=e.depth*i;e.dx=r;e.dy=i;if(o&&(a=o.length)){var a,s,l,u=-1;r=e.value?r/e.value:0;for(;++u<a;){t(s=o[u],n,l=s.value*r,i);n+=l}}}function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}function n(n,o){var a=r.call(this,n,o);t(a[0],0,i[0],i[1]/e(a[0]));return a}var r=is.layout.hierarchy(),i=[1,1];n.size=function(t){if(!arguments.length)return i;i=t;return n};return to(n,r)};is.layout.pie=function(){function t(a){var s,l=a.length,u=a.map(function(n,r){return+e.call(t,n,r)}),c=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof i?i.apply(this,arguments):i)-c,h=Math.min(Math.abs(f)/l,+("function"==typeof o?o.apply(this,arguments):o)),d=h*(0>f?-1:1),p=(f-l*d)/is.sum(u),g=is.range(l),m=[];null!=n&&g.sort(n===vu?function(t,e){return u[e]-u[t]}:function(t,e){return n(a[t],a[e])});g.forEach(function(t){m[t]={data:a[t],value:s=u[t],startAngle:c,endAngle:c+=s*p+d,padAngle:h}});return m}var e=Number,n=vu,r=0,i=Ps,o=0;t.value=function(n){if(!arguments.length)return e;e=n;return t};t.sort=function(e){if(!arguments.length)return n;n=e;return t};t.startAngle=function(e){if(!arguments.length)return r;r=e;return t};t.endAngle=function(e){if(!arguments.length)return i;i=e;return t};t.padAngle=function(e){if(!arguments.length)return o;o=e;return t};return t};var vu={};is.layout.stack=function(){function t(s,l){if(!(h=s.length))return s;var u=s.map(function(n,r){return e.call(t,n,r)}),c=u.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),a.call(t,e,n)]})}),f=n.call(t,c,l);u=is.permute(u,f);c=is.permute(c,f);var h,d,p,g,m=r.call(t,c,l),v=u[0].length; for(p=0;v>p;++p){i.call(t,u[0][p],g=m[p],c[0][p][1]);for(d=1;h>d;++d)i.call(t,u[d][p],g+=c[d-1][p][1],c[d][p][1])}return s}var e=x,n=co,r=fo,i=uo,o=so,a=lo;t.values=function(n){if(!arguments.length)return e;e=n;return t};t.order=function(e){if(!arguments.length)return n;n="function"==typeof e?e:yu.get(e)||co;return t};t.offset=function(e){if(!arguments.length)return r;r="function"==typeof e?e:bu.get(e)||fo;return t};t.x=function(e){if(!arguments.length)return o;o=e;return t};t.y=function(e){if(!arguments.length)return a;a=e;return t};t.out=function(e){if(!arguments.length)return i;i=e;return t};return t};var yu=is.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(ho),o=t.map(po),a=is.range(r).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;r>e;++e){n=a[e];if(l>s){s+=o[n];u.push(n)}else{l+=o[n];c.push(n)}}return c.reverse().concat(u)},reverse:function(t){return is.range(t.length).reverse()},"default":co}),bu=is.map({silhouette:function(t){var e,n,r,i=t.length,o=t[0].length,a=[],s=0,l=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>s&&(s=r);a.push(r)}for(n=0;o>n;++n)l[n]=(s-a[n])/2;return l},wiggle:function(t){var e,n,r,i,o,a,s,l,u,c=t.length,f=t[0],h=f.length,d=[];d[0]=l=u=0;for(n=1;h>n;++n){for(e=0,i=0;c>e;++e)i+=t[e][n][1];for(e=0,o=0,s=f[n][0]-f[n-1][0];c>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/s;o+=a*t[e][n][1]}d[n]=l-=i?o/i*s:0;u>l&&(u=l)}for(n=0;h>n;++n)d[n]-=u;return d},expand:function(t){var e,n,r,i=t.length,o=t[0].length,a=1/i,s=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;o>n;++n)s[n]=0;return s},zero:fo});is.layout.histogram=function(){function t(t,o){for(var a,s,l=[],u=t.map(n,this),c=r.call(this,u,o),f=i.call(this,c,u,o),o=-1,h=u.length,d=f.length-1,p=e?1:1/h;++o<d;){a=l[o]=[];a.dx=f[o+1]-(a.x=f[o]);a.y=0}if(d>0){o=-1;for(;++o<h;){s=u[o];if(s>=c[0]&&s<=c[1]){a=l[is.bisect(f,s,1,d)-1];a.y+=p;a.push(t[o])}}}return l}var e=!0,n=Number,r=yo,i=mo;t.value=function(e){if(!arguments.length)return n;n=e;return t};t.range=function(e){if(!arguments.length)return r;r=De(e);return t};t.bins=function(e){if(!arguments.length)return i;i="number"==typeof e?function(t){return vo(t,e)}:De(e);return t};t.frequency=function(n){if(!arguments.length)return e;e=!!n;return t};return t};is.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),s=a[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};s.x=s.y=0;no(s,function(t){t.r=+c(t.value)});no(s,So);if(r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;no(s,function(t){t.r+=f});no(s,So);no(s,function(t){t.r-=f})}_o(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u));return a}var e,n=is.layout.hierarchy().sort(bo),r=0,i=[1,1];t.size=function(e){if(!arguments.length)return i;i=e;return t};t.radius=function(n){if(!arguments.length)return e;e=null==n||"function"==typeof n?n:+n;return t};t.padding=function(e){if(!arguments.length)return r;r=+e;return t};return to(t,n)};is.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);no(h,n),h.parent.m=-h.z;eo(h,r);if(u)eo(f,o);else{var d=f,p=f,g=f;eo(f,function(t){t.x<d.x&&(d=t);t.x>p.x&&(p=t);t.depth>g.depth&&(g=t)});var m=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+m),y=l[1]/(g.depth||1);eo(f,function(t){t.x=(t.x+m)*v;t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,s=o.length;s>a;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Eo(t);var o=(e[0].z+e[e.length-1].z)/2;if(r){t.z=r.z+s(t._,r._);t.m=t.z-o}else t.z=o}else r&&(t.z=r.z+s(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,o=t,a=e,l=i.parent.children[0],u=i.m,c=o.m,f=a.m,h=l.m;a=Ao(a),i=Lo(i),a&&i;){l=Lo(l);o=Ao(o);o.a=t;r=a.z+f-i.z-u+s(a._,i._);if(r>0){No(jo(a,t,n),t,r);u+=r;c+=r}f+=a.m;u+=i.m;h+=l.m;c+=o.m}if(a&&!Ao(o)){o.t=a;o.m+=f-c}if(i&&!Lo(l)){l.t=i;l.m+=u-h;n=t}}return n}function o(t){t.x*=l[0];t.y=t.depth*l[1]}var a=is.layout.hierarchy().sort(null).value(null),s=Do,l=[1,1],u=null;t.separation=function(e){if(!arguments.length)return s;s=e;return t};t.size=function(e){if(!arguments.length)return u?null:l;u=null==(l=e)?o:null;return t};t.nodeSize=function(e){if(!arguments.length)return u?l:null;u=null==(l=e)?null:o;return t};return to(t,a)};is.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],u=0;no(l,function(t){var e=t.children;if(e&&e.length){t.x=Po(e);t.y=Io(e)}else{t.x=a?u+=n(t,a):0;t.y=0;a=t}});var c=Ho(l),f=Oo(l),h=c.x-n(c,f)/2,d=f.x+n(f,c)/2;no(l,i?function(t){t.x=(t.x-l.x)*r[0];t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0];t.y=(1-(l.y?t.y/l.y:1))*r[1]});return s}var e=is.layout.hierarchy().sort(null).value(null),n=Do,r=[1,1],i=!1;t.separation=function(e){if(!arguments.length)return n;n=e;return t};t.size=function(e){if(!arguments.length)return i?null:r;i=null==(r=e);return t};t.nodeSize=function(e){if(!arguments.length)return i?r:null;i=null!=(r=e);return t};return to(t,e)};is.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i<o;){r=(n=t[i]).value*(0>e?0:e);n.area=isNaN(r)||0>=r?0:r}}function e(n){var o=n.children;if(o&&o.length){var a,s,l,u=f(n),c=[],h=o.slice(),p=1/0,g="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&n.depth?u.dy:u.dx:Math.min(u.dx,u.dy);t(h,u.dx*u.dy/n.value);c.area=0;for(;(l=h.length)>0;){c.push(a=h[l-1]);c.area+=a.area;if("squarify"!==d||(s=r(c,g))<=p){h.pop();p=s}else{c.area-=c.pop().area;i(c,g,u,!1);g=Math.min(u.dx,u.dy);c.length=c.area=0;p=1/0}}if(c.length){i(c,g,u,!0);c.length=c.area=0}o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),s=r.slice(),l=[];t(s,a.dx*a.dy/e.value);l.area=0;for(;o=s.pop();){l.push(o);l.area+=o.area;if(null!=o.z){i(l,o.z?a.dx:a.dy,a,!s.length);l.length=l.area=0}}r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++a<s;)if(n=t[a].area){o>n&&(o=n);n>i&&(i=n)}r*=r;e*=e;return r?Math.max(e*i*p/r,r/(e*o*p)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){(r||c>n.dy)&&(c=n.dy);for(;++o<a;){i=t[o];i.x=s;i.y=u;i.dy=c;s+=i.dx=Math.min(n.x+n.dx-s,c?l(i.area/c):0)}i.z=!0;i.dx+=n.x+n.dx-s;n.y+=c;n.dy-=c}else{(r||c>n.dx)&&(c=n.dx);for(;++o<a;){i=t[o];i.x=s;i.y=u;i.dx=c;u+=i.dy=Math.min(n.y+n.dy-u,c?l(i.area/c):0)}i.z=!1;i.dy+=n.y+n.dy-u;n.x+=c;n.dx-=c}}function o(r){var i=a||s(r),o=i[0];o.x=0;o.y=0;o.dx=u[0];o.dy=u[1];a&&s.revalue(o);t([o],o.dx*o.dy/o.value);(a?n:e)(o);h&&(a=i);return i}var a,s=is.layout.hierarchy(),l=Math.round,u=[1,1],c=null,f=Ro,h=!1,d="squarify",p=.5*(1+Math.sqrt(5));o.size=function(t){if(!arguments.length)return u;u=t;return o};o.padding=function(t){function e(e){var n=t.call(o,e,e.depth);return null==n?Ro(e):Fo(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Fo(e,t)}if(!arguments.length)return c;var r;f=null==(c=t)?Ro:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n;return o};o.round=function(t){if(!arguments.length)return l!=Number;l=t?Math.round:Number;return o};o.sticky=function(t){if(!arguments.length)return h;h=t;a=null;return o};o.ratio=function(t){if(!arguments.length)return p;p=t;return o};o.mode=function(t){if(!arguments.length)return d;d=t+"";return o};return to(o,s)};is.random={normal:function(t,e){var n=arguments.length;2>n&&(e=1);1>n&&(t=0);return function(){var n,r,i;do{n=2*Math.random()-1;r=2*Math.random()-1;i=n*n+r*r}while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=is.random.normal.apply(is,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=is.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}};is.scale={};var xu={floor:x,ceil:x};is.scale.linear=function(){return Xo([0,1],[0,1],xi,!1)};var wu={s:1,g:1,p:1,r:1,e:1};is.scale.log=function(){return ta(is.scale.linear().domain([0,1]),10,!0,[1,10])};var Cu=is.format(".0e"),Su={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};is.scale.pow=function(){return ea(is.scale.linear(),1,[0,1])};is.scale.sqrt=function(){return is.scale.pow().exponent(.5)};is.scale.ordinal=function(){return ra([],{t:"range",a:[[]]})};is.scale.category10=function(){return is.scale.ordinal().range(Tu)};is.scale.category20=function(){return is.scale.ordinal().range(ku)};is.scale.category20b=function(){return is.scale.ordinal().range(_u)};is.scale.category20c=function(){return is.scale.ordinal().range(Mu)};var Tu=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(we),ku=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(we),_u=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(we),Mu=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(we);is.scale.quantile=function(){return ia([],[])};is.scale.quantize=function(){return oa(0,1,[0,1])};is.scale.threshold=function(){return aa([.5],[0,1])};is.scale.identity=function(){return sa([0,1])};is.svg={};is.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),u=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Os,f=s.apply(this,arguments)-Os,h=Math.abs(f-c),d=c>f?0:1;t>u&&(p=u,u=t,t=p);if(h>=Hs)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,g,m,v,y,b,x,w,C,S,T,k,_=0,M=0,D=[];if(v=(+l.apply(this,arguments)||0)/2){m=o===Du?Math.sqrt(t*t+u*u):+o.apply(this,arguments);d||(M*=-1);u&&(M=re(m/u*Math.sin(v)));t&&(_=re(m/t*Math.sin(v)))}if(u){y=u*Math.cos(c+M);b=u*Math.sin(c+M);x=u*Math.cos(f-M);w=u*Math.sin(f-M);var L=Math.abs(f-c-2*M)<=Is?0:1;if(M&&pa(y,b,x,w)===d^L){var A=(c+f)/2;y=u*Math.cos(A);b=u*Math.sin(A);x=w=null}}else y=b=0;if(t){C=t*Math.cos(f-_);S=t*Math.sin(f-_);T=t*Math.cos(c+_);k=t*Math.sin(c+_);var N=Math.abs(c-f+2*_)<=Is?0:1;if(_&&pa(C,S,T,k)===1-d^N){var E=(c+f)/2;C=t*Math.cos(E);S=t*Math.sin(E);T=k=null}}else C=S=0;if((p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^d?0:1;var j=null==T?[C,S]:null==x?[y,b]:Pr([y,b],[T,k],[x,w],[C,S]),I=y-j[0],P=b-j[1],H=x-j[0],O=w-j[1],R=1/Math.sin(Math.acos((I*H+P*O)/(Math.sqrt(I*I+P*P)*Math.sqrt(H*H+O*O)))/2),F=Math.sqrt(j[0]*j[0]+j[1]*j[1]);if(null!=x){var W=Math.min(p,(u-F)/(R+1)),z=ga(null==T?[C,S]:[T,k],[y,b],u,W,d),q=ga([x,w],[C,S],u,W,d);p===W?D.push("M",z[0],"A",W,",",W," 0 0,",g," ",z[1],"A",u,",",u," 0 ",1-d^pa(z[1][0],z[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",W,",",W," 0 0,",g," ",q[0]):D.push("M",z[0],"A",W,",",W," 0 1,",g," ",q[0])}else D.push("M",y,",",b);if(null!=T){var U=Math.min(p,(t-F)/(R-1)),B=ga([y,b],[T,k],t,-U,d),V=ga([C,S],null==x?[y,b]:[x,w],t,-U,d);p===U?D.push("L",V[0],"A",U,",",U," 0 0,",g," ",V[1],"A",t,",",t," 0 ",d^pa(V[1][0],V[1][1],B[1][0],B[1][1]),",",1-d," ",B[1],"A",U,",",U," 0 0,",g," ",B[0]):D.push("L",V[0],"A",U,",",U," 0 0,",g," ",B[0])}else D.push("L",C,",",S)}else{D.push("M",y,",",b);null!=x&&D.push("A",u,",",u," 0 ",L,",",d," ",x,",",w);D.push("L",C,",",S);null!=T&&D.push("A",t,",",t," 0 ",N,",",1-d," ",T,",",k)}D.push("Z");return D.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=ua,r=ca,i=la,o=Du,a=fa,s=ha,l=da;t.innerRadius=function(e){if(!arguments.length)return n;n=De(e);return t};t.outerRadius=function(e){if(!arguments.length)return r;r=De(e);return t};t.cornerRadius=function(e){if(!arguments.length)return i;i=De(e);return t};t.padRadius=function(e){if(!arguments.length)return o;o=e==Du?Du:De(e);return t};t.startAngle=function(e){if(!arguments.length)return a;a=De(e);return t};t.endAngle=function(e){if(!arguments.length)return s;s=De(e);return t};t.padAngle=function(e){if(!arguments.length)return l;l=De(e);return t};t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Os;return[Math.cos(e)*t,Math.sin(e)*t]};return t};var Du="auto";is.svg.line=function(){return ma(x)};var Lu=is.map({linear:va,"linear-closed":ya,step:ba,"step-before":xa,"step-after":wa,basis:Ma,"basis-open":Da,"basis-closed":La,bundle:Aa,cardinal:Ta,"cardinal-open":Ca,"cardinal-closed":Sa,monotone:Ha});Lu.forEach(function(t,e){e.key=t;e.closed=/-closed$/.test(t)});var Au=[0,2/3,1/3,0],Nu=[0,1/3,2/3,0],Eu=[0,1/6,2/3,1/6];is.svg.line.radial=function(){var t=ma(Oa);t.radius=t.x,delete t.x;t.angle=t.y,delete t.y;return t};xa.reverse=wa;wa.reverse=xa;is.svg.area=function(){return Ra(x)};is.svg.area.radial=function(){var t=Ra(Oa);t.radius=t.x,delete t.x;t.innerRadius=t.x0,delete t.x0;t.outerRadius=t.x1,delete t.x1;t.angle=t.y,delete t.y;t.startAngle=t.y0,delete t.y0;t.endAngle=t.y1,delete t.y1;return t};is.svg.chord=function(){function t(t,s){var l=e(this,o,t,s),u=e(this,a,t,s);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(n(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+r(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),o=s.call(t,i,r),a=l.call(t,i,r)-Os,c=u.call(t,i,r)-Os;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Is)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=xr,a=wr,s=Fa,l=fa,u=ha;t.radius=function(e){if(!arguments.length)return s;s=De(e);return t};t.source=function(e){if(!arguments.length)return o;o=De(e);return t};t.target=function(e){if(!arguments.length)return a;a=De(e);return t};t.startAngle=function(e){if(!arguments.length)return l;l=De(e);return t};t.endAngle=function(e){if(!arguments.length)return u;u=De(e);return t};return t};is.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];l=l.map(r);return"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=xr,n=wr,r=Wa;t.source=function(n){if(!arguments.length)return e;e=De(n);return t};t.target=function(e){if(!arguments.length)return n;n=De(e);return t};t.projection=function(e){if(!arguments.length)return r;r=e;return t};return t};is.svg.diagonal.radial=function(){var t=is.svg.diagonal(),e=Wa,n=t.projection;t.projection=function(t){return arguments.length?n(za(e=t)):e};return t};is.svg.symbol=function(){function t(t,r){return(ju.get(e.call(this,t,r))||Ba)(n.call(this,t,r))}var e=Ua,n=qa;t.type=function(n){if(!arguments.length)return e;e=De(n);return t};t.size=function(e){if(!arguments.length)return n;n=De(e);return t};return t};var ju=is.map({circle:Ba,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Pu)),n=e*Pu;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Iu),n=e*Iu/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Iu),n=e*Iu/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});is.svg.symbolTypes=ju.keys();var Iu=Math.sqrt(3),Pu=Math.tan(30*Rs);ks.transition=function(t){for(var e,n,r=Hu||++Wu,i=Ya(t),o=[],a=Ou||{time:Date.now(),ease:Mi,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;){(n=u[c])&&Ja(n,c,i,r,a);e.push(n)}}return Xa(o,i,r)};ks.interrupt=function(t){return this.each(null==t?Ru:Va(Ya(t)))};var Hu,Ou,Ru=Va(Ya()),Fu=[],Wu=0;Fu.call=ks.call;Fu.empty=ks.empty;Fu.node=ks.node;Fu.size=ks.size;is.transition=function(t,e){return t&&t.transition?Hu?t.transition(e):t:is.selection().transition(t)};is.transition.prototype=Fu;Fu.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=A(t);for(var s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)if((r=u[c])&&(n=t.call(r,r.__data__,c,s))){"__data__"in r&&(n.__data__=r.__data__);Ja(n,c,o,i,r[o][i]);e.push(n)}else e.push(null)}return Xa(a,o,i)};Fu.selectAll=function(t){var e,n,r,i,o,a=this.id,s=this.namespace,l=[];t=N(t);for(var u=-1,c=this.length;++u<c;)for(var f=this[u],h=-1,d=f.length;++h<d;)if(r=f[h]){o=r[s][a];n=t.call(r,r.__data__,h,u);l.push(e=[]);for(var p=-1,g=n.length;++p<g;){(i=n[p])&&Ja(i,p,s,a,o);e.push(i)}}return Xa(l,s,a)};Fu.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=U(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var n=this[o],s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return Xa(i,this.namespace,this.id)};Fu.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})};Fu.attr=function(t,e){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(s);return n!==t&&(e=a(n,t),function(t){this.setAttribute(s,e(t))})})}function o(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(s.space,s.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Ui:xi,s=is.ns.qualify(t);return Ga(this,"attr."+t,e,s.local?o:i)};Fu.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=is.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)};Fu.style=function(t,e,n){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=r(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=xi(o,e),function(e){this.style.setProperty(t,i(e),n)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Ga(this,"style."+t,e,o)};Fu.styleTween=function(t,e,n){function i(i,o){var a=e.call(this,i,o,r(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),n)}}arguments.length<3&&(n="");return this.tween("style."+t,i)};Fu.text=function(t){return Ga(this,"text",t,$a)};Fu.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})};Fu.ease=function(t){var e=this.id,n=this.namespace;if(arguments.length<1)return this.node()[n][e].ease;"function"!=typeof t&&(t=is.ease.apply(is,arguments));return V(this,function(r){r[n][e].ease=t})};Fu.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))};Fu.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))};Fu.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Ou,o=Hu;try{Hu=n;V(this,function(e,i,o){Ou=e[r][n];t.call(e,e.__data__,i,o)})}finally{Ou=i;Hu=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=is.dispatch("start","end","interrupt"))).on(t,e)});return this};Fu.transition=function(){for(var t,e,n,r,i=this.id,o=++Wu,a=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,f=e.length;f>c;c++){if(n=e[c]){r=n[a][i];Ja(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})}t.push(n)}}return Xa(s,a,o)};is.svg.axis=function(){function t(t){t.each(function(){var t,u=is.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),h=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,d=null==e?f.tickFormat?f.tickFormat.apply(f,s):x:e,p=u.selectAll(".tick").data(h,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Es),m=is.transition(p.exit()).style("opacity",Es).remove(),v=is.transition(p.order()).style("opacity",1),y=Math.max(i,0)+a,b=zo(f),w=u.selectAll(".domain").data([0]),C=(w.enter().append("path").attr("class","domain"),is.transition(w));g.append("line");g.append("text");var S,T,k,_,M=g.select("line"),D=v.select("line"),L=p.select("text").text(d),A=g.select("text"),N=v.select("text"),E="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r){t=Ka,S="x",k="y",T="x2",_="y2";L.attr("dy",0>E?"0em":".71em").style("text-anchor","middle");C.attr("d","M"+b[0]+","+E*o+"V0H"+b[1]+"V"+E*o)}else{t=Za,S="y",k="x",T="y2",_="x2";L.attr("dy",".32em").style("text-anchor",0>E?"end":"start");C.attr("d","M"+E*o+","+b[0]+"H0V"+b[1]+"H"+E*o)}M.attr(_,E*i);A.attr(k,E*y);D.attr(T,0).attr(_,E*i);N.attr(S,0).attr(k,E*y);if(f.rangeBand){var j=f,I=j.rangeBand()/2;c=f=function(t){return j(t)+I}}else c.rangeBand?c=f:m.call(t,f,c);g.call(t,c,f);v.call(t,f,f)})}var e,n=is.scale.linear(),r=zu,i=6,o=6,a=3,s=[10],l=null;t.scale=function(e){if(!arguments.length)return n;n=e;return t};t.orient=function(e){if(!arguments.length)return r;r=e in qu?e+"":zu;return t};t.ticks=function(){if(!arguments.length)return s;s=arguments;return t};t.tickValues=function(e){if(!arguments.length)return l;l=e;return t};t.tickFormat=function(n){if(!arguments.length)return e;e=n;return t};t.tickSize=function(e){var n=arguments.length;if(!n)return i;i=+e;o=+arguments[n-1];return t};t.innerTickSize=function(e){if(!arguments.length)return i;i=+e;return t};t.outerTickSize=function(e){if(!arguments.length)return o;o=+e;return t};t.tickPadding=function(e){if(!arguments.length)return a;a=+e;return t};t.tickSubdivide=function(){return arguments.length&&t};return t};var zu="bottom",qu={top:1,right:1,bottom:1,left:1};is.svg.brush=function(){function t(r){r.each(function(){var r=is.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=r.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");r.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=r.selectAll(".resize").data(g,x);s.exit().remove();s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Uu[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");s.style("display",t.empty()?"none":null);var l,f=is.transition(r),h=is.transition(a);if(u){l=zo(u);h.attr("x",l[0]).attr("width",l[1]-l[0]);n(f)}if(c){l=zo(c);h.attr("y",l[0]).attr("height",l[1]-l[0]);i(f)}e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",f[0]);t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]);t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){if(32==is.event.keyCode){if(!L){b=null;N[0]-=f[1];N[1]-=h[1];L=2}_()}}function g(){if(32==is.event.keyCode&&2==L){N[0]+=f[1];N[1]+=h[1];L=0;_()}}function m(){var t=is.mouse(w),r=!1;if(x){t[0]+=x[0];t[1]+=x[1]}if(!L)if(is.event.altKey){b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]);N[0]=f[+(t[0]<b[0])];N[1]=h[+(t[1]<b[1])]}else b=null;if(M&&v(t,u,0)){n(T);r=!0}if(D&&v(t,c,1)){i(T);r=!0}if(r){e(T);S({type:"brush",mode:L?"move":"resize"})}}function v(t,e,n){var r,i,o=zo(e),l=o[0],u=o[1],c=N[n],g=n?h:f,m=g[1]-g[0];if(L){l-=c;u-=m+c}r=(n?p:d)?Math.max(l,Math.min(u,t[n])):t[n];if(L)i=(r+=c)+m;else{b&&(c=Math.max(l,Math.min(u,2*b[n]-r)));if(r>c){i=r;r=c}else i=c}if(g[0]!=r||g[1]!=i){n?s=null:a=null;g[0]=r;g[1]=i;return!0}}function y(){m();T.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null);is.select("body").style("cursor",null);E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);A();S({type:"brushend"})}var b,x,w=this,C=is.select(is.event.target),S=l.of(w,arguments),T=is.select(w),k=C.datum(),M=!/^(n|s)$/.test(k)&&u,D=!/^(e|w)$/.test(k)&&c,L=C.classed("extent"),A=K(w),N=is.mouse(w),E=is.select(r(w)).on("keydown.brush",o).on("keyup.brush",g);is.event.changedTouches?E.on("touchmove.brush",m).on("touchend.brush",y):E.on("mousemove.brush",m).on("mouseup.brush",y);T.interrupt().selectAll("*").interrupt();if(L){N[0]=f[0]-N[0];N[1]=h[0]-N[1]}else if(k){var j=+/w$/.test(k),I=+/^n/.test(k);x=[f[1-j]-N[0],h[1-I]-N[1]];N[0]=f[j];N[1]=h[I]}else is.event.altKey&&(b=N.slice());T.style("pointer-events","none").selectAll(".resize").style("display",null);is.select("body").style("cursor",C.style("cursor"));S({type:"brushstart"});m()}var a,s,l=D(t,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],h=[0,0],d=!0,p=!0,g=Bu[0];t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:f,y:h,i:a,j:s},n=this.__chart__||e;this.__chart__=e;if(Hu)is.select(this).transition().each("start.brush",function(){a=n.i;s=n.j;f=n.x;h=n.y;t({type:"brushstart"})}).tween("brush:brush",function(){var n=wi(f,e.x),r=wi(h,e.y);a=s=null;return function(i){f=e.x=n(i);h=e.y=r(i);t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i;s=e.j;t({type:"brush",mode:"resize"});t({type:"brushend"})});else{t({type:"brushstart"});t({type:"brush",mode:"resize"});t({type:"brushend"})}})};t.x=function(e){if(!arguments.length)return u;u=e;g=Bu[!u<<1|!c];return t};t.y=function(e){if(!arguments.length)return c;c=e;g=Bu[!u<<1|!c];return t};t.clamp=function(e){if(!arguments.length)return u&&c?[d,p]:u?d:c?p:null;u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e);return t};t.extent=function(e){var n,r,i,o,l;if(!arguments.length){if(u)if(a)n=a[0],r=a[1];else{n=f[0],r=f[1];u.invert&&(n=u.invert(n),r=u.invert(r));n>r&&(l=n,n=r,r=l)}if(c)if(s)i=s[0],o=s[1];else{i=h[0],o=h[1];c.invert&&(i=c.invert(i),o=c.invert(o));i>o&&(l=i,i=o,o=l)}return u&&c?[[n,i],[r,o]]:u?[n,r]:c&&[i,o]}if(u){n=e[0],r=e[1];c&&(n=n[0],r=r[0]);a=[n,r];u.invert&&(n=u(n),r=u(r));n>r&&(l=n,n=r,r=l);(n!=f[0]||r!=f[1])&&(f=[n,r])}if(c){i=e[0],o=e[1];u&&(i=i[1],o=o[1]);s=[i,o];c.invert&&(i=c(i),o=c(o));i>o&&(l=i,i=o,o=l);(i!=h[0]||o!=h[1])&&(h=[i,o])}return t};t.clear=function(){if(!t.empty()){f=[0,0],h=[0,0];a=s=null}return t};t.empty=function(){return!!u&&f[0]==f[1]||!!c&&h[0]==h[1]};return is.rebind(t,l,"on")};var Uu={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bu=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vu=cl.format=ml.timeFormat,Xu=Vu.utc,Gu=Xu("%Y-%m-%dT%H:%M:%S.%LZ");Vu.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Qa:Gu;Qa.parse=function(t){var e=new Date(t);return isNaN(e)?null:e};Qa.toString=Gu.toString;cl.second=ze(function(t){return new fl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()});cl.seconds=cl.second.range;cl.seconds.utc=cl.second.utc.range;cl.minute=ze(function(t){return new fl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()});cl.minutes=cl.minute.range;cl.minutes.utc=cl.minute.utc.range;cl.hour=ze(function(t){var e=t.getTimezoneOffset()/60;return new fl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()});cl.hours=cl.hour.range;cl.hours.utc=cl.hour.utc.range;cl.month=ze(function(t){t=cl.day(t);t.setDate(1);return t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()});cl.months=cl.month.range;cl.months.utc=cl.month.utc.range;var $u=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Yu=[[cl.second,1],[cl.second,5],[cl.second,15],[cl.second,30],[cl.minute,1],[cl.minute,5],[cl.minute,15],[cl.minute,30],[cl.hour,1],[cl.hour,3],[cl.hour,6],[cl.hour,12],[cl.day,1],[cl.day,2],[cl.week,1],[cl.month,1],[cl.month,3],[cl.year,1]],Ju=Vu.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Nn]]),Ku={range:function(t,e,n){return is.range(Math.ceil(t/n)*n,+e,n).map(es)},floor:x,ceil:x};Yu.year=cl.year;cl.scale=function(){return ts(is.scale.linear(),Yu,Ju)};var Zu=Yu.map(function(t){return[t[0].utc,t[1]]}),Qu=Xu.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Nn]]);Zu.year=cl.year.utc;cl.scale.utc=function(){return ts(is.scale.linear(),Zu,Qu)};is.text=Le(function(t){return t.responseText});is.json=function(t,e){return Ae(t,"application/json",ns,e)};is.html=function(t,e){return Ae(t,"text/html",rs,e)};is.xml=Le(function(t){return t.responseXML});"function"==typeof t&&t.amd?t(is):"object"==typeof n&&n.exports&&(n.exports=is);this.d3=is}()},{}],15:[function(t){var e=t("jquery");(function(t,e){function n(e,n){var i,o,a,s=e.nodeName.toLowerCase();if("area"===s){i=e.parentNode;o=i.name;if(!e.href||!o||"map"!==i.nodeName.toLowerCase())return!1;a=t("img[usemap=#"+o+"]")[0];return!!a&&r(a)}return(/input|select|textarea|button|object/.test(s)?!e.disabled:"a"===s?e.href||n:n)&&r(e)}function r(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var i=0,o=/^ui-id-\d+$/;t.ui=t.ui||{};t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});t.fn.extend({focus:function(e){return function(n,r){return"number"==typeof n?this.each(function(){var e=this;setTimeout(function(){t(e).focus();r&&r.call(e)},n)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0);return/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var r,i,o=t(this[0]);o.length&&o[0]!==document;){r=o.css("position");if("absolute"===r||"relative"===r||"fixed"===r){i=parseInt(o.css("zIndex"),10);if(!isNaN(i)&&0!==i)return i}o=o.parent() }return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++i)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}});t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,r){return!!t.data(e,r[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var r=t.attr(e,"tabindex"),i=isNaN(r);return(i||r>=0)&&n(e,!i)}});t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(n,r){function i(e,n,r,i){t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0;r&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0);i&&(n-=parseFloat(t.css(e,"margin"+this))||0)});return n}var o="Width"===r?["Left","Right"]:["Top","Bottom"],a=r.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+r]=function(n){return n===e?s["inner"+r].call(this):this.each(function(){t(this).css(a,i(this,n)+"px")})};t.fn["outer"+r]=function(e,n){return"number"!=typeof e?s["outer"+r].call(this,e):this.each(function(){t(this).css(a,i(this,e,!0,n)+"px")})}});t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))});t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData));t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());t.support.selectstart="onselectstart"in document.createElement("div");t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});t.extend(t.ui,{plugin:{add:function(e,n,r){var i,o=t.ui[e].prototype;for(i in r){o.plugins[i]=o.plugins[i]||[];o.plugins[i].push([n,r[i]])}},call:function(t,e,n){var r,i=t.plugins[e];if(i&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(r=0;r<i.length;r++)t.options[i[r][0]]&&i[r][1].apply(t.element,n)}},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;if(e[r]>0)return!0;e[r]=1;i=e[r]>0;e[r]=0;return i}})})(e)},{jquery:19}],16:[function(t){var e=t("jquery");t("./widget");(function(t){var e=!1;t(document).mouseup(function(){e=!1});t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent")){t.removeData(n.target,e.widgetName+".preventClickEvent");n.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseStarted&&this._mouseUp(n);this._mouseDownEvent=n;var r=this,i=1===n.which,o="string"==typeof this.options.cancel&&n.target.nodeName?t(n.target).closest(this.options.cancel).length:!1;if(!i||o||!this._mouseCapture(n))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(n)&&this._mouseDelayMet(n)){this._mouseStarted=this._mouseStart(n)!==!1;if(!this._mouseStarted){n.preventDefault();return!0}}!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(t){return r._mouseMove(t)};this._mouseUpDelegate=function(t){return r._mouseUp(t)};t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);n.preventDefault();e=!0;return!0}},_mouseMove:function(e){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1;this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)}return!this._mouseStarted},_mouseUp:function(e){t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0);this._mouseStop(e)}return!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(e)},{"./widget":18,jquery:19}],17:[function(t){var e=t("jquery");t("./core");t("./mouse");t("./widget");(function(t){function e(t,e,n){return t>e&&e+n>t}function n(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?"x"===t.axis||n(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,n){if("disabled"===e){this.options[e]=n;this.widget().toggleClass("ui-sortable-disabled",!!n)}else t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,n){var r=null,i=!1,o=this;if(this.reverting)return!1;if(this.options.disabled||"static"===this.options.type)return!1;this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o){r=t(this);return!1}});t.data(e.target,o.widgetName+"-item")===o&&(r=t(e.target));if(!r)return!1;if(this.options.handle&&!n){t(this.options.handle,r).find("*").addBack().each(function(){this===e.target&&(i=!0)});if(!i)return!1}this.currentItem=r;this._removeCurrentsFromItems();return!0},_mouseStart:function(e,n,r){var i,o,a=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!==this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();a.containment&&this._setContainment();if(a.cursor&&"auto"!==a.cursor){o=this.document.find("body");this.storedCursor=o.css("cursor");o.css("cursor",a.cursor);this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)}if(a.opacity){this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity"));this.helper.css("opacity",a.opacity)}if(a.zIndex){this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex"));this.helper.css("zIndex",a.zIndex)}this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());this._trigger("start",e,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",e,this._uiHash(this));t.ui.ddmanager&&(t.ui.ddmanager.current=this);t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return!0},_mouseDrag:function(e){var n,r,i,o,a=this.options,s=!1;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){if(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName){this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-a.scrollSpeed);this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-a.scrollSpeed)}else{e.pageY-t(document).scrollTop()<a.scrollSensitivity?s=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(s=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed));e.pageX-t(document).scrollLeft()<a.scrollSensitivity?s=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(s=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))}s!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(n=this.items.length-1;n>=0;n--){r=this.items[n];i=r.item[0];o=this._intersectsWithPointer(r);if(o&&r.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==i&&!t.contains(this.placeholder[0],i)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],i):!0)){this.direction=1===o?"down":"up";if("pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(e,r);this._trigger("change",e,this._uiHash());break}}this._contactContainers(e);t.ui.ddmanager&&t.ui.ddmanager.drag(this,e);this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(e,n){if(e){t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e);if(this.options.revert){var r=this,i=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft));o&&"y"!==o||(a.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop));this.reverting=!0;t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){r._clear(e)})}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove();t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];e=e||{};t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&r.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))});!r.length&&e.key&&r.push(e.key+"=");return r.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];e=e||{};n.each(function(){r.push(t(e.item||this).attr(e.attribute||"id")||"")});return r},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,o=t.left,a=o+t.width,s=t.top,l=s+t.height,u=this.offset.click.top,c=this.offset.click.left,f="x"===this.options.axis||r+u>s&&l>r+u,h="y"===this.options.axis||e+c>o&&a>e+c,d=f&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:o<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<a&&s<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var n="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),r="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return i?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var n=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&r||"left"===o&&!r:i&&("down"===i&&n||"up"===i&&!n)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function n(){s.push(this)}var r,i,o,a,s=[],l=[],u=this._connectWith();if(u&&e)for(r=u.length-1;r>=0;r--){o=t(u[r]);for(i=o.length-1;i>=0;i--){a=t.data(o[i],this.widgetFullName);a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(r=l.length-1;r>=0;r--)l[r][0].each(n);return t(s)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n<e.length;n++)if(e[n]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[];this.containers=[this];var n,r,i,o,a,s,l,u,c=this.items,f=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--){i=t(h[n]);for(r=i.length-1;r>=0;r--){o=t.data(i[r],this.widgetFullName);if(o&&o!==this&&!o.options.disabled){f.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]);this.containers.push(o)}}}for(n=f.length-1;n>=0;n--){a=f[n][1];s=f[n][0];for(r=0,u=s.length;u>r;r++){l=t(s[r]);l.data(this.widgetName+"-item",a);c.push({item:l,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,o;for(n=this.items.length-1;n>=0;n--){r=this.items[n];if(r.instance===this.currentContainer||!this.currentContainer||r.item[0]===this.currentItem[0]){i=this.options.toleranceElement?t(this.options.toleranceElement,r.item):r.item;if(!e){r.width=i.outerWidth();r.height=i.outerHeight()}o=i.offset();r.left=o.left;r.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--){o=this.containers[n].element.offset();this.containers[n].containerCache.left=o.left;this.containers[n].containerCache.top=o.top;this.containers[n].containerCache.width=this.containers[n].element.outerWidth();this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(e){e=e||this;var n,r=e.options;if(!r.placeholder||r.placeholder.constructor===String){n=r.placeholder;r.placeholder={element:function(){var r=e.currentItem[0].nodeName.toLowerCase(),i=t("<"+r+">",e.document[0]).addClass(n||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");"tr"===r?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)}):"img"===r&&i.attr("src",e.currentItem.attr("src"));n||i.css("visibility","hidden");return i},update:function(t,i){if(!n||r.forcePlaceholderSize){i.height()||i.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10));i.width()||i.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}}e.placeholder=t(r.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);r.placeholder.update(e,e.placeholder)},_contactContainers:function(r){var i,o,a,s,l,u,c,f,h,d,p=null,g=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(p&&t.contains(this.containers[i].element[0],p.element[0]))continue;p=this.containers[i];g=i}else if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",r,this._uiHash(this));this.containers[i].containerCache.over=0}if(p)if(1===this.containers.length){if(!this.containers[g].containerCache.over){this.containers[g]._trigger("over",r,this._uiHash(this));this.containers[g].containerCache.over=1}}else{a=1e4;s=null;d=p.floating||n(this.currentItem);l=d?"left":"top";u=d?"width":"height";c=this.positionAbs[l]+this.offset.click[l];for(o=this.items.length-1;o>=0;o--)if(t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!d||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))){f=this.items[o].item.offset()[l];h=!1;if(Math.abs(f-c)>Math.abs(f+this.items[o][u]-c)){h=!0;f+=this.items[o][u]}if(Math.abs(f-c)<a){a=Math.abs(f-c);s=this.items[o];this.direction=h?"up":"down"}}if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;s?this._rearrange(r,s,null,!0):this._rearrange(r,null,this.containers[g].element,!0);this._trigger("change",r,this._uiHash());this.containers[g]._trigger("change",r,this._uiHash(this));this.currentContainer=this.containers[g];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[g]._trigger("over",r,this._uiHash(this));this.containers[g].containerCache.over=1}},_createHelper:function(e){var n=this.options,r=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;r.parents("body").length||t("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]);r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width());(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height());return r},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" "));t.isArray(e)&&(e={left:+e[0],top:+e[1]||0});"left"in e&&(this.offset.click.left=e.left+this.margins.left);"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left);"top"in e&&(this.offset.click.top=e.top+this.margins.top);"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if("absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0});return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,r,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode);("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===i.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===i.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]);if(!/^(document|window|parent)$/.test(i.containment)){e=t(i.containment)[0];n=t(i.containment).offset();r="hidden"!==t(e).css("overflow");this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,n){n||(n=this.position);var r="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:i.scrollLeft())*r}},_generatePosition:function(e){var n,r,i=this.options,o=e.pageX,a=e.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(s[0].tagName);"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());if(this.originalPosition){if(this.containment){e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left);e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top);e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left);e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)}if(i.grid){n=this.originalPageY+Math.round((a-this.originalPageY)/i.grid[1])*i.grid[1];a=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n;r=this.originalPageX+Math.round((o-this.originalPageX)/i.grid[0])*i.grid[0];o=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r}}return{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:s.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:s.scrollLeft())}},_rearrange:function(t,e,n,r){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(t,e){function n(t,e,n){return function(r){n._trigger(t,r,e._uiHash(e))}}this.reverting=!1;var r,i=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!e&&i.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))});!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||i.push(function(t){this._trigger("update",t,this._uiHash())});if(this!==this.currentContainer&&!e){i.push(function(t){this._trigger("remove",t,this._uiHash())});i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer));i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))}for(r=this.containers.length-1;r>=0;r--){e||i.push(n("deactivate",this,this.containers[r]));if(this.containers[r].containerCache.over){i.push(n("out",this,this.containers[r]));this.containers[r].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",t,this._uiHash());for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}this.fromOutside=!1;return!1}e||this._trigger("beforeStop",t,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!==this.currentItem[0]&&this.helper.remove();this.helper=null;if(!e){for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})})(e)},{"./core":15,"./mouse":16,"./widget":18,jquery:19}],18:[function(t){var e=t("jquery");(function(t,e){var n=0,r=Array.prototype.slice,i=t.cleanData;t.cleanData=function(e){for(var n,r=0;null!=(n=e[r]);r++)try{t(n).triggerHandler("remove")}catch(o){}i(e)};t.widget=function(e,n,r){var i,o,a,s,l={},u=e.split(".")[0];e=e.split(".")[1];i=u+"-"+e;if(!r){r=n;n=t.Widget}t.expr[":"][i.toLowerCase()]=function(e){return!!t.data(e,i)};t[u]=t[u]||{};o=t[u][e];a=t[u][e]=function(t,e){if(!this._createWidget)return new a(t,e);arguments.length&&this._createWidget(t,e);return void 0};t.extend(a,o,{version:r.version,_proto:t.extend({},r),_childConstructors:[]});s=new n;s.options=t.widget.extend({},s.options);t.each(r,function(e,r){l[e]=t.isFunction(r)?function(){var t=function(){return n.prototype[e].apply(this,arguments)},i=function(t){return n.prototype[e].apply(this,t)};return function(){var e,n=this._super,o=this._superApply;this._super=t;this._superApply=i;e=r.apply(this,arguments);this._super=n;this._superApply=o;return e}}():r});a.prototype=t.widget.extend(s,{widgetEventPrefix:o?s.widgetEventPrefix||e:e},l,{constructor:a,namespace:u,widgetName:e,widgetFullName:i});if(o){t.each(o._childConstructors,function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,a,n._proto)});delete o._childConstructors}else n._childConstructors.push(a);t.widget.bridge(e,a)};t.widget.extend=function(n){for(var i,o,a=r.call(arguments,1),s=0,l=a.length;l>s;s++)for(i in a[s]){o=a[s][i];a[s].hasOwnProperty(i)&&o!==e&&(n[i]=t.isPlainObject(o)?t.isPlainObject(n[i])?t.widget.extend({},n[i],o):t.widget.extend({},o):o)}return n};t.widget.bridge=function(n,i){var o=i.prototype.widgetFullName||n;t.fn[n]=function(a){var s="string"==typeof a,l=r.call(arguments,1),u=this;a=!s&&l.length?t.widget.extend.apply(null,[a].concat(l)):a;this.each(s?function(){var r,i=t.data(this,o);if(!i)return t.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+a+"'");if(!t.isFunction(i[a])||"_"===a.charAt(0))return t.error("no such method '"+a+"' for "+n+" widget instance");r=i[a].apply(i,l);if(r!==i&&r!==e){u=r&&r.jquery?u.pushStack(r.get()):r;return!1}}:function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new i(a,this))});return u}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,r){r=t(r||this.defaultElement||this)[0];this.element=t(r);this.uuid=n++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=t.widget.extend({},this.options,this._getCreateOptions(),e); this.bindings=t();this.hoverable=t();this.focusable=t();if(r!==this){t.data(r,this.widgetFullName,this);this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}});this.document=t(r.style?r.ownerDocument:r.document||r);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)}this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(n,r){var i,o,a,s=n;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof n){s={};i=n.split(".");n=i.shift();if(i.length){o=s[n]=t.widget.extend({},this.options[n]);for(a=0;a<i.length-1;a++){o[i[a]]=o[i[a]]||{};o=o[i[a]]}n=i.pop();if(1===arguments.length)return o[n]===e?null:o[n];o[n]=r}else{if(1===arguments.length)return this.options[n]===e?null:this.options[n];s[n]=r}}this._setOptions(s);return this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){this.options[t]=e;if("disabled"===t){this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,n,r){var i,o=this;if("boolean"!=typeof e){r=n;n=e;e=!1}if(r){n=i=t(n);this.bindings=this.bindings.add(n)}else{r=n;n=this.element;i=this.widget()}t.each(r,function(r,a){function s(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(s.guid=a.guid=a.guid||s.guid||t.guid++);var l=r.match(/^(\w+)\s*(.*)$/),u=l[1]+o.eventNamespace,c=l[2];c?i.delegate(c,u,s):n.bind(u,s)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.unbind(e).undelegate(e)},_delay:function(t,e){function n(){return("string"==typeof t?r[t]:t).apply(r,arguments)}var r=this;return setTimeout(n,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,n,r){var i,o,a=this.options[e];r=r||{};n=t.Event(n);n.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();n.target=this.element[0];o=n.originalEvent;if(o)for(i in o)i in n||(n[i]=o[i]);this.element.trigger(n,r);return!(t.isFunction(a)&&a.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(r,i,o){"string"==typeof i&&(i={effect:i});var a,s=i?i===!0||"number"==typeof i?n:i.effect||n:e;i=i||{};"number"==typeof i&&(i={duration:i});a=!t.isEmptyObject(i);i.complete=o;i.delay&&r.delay(i.delay);a&&t.effects&&t.effects.effect[s]?r[e](i):s!==e&&r[s]?r[s](i.duration,i.easing,o):r.queue(function(n){t(this)[e]();o&&o.call(r[0]);n()})}})})(e)},{jquery:19}],19:[function(e,n){(function(t,e){"object"==typeof n&&"object"==typeof n.exports?n.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)})("undefined"!=typeof window?window:this,function(e,n){function r(t){var e=t.length,n=oe.type(t);return"function"===n||oe.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function i(t,e,n){if(oe.isFunction(e))return oe.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return oe.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(de.test(e))return oe.filter(e,t,n);e=oe.filter(e,t)}return oe.grep(t,function(t){return oe.inArray(t,e)>=0!==n})}function o(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function a(t){var e=we[t]={};oe.each(t.match(xe)||[],function(t,n){e[n]=!0});return e}function s(){if(ge.addEventListener){ge.removeEventListener("DOMContentLoaded",l,!1);e.removeEventListener("load",l,!1)}else{ge.detachEvent("onreadystatechange",l);e.detachEvent("onload",l)}}function l(){if(ge.addEventListener||"load"===event.type||"complete"===ge.readyState){s();oe.ready()}}function u(t,e,n){if(void 0===n&&1===t.nodeType){var r="data-"+e.replace(_e,"-$1").toLowerCase();n=t.getAttribute(r);if("string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ke.test(n)?oe.parseJSON(n):n}catch(i){}oe.data(t,e,n)}else n=void 0}return n}function c(t){var e;for(e in t)if(("data"!==e||!oe.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function f(t,e,n,r){if(oe.acceptData(t)){var i,o,a=oe.expando,s=t.nodeType,l=s?oe.cache:t,u=s?t[a]:t[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof e){u||(u=s?t[a]=Y.pop()||oe.guid++:a);l[u]||(l[u]=s?{}:{toJSON:oe.noop});("object"==typeof e||"function"==typeof e)&&(r?l[u]=oe.extend(l[u],e):l[u].data=oe.extend(l[u].data,e));o=l[u];if(!r){o.data||(o.data={});o=o.data}void 0!==n&&(o[oe.camelCase(e)]=n);if("string"==typeof e){i=o[e];null==i&&(i=o[oe.camelCase(e)])}else i=o;return i}}}function h(t,e,n){if(oe.acceptData(t)){var r,i,o=t.nodeType,a=o?oe.cache:t,s=o?t[oe.expando]:oe.expando;if(a[s]){if(e){r=n?a[s]:a[s].data;if(r){if(oe.isArray(e))e=e.concat(oe.map(e,oe.camelCase));else if(e in r)e=[e];else{e=oe.camelCase(e);e=e in r?[e]:e.split(" ")}i=e.length;for(;i--;)delete r[e[i]];if(n?!c(r):!oe.isEmptyObject(r))return}}if(!n){delete a[s].data;if(!c(a[s]))return}o?oe.cleanData([t],!0):re.deleteExpando||a!=a.window?delete a[s]:a[s]=null}}}function d(){return!0}function p(){return!1}function g(){try{return ge.activeElement}catch(t){}}function m(t){var e=Oe.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function v(t,e){var n,r,i=0,o=typeof t.getElementsByTagName!==Te?t.getElementsByTagName(e||"*"):typeof t.querySelectorAll!==Te?t.querySelectorAll(e||"*"):void 0;if(!o)for(o=[],n=t.childNodes||t;null!=(r=n[i]);i++)!e||oe.nodeName(r,e)?o.push(r):oe.merge(o,v(r,e));return void 0===e||e&&oe.nodeName(t,e)?oe.merge([t],o):o}function y(t){Ne.test(t.type)&&(t.defaultChecked=t.checked)}function b(t,e){return oe.nodeName(t,"table")&&oe.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function x(t){t.type=(null!==oe.find.attr(t,"type"))+"/"+t.type;return t}function w(t){var e=$e.exec(t.type);e?t.type=e[1]:t.removeAttribute("type");return t}function C(t,e){for(var n,r=0;null!=(n=t[r]);r++)oe._data(n,"globalEval",!e||oe._data(e[r],"globalEval"))}function S(t,e){if(1===e.nodeType&&oe.hasData(t)){var n,r,i,o=oe._data(t),a=oe._data(e,o),s=o.events;if(s){delete a.handle;a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)oe.event.add(e,n,s[n][r])}a.data&&(a.data=oe.extend({},a.data))}}function T(t,e){var n,r,i;if(1===e.nodeType){n=e.nodeName.toLowerCase();if(!re.noCloneEvent&&e[oe.expando]){i=oe._data(e);for(r in i.events)oe.removeEvent(e,r,i.handle);e.removeAttribute(oe.expando)}if("script"===n&&e.text!==t.text){x(e).text=t.text;w(e)}else if("object"===n){e.parentNode&&(e.outerHTML=t.outerHTML);re.html5Clone&&t.innerHTML&&!oe.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)}else if("input"===n&&Ne.test(t.type)){e.defaultChecked=e.checked=t.checked;e.value!==t.value&&(e.value=t.value)}else"option"===n?e.defaultSelected=e.selected=t.defaultSelected:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}}function k(t,n){var r,i=oe(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:oe.css(i[0],"display");i.detach();return o}function _(t){var e=ge,n=tn[t];if(!n){n=k(t,e);if("none"===n||!n){Qe=(Qe||oe("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement);e=(Qe[0].contentWindow||Qe[0].contentDocument).document;e.write();e.close();n=k(t,e);Qe.detach()}tn[t]=n}return n}function M(t,e){return{get:function(){var n=t();if(null!=n){if(!n)return(this.get=e).apply(this,arguments);delete this.get}}}}function D(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),r=e,i=pn.length;i--;){e=pn[i]+n;if(e in t)return e}return r}function L(t,e){for(var n,r,i,o=[],a=0,s=t.length;s>a;a++){r=t[a];if(r.style){o[a]=oe._data(r,"olddisplay");n=r.style.display;if(e){o[a]||"none"!==n||(r.style.display="");""===r.style.display&&Le(r)&&(o[a]=oe._data(r,"olddisplay",_(r.nodeName)))}else{i=Le(r);(n&&"none"!==n||!i)&&oe._data(r,"olddisplay",i?n:oe.css(r,"display"))}}}for(a=0;s>a;a++){r=t[a];r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?o[a]||"":"none"))}return t}function A(t,e,n){var r=cn.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function N(t,e,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2){"margin"===n&&(a+=oe.css(t,n+De[o],!0,i));if(r){"content"===n&&(a-=oe.css(t,"padding"+De[o],!0,i));"margin"!==n&&(a-=oe.css(t,"border"+De[o]+"Width",!0,i))}else{a+=oe.css(t,"padding"+De[o],!0,i);"padding"!==n&&(a+=oe.css(t,"border"+De[o]+"Width",!0,i))}}return a}function E(t,e,n){var r=!0,i="width"===e?t.offsetWidth:t.offsetHeight,o=en(t),a=re.boxSizing&&"border-box"===oe.css(t,"boxSizing",!1,o);if(0>=i||null==i){i=nn(t,e,o);(0>i||null==i)&&(i=t.style[e]);if(on.test(i))return i;r=a&&(re.boxSizingReliable()||i===t.style[e]);i=parseFloat(i)||0}return i+N(t,e,n||(a?"border":"content"),r,o)+"px"}function j(t,e,n,r,i){return new j.prototype.init(t,e,n,r,i)}function I(){setTimeout(function(){gn=void 0});return gn=oe.now()}function P(t,e){var n,r={height:t},i=0;e=e?1:0;for(;4>i;i+=2-e){n=De[i];r["margin"+n]=r["padding"+n]=t}e&&(r.opacity=r.width=t);return r}function H(t,e,n){for(var r,i=(wn[e]||[]).concat(wn["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,e,t))return r}function O(t,e,n){var r,i,o,a,s,l,u,c,f=this,h={},d=t.style,p=t.nodeType&&Le(t),g=oe._data(t,"fxshow");if(!n.queue){s=oe._queueHooks(t,"fx");if(null==s.unqueued){s.unqueued=0;l=s.empty.fire;s.empty.fire=function(){s.unqueued||l()}}s.unqueued++;f.always(function(){f.always(function(){s.unqueued--;oe.queue(t,"fx").length||s.empty.fire()})})}if(1===t.nodeType&&("height"in e||"width"in e)){n.overflow=[d.overflow,d.overflowX,d.overflowY];u=oe.css(t,"display");c="none"===u?oe._data(t,"olddisplay")||_(t.nodeName):u;"inline"===c&&"none"===oe.css(t,"float")&&(re.inlineBlockNeedsLayout&&"inline"!==_(t.nodeName)?d.zoom=1:d.display="inline-block")}if(n.overflow){d.overflow="hidden";re.shrinkWrapBlocks()||f.always(function(){d.overflow=n.overflow[0];d.overflowX=n.overflow[1];d.overflowY=n.overflow[2]})}for(r in e){i=e[r];if(vn.exec(i)){delete e[r];o=o||"toggle"===i;if(i===(p?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;p=!0}h[r]=g&&g[r]||oe.style(t,r)}else u=void 0}if(oe.isEmptyObject(h))"inline"===("none"===u?_(t.nodeName):u)&&(d.display=u);else{g?"hidden"in g&&(p=g.hidden):g=oe._data(t,"fxshow",{});o&&(g.hidden=!p);p?oe(t).show():f.done(function(){oe(t).hide()});f.done(function(){var e;oe._removeData(t,"fxshow");for(e in h)oe.style(t,e,h[e])});for(r in h){a=H(p?g[r]:0,r,f);if(!(r in g)){g[r]=a.start;if(p){a.end=a.start;a.start="width"===r||"height"===r?1:0}}}}}function R(t,e){var n,r,i,o,a;for(n in t){r=oe.camelCase(n);i=e[r];o=t[n];if(oe.isArray(o)){i=o[1];o=t[n]=o[0]}if(n!==r){t[r]=o;delete t[n]}a=oe.cssHooks[r];if(a&&"expand"in a){o=a.expand(o);delete t[r];for(n in o)if(!(n in t)){t[n]=o[n];e[n]=i}}else e[r]=i}}function F(t,e,n){var r,i,o=0,a=xn.length,s=oe.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var e=gn||I(),n=Math.max(0,u.startTime+u.duration-e),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;l>a;a++)u.tweens[a].run(o);s.notifyWith(t,[u,o,n]);if(1>o&&l)return n;s.resolveWith(t,[u]);return!1},u=s.promise({elem:t,props:oe.extend({},e),opts:oe.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:gn||I(),duration:n.duration,tweens:[],createTween:function(e,n){var r=oe.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);u.tweens.push(r);return r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;i=!0;for(;r>n;n++)u.tweens[n].run(1);e?s.resolveWith(t,[u,e]):s.rejectWith(t,[u,e]);return this}}),c=u.props;R(c,u.opts.specialEasing);for(;a>o;o++){r=xn[o].call(u,t,c,u.opts);if(r)return r}oe.map(c,H,u);oe.isFunction(u.opts.start)&&u.opts.start.call(t,u);oe.fx.timer(oe.extend(l,{elem:t,anim:u,queue:u.opts.queue}));return u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function W(t){return function(e,n){if("string"!=typeof e){n=e;e="*"}var r,i=0,o=e.toLowerCase().match(xe)||[];if(oe.isFunction(n))for(;r=o[i++];)if("+"===r.charAt(0)){r=r.slice(1)||"*";(t[r]=t[r]||[]).unshift(n)}else(t[r]=t[r]||[]).push(n)}}function z(t,e,n,r){function i(s){var l;o[s]=!0;oe.each(t[s]||[],function(t,s){var u=s(e,n,r);if("string"==typeof u&&!a&&!o[u]){e.dataTypes.unshift(u);i(u);return!1}return a?!(l=u):void 0});return l}var o={},a=t===Vn;return i(e.dataTypes[0])||!o["*"]&&i("*")}function q(t,e){var n,r,i=oe.ajaxSettings.flatOptions||{};for(r in e)void 0!==e[r]&&((i[r]?t:n||(n={}))[r]=e[r]);n&&oe.extend(!0,t,n);return t}function U(t,e,n){for(var r,i,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];){l.shift();void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"))}if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||t.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}if(o){o!==l[0]&&l.unshift(o);return n[o]}}function B(t,e,n,r){var i,o,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];o=c.shift();for(;o;){t.responseFields[o]&&(n[t.responseFields[o]]=e);!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType));l=o;o=c.shift();if(o)if("*"===o)o=l;else if("*"!==l&&l!==o){a=u[l+" "+o]||u["* "+o];if(!a)for(i in u){s=i.split(" ");if(s[1]===o){a=u[l+" "+s[0]]||u["* "+s[0]];if(a){if(a===!0)a=u[i];else if(u[i]!==!0){o=s[0];c.unshift(s[1])}break}}}if(a!==!0)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+l+" to "+o}}}}return{state:"success",data:e}}function V(t,e,n,r){var i;if(oe.isArray(e))oe.each(e,function(e,i){n||Yn.test(t)?r(t,i):V(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==oe.type(e))r(t,e);else for(i in e)V(t+"["+i+"]",e[i],n,r)}function X(){try{return new e.XMLHttpRequest}catch(t){}}function G(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $(t){return oe.isWindow(t)?t:9===t.nodeType?t.defaultView||t.parentWindow:!1}var Y=[],J=Y.slice,K=Y.concat,Z=Y.push,Q=Y.indexOf,te={},ee=te.toString,ne=te.hasOwnProperty,re={},ie="1.11.2",oe=function(t,e){return new oe.fn.init(t,e)},ae=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,se=/^-ms-/,le=/-([\da-z])/gi,ue=function(t,e){return e.toUpperCase()};oe.fn=oe.prototype={jquery:ie,constructor:oe,selector:"",length:0,toArray:function(){return J.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:J.call(this)},pushStack:function(t){var e=oe.merge(this.constructor(),t);e.prevObject=this;e.context=this.context;return e},each:function(t,e){return oe.each(this,t,e)},map:function(t){return this.pushStack(oe.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(J.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:Z,sort:Y.sort,splice:Y.splice};oe.extend=oe.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;if("boolean"==typeof a){u=a;a=arguments[s]||{};s++}"object"==typeof a||oe.isFunction(a)||(a={});if(s===l){a=this;s--}for(;l>s;s++)if(null!=(i=arguments[s]))for(r in i){t=a[r];n=i[r];if(a!==n)if(u&&n&&(oe.isPlainObject(n)||(e=oe.isArray(n)))){if(e){e=!1;o=t&&oe.isArray(t)?t:[]}else o=t&&oe.isPlainObject(t)?t:{};a[r]=oe.extend(u,o,n)}else void 0!==n&&(a[r]=n)}return a};oe.extend({expando:"jQuery"+(ie+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===oe.type(t)},isArray:Array.isArray||function(t){return"array"===oe.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!oe.isArray(t)&&t-parseFloat(t)+1>=0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},isPlainObject:function(t){var e;if(!t||"object"!==oe.type(t)||t.nodeType||oe.isWindow(t))return!1;try{if(t.constructor&&!ne.call(t,"constructor")&&!ne.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(re.ownLast)for(e in t)return ne.call(t,e);for(e in t);return void 0===e||ne.call(t,e)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?te[ee.call(t)]||"object":typeof t},globalEval:function(t){t&&oe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(t){return t.replace(se,"ms-").replace(le,ue)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var i,o=0,a=t.length,s=r(t);if(n)if(s)for(;a>o;o++){i=e.apply(t[o],n);if(i===!1)break}else for(o in t){i=e.apply(t[o],n);if(i===!1)break}else if(s)for(;a>o;o++){i=e.call(t[o],o,t[o]);if(i===!1)break}else for(o in t){i=e.call(t[o],o,t[o]);if(i===!1)break}return t},trim:function(t){return null==t?"":(t+"").replace(ae,"")},makeArray:function(t,e){var n=e||[];null!=t&&(r(Object(t))?oe.merge(n,"string"==typeof t?[t]:t):Z.call(n,t));return n},inArray:function(t,e,n){var r;if(e){if(Q)return Q.call(e,t,n);r=e.length;n=n?0>n?Math.max(0,r+n):n:0;for(;r>n;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;n>r;)t[i++]=e[r++];if(n!==n)for(;void 0!==e[r];)t[i++]=e[r++];t.length=i;return t},grep:function(t,e,n){for(var r,i=[],o=0,a=t.length,s=!n;a>o;o++){r=!e(t[o],o);r!==s&&i.push(t[o])}return i},map:function(t,e,n){var i,o=0,a=t.length,s=r(t),l=[];if(s)for(;a>o;o++){i=e(t[o],o,n);null!=i&&l.push(i)}else for(o in t){i=e(t[o],o,n);null!=i&&l.push(i)}return K.apply([],l)},guid:1,proxy:function(t,e){var n,r,i;if("string"==typeof e){i=t[e];e=t;t=i}if(!oe.isFunction(t))return void 0;n=J.call(arguments,2);r=function(){return t.apply(e||this,n.concat(J.call(arguments)))};r.guid=t.guid=t.guid||oe.guid++;return r},now:function(){return+new Date},support:re});oe.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){te["[object "+e+"]"]=e.toLowerCase()});var ce=function(t){function e(t,e,n,r){var i,o,a,s,l,u,f,d,p,g;(e?e.ownerDocument||e:W)!==E&&N(e);e=e||E;n=n||[];s=e.nodeType;if("string"!=typeof t||!t||1!==s&&9!==s&&11!==s)return n;if(!r&&I){if(11!==s&&(i=ye.exec(t)))if(a=i[1]){if(9===s){o=e.getElementById(a);if(!o||!o.parentNode)return n;if(o.id===a){n.push(o);return n}}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&R(e,o)&&o.id===a){n.push(o);return n}}else{if(i[2]){Z.apply(n,e.getElementsByTagName(t));return n}if((a=i[3])&&w.getElementsByClassName){Z.apply(n,e.getElementsByClassName(a));return n}}if(w.qsa&&(!P||!P.test(t))){d=f=F;p=e;g=1!==s&&t;if(1===s&&"object"!==e.nodeName.toLowerCase()){u=k(t);(f=e.getAttribute("id"))?d=f.replace(xe,"\\$&"):e.setAttribute("id",d);d="[id='"+d+"'] ";l=u.length;for(;l--;)u[l]=d+h(u[l]);p=be.test(t)&&c(e.parentNode)||e;g=u.join(",")}if(g)try{Z.apply(n,p.querySelectorAll(g));return n}catch(m){}finally{f||e.removeAttribute("id")}}}return M(t.replace(le,"$1"),e,n,r)}function n(){function t(n,r){e.push(n+" ")>C.cacheLength&&delete t[e.shift()];return t[n+" "]=r}var e=[];return t}function r(t){t[F]=!0;return t}function i(t){var e=E.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e);e=null}}function o(t,e){for(var n=t.split("|"),r=t.length;r--;)C.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||G)-(~t.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function l(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function u(t){return r(function(e){e=+e;return r(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function f(){}function h(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function d(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=q++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,a){var s,l,u=[z,o];if(a){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||i){l=e[F]||(e[F]={});if((s=l[r])&&s[0]===z&&s[1]===o)return u[2]=s[2];l[r]=u;if(u[2]=t(e,n,a))return!0}}}function p(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function g(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function m(t,e,n,r,i){for(var o,a=[],s=0,l=t.length,u=null!=e;l>s;s++)if((o=t[s])&&(!n||n(o,r,i))){a.push(o);u&&e.push(s)}return a}function v(t,e,n,i,o,a){i&&!i[F]&&(i=v(i));o&&!o[F]&&(o=v(o,a));return r(function(r,a,s,l){var u,c,f,h=[],d=[],p=a.length,v=r||g(e||"*",s.nodeType?[s]:s,[]),y=!t||!r&&e?v:m(v,h,t,s,l),b=n?o||(r?t:p||i)?[]:a:y;n&&n(y,b,s,l);if(i){u=m(b,d);i(u,[],s,l);c=u.length;for(;c--;)(f=u[c])&&(b[d[c]]=!(y[d[c]]=f))}if(r){if(o||t){if(o){u=[];c=b.length;for(;c--;)(f=b[c])&&u.push(y[c]=f);o(null,b=[],u,l)}c=b.length;for(;c--;)(f=b[c])&&(u=o?te(r,f):h[c])>-1&&(r[u]=!(a[u]=f))}}else{b=m(b===a?b.splice(p,b.length):b);o?o(null,a,b,l):Z.apply(a,b)}})}function y(t){for(var e,n,r,i=t.length,o=C.relative[t[0].type],a=o||C.relative[" "],s=o?1:0,l=d(function(t){return t===e},a,!0),u=d(function(t){return te(e,t)>-1},a,!0),c=[function(t,n,r){var i=!o&&(r||n!==D)||((e=n).nodeType?l(t,n,r):u(t,n,r));e=null;return i}];i>s;s++)if(n=C.relative[t[s].type])c=[d(p(c),n)];else{n=C.filter[t[s].type].apply(null,t[s].matches);if(n[F]){r=++s;for(;i>r&&!C.relative[t[r].type];r++);return v(s>1&&p(c),s>1&&h(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&y(t.slice(s,r)),i>r&&y(t=t.slice(r)),i>r&&h(t))}c.push(n)}return p(c)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,u){var c,f,h,d=0,p="0",g=r&&[],v=[],y=D,b=r||o&&C.find.TAG("*",u),x=z+=null==y?1:Math.random()||.1,w=b.length;u&&(D=a!==E&&a);for(;p!==w&&null!=(c=b[p]);p++){if(o&&c){f=0;for(;h=t[f++];)if(h(c,a,s)){l.push(c);break}u&&(z=x)}if(i){(c=!h&&c)&&d--;r&&g.push(c)}}d+=p;if(i&&p!==d){f=0;for(;h=n[f++];)h(g,v,a,s);if(r){if(d>0)for(;p--;)g[p]||v[p]||(v[p]=J.call(l));v=m(v)}Z.apply(l,v);u&&!r&&v.length>0&&d+n.length>1&&e.uniqueSort(l)}if(u){z=x;D=y}return g};return i?r(a):a}var x,w,C,S,T,k,_,M,D,L,A,N,E,j,I,P,H,O,R,F="sizzle"+1*new Date,W=t.document,z=0,q=0,U=n(),B=n(),V=n(),X=function(t,e){t===e&&(A=!0);return 0},G=1<<31,$={}.hasOwnProperty,Y=[],J=Y.pop,K=Y.push,Z=Y.push,Q=Y.slice,te=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},ee="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),he=new RegExp(ae),de=new RegExp("^"+ie+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+ee+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},ge=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,xe=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Ce=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Se=function(){N()};try{Z.apply(Y=Q.call(W.childNodes),W.childNodes);Y[W.childNodes.length].nodeType}catch(Te){Z={apply:Y.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}w=e.support={};T=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1};N=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:W;if(r===E||9!==r.nodeType||!r.documentElement)return E;E=r;j=r.documentElement;n=r.defaultView;n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Se,!1):n.attachEvent&&n.attachEvent("onunload",Se));I=!T(r);w.attributes=i(function(t){t.className="i";return!t.getAttribute("className")});w.getElementsByTagName=i(function(t){t.appendChild(r.createComment(""));return!t.getElementsByTagName("*").length});w.getElementsByClassName=ve.test(r.getElementsByClassName);w.getById=i(function(t){j.appendChild(t).id=F;return!r.getElementsByName||!r.getElementsByName(F).length});if(w.getById){C.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&I){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}};C.filter.ID=function(t){var e=t.replace(we,Ce);return function(t){return t.getAttribute("id")===e}}}else{delete C.find.ID;C.filter.ID=function(t){var e=t.replace(we,Ce);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}}C.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o};C.find.CLASS=w.getElementsByClassName&&function(t,e){return I?e.getElementsByClassName(t):void 0};H=[];P=[];if(w.qsa=ve.test(r.querySelectorAll)){i(function(t){j.appendChild(t).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\f]' msallowcapture=''><option selected=''></option></select>";t.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+ne+"*(?:''|\"\")");t.querySelectorAll("[selected]").length||P.push("\\["+ne+"*(?:value|"+ee+")");t.querySelectorAll("[id~="+F+"-]").length||P.push("~=");t.querySelectorAll(":checked").length||P.push(":checked");t.querySelectorAll("a#"+F+"+*").length||P.push(".#.+[+~]")});i(function(t){var e=r.createElement("input");e.setAttribute("type","hidden");t.appendChild(e).setAttribute("name","D");t.querySelectorAll("[name=d]").length&&P.push("name"+ne+"*[*^$|!~]?=");t.querySelectorAll(":enabled").length||P.push(":enabled",":disabled");t.querySelectorAll("*,:x");P.push(",.*:")})}(w.matchesSelector=ve.test(O=j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector||j.msMatchesSelector))&&i(function(t){w.disconnectedMatch=O.call(t,"div");O.call(t,"[s!='']:x");H.push("!=",ae)});P=P.length&&new RegExp(P.join("|"));H=H.length&&new RegExp(H.join("|"));e=ve.test(j.compareDocumentPosition);R=e||ve.test(j.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1};X=e?function(t,e){if(t===e){A=!0;return 0}var n=!t.compareDocumentPosition-!e.compareDocumentPosition;if(n)return n;n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1;return 1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===W&&R(W,t)?-1:e===r||e.ownerDocument===W&&R(W,e)?1:L?te(L,t)-te(L,e):0:4&n?-1:1}:function(t,e){if(t===e){A=!0;return 0}var n,i=0,o=t.parentNode,s=e.parentNode,l=[t],u=[e];if(!o||!s)return t===r?-1:e===r?1:o?-1:s?1:L?te(L,t)-te(L,e):0;if(o===s)return a(t,e);n=t;for(;n=n.parentNode;)l.unshift(n);n=e;for(;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?a(l[i],u[i]):l[i]===W?-1:u[i]===W?1:0};return r};e.matches=function(t,n){return e(t,null,null,n)};e.matchesSelector=function(t,n){(t.ownerDocument||t)!==E&&N(t);n=n.replace(fe,"='$1']");if(!(!w.matchesSelector||!I||H&&H.test(n)||P&&P.test(n)))try{var r=O.call(t,n);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,E,null,[t]).length>0};e.contains=function(t,e){(t.ownerDocument||t)!==E&&N(t);return R(t,e)};e.attr=function(t,e){(t.ownerDocument||t)!==E&&N(t);var n=C.attrHandle[e.toLowerCase()],r=n&&$.call(C.attrHandle,e.toLowerCase())?n(t,e,!I):void 0;return void 0!==r?r:w.attributes||!I?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null};e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)};e.uniqueSort=function(t){var e,n=[],r=0,i=0;A=!w.detectDuplicates;L=!w.sortStable&&t.slice(0);t.sort(X);if(A){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}L=null;return t};S=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=S(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=S(e);return n};C=e.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){t[1]=t[1].replace(we,Ce);t[3]=(t[3]||t[4]||t[5]||"").replace(we,Ce);"~="===t[2]&&(t[3]=" "+t[3]+" ");return t.slice(0,4)},CHILD:function(t){t[1]=t[1].toLowerCase();if("nth"===t[1].slice(0,3)){t[3]||e.error(t[0]);t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3]));t[5]=+(t[7]+t[8]||"odd"===t[3])}else t[3]&&e.error(t[0]);return t},PSEUDO:function(t){var e,n=!t[6]&&t[2];if(pe.CHILD.test(t[0]))return null;if(t[3])t[2]=t[4]||t[5]||"";else if(n&&he.test(n)&&(e=k(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)){t[0]=t[0].slice(0,e);t[2]=n.slice(0,e)}return t.slice(0,3)}},filter:{TAG:function(t){var e=t.replace(we,Ce).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=U[t+" "];return e||(e=new RegExp("(^|"+ne+")"+t+"("+ne+"|$)"))&&U(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"") })},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);if(null==o)return"!="===n;if(!n)return!0;o+="";return"="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,f,h,d,p,g=o!==a?"nextSibling":"previousSibling",m=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!l&&!s;if(m){if(o){for(;g;){f=e;for(;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}p=[a?m.firstChild:m.lastChild];if(a&&y){c=m[F]||(m[F]={});u=c[t]||[];d=u[0]===z&&u[1];h=u[0]===z&&u[2];f=d&&m.childNodes[d];for(;f=++d&&f&&f[g]||(h=d=0)||p.pop();)if(1===f.nodeType&&++h&&f===e){c[t]=[z,d,h];break}}else if(y&&(u=(e[F]||(e[F]={}))[t])&&u[0]===z)h=u[1];else for(;f=++d&&f&&f[g]||(h=d=0)||p.pop();)if((s?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++h){y&&((f[F]||(f[F]={}))[t]=[z,h]);if(f===e)break}h-=i;return h===r||h%r===0&&h/r>=0}}},PSEUDO:function(t,n){var i,o=C.pseudos[t]||C.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);if(o[F])return o(n);if(o.length>1){i=[t,t,"",n];return C.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),a=i.length;a--;){r=te(t,i[a]);t[r]=!(e[r]=i[a])}}):function(t){return o(t,0,i)}}return o}},pseudos:{not:r(function(t){var e=[],n=[],i=_(t.replace(le,"$1"));return i[F]?r(function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,r,o){e[0]=t;i(e,null,o,n);e[0]=null;return!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){t=t.replace(we,Ce);return function(e){return(e.textContent||e.innerText||S(e)).indexOf(t)>-1}}),lang:r(function(t){de.test(t||"")||e.error("unsupported lang: "+t);t=t.replace(we,Ce).toLowerCase();return function(e){var n;do if(n=I?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang")){n=n.toLowerCase();return n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===j},focus:function(t){return t===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){t.parentNode&&t.parentNode.selectedIndex;return t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!C.pseudos.empty(t)},header:function(t){return me.test(t.nodeName)},input:function(t){return ge.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,n){return[0>n?n+e:n]}),even:u(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:u(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:u(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:u(function(t,e,n){for(var r=0>n?n+e:n;++r<e;)t.push(r);return t})}};C.pseudos.nth=C.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[x]=s(x);for(x in{submit:!0,reset:!0})C.pseudos[x]=l(x);f.prototype=C.filters=C.pseudos;C.setFilters=new f;k=e.tokenize=function(t,n){var r,i,o,a,s,l,u,c=B[t+" "];if(c)return n?0:c.slice(0);s=t;l=[];u=C.preFilter;for(;s;){if(!r||(i=ue.exec(s))){i&&(s=s.slice(i[0].length)||s);l.push(o=[])}r=!1;if(i=ce.exec(s)){r=i.shift();o.push({value:r,type:i[0].replace(le," ")});s=s.slice(r.length)}for(a in C.filter)if((i=pe[a].exec(s))&&(!u[a]||(i=u[a](i)))){r=i.shift();o.push({value:r,type:a,matches:i});s=s.slice(r.length)}if(!r)break}return n?s.length:s?e.error(t):B(t,l).slice(0)};_=e.compile=function(t,e){var n,r=[],i=[],o=V[t+" "];if(!o){e||(e=k(t));n=e.length;for(;n--;){o=y(e[n]);o[F]?r.push(o):i.push(o)}o=V(t,b(i,r));o.selector=t}return o};M=e.select=function(t,e,n,r){var i,o,a,s,l,u="function"==typeof t&&t,f=!r&&k(t=u.selector||t);n=n||[];if(1===f.length){o=f[0]=f[0].slice(0);if(o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===e.nodeType&&I&&C.relative[o[1].type]){e=(C.find.ID(a.matches[0].replace(we,Ce),e)||[])[0];if(!e)return n;u&&(e=e.parentNode);t=t.slice(o.shift().value.length)}i=pe.needsContext.test(t)?0:o.length;for(;i--;){a=o[i];if(C.relative[s=a.type])break;if((l=C.find[s])&&(r=l(a.matches[0].replace(we,Ce),be.test(o[0].type)&&c(e.parentNode)||e))){o.splice(i,1);t=r.length&&h(o);if(!t){Z.apply(n,r);return n}break}}}(u||_(t,f))(r,e,!I,n,be.test(t)&&c(e.parentNode)||e);return n};w.sortStable=F.split("").sort(X).join("")===F;w.detectDuplicates=!!A;N();w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(E.createElement("div"))});i(function(t){t.innerHTML="<a href='#'></a>";return"#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)});w.attributes&&i(function(t){t.innerHTML="<input/>";t.firstChild.setAttribute("value","");return""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue});i(function(t){return null==t.getAttribute("disabled")})||o(ee,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null});return e}(e);oe.find=ce;oe.expr=ce.selectors;oe.expr[":"]=oe.expr.pseudos;oe.unique=ce.uniqueSort;oe.text=ce.getText;oe.isXMLDoc=ce.isXML;oe.contains=ce.contains;var fe=oe.expr.match.needsContext,he=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;oe.filter=function(t,e,n){var r=e[0];n&&(t=":not("+t+")");return 1===e.length&&1===r.nodeType?oe.find.matchesSelector(r,t)?[r]:[]:oe.find.matches(t,oe.grep(e,function(t){return 1===t.nodeType}))};oe.fn.extend({find:function(t){var e,n=[],r=this,i=r.length;if("string"!=typeof t)return this.pushStack(oe(t).filter(function(){for(e=0;i>e;e++)if(oe.contains(r[e],this))return!0}));for(e=0;i>e;e++)oe.find(t,r[e],n);n=this.pushStack(i>1?oe.unique(n):n);n.selector=this.selector?this.selector+" "+t:t;return n},filter:function(t){return this.pushStack(i(this,t||[],!1))},not:function(t){return this.pushStack(i(this,t||[],!0))},is:function(t){return!!i(this,"string"==typeof t&&fe.test(t)?oe(t):t||[],!1).length}});var pe,ge=e.document,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ve=oe.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:me.exec(t);if(!n||!n[1]&&e)return!e||e.jquery?(e||pe).find(t):this.constructor(e).find(t);if(n[1]){e=e instanceof oe?e[0]:e;oe.merge(this,oe.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:ge,!0));if(he.test(n[1])&&oe.isPlainObject(e))for(n in e)oe.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}r=ge.getElementById(n[2]);if(r&&r.parentNode){if(r.id!==n[2])return pe.find(t);this.length=1;this[0]=r}this.context=ge;this.selector=t;return this}if(t.nodeType){this.context=this[0]=t;this.length=1;return this}if(oe.isFunction(t))return"undefined"!=typeof pe.ready?pe.ready(t):t(oe);if(void 0!==t.selector){this.selector=t.selector;this.context=t.context}return oe.makeArray(t,this)};ve.prototype=oe.fn;pe=oe(ge);var ye=/^(?:parents|prev(?:Until|All))/,be={children:!0,contents:!0,next:!0,prev:!0};oe.extend({dir:function(t,e,n){for(var r=[],i=t[e];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!oe(i).is(n));){1===i.nodeType&&r.push(i);i=i[e]}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});oe.fn.extend({has:function(t){var e,n=oe(t,this),r=n.length;return this.filter(function(){for(e=0;r>e;e++)if(oe.contains(this,n[e]))return!0})},closest:function(t,e){for(var n,r=0,i=this.length,o=[],a=fe.test(t)||"string"!=typeof t?oe(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&oe.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?oe.unique(o):o)},index:function(t){return t?"string"==typeof t?oe.inArray(this[0],oe(t)):oe.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(oe.unique(oe.merge(this.get(),oe(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}});oe.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return oe.dir(t,"parentNode")},parentsUntil:function(t,e,n){return oe.dir(t,"parentNode",n)},next:function(t){return o(t,"nextSibling")},prev:function(t){return o(t,"previousSibling")},nextAll:function(t){return oe.dir(t,"nextSibling")},prevAll:function(t){return oe.dir(t,"previousSibling")},nextUntil:function(t,e,n){return oe.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return oe.dir(t,"previousSibling",n)},siblings:function(t){return oe.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return oe.sibling(t.firstChild)},contents:function(t){return oe.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:oe.merge([],t.childNodes)}},function(t,e){oe.fn[t]=function(n,r){var i=oe.map(this,e,n);"Until"!==t.slice(-5)&&(r=n);r&&"string"==typeof r&&(i=oe.filter(r,i));if(this.length>1){be[t]||(i=oe.unique(i));ye.test(t)&&(i=i.reverse())}return this.pushStack(i)}});var xe=/\S+/g,we={};oe.Callbacks=function(t){t="string"==typeof t?we[t]||a(t):oe.extend({},t);var e,n,r,i,o,s,l=[],u=!t.once&&[],c=function(a){n=t.memory&&a;r=!0;o=s||0;s=0;i=l.length;e=!0;for(;l&&i>o;o++)if(l[o].apply(a[0],a[1])===!1&&t.stopOnFalse){n=!1;break}e=!1;l&&(u?u.length&&c(u.shift()):n?l=[]:f.disable())},f={add:function(){if(l){var r=l.length;(function o(e){oe.each(e,function(e,n){var r=oe.type(n);"function"===r?t.unique&&f.has(n)||l.push(n):n&&n.length&&"string"!==r&&o(n)})})(arguments);if(e)i=l.length;else if(n){s=r;c(n)}}return this},remove:function(){l&&oe.each(arguments,function(t,n){for(var r;(r=oe.inArray(n,l,r))>-1;){l.splice(r,1);if(e){i>=r&&i--;o>=r&&o--}}});return this},has:function(t){return t?oe.inArray(t,l)>-1:!(!l||!l.length)},empty:function(){l=[];i=0;return this},disable:function(){l=u=n=void 0;return this},disabled:function(){return!l},lock:function(){u=void 0;n||f.disable();return this},locked:function(){return!u},fireWith:function(t,n){if(l&&(!r||u)){n=n||[];n=[t,n.slice?n.slice():n];e?u.push(n):c(n)}return this},fire:function(){f.fireWith(this,arguments);return this},fired:function(){return!!r}};return f};oe.extend({Deferred:function(t){var e=[["resolve","done",oe.Callbacks("once memory"),"resolved"],["reject","fail",oe.Callbacks("once memory"),"rejected"],["notify","progress",oe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var t=arguments;return oe.Deferred(function(n){oe.each(e,function(e,o){var a=oe.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&oe.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})});t=null}).promise()},promise:function(t){return null!=t?oe.extend(t,r):r}},i={};r.pipe=r.then;oe.each(e,function(t,o){var a=o[2],s=o[3];r[o[1]]=a.add;s&&a.add(function(){n=s},e[1^t][2].disable,e[2][2].lock);i[o[0]]=function(){i[o[0]+"With"](this===i?r:this,arguments);return this};i[o[0]+"With"]=a.fireWith});r.promise(i);t&&t.call(i,i);return i},when:function(t){var e,n,r,i=0,o=J.call(arguments),a=o.length,s=1!==a||t&&oe.isFunction(t.promise)?a:0,l=1===s?t:oe.Deferred(),u=function(t,n,r){return function(i){n[t]=this;r[t]=arguments.length>1?J.call(arguments):i;r===e?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1){e=new Array(a);n=new Array(a);r=new Array(a);for(;a>i;i++)o[i]&&oe.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,e)):--s}s||l.resolveWith(r,o);return l.promise()}});var Ce;oe.fn.ready=function(t){oe.ready.promise().done(t);return this};oe.extend({isReady:!1,readyWait:1,holdReady:function(t){t?oe.readyWait++:oe.ready(!0)},ready:function(t){if(t===!0?!--oe.readyWait:!oe.isReady){if(!ge.body)return setTimeout(oe.ready);oe.isReady=!0;if(!(t!==!0&&--oe.readyWait>0)){Ce.resolveWith(ge,[oe]);if(oe.fn.triggerHandler){oe(ge).triggerHandler("ready");oe(ge).off("ready")}}}}});oe.ready.promise=function(t){if(!Ce){Ce=oe.Deferred();if("complete"===ge.readyState)setTimeout(oe.ready);else if(ge.addEventListener){ge.addEventListener("DOMContentLoaded",l,!1);e.addEventListener("load",l,!1)}else{ge.attachEvent("onreadystatechange",l);e.attachEvent("onload",l);var n=!1;try{n=null==e.frameElement&&ge.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!oe.isReady){try{n.doScroll("left")}catch(t){return setTimeout(i,50)}s();oe.ready()}}()}}return Ce.promise(t)};var Se,Te="undefined";for(Se in oe(re))break;re.ownLast="0"!==Se;re.inlineBlockNeedsLayout=!1;oe(function(){var t,e,n,r;n=ge.getElementsByTagName("body")[0];if(n&&n.style){e=ge.createElement("div");r=ge.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);if(typeof e.style.zoom!==Te){e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";re.inlineBlockNeedsLayout=t=3===e.offsetWidth;t&&(n.style.zoom=1)}n.removeChild(r)}});(function(){var t=ge.createElement("div");if(null==re.deleteExpando){re.deleteExpando=!0;try{delete t.test}catch(e){re.deleteExpando=!1}}t=null})();oe.acceptData=function(t){var e=oe.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return 1!==n&&9!==n?!1:!e||e!==!0&&t.getAttribute("classid")===e};var ke=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;oe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){t=t.nodeType?oe.cache[t[oe.expando]]:t[oe.expando];return!!t&&!c(t)},data:function(t,e,n){return f(t,e,n)},removeData:function(t,e){return h(t,e)},_data:function(t,e,n){return f(t,e,n,!0)},_removeData:function(t,e){return h(t,e,!0)}});oe.fn.extend({data:function(t,e){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length){i=oe.data(o);if(1===o.nodeType&&!oe._data(o,"parsedAttrs")){n=a.length;for(;n--;)if(a[n]){r=a[n].name;if(0===r.indexOf("data-")){r=oe.camelCase(r.slice(5));u(o,r,i[r])}}oe._data(o,"parsedAttrs",!0)}}return i}return"object"==typeof t?this.each(function(){oe.data(this,t)}):arguments.length>1?this.each(function(){oe.data(this,t,e)}):o?u(o,t,oe.data(o,t)):void 0},removeData:function(t){return this.each(function(){oe.removeData(this,t)})}});oe.extend({queue:function(t,e,n){var r;if(t){e=(e||"fx")+"queue";r=oe._data(t,e);n&&(!r||oe.isArray(n)?r=oe._data(t,e,oe.makeArray(n)):r.push(n));return r||[]}},dequeue:function(t,e){e=e||"fx";var n=oe.queue(t,e),r=n.length,i=n.shift(),o=oe._queueHooks(t,e),a=function(){oe.dequeue(t,e)};if("inprogress"===i){i=n.shift();r--}if(i){"fx"===e&&n.unshift("inprogress");delete o.stop;i.call(t,a,o)}!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return oe._data(t,n)||oe._data(t,n,{empty:oe.Callbacks("once memory").add(function(){oe._removeData(t,e+"queue");oe._removeData(t,n)})})}});oe.fn.extend({queue:function(t,e){var n=2;if("string"!=typeof t){e=t;t="fx";n--}return arguments.length<n?oe.queue(this[0],t):void 0===e?this:this.each(function(){var n=oe.queue(this,t,e);oe._queueHooks(this,t);"fx"===t&&"inprogress"!==n[0]&&oe.dequeue(this,t)})},dequeue:function(t){return this.each(function(){oe.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=oe.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};if("string"!=typeof t){e=t;t=void 0}t=t||"fx";for(;a--;){n=oe._data(o[a],t+"queueHooks");if(n&&n.empty){r++;n.empty.add(s)}}s();return i.promise(e)}});var Me=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,De=["Top","Right","Bottom","Left"],Le=function(t,e){t=e||t;return"none"===oe.css(t,"display")||!oe.contains(t.ownerDocument,t)},Ae=oe.access=function(t,e,n,r,i,o,a){var s=0,l=t.length,u=null==n;if("object"===oe.type(n)){i=!0;for(s in n)oe.access(t,e,s,n[s],!0,o,a)}else if(void 0!==r){i=!0;oe.isFunction(r)||(a=!0);if(u)if(a){e.call(t,r);e=null}else{u=e;e=function(t,e,n){return u.call(oe(t),n)}}if(e)for(;l>s;s++)e(t[s],n,a?r:r.call(t[s],s,e(t[s],n)))}return i?t:u?e.call(t):l?e(t[0],n):o},Ne=/^(?:checkbox|radio)$/i;(function(){var t=ge.createElement("input"),e=ge.createElement("div"),n=ge.createDocumentFragment();e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";re.leadingWhitespace=3===e.firstChild.nodeType;re.tbody=!e.getElementsByTagName("tbody").length;re.htmlSerialize=!!e.getElementsByTagName("link").length;re.html5Clone="<:nav></:nav>"!==ge.createElement("nav").cloneNode(!0).outerHTML;t.type="checkbox";t.checked=!0;n.appendChild(t);re.appendChecked=t.checked;e.innerHTML="<textarea>x</textarea>";re.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue;n.appendChild(e);e.innerHTML="<input type='radio' checked='checked' name='t'/>";re.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked;re.noCloneEvent=!0;if(e.attachEvent){e.attachEvent("onclick",function(){re.noCloneEvent=!1});e.cloneNode(!0).click()}if(null==re.deleteExpando){re.deleteExpando=!0;try{delete e.test}catch(r){re.deleteExpando=!1}}})();(function(){var t,n,r=ge.createElement("div");for(t in{submit:!0,change:!0,focusin:!0}){n="on"+t;if(!(re[t+"Bubbles"]=n in e)){r.setAttribute(n,"t");re[t+"Bubbles"]=r.attributes[n].expando===!1}}r=null})();var Ee=/^(?:input|select|textarea)$/i,je=/^key/,Ie=/^(?:mouse|pointer|contextmenu)|click/,Pe=/^(?:focusinfocus|focusoutblur)$/,He=/^([^.]*)(?:\.(.+)|)$/;oe.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,u,c,f,h,d,p,g,m=oe._data(t);if(m){if(n.handler){l=n;n=l.handler;i=l.selector}n.guid||(n.guid=oe.guid++);(a=m.events)||(a=m.events={});if(!(c=m.handle)){c=m.handle=function(t){return typeof oe===Te||t&&oe.event.triggered===t.type?void 0:oe.event.dispatch.apply(c.elem,arguments)};c.elem=t}e=(e||"").match(xe)||[""];s=e.length;for(;s--;){o=He.exec(e[s])||[];d=g=o[1];p=(o[2]||"").split(".").sort();if(d){u=oe.event.special[d]||{};d=(i?u.delegateType:u.bindType)||d;u=oe.event.special[d]||{};f=oe.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&oe.expr.match.needsContext.test(i),namespace:p.join(".")},l);if(!(h=a[d])){h=a[d]=[];h.delegateCount=0;u.setup&&u.setup.call(t,r,p,c)!==!1||(t.addEventListener?t.addEventListener(d,c,!1):t.attachEvent&&t.attachEvent("on"+d,c))}if(u.add){u.add.call(t,f);f.handler.guid||(f.handler.guid=n.guid)}i?h.splice(h.delegateCount++,0,f):h.push(f);oe.event.global[d]=!0}}t=null}},remove:function(t,e,n,r,i){var o,a,s,l,u,c,f,h,d,p,g,m=oe.hasData(t)&&oe._data(t);if(m&&(c=m.events)){e=(e||"").match(xe)||[""];u=e.length;for(;u--;){s=He.exec(e[u])||[];d=g=s[1];p=(s[2]||"").split(".").sort();if(d){f=oe.event.special[d]||{};d=(r?f.delegateType:f.bindType)||d;h=c[d]||[];s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)");l=o=h.length;for(;o--;){a=h[o];if(!(!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector))){h.splice(o,1);a.selector&&h.delegateCount--;f.remove&&f.remove.call(t,a)}}if(l&&!h.length){f.teardown&&f.teardown.call(t,p,m.handle)!==!1||oe.removeEvent(t,d,m.handle);delete c[d]}}else for(d in c)oe.event.remove(t,d+e[u],n,r,!0)}if(oe.isEmptyObject(c)){delete m.handle;oe._removeData(t,"events")}}},trigger:function(t,n,r,i){var o,a,s,l,u,c,f,h=[r||ge],d=ne.call(t,"type")?t.type:t,p=ne.call(t,"namespace")?t.namespace.split("."):[];s=c=r=r||ge;if(3!==r.nodeType&&8!==r.nodeType&&!Pe.test(d+oe.event.triggered)){if(d.indexOf(".")>=0){p=d.split(".");d=p.shift();p.sort()}a=d.indexOf(":")<0&&"on"+d;t=t[oe.expando]?t:new oe.Event(d,"object"==typeof t&&t);t.isTrigger=i?2:3;t.namespace=p.join(".");t.namespace_re=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;t.result=void 0;t.target||(t.target=r);n=null==n?[t]:oe.makeArray(n,[t]);u=oe.event.special[d]||{};if(i||!u.trigger||u.trigger.apply(r,n)!==!1){if(!i&&!u.noBubble&&!oe.isWindow(r)){l=u.delegateType||d;Pe.test(l+d)||(s=s.parentNode);for(;s;s=s.parentNode){h.push(s);c=s}c===(r.ownerDocument||ge)&&h.push(c.defaultView||c.parentWindow||e)}f=0;for(;(s=h[f++])&&!t.isPropagationStopped();){t.type=f>1?l:u.bindType||d;o=(oe._data(s,"events")||{})[t.type]&&oe._data(s,"handle");o&&o.apply(s,n);o=a&&s[a];if(o&&o.apply&&oe.acceptData(s)){t.result=o.apply(s,n);t.result===!1&&t.preventDefault()}}t.type=d;if(!i&&!t.isDefaultPrevented()&&(!u._default||u._default.apply(h.pop(),n)===!1)&&oe.acceptData(r)&&a&&r[d]&&!oe.isWindow(r)){c=r[a];c&&(r[a]=null);oe.event.triggered=d;try{r[d]()}catch(g){}oe.event.triggered=void 0;c&&(r[a]=c)}return t.result}}},dispatch:function(t){t=oe.event.fix(t);var e,n,r,i,o,a=[],s=J.call(arguments),l=(oe._data(this,"events")||{})[t.type]||[],u=oe.event.special[t.type]||{};s[0]=t;t.delegateTarget=this;if(!u.preDispatch||u.preDispatch.call(this,t)!==!1){a=oe.event.handlers.call(this,t,l);e=0;for(;(i=a[e++])&&!t.isPropagationStopped();){t.currentTarget=i.elem;o=0;for(;(r=i.handlers[o++])&&!t.isImmediatePropagationStopped();)if(!t.namespace_re||t.namespace_re.test(r.namespace)){t.handleObj=r;t.data=r.data;n=((oe.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,s);if(void 0!==n&&(t.result=n)===!1){t.preventDefault();t.stopPropagation()}}}u.postDispatch&&u.postDispatch.call(this,t);return t.result}},handlers:function(t,e){var n,r,i,o,a=[],s=e.delegateCount,l=t.target;if(s&&l.nodeType&&(!t.button||"click"!==t.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==t.type)){i=[];for(o=0;s>o;o++){r=e[o];n=r.selector+" ";void 0===i[n]&&(i[n]=r.needsContext?oe(n,this).index(l)>=0:oe.find(n,this,null,[l]).length);i[n]&&i.push(r)}i.length&&a.push({elem:l,handlers:i})}s<e.length&&a.push({elem:this,handlers:e.slice(s)});return a},fix:function(t){if(t[oe.expando])return t;var e,n,r,i=t.type,o=t,a=this.fixHooks[i];a||(this.fixHooks[i]=a=Ie.test(i)?this.mouseHooks:je.test(i)?this.keyHooks:{});r=a.props?this.props.concat(a.props):this.props;t=new oe.Event(o);e=r.length;for(;e--;){n=r[e];t[n]=o[n]}t.target||(t.target=o.srcElement||ge);3===t.target.nodeType&&(t.target=t.target.parentNode);t.metaKey=!!t.metaKey;return a.filter?a.filter(t,o):t},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode);return t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,r,i,o=e.button,a=e.fromElement;if(null==t.pageX&&null!=e.clientX){r=t.target.ownerDocument||ge;i=r.documentElement;n=r.body;t.pageX=e.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0);t.pageY=e.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)}!t.relatedTarget&&a&&(t.relatedTarget=a===t.target?e.toElement:a);t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0);return t}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)try{this.focus();return!1}catch(t){}},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur){this.blur();return!1}},delegateType:"focusout"},click:{trigger:function(){if(oe.nodeName(this,"input")&&"checkbox"===this.type&&this.click){this.click();return!1}},_default:function(t){return oe.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var i=oe.extend(new oe.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?oe.event.trigger(i,null,e):oe.event.dispatch.call(e,i);i.isDefaultPrevented()&&n.preventDefault()}};oe.removeEvent=ge.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){var r="on"+e;if(t.detachEvent){typeof t[r]===Te&&(t[r]=null);t.detachEvent(r,n)}};oe.Event=function(t,e){if(!(this instanceof oe.Event))return new oe.Event(t,e);if(t&&t.type){this.originalEvent=t;this.type=t.type;this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?d:p}else this.type=t;e&&oe.extend(this,e);this.timeStamp=t&&t.timeStamp||oe.now();this[oe.expando]=!0};oe.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=d;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=d;if(t){t.stopPropagation&&t.stopPropagation();t.cancelBubble=!0}},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=d;t&&t.stopImmediatePropagation&&t.stopImmediatePropagation();this.stopPropagation()}};oe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){oe.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;if(!i||i!==r&&!oe.contains(r,i)){t.type=o.origType;n=o.handler.apply(this,arguments);t.type=e}return n}}});re.submitBubbles||(oe.event.special.submit={setup:function(){if(oe.nodeName(this,"form"))return!1;oe.event.add(this,"click._submit keypress._submit",function(t){var e=t.target,n=oe.nodeName(e,"input")||oe.nodeName(e,"button")?e.form:void 0;if(n&&!oe._data(n,"submitBubbles")){oe.event.add(n,"submit._submit",function(t){t._submit_bubble=!0});oe._data(n,"submitBubbles",!0)}});return void 0},postDispatch:function(t){if(t._submit_bubble){delete t._submit_bubble;this.parentNode&&!t.isTrigger&&oe.event.simulate("submit",this.parentNode,t,!0)}},teardown:function(){if(oe.nodeName(this,"form"))return!1;oe.event.remove(this,"._submit");return void 0}});re.changeBubbles||(oe.event.special.change={setup:function(){if(Ee.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type){oe.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)});oe.event.add(this,"click._change",function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1);oe.event.simulate("change",this,t,!0)})}return!1}oe.event.add(this,"beforeactivate._change",function(t){var e=t.target;if(Ee.test(e.nodeName)&&!oe._data(e,"changeBubbles")){oe.event.add(e,"change._change",function(t){!this.parentNode||t.isSimulated||t.isTrigger||oe.event.simulate("change",this.parentNode,t,!0)});oe._data(e,"changeBubbles",!0)}})},handle:function(t){var e=t.target;return this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type?t.handleObj.handler.apply(this,arguments):void 0},teardown:function(){oe.event.remove(this,"._change");return!Ee.test(this.nodeName)}});re.focusinBubbles||oe.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){oe.event.simulate(e,t.target,oe.event.fix(t),!0)};oe.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=oe._data(r,e);i||r.addEventListener(t,n,!0);oe._data(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=oe._data(r,e)-1;if(i)oe._data(r,e,i);else{r.removeEventListener(t,n,!0);oe._removeData(r,e)}}}});oe.fn.extend({on:function(t,e,n,r,i){var o,a;if("object"==typeof t){if("string"!=typeof e){n=n||e;e=void 0}for(o in t)this.on(o,e,n,t[o],i);return this}if(null==n&&null==r){r=e;n=e=void 0}else if(null==r)if("string"==typeof e){r=n;n=void 0}else{r=n;n=e;e=void 0}if(r===!1)r=p;else if(!r)return this;if(1===i){a=r;r=function(t){oe().off(t);return a.apply(this,arguments)};r.guid=a.guid||(a.guid=oe.guid++)}return this.each(function(){oe.event.add(this,t,r,n,e)})},one:function(t,e,n,r){return this.on(t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj){r=t.handleObj;oe(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler);return this}if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}if(e===!1||"function"==typeof e){n=e;e=void 0}n===!1&&(n=p);return this.each(function(){oe.event.remove(this,t,n,e)})},trigger:function(t,e){return this.each(function(){oe.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];return n?oe.event.trigger(t,e,n,!0):void 0}});var Oe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Re=/ jQuery\d+="(?:null|\d+)"/g,Fe=new RegExp("<(?:"+Oe+")[\\s/>]","i"),We=/^\s+/,ze=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,qe=/<([\w:]+)/,Ue=/<tbody/i,Be=/<|&#?\w+;/,Ve=/<(?:script|style|link)/i,Xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ge=/^$|\/(?:java|ecma)script/i,$e=/^true\/(.*)/,Ye=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Je={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:re.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Ke=m(ge),Ze=Ke.appendChild(ge.createElement("div"));Je.optgroup=Je.option;Je.tbody=Je.tfoot=Je.colgroup=Je.caption=Je.thead;Je.th=Je.td;oe.extend({clone:function(t,e,n){var r,i,o,a,s,l=oe.contains(t.ownerDocument,t);if(re.html5Clone||oe.isXMLDoc(t)||!Fe.test("<"+t.nodeName+">"))o=t.cloneNode(!0);else{Ze.innerHTML=t.outerHTML;Ze.removeChild(o=Ze.firstChild)}if(!(re.noCloneEvent&&re.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||oe.isXMLDoc(t))){r=v(o);s=v(t);for(a=0;null!=(i=s[a]);++a)r[a]&&T(i,r[a])}if(e)if(n){s=s||v(t);r=r||v(o);for(a=0;null!=(i=s[a]);a++)S(i,r[a])}else S(t,o);r=v(o,"script");r.length>0&&C(r,!l&&v(t,"script"));r=s=i=null;return o},buildFragment:function(t,e,n,r){for(var i,o,a,s,l,u,c,f=t.length,h=m(e),d=[],p=0;f>p;p++){o=t[p];if(o||0===o)if("object"===oe.type(o))oe.merge(d,o.nodeType?[o]:o);else if(Be.test(o)){s=s||h.appendChild(e.createElement("div"));l=(qe.exec(o)||["",""])[1].toLowerCase();c=Je[l]||Je._default;s.innerHTML=c[1]+o.replace(ze,"<$1></$2>")+c[2];i=c[0];for(;i--;)s=s.lastChild;!re.leadingWhitespace&&We.test(o)&&d.push(e.createTextNode(We.exec(o)[0]));if(!re.tbody){o="table"!==l||Ue.test(o)?"<table>"!==c[1]||Ue.test(o)?0:s:s.firstChild;i=o&&o.childNodes.length;for(;i--;)oe.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}oe.merge(d,s.childNodes);s.textContent="";for(;s.firstChild;)s.removeChild(s.firstChild);s=h.lastChild}else d.push(e.createTextNode(o))}s&&h.removeChild(s);re.appendChecked||oe.grep(v(d,"input"),y);p=0;for(;o=d[p++];)if(!r||-1===oe.inArray(o,r)){a=oe.contains(o.ownerDocument,o);s=v(h.appendChild(o),"script");a&&C(s);if(n){i=0;for(;o=s[i++];)Ge.test(o.type||"")&&n.push(o)}}s=null;return h},cleanData:function(t,e){for(var n,r,i,o,a=0,s=oe.expando,l=oe.cache,u=re.deleteExpando,c=oe.event.special;null!=(n=t[a]);a++)if(e||oe.acceptData(n)){i=n[s];o=i&&l[i];if(o){if(o.events)for(r in o.events)c[r]?oe.event.remove(n,r):oe.removeEvent(n,r,o.handle); if(l[i]){delete l[i];u?delete n[s]:typeof n.removeAttribute!==Te?n.removeAttribute(s):n[s]=null;Y.push(i)}}}}});oe.fn.extend({text:function(t){return Ae(this,function(t){return void 0===t?oe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ge).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=b(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=b(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?oe.filter(t,this):this,i=0;null!=(n=r[i]);i++){e||1!==n.nodeType||oe.cleanData(v(n));if(n.parentNode){e&&oe.contains(n.ownerDocument,n)&&C(v(n,"script"));n.parentNode.removeChild(n)}}return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){1===t.nodeType&&oe.cleanData(v(t,!1));for(;t.firstChild;)t.removeChild(t.firstChild);t.options&&oe.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){t=null==t?!1:t;e=null==e?t:e;return this.map(function(){return oe.clone(this,t,e)})},html:function(t){return Ae(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Re,""):void 0;if(!("string"!=typeof t||Ve.test(t)||!re.htmlSerialize&&Fe.test(t)||!re.leadingWhitespace&&We.test(t)||Je[(qe.exec(t)||["",""])[1].toLowerCase()])){t=t.replace(ze,"<$1></$2>");try{for(;r>n;n++){e=this[n]||{};if(1===e.nodeType){oe.cleanData(v(e,!1));e.innerHTML=t}}e=0}catch(i){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];this.domManip(arguments,function(e){t=this.parentNode;oe.cleanData(v(this));t&&t.replaceChild(e,this)});return t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=K.apply([],t);var n,r,i,o,a,s,l=0,u=this.length,c=this,f=u-1,h=t[0],d=oe.isFunction(h);if(d||u>1&&"string"==typeof h&&!re.checkClone&&Xe.test(h))return this.each(function(n){var r=c.eq(n);d&&(t[0]=h.call(this,n,r.html()));r.domManip(t,e)});if(u){s=oe.buildFragment(t,this[0].ownerDocument,!1,this);n=s.firstChild;1===s.childNodes.length&&(s=n);if(n){o=oe.map(v(s,"script"),x);i=o.length;for(;u>l;l++){r=s;if(l!==f){r=oe.clone(r,!0,!0);i&&oe.merge(o,v(r,"script"))}e.call(this[l],r,l)}if(i){a=o[o.length-1].ownerDocument;oe.map(o,w);for(l=0;i>l;l++){r=o[l];Ge.test(r.type||"")&&!oe._data(r,"globalEval")&&oe.contains(a,r)&&(r.src?oe._evalUrl&&oe._evalUrl(r.src):oe.globalEval((r.text||r.textContent||r.innerHTML||"").replace(Ye,"")))}}s=n=null}}return this}});oe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){oe.fn[t]=function(t){for(var n,r=0,i=[],o=oe(t),a=o.length-1;a>=r;r++){n=r===a?this:this.clone(!0);oe(o[r])[e](n);Z.apply(i,n.get())}return this.pushStack(i)}});var Qe,tn={};(function(){var t;re.shrinkWrapBlocks=function(){if(null!=t)return t;t=!1;var e,n,r;n=ge.getElementsByTagName("body")[0];if(n&&n.style){e=ge.createElement("div");r=ge.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);if(typeof e.style.zoom!==Te){e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1";e.appendChild(ge.createElement("div")).style.width="5px";t=3!==e.offsetWidth}n.removeChild(r);return t}}})();var en,nn,rn=/^margin/,on=new RegExp("^("+Me+")(?!px)[a-z%]+$","i"),an=/^(top|right|bottom|left)$/;if(e.getComputedStyle){en=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};nn=function(t,e,n){var r,i,o,a,s=t.style;n=n||en(t);a=n?n.getPropertyValue(e)||n[e]:void 0;if(n){""!==a||oe.contains(t.ownerDocument,t)||(a=oe.style(t,e));if(on.test(a)&&rn.test(e)){r=s.width;i=s.minWidth;o=s.maxWidth;s.minWidth=s.maxWidth=s.width=a;a=n.width;s.width=r;s.minWidth=i;s.maxWidth=o}}return void 0===a?a:a+""}}else if(ge.documentElement.currentStyle){en=function(t){return t.currentStyle};nn=function(t,e,n){var r,i,o,a,s=t.style;n=n||en(t);a=n?n[e]:void 0;null==a&&s&&s[e]&&(a=s[e]);if(on.test(a)&&!an.test(e)){r=s.left;i=t.runtimeStyle;o=i&&i.left;o&&(i.left=t.currentStyle.left);s.left="fontSize"===e?"1em":a;a=s.pixelLeft+"px";s.left=r;o&&(i.left=o)}return void 0===a?a:a+""||"auto"}}(function(){function t(){var t,n,r,i;n=ge.getElementsByTagName("body")[0];if(n&&n.style){t=ge.createElement("div");r=ge.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(t);t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";o=a=!1;l=!0;if(e.getComputedStyle){o="1%"!==(e.getComputedStyle(t,null)||{}).top;a="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width;i=t.appendChild(ge.createElement("div"));i.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0";i.style.marginRight=i.style.width="0";t.style.width="1px";l=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight);t.removeChild(i)}t.innerHTML="<table><tr><td></td><td>t</td></tr></table>";i=t.getElementsByTagName("td");i[0].style.cssText="margin:0;border:0;padding:0;display:none";s=0===i[0].offsetHeight;if(s){i[0].style.display="";i[1].style.display="none";s=0===i[0].offsetHeight}n.removeChild(r)}}var n,r,i,o,a,s,l;n=ge.createElement("div");n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";i=n.getElementsByTagName("a")[0];r=i&&i.style;if(r){r.cssText="float:left;opacity:.5";re.opacity="0.5"===r.opacity;re.cssFloat=!!r.cssFloat;n.style.backgroundClip="content-box";n.cloneNode(!0).style.backgroundClip="";re.clearCloneStyle="content-box"===n.style.backgroundClip;re.boxSizing=""===r.boxSizing||""===r.MozBoxSizing||""===r.WebkitBoxSizing;oe.extend(re,{reliableHiddenOffsets:function(){null==s&&t();return s},boxSizingReliable:function(){null==a&&t();return a},pixelPosition:function(){null==o&&t();return o},reliableMarginRight:function(){null==l&&t();return l}})}})();oe.swap=function(t,e,n,r){var i,o,a={};for(o in e){a[o]=t.style[o];t.style[o]=e[o]}i=n.apply(t,r||[]);for(o in e)t.style[o]=a[o];return i};var sn=/alpha\([^)]*\)/i,ln=/opacity\s*=\s*([^)]*)/,un=/^(none|table(?!-c[ea]).+)/,cn=new RegExp("^("+Me+")(.*)$","i"),fn=new RegExp("^([+-])=("+Me+")","i"),hn={position:"absolute",visibility:"hidden",display:"block"},dn={letterSpacing:"0",fontWeight:"400"},pn=["Webkit","O","Moz","ms"];oe.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=nn(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":re.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=oe.camelCase(e),l=t.style;e=oe.cssProps[s]||(oe.cssProps[s]=D(l,s));a=oe.cssHooks[e]||oe.cssHooks[s];if(void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:l[e];o=typeof n;if("string"===o&&(i=fn.exec(n))){n=(i[1]+1)*i[2]+parseFloat(oe.css(t,e));o="number"}if(null!=n&&n===n){"number"!==o||oe.cssNumber[s]||(n+="px");re.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit");if(!(a&&"set"in a&&void 0===(n=a.set(t,n,r))))try{l[e]=n}catch(u){}}}},css:function(t,e,n,r){var i,o,a,s=oe.camelCase(e);e=oe.cssProps[s]||(oe.cssProps[s]=D(t.style,s));a=oe.cssHooks[e]||oe.cssHooks[s];a&&"get"in a&&(o=a.get(t,!0,n));void 0===o&&(o=nn(t,e,r));"normal"===o&&e in dn&&(o=dn[e]);if(""===n||n){i=parseFloat(o);return n===!0||oe.isNumeric(i)?i||0:o}return o}});oe.each(["height","width"],function(t,e){oe.cssHooks[e]={get:function(t,n,r){return n?un.test(oe.css(t,"display"))&&0===t.offsetWidth?oe.swap(t,hn,function(){return E(t,e,r)}):E(t,e,r):void 0},set:function(t,n,r){var i=r&&en(t);return A(t,n,r?N(t,e,r,re.boxSizing&&"border-box"===oe.css(t,"boxSizing",!1,i),i):0)}}});re.opacity||(oe.cssHooks.opacity={get:function(t,e){return ln.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,r=t.currentStyle,i=oe.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if((e>=1||""===e)&&""===oe.trim(o.replace(sn,""))&&n.removeAttribute){n.removeAttribute("filter");if(""===e||r&&!r.filter)return}n.filter=sn.test(o)?o.replace(sn,i):o+" "+i}});oe.cssHooks.marginRight=M(re.reliableMarginRight,function(t,e){return e?oe.swap(t,{display:"inline-block"},nn,[t,"marginRight"]):void 0});oe.each({margin:"",padding:"",border:"Width"},function(t,e){oe.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[t+De[r]+e]=o[r]||o[r-2]||o[0];return i}};rn.test(t)||(oe.cssHooks[t+e].set=A)});oe.fn.extend({css:function(t,e){return Ae(this,function(t,e,n){var r,i,o={},a=0;if(oe.isArray(e)){r=en(t);i=e.length;for(;i>a;a++)o[e[a]]=oe.css(t,e[a],!1,r);return o}return void 0!==n?oe.style(t,e,n):oe.css(t,e)},t,e,arguments.length>1)},show:function(){return L(this,!0)},hide:function(){return L(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Le(this)?oe(this).show():oe(this).hide()})}});oe.Tween=j;j.prototype={constructor:j,init:function(t,e,n,r,i,o){this.elem=t;this.prop=n;this.easing=i||"swing";this.options=e;this.start=this.now=this.cur();this.end=r;this.unit=o||(oe.cssNumber[n]?"":"px")},cur:function(){var t=j.propHooks[this.prop];return t&&t.get?t.get(this):j.propHooks._default.get(this)},run:function(t){var e,n=j.propHooks[this.prop];this.pos=e=this.options.duration?oe.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t;this.now=(this.end-this.start)*e+this.start;this.options.step&&this.options.step.call(this.elem,this.now,this);n&&n.set?n.set(this):j.propHooks._default.set(this);return this}};j.prototype.init.prototype=j.prototype;j.propHooks={_default:{get:function(t){var e;if(null!=t.elem[t.prop]&&(!t.elem.style||null==t.elem.style[t.prop]))return t.elem[t.prop];e=oe.css(t.elem,t.prop,"");return e&&"auto"!==e?e:0},set:function(t){oe.fx.step[t.prop]?oe.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[oe.cssProps[t.prop]]||oe.cssHooks[t.prop])?oe.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}};j.propHooks.scrollTop=j.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}};oe.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}};oe.fx=j.prototype.init;oe.fx.step={};var gn,mn,vn=/^(?:toggle|show|hide)$/,yn=new RegExp("^(?:([+-])=|)("+Me+")([a-z%]*)$","i"),bn=/queueHooks$/,xn=[O],wn={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),i=yn.exec(e),o=i&&i[3]||(oe.cssNumber[t]?"":"px"),a=(oe.cssNumber[t]||"px"!==o&&+r)&&yn.exec(oe.css(n.elem,t)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3];i=i||[];a=+r||1;do{s=s||".5";a/=s;oe.style(n.elem,t,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}if(i){a=n.start=+a||+r||0;n.unit=o;n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]}return n}]};oe.Animation=oe.extend(F,{tweener:function(t,e){if(oe.isFunction(t)){e=t;t=["*"]}else t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++){n=t[r];wn[n]=wn[n]||[];wn[n].unshift(e)}},prefilter:function(t,e){e?xn.unshift(t):xn.push(t)}});oe.speed=function(t,e,n){var r=t&&"object"==typeof t?oe.extend({},t):{complete:n||!n&&e||oe.isFunction(t)&&t,duration:t,easing:n&&e||e&&!oe.isFunction(e)&&e};r.duration=oe.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in oe.fx.speeds?oe.fx.speeds[r.duration]:oe.fx.speeds._default;(null==r.queue||r.queue===!0)&&(r.queue="fx");r.old=r.complete;r.complete=function(){oe.isFunction(r.old)&&r.old.call(this);r.queue&&oe.dequeue(this,r.queue)};return r};oe.fn.extend({fadeTo:function(t,e,n,r){return this.filter(Le).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=oe.isEmptyObject(t),o=oe.speed(e,n,r),a=function(){var e=F(this,oe.extend({},t),o);(i||oe._data(this,"finish"))&&e.stop(!0)};a.finish=a;return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop;e(n)};if("string"!=typeof t){n=e;e=t;t=void 0}e&&t!==!1&&this.queue(t||"fx",[]);return this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=oe.timers,a=oe._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&bn.test(i)&&r(a[i]);for(i=o.length;i--;)if(o[i].elem===this&&(null==t||o[i].queue===t)){o[i].anim.stop(n);e=!1;o.splice(i,1)}(e||!n)&&oe.dequeue(this,t)})},finish:function(t){t!==!1&&(t=t||"fx");return this.each(function(){var e,n=oe._data(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=oe.timers,a=r?r.length:0;n.finish=!0;oe.queue(this,t,[]);i&&i.stop&&i.stop.call(this,!0);for(e=o.length;e--;)if(o[e].elem===this&&o[e].queue===t){o[e].anim.stop(!0);o.splice(e,1)}for(e=0;a>e;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}});oe.each(["toggle","show","hide"],function(t,e){var n=oe.fn[e];oe.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(P(e,!0),t,r,i)}});oe.each({slideDown:P("show"),slideUp:P("hide"),slideToggle:P("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){oe.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}});oe.timers=[];oe.fx.tick=function(){var t,e=oe.timers,n=0;gn=oe.now();for(;n<e.length;n++){t=e[n];t()||e[n]!==t||e.splice(n--,1)}e.length||oe.fx.stop();gn=void 0};oe.fx.timer=function(t){oe.timers.push(t);t()?oe.fx.start():oe.timers.pop()};oe.fx.interval=13;oe.fx.start=function(){mn||(mn=setInterval(oe.fx.tick,oe.fx.interval))};oe.fx.stop=function(){clearInterval(mn);mn=null};oe.fx.speeds={slow:600,fast:200,_default:400};oe.fn.delay=function(t,e){t=oe.fx?oe.fx.speeds[t]||t:t;e=e||"fx";return this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})};(function(){var t,e,n,r,i;e=ge.createElement("div");e.setAttribute("className","t");e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";r=e.getElementsByTagName("a")[0];n=ge.createElement("select");i=n.appendChild(ge.createElement("option"));t=e.getElementsByTagName("input")[0];r.style.cssText="top:1px";re.getSetAttribute="t"!==e.className;re.style=/top/.test(r.getAttribute("style"));re.hrefNormalized="/a"===r.getAttribute("href");re.checkOn=!!t.value;re.optSelected=i.selected;re.enctype=!!ge.createElement("form").enctype;n.disabled=!0;re.optDisabled=!i.disabled;t=ge.createElement("input");t.setAttribute("value","");re.input=""===t.getAttribute("value");t.value="t";t.setAttribute("type","radio");re.radioValue="t"===t.value})();var Cn=/\r/g;oe.fn.extend({val:function(t){var e,n,r,i=this[0];if(arguments.length){r=oe.isFunction(t);return this.each(function(n){var i;if(1===this.nodeType){i=r?t.call(this,n,oe(this).val()):t;null==i?i="":"number"==typeof i?i+="":oe.isArray(i)&&(i=oe.map(i,function(t){return null==t?"":t+""}));e=oe.valHooks[this.type]||oe.valHooks[this.nodeName.toLowerCase()];e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i)}})}if(i){e=oe.valHooks[i.type]||oe.valHooks[i.nodeName.toLowerCase()];if(e&&"get"in e&&void 0!==(n=e.get(i,"value")))return n;n=i.value;return"string"==typeof n?n.replace(Cn,""):null==n?"":n}}});oe.extend({valHooks:{option:{get:function(t){var e=oe.find.attr(t,"value");return null!=e?e:oe.trim(oe.text(t))}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++){n=r[l];if(!(!n.selected&&l!==i||(re.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&oe.nodeName(n.parentNode,"optgroup"))){e=oe(n).val();if(o)return e;a.push(e)}}return a},set:function(t,e){for(var n,r,i=t.options,o=oe.makeArray(e),a=i.length;a--;){r=i[a];if(oe.inArray(oe.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1}n||(t.selectedIndex=-1);return i}}}});oe.each(["radio","checkbox"],function(){oe.valHooks[this]={set:function(t,e){return oe.isArray(e)?t.checked=oe.inArray(oe(t).val(),e)>=0:void 0}};re.checkOn||(oe.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Sn,Tn,kn=oe.expr.attrHandle,_n=/^(?:checked|selected)$/i,Mn=re.getSetAttribute,Dn=re.input;oe.fn.extend({attr:function(t,e){return Ae(this,oe.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){oe.removeAttr(this,t)})}});oe.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o){if(typeof t.getAttribute===Te)return oe.prop(t,e,n);if(1!==o||!oe.isXMLDoc(t)){e=e.toLowerCase();r=oe.attrHooks[e]||(oe.expr.match.bool.test(e)?Tn:Sn)}if(void 0===n){if(r&&"get"in r&&null!==(i=r.get(t,e)))return i;i=oe.find.attr(t,e);return null==i?void 0:i}if(null!==n){if(r&&"set"in r&&void 0!==(i=r.set(t,n,e)))return i;t.setAttribute(e,n+"");return n}oe.removeAttr(t,e)}},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(xe);if(o&&1===t.nodeType)for(;n=o[i++];){r=oe.propFix[n]||n;oe.expr.match.bool.test(n)?Dn&&Mn||!_n.test(n)?t[r]=!1:t[oe.camelCase("default-"+n)]=t[r]=!1:oe.attr(t,n,"");t.removeAttribute(Mn?n:r)}},attrHooks:{type:{set:function(t,e){if(!re.radioValue&&"radio"===e&&oe.nodeName(t,"input")){var n=t.value;t.setAttribute("type",e);n&&(t.value=n);return e}}}}});Tn={set:function(t,e,n){e===!1?oe.removeAttr(t,n):Dn&&Mn||!_n.test(n)?t.setAttribute(!Mn&&oe.propFix[n]||n,n):t[oe.camelCase("default-"+n)]=t[n]=!0;return n}};oe.each(oe.expr.match.bool.source.match(/\w+/g),function(t,e){var n=kn[e]||oe.find.attr;kn[e]=Dn&&Mn||!_n.test(e)?function(t,e,r){var i,o;if(!r){o=kn[e];kn[e]=i;i=null!=n(t,e,r)?e.toLowerCase():null;kn[e]=o}return i}:function(t,e,n){return n?void 0:t[oe.camelCase("default-"+e)]?e.toLowerCase():null}});Dn&&Mn||(oe.attrHooks.value={set:function(t,e,n){if(!oe.nodeName(t,"input"))return Sn&&Sn.set(t,e,n);t.defaultValue=e;return void 0}});if(!Mn){Sn={set:function(t,e,n){var r=t.getAttributeNode(n);r||t.setAttributeNode(r=t.ownerDocument.createAttribute(n));r.value=e+="";return"value"===n||e===t.getAttribute(n)?e:void 0}};kn.id=kn.name=kn.coords=function(t,e,n){var r;return n?void 0:(r=t.getAttributeNode(e))&&""!==r.value?r.value:null};oe.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);return n&&n.specified?n.value:void 0},set:Sn.set};oe.attrHooks.contenteditable={set:function(t,e,n){Sn.set(t,""===e?!1:e,n)}};oe.each(["width","height"],function(t,e){oe.attrHooks[e]={set:function(t,n){if(""===n){t.setAttribute(e,"auto");return n}}}})}re.style||(oe.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var Ln=/^(?:input|select|textarea|button|object)$/i,An=/^(?:a|area)$/i;oe.fn.extend({prop:function(t,e){return Ae(this,oe.prop,t,e,arguments.length>1)},removeProp:function(t){t=oe.propFix[t]||t;return this.each(function(){try{this[t]=void 0;delete this[t]}catch(e){}})}});oe.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a){o=1!==a||!oe.isXMLDoc(t);if(o){e=oe.propFix[e]||e;i=oe.propHooks[e]}return void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]}},propHooks:{tabIndex:{get:function(t){var e=oe.find.attr(t,"tabindex");return e?parseInt(e,10):Ln.test(t.nodeName)||An.test(t.nodeName)&&t.href?0:-1}}}});re.hrefNormalized||oe.each(["href","src"],function(t,e){oe.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}});re.optSelected||(oe.propHooks.selected={get:function(t){var e=t.parentNode;if(e){e.selectedIndex;e.parentNode&&e.parentNode.selectedIndex}return null}});oe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){oe.propFix[this.toLowerCase()]=this});re.enctype||(oe.propFix.enctype="encoding");var Nn=/[\t\r\n\f]/g;oe.fn.extend({addClass:function(t){var e,n,r,i,o,a,s=0,l=this.length,u="string"==typeof t&&t;if(oe.isFunction(t))return this.each(function(e){oe(this).addClass(t.call(this,e,this.className))});if(u){e=(t||"").match(xe)||[];for(;l>s;s++){n=this[s];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Nn," "):" ");if(r){o=0;for(;i=e[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=oe.trim(r);n.className!==a&&(n.className=a)}}}return this},removeClass:function(t){var e,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof t&&t;if(oe.isFunction(t))return this.each(function(e){oe(this).removeClass(t.call(this,e,this.className))});if(u){e=(t||"").match(xe)||[];for(;l>s;s++){n=this[s];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Nn," "):"");if(r){o=0;for(;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=t?oe.trim(r):"";n.className!==a&&(n.className=a)}}}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):this.each(oe.isFunction(t)?function(n){oe(this).toggleClass(t.call(this,n,this.className,e),e)}:function(){if("string"===n)for(var e,r=0,i=oe(this),o=t.match(xe)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else if(n===Te||"boolean"===n){this.className&&oe._data(this,"__className__",this.className);this.className=this.className||t===!1?"":oe._data(this,"__className__")||""}})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Nn," ").indexOf(e)>=0)return!0;return!1}});oe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){oe.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});oe.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var En=oe.now(),jn=/\?/,In=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;oe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=oe.trim(t+"");return i&&!oe.trim(i.replace(In,function(t,e,i,o){n&&e&&(r=0);if(0===r)return t;n=i||e;r+=!o-!i;return""}))?Function("return "+i)():oe.error("Invalid JSON: "+t)};oe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{if(e.DOMParser){r=new DOMParser;n=r.parseFromString(t,"text/xml")}else{n=new ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(t)}}catch(i){n=void 0}n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||oe.error("Invalid XML: "+t);return n};var Pn,Hn,On=/#.*$/,Rn=/([?&])_=[^&]*/,Fn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Wn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,zn=/^(?:GET|HEAD)$/,qn=/^\/\//,Un=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Bn={},Vn={},Xn="*/".concat("*");try{Hn=location.href}catch(Gn){Hn=ge.createElement("a");Hn.href="";Hn=Hn.href}Pn=Un.exec(Hn.toLowerCase())||[];oe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Hn,type:"GET",isLocal:Wn.test(Pn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Xn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":oe.parseJSON,"text xml":oe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?q(q(t,oe.ajaxSettings),e):q(oe.ajaxSettings,t)},ajaxPrefilter:W(Bn),ajaxTransport:W(Vn),ajax:function(t,e){function n(t,e,n,r){var i,c,v,y,x,C=e;if(2!==b){b=2;s&&clearTimeout(s);u=void 0;a=r||"";w.readyState=t>0?4:0;i=t>=200&&300>t||304===t;n&&(y=U(f,w,n));y=B(f,y,w,i);if(i){if(f.ifModified){x=w.getResponseHeader("Last-Modified");x&&(oe.lastModified[o]=x);x=w.getResponseHeader("etag");x&&(oe.etag[o]=x)}if(204===t||"HEAD"===f.type)C="nocontent";else if(304===t)C="notmodified";else{C=y.state;c=y.data;v=y.error;i=!v}}else{v=C;if(t||!C){C="error";0>t&&(t=0)}}w.status=t;w.statusText=(e||C)+"";i?p.resolveWith(h,[c,C,w]):p.rejectWith(h,[w,C,v]);w.statusCode(m);m=void 0;l&&d.trigger(i?"ajaxSuccess":"ajaxError",[w,f,i?c:v]);g.fireWith(h,[w,C]);if(l){d.trigger("ajaxComplete",[w,f]);--oe.active||oe.event.trigger("ajaxStop")}}}if("object"==typeof t){e=t;t=void 0}e=e||{};var r,i,o,a,s,l,u,c,f=oe.ajaxSetup({},e),h=f.context||f,d=f.context&&(h.nodeType||h.jquery)?oe(h):oe.event,p=oe.Deferred(),g=oe.Callbacks("once memory"),m=f.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!c){c={};for(;e=Fn.exec(a);)c[e[1].toLowerCase()]=e[2]}e=c[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(t,e){var n=t.toLowerCase();if(!b){t=y[n]=y[n]||t;v[t]=e}return this},overrideMimeType:function(t){b||(f.mimeType=t);return this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)m[e]=[m[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||x;u&&u.abort(e);n(0,e);return this}};p.promise(w).complete=g.add;w.success=w.done;w.error=w.fail;f.url=((t||f.url||Hn)+"").replace(On,"").replace(qn,Pn[1]+"//");f.type=e.method||e.type||f.method||f.type;f.dataTypes=oe.trim(f.dataType||"*").toLowerCase().match(xe)||[""];if(null==f.crossDomain){r=Un.exec(f.url.toLowerCase());f.crossDomain=!(!r||r[1]===Pn[1]&&r[2]===Pn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(Pn[3]||("http:"===Pn[1]?"80":"443")))}f.data&&f.processData&&"string"!=typeof f.data&&(f.data=oe.param(f.data,f.traditional));z(Bn,f,e,w);if(2===b)return w;l=oe.event&&f.global;l&&0===oe.active++&&oe.event.trigger("ajaxStart");f.type=f.type.toUpperCase();f.hasContent=!zn.test(f.type);o=f.url;if(!f.hasContent){if(f.data){o=f.url+=(jn.test(o)?"&":"?")+f.data;delete f.data}f.cache===!1&&(f.url=Rn.test(o)?o.replace(Rn,"$1_="+En++):o+(jn.test(o)?"&":"?")+"_="+En++)}if(f.ifModified){oe.lastModified[o]&&w.setRequestHeader("If-Modified-Since",oe.lastModified[o]);oe.etag[o]&&w.setRequestHeader("If-None-Match",oe.etag[o])}(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)&&w.setRequestHeader("Content-Type",f.contentType);w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Xn+"; q=0.01":""):f.accepts["*"]);for(i in f.headers)w.setRequestHeader(i,f.headers[i]);if(f.beforeSend&&(f.beforeSend.call(h,w,f)===!1||2===b))return w.abort();x="abort";for(i in{success:1,error:1,complete:1})w[i](f[i]);u=z(Vn,f,e,w);if(u){w.readyState=1;l&&d.trigger("ajaxSend",[w,f]);f.async&&f.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1;u.send(v,n)}catch(C){if(!(2>b))throw C;n(-1,C)}}else n(-1,"No Transport");return w},getJSON:function(t,e,n){return oe.get(t,e,n,"json")},getScript:function(t,e){return oe.get(t,void 0,e,"script")}});oe.each(["get","post"],function(t,e){oe[e]=function(t,n,r,i){if(oe.isFunction(n)){i=i||r;r=n;n=void 0}return oe.ajax({url:t,type:e,dataType:i,data:n,success:r})}});oe._evalUrl=function(t){return oe.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})};oe.fn.extend({wrapAll:function(t){if(oe.isFunction(t))return this.each(function(e){oe(this).wrapAll(t.call(this,e))});if(this[0]){var e=oe(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]);e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return this.each(oe.isFunction(t)?function(e){oe(this).wrapInner(t.call(this,e))}:function(){var e=oe(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=oe.isFunction(t);return this.each(function(n){oe(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){oe.nodeName(this,"body")||oe(this).replaceWith(this.childNodes)}).end()}});oe.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0||!re.reliableHiddenOffsets()&&"none"===(t.style&&t.style.display||oe.css(t,"display"))};oe.expr.filters.visible=function(t){return!oe.expr.filters.hidden(t)};var $n=/%20/g,Yn=/\[\]$/,Jn=/\r?\n/g,Kn=/^(?:submit|button|image|reset|file)$/i,Zn=/^(?:input|select|textarea|keygen)/i;oe.param=function(t,e){var n,r=[],i=function(t,e){e=oe.isFunction(e)?e():null==e?"":e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};void 0===e&&(e=oe.ajaxSettings&&oe.ajaxSettings.traditional);if(oe.isArray(t)||t.jquery&&!oe.isPlainObject(t))oe.each(t,function(){i(this.name,this.value)});else for(n in t)V(n,t[n],e,i);return r.join("&").replace($n,"+")};oe.fn.extend({serialize:function(){return oe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=oe.prop(this,"elements");return t?oe.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!oe(this).is(":disabled")&&Zn.test(this.nodeName)&&!Kn.test(t)&&(this.checked||!Ne.test(t))}).map(function(t,e){var n=oe(this).val();return null==n?null:oe.isArray(n)?oe.map(n,function(t){return{name:e.name,value:t.replace(Jn,"\r\n")}}):{name:e.name,value:n.replace(Jn,"\r\n")}}).get()}});oe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&X()||G()}:X;var Qn=0,tr={},er=oe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var t in tr)tr[t](void 0,!0)});re.cors=!!er&&"withCredentials"in er;er=re.ajax=!!er;er&&oe.ajaxTransport(function(t){if(!t.crossDomain||re.cors){var e;return{send:function(n,r){var i,o=t.xhr(),a=++Qn;o.open(t.type,t.url,t.async,t.username,t.password);if(t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType);t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(t.hasContent&&t.data||null);e=function(n,i){var s,l,u;if(e&&(i||4===o.readyState)){delete tr[a];e=void 0;o.onreadystatechange=oe.noop;if(i)4!==o.readyState&&o.abort();else{u={};s=o.status;"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(c){l=""}s||!t.isLocal||t.crossDomain?1223===s&&(s=204):s=u.text?200:404}}u&&r(s,l,u,o.getAllResponseHeaders())};t.async?4===o.readyState?setTimeout(e):o.onreadystatechange=tr[a]=e:e()},abort:function(){e&&e(void 0,!0)}}}});oe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){oe.globalEval(t);return t}}});oe.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1);if(t.crossDomain){t.type="GET";t.global=!1}});oe.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=ge.head||oe("head")[0]||ge.documentElement; return{send:function(r,i){e=ge.createElement("script");e.async=!0;t.scriptCharset&&(e.charset=t.scriptCharset);e.src=t.url;e.onload=e.onreadystatechange=function(t,n){if(n||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;e.parentNode&&e.parentNode.removeChild(e);e=null;n||i(200,"success")}};n.insertBefore(e,n.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var nr=[],rr=/(=)\?(?=&|$)|\?\?/;oe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=nr.pop()||oe.expando+"_"+En++;this[t]=!0;return t}});oe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(rr.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&rr.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0]){i=t.jsonpCallback=oe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback;s?t[s]=t[s].replace(rr,"$1"+i):t.jsonp!==!1&&(t.url+=(jn.test(t.url)?"&":"?")+t.jsonp+"="+i);t.converters["script json"]=function(){a||oe.error(i+" was not called");return a[0]};t.dataTypes[0]="json";o=e[i];e[i]=function(){a=arguments};r.always(function(){e[i]=o;if(t[i]){t.jsonpCallback=n.jsonpCallback;nr.push(i)}a&&oe.isFunction(o)&&o(a[0]);a=o=void 0});return"script"}});oe.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;if("boolean"==typeof e){n=e;e=!1}e=e||ge;var r=he.exec(t),i=!n&&[];if(r)return[e.createElement(r[1])];r=oe.buildFragment([t],e,i);i&&i.length&&oe(i).remove();return oe.merge([],r.childNodes)};var ir=oe.fn.load;oe.fn.load=function(t,e,n){if("string"!=typeof t&&ir)return ir.apply(this,arguments);var r,i,o,a=this,s=t.indexOf(" ");if(s>=0){r=oe.trim(t.slice(s,t.length));t=t.slice(0,s)}if(oe.isFunction(e)){n=e;e=void 0}else e&&"object"==typeof e&&(o="POST");a.length>0&&oe.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){i=arguments;a.html(r?oe("<div>").append(oe.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){a.each(n,i||[t.responseText,e,t])});return this};oe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){oe.fn[e]=function(t){return this.on(e,t)}});oe.expr.filters.animated=function(t){return oe.grep(oe.timers,function(e){return t===e.elem}).length};var or=e.document.documentElement;oe.offset={setOffset:function(t,e,n){var r,i,o,a,s,l,u,c=oe.css(t,"position"),f=oe(t),h={};"static"===c&&(t.style.position="relative");s=f.offset();o=oe.css(t,"top");l=oe.css(t,"left");u=("absolute"===c||"fixed"===c)&&oe.inArray("auto",[o,l])>-1;if(u){r=f.position();a=r.top;i=r.left}else{a=parseFloat(o)||0;i=parseFloat(l)||0}oe.isFunction(e)&&(e=e.call(t,n,s));null!=e.top&&(h.top=e.top-s.top+a);null!=e.left&&(h.left=e.left-s.left+i);"using"in e?e.using.call(t,h):f.css(h)}};oe.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){oe.offset.setOffset(this,t,e)});var e,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o){e=o.documentElement;if(!oe.contains(e,i))return r;typeof i.getBoundingClientRect!==Te&&(r=i.getBoundingClientRect());n=$(o);return{top:r.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:r.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}}},position:function(){if(this[0]){var t,e,n={top:0,left:0},r=this[0];if("fixed"===oe.css(r,"position"))e=r.getBoundingClientRect();else{t=this.offsetParent();e=this.offset();oe.nodeName(t[0],"html")||(n=t.offset());n.top+=oe.css(t[0],"borderTopWidth",!0);n.left+=oe.css(t[0],"borderLeftWidth",!0)}return{top:e.top-n.top-oe.css(r,"marginTop",!0),left:e.left-n.left-oe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||or;t&&!oe.nodeName(t,"html")&&"static"===oe.css(t,"position");)t=t.offsetParent;return t||or})}});oe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);oe.fn[t]=function(r){return Ae(this,function(t,r,i){var o=$(t);if(void 0===i)return o?e in o?o[e]:o.document.documentElement[r]:t[r];o?o.scrollTo(n?oe(o).scrollLeft():i,n?i:oe(o).scrollTop()):t[r]=i;return void 0},t,r,arguments.length,null)}});oe.each(["top","left"],function(t,e){oe.cssHooks[e]=M(re.pixelPosition,function(t,n){if(n){n=nn(t,e);return on.test(n)?oe(t).position()[e]+"px":n}})});oe.each({Height:"height",Width:"width"},function(t,e){oe.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){oe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Ae(this,function(e,n,r){var i;if(oe.isWindow(e))return e.document.documentElement["client"+t];if(9===e.nodeType){i=e.documentElement;return Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])}return void 0===r?oe.css(e,n,a):oe.style(e,n,r,a)},e,o?r:void 0,o,null)}})});oe.fn.size=function(){return this.length};oe.fn.andSelf=oe.fn.addBack;"function"==typeof t&&t.amd&&t("jquery",[],function(){return oe});var ar=e.jQuery,sr=e.$;oe.noConflict=function(t){e.$===oe&&(e.$=sr);t&&e.jQuery===oe&&(e.jQuery=ar);return oe};typeof n===Te&&(e.jQuery=e.$=oe);return oe})},{}],20:[function(e,n,r){(function(){var i;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){return t.pivotUtilities.d3_renderers={Treemap:function(e,n){var r,i,o,a,s,l,u,c,f,h,d,p,g,m;o={localeStrings:{}};n=t.extend(o,n);l=t("<div style='width: 100%; height: 100%;'>");c={name:"All",children:[]};r=function(t,e,n){var i,o,a,s,l,u;if(0!==e.length){null==t.children&&(t.children=[]);a=e.shift();u=t.children;for(s=0,l=u.length;l>s;s++){i=u[s];if(i.name===a){r(i,e,n);return}}o={name:a};r(o,e,n);return t.children.push(o)}t.value=n};m=e.getRowKeys();for(p=0,g=m.length;g>p;p++){u=m[p];h=e.getAggregator(u,[]).value();null!=h&&r(c,u,h)}i=d3.scale.category10();d=t(window).width()/1.4;a=t(window).height()/1.4;s=10;f=d3.layout.treemap().size([d,a]).sticky(!0).value(function(t){return t.size});d3.select(l[0]).append("div").style("position","relative").style("width",d+2*s+"px").style("height",a+2*s+"px").style("left",s+"px").style("top",s+"px").datum(c).selectAll(".node").data(f.padding([15,0,0,0]).value(function(t){return t.value}).nodes).enter().append("div").attr("class","node").style("background",function(t){return null!=t.children?"lightgrey":i(t.name)}).text(function(t){return t.name}).call(function(){this.style("left",function(t){return t.x+"px"}).style("top",function(t){return t.y+"px"}).style("width",function(t){return Math.max(0,t.dx-1)+"px"}).style("height",function(t){return Math.max(0,t.dy-1)+"px"})});return l}}})}).call(this)},{jquery:19}],21:[function(e,n,r){(function(){var i;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){var e;e=function(e,n){return function(r,i){var o,a,s,l,u,c,f,h,d,p,g,m,v,y,b,x,w,C,S,T,k,_,M,D,L;c={localeStrings:{vs:"vs",by:"by"}};i=t.extend(c,i);w=r.getRowKeys();0===w.length&&w.push([]);s=r.getColKeys();0===s.length&&s.push([]);p=function(){var t,e,n;n=[];for(t=0,e=w.length;e>t;t++){h=w[t];n.push(h.join("-"))}return n}();p.unshift("");m=0;l=[p];for(_=0,D=s.length;D>_;_++){a=s[_];b=[a.join("-")];m+=b[0].length;for(M=0,L=w.length;L>M;M++){x=w[M];o=r.getAggregator(x,a);b.push(null!=o.value()?o.value():null)}l.push(b)}C=T=r.aggregatorName+(r.valAttrs.length?"("+r.valAttrs.join(", ")+")":"");d=r.colAttrs.join("-");""!==d&&(C+=" "+i.localeStrings.vs+" "+d);f=r.rowAttrs.join("-");""!==f&&(C+=" "+i.localeStrings.by+" "+f);v={width:t(window).width()/1.4,height:t(window).height()/1.4,title:C,hAxis:{title:d,slantedText:m>50},vAxis:{title:T}};2===l[0].length&&""===l[0][1]&&(v.legend={position:"none"});for(g in n){S=n[g];v[g]=S}u=google.visualization.arrayToDataTable(l);y=t("<div style='width: 100%; height: 100%;'>");k=new google.visualization.ChartWrapper({dataTable:u,chartType:e,options:v});k.draw(y[0]);y.bind("dblclick",function(){var t;t=new google.visualization.ChartEditor;google.visualization.events.addListener(t,"ok",function(){return t.getChartWrapper().draw(y[0])});return t.openDialog(k)});return y}};return t.pivotUtilities.gchart_renderers={"Line Chart":e("LineChart"),"Bar Chart":e("ColumnChart"),"Stacked Bar Chart":e("ColumnChart",{isStacked:!0}),"Area Chart":e("AreaChart",{isStacked:!0})}})}).call(this)},{jquery:19}],22:[function(e,n,r){(function(){var i,o=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=[].slice,s=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){var e,n,r,i,u,c,f,h,d,p,g,m,v,y,b,x;n=function(t,e,n){var r,i,o,a;t+="";i=t.split(".");o=i[0];a=i.length>1?n+i[1]:"";r=/(\d+)(\d{3})/;for(;r.test(o);)o=o.replace(r,"$1"+e+"$2");return o+a};p=function(e){var r;r={digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:"",showZero:!1};e=t.extend(r,e);return function(t){var r;if(isNaN(t)||!isFinite(t))return"";if(0===t&&!e.showZero)return"";r=n((e.scaler*t).toFixed(e.digitsAfterDecimal),e.thousandsSep,e.decimalSep);return""+e.prefix+r+e.suffix}};v=p();y=p({digitsAfterDecimal:0});b=p({digitsAfterDecimal:1,scaler:100,suffix:"%"});r={count:function(t){null==t&&(t=y);return function(){return function(){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},countUnique:function(t){null==t&&(t=y);return function(e){var n;n=e[0];return function(){return{uniq:[],push:function(t){var e;return e=t[n],o.call(this.uniq,e)<0?this.uniq.push(t[n]):void 0},value:function(){return this.uniq.length},format:t,numInputs:null!=n?0:1}}}},listUnique:function(t){return function(e){var n;n=e[0];return function(){return{uniq:[],push:function(t){var e;return e=t[n],o.call(this.uniq,e)<0?this.uniq.push(t[n]):void 0},value:function(){return this.uniq.join(t)},format:function(t){return t},numInputs:null!=n?0:1}}}},sum:function(t){null==t&&(t=v);return function(e){var n;n=e[0];return function(){return{sum:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:this.sum+=parseFloat(t[n])},value:function(){return this.sum},format:t,numInputs:null!=n?0:1}}}},average:function(t){null==t&&(t=v);return function(e){var n;n=e[0];return function(){return{sum:0,len:0,push:function(t){if(!isNaN(parseFloat(t[n]))){this.sum+=parseFloat(t[n]);return this.len++}},value:function(){return this.sum/this.len},format:t,numInputs:null!=n?0:1}}}},sumOverSum:function(t){null==t&&(t=v);return function(e){var n,r;r=e[0],n=e[1];return function(){return{sumNum:0,sumDenom:0,push:function(t){isNaN(parseFloat(t[r]))||(this.sumNum+=parseFloat(t[r]));return isNaN(parseFloat(t[n]))?void 0:this.sumDenom+=parseFloat(t[n])},value:function(){return this.sumNum/this.sumDenom},format:t,numInputs:null!=r&&null!=n?0:2}}}},sumOverSumBound80:function(t,e){null==t&&(t=!0);null==e&&(e=v);return function(n){var r,i;i=n[0],r=n[1];return function(){return{sumNum:0,sumDenom:0,push:function(t){isNaN(parseFloat(t[i]))||(this.sumNum+=parseFloat(t[i]));return isNaN(parseFloat(t[r]))?void 0:this.sumDenom+=parseFloat(t[r])},value:function(){var e;e=t?1:-1;return(.821187207574908/this.sumDenom+this.sumNum/this.sumDenom+1.2815515655446004*e*Math.sqrt(.410593603787454/(this.sumDenom*this.sumDenom)+this.sumNum*(1-this.sumNum/this.sumDenom)/(this.sumDenom*this.sumDenom)))/(1+1.642374415149816/this.sumDenom)},format:e,numInputs:null!=i&&null!=r?0:2}}}},fractionOf:function(t,e,n){null==e&&(e="total");null==n&&(n=b);return function(){var r;r=1<=arguments.length?a.call(arguments,0):[];return function(i,o,a){return{selector:{total:[[],[]],row:[o,[]],col:[[],a]}[e],inner:t.apply(null,r)(i,o,a),push:function(t){return this.inner.push(t)},format:n,value:function(){return this.inner.value()/i.getAggregator.apply(i,this.selector).inner.value()},numInputs:t.apply(null,r)().numInputs}}}}};i=function(t){return{Count:t.count(y),"Count Unique Values":t.countUnique(y),"List Unique Values":t.listUnique(", "),Sum:t.sum(v),"Integer Sum":t.sum(y),Average:t.average(v),"Sum over Sum":t.sumOverSum(v),"80% Upper Bound":t.sumOverSumBound80(!0,v),"80% Lower Bound":t.sumOverSumBound80(!1,v),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",b),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",b),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",b),"Count as Fraction of Total":t.fractionOf(t.count(),"total",b),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",b),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",b)}}(r);m={Table:function(t,e){return g(t,e)},"Table Barchart":function(e,n){return t(g(e,n)).barchart()},Heatmap:function(e,n){return t(g(e,n)).heatmap()},"Row Heatmap":function(e,n){return t(g(e,n)).heatmap("rowheatmap")},"Col Heatmap":function(e,n){return t(g(e,n)).heatmap("colheatmap")}};f={en:{aggregators:i,renderers:m,localeStrings:{renderError:"An error occurred rendering the PivotTable results.",computeError:"An error occurred computing the PivotTable results.",uiRenderError:"An error occurred rendering the PivotTable UI.",selectAll:"Select All",selectNone:"Select None",tooMany:"(too many to list)",filterResults:"Filter results",totals:"Totals",vs:"vs",by:"by"}}};h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];x=function(t){return("0"+t).substr(-2,2)};c={bin:function(t,e){return function(n){return n[t]-n[t]%e}},dateFormat:function(t,e,n,r){null==n&&(n=h);null==r&&(r=u);return function(i){var o;o=new Date(Date.parse(i[t]));return isNaN(o)?"":e.replace(/%(.)/g,function(t,e){switch(e){case"y":return o.getFullYear();case"m":return x(o.getMonth()+1);case"n":return n[o.getMonth()];case"d":return x(o.getDate());case"w":return r[o.getDay()];case"x":return o.getDay();case"H":return x(o.getHours());case"M":return x(o.getMinutes());case"S":return x(o.getSeconds());default:return"%"+e}})}}};d=function(){return function(t,e){var n,r,i,o,a,s,l;s=/(\d+)|(\D+)/g;a=/\d/;l=/^0/;if("number"==typeof t||"number"==typeof e)return isNaN(t)?1:isNaN(e)?-1:t-e;n=String(t).toLowerCase();i=String(e).toLowerCase();if(n===i)return 0;if(!a.test(n)||!a.test(i))return n>i?1:-1;n=n.match(s);i=i.match(s);for(;n.length&&i.length;){r=n.shift();o=i.shift();if(r!==o)return a.test(r)&&a.test(o)?r.replace(l,".0")-o.replace(l,".0"):r>o?1:-1}return n.length-i.length}}(this);t.pivotUtilities={aggregatorTemplates:r,aggregators:i,renderers:m,derivers:c,locales:f,naturalSort:d,numberFormat:p};e=function(){function e(t,n){this.getAggregator=s(this.getAggregator,this);this.getRowKeys=s(this.getRowKeys,this);this.getColKeys=s(this.getColKeys,this);this.sortKeys=s(this.sortKeys,this);this.arrSort=s(this.arrSort,this);this.natSort=s(this.natSort,this);this.aggregator=n.aggregator;this.aggregatorName=n.aggregatorName;this.colAttrs=n.cols;this.rowAttrs=n.rows;this.valAttrs=n.vals;this.tree={};this.rowKeys=[];this.colKeys=[];this.rowTotals={};this.colTotals={};this.allTotal=this.aggregator(this,[],[]);this.sorted=!1;e.forEachRecord(t,n.derivedAttributes,function(t){return function(e){return n.filter(e)?t.processRecord(e):void 0}}(this))}e.forEachRecord=function(e,n,r){var i,o,a,s,u,c,f,h,d,p,g,m;i=t.isEmptyObject(n)?r:function(t){var e,i,o;for(e in n){i=n[e];t[e]=null!=(o=i(t))?o:t[e]}return r(t)};if(t.isFunction(e))return e(i);if(t.isArray(e)){if(t.isArray(e[0])){g=[];for(a in e)if(l.call(e,a)){o=e[a];if(a>0){c={};p=e[0];for(s in p)if(l.call(p,s)){u=p[s];c[u]=o[s]}g.push(i(c))}}return g}m=[];for(h=0,d=e.length;d>h;h++){c=e[h];m.push(i(c))}return m}if(e instanceof jQuery){f=[];t("thead > tr > th",e).each(function(){return f.push(t(this).text())});return t("tbody > tr",e).each(function(){c={};t("td",this).each(function(e){return c[f[e]]=t(this).text()});return i(c)})}throw new Error("unknown input format")};e.convertToArray=function(t){var n;n=[];e.forEachRecord(t,{},function(t){return n.push(t)});return n};e.prototype.natSort=function(t,e){return d(t,e)};e.prototype.arrSort=function(t,e){return this.natSort(t.join(),e.join())};e.prototype.sortKeys=function(){if(!this.sorted){this.rowKeys.sort(this.arrSort);this.colKeys.sort(this.arrSort)}return this.sorted=!0};e.prototype.getColKeys=function(){this.sortKeys();return this.colKeys};e.prototype.getRowKeys=function(){this.sortKeys();return this.rowKeys};e.prototype.processRecord=function(t){var e,n,r,i,o,a,s,l,u,c,f,h,d;e=[];i=[];c=this.colAttrs;for(a=0,l=c.length;l>a;a++){o=c[a];e.push(null!=(f=t[o])?f:"null")}h=this.rowAttrs;for(s=0,u=h.length;u>s;s++){o=h[s];i.push(null!=(d=t[o])?d:"null")}r=i.join(String.fromCharCode(0));n=e.join(String.fromCharCode(0));this.allTotal.push(t);if(0!==i.length){if(!this.rowTotals[r]){this.rowKeys.push(i);this.rowTotals[r]=this.aggregator(this,i,[])}this.rowTotals[r].push(t)}if(0!==e.length){if(!this.colTotals[n]){this.colKeys.push(e);this.colTotals[n]=this.aggregator(this,[],e)}this.colTotals[n].push(t)}if(0!==e.length&&0!==i.length){this.tree[r]||(this.tree[r]={});this.tree[r][n]||(this.tree[r][n]=this.aggregator(this,i,e));return this.tree[r][n].push(t)}};e.prototype.getAggregator=function(t,e){var n,r,i;i=t.join(String.fromCharCode(0));r=e.join(String.fromCharCode(0));n=0===t.length&&0===e.length?this.allTotal:0===t.length?this.colTotals[r]:0===e.length?this.rowTotals[i]:this.tree[i][r];return null!=n?n:{value:function(){return null},format:function(){return""}}};return e}();g=function(e,n){var r,i,o,a,s,u,c,f,h,d,p,g,m,v,y,b,x,w,C,S,T;u={localeStrings:{totals:"Totals"}};n=t.extend(u,n);o=e.colAttrs;p=e.rowAttrs;m=e.getRowKeys();s=e.getColKeys();d=document.createElement("table");d.className="pvtTable";v=function(t,e,n){var r,i,o,a,s,l;if(0!==e){i=!0;for(a=s=0;n>=0?n>=s:s>=n;a=n>=0?++s:--s)t[e-1][a]!==t[e][a]&&(i=!1);if(i)return-1}r=0;for(;e+r<t.length;){o=!1;for(a=l=0;n>=0?n>=l:l>=n;a=n>=0?++l:--l)t[e][a]!==t[e+r][a]&&(o=!0);if(o)break;r++}return r};for(f in o)if(l.call(o,f)){i=o[f];w=document.createElement("tr");if(0===parseInt(f)&&0!==p.length){b=document.createElement("th");b.setAttribute("colspan",p.length);b.setAttribute("rowspan",o.length);w.appendChild(b)}b=document.createElement("th");b.className="pvtAxisLabel";b.textContent=i;w.appendChild(b);for(c in s)if(l.call(s,c)){a=s[c];T=v(s,parseInt(c),parseInt(f));if(-1!==T){b=document.createElement("th");b.className="pvtColLabel";b.textContent=a[f];b.setAttribute("colspan",T);parseInt(f)===o.length-1&&0!==p.length&&b.setAttribute("rowspan",2);w.appendChild(b)}}if(0===parseInt(f)){b=document.createElement("th");b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals;b.setAttribute("rowspan",o.length+(0===p.length?0:1));w.appendChild(b)}d.appendChild(w)}if(0!==p.length){w=document.createElement("tr");for(c in p)if(l.call(p,c)){h=p[c];b=document.createElement("th");b.className="pvtAxisLabel";b.textContent=h;w.appendChild(b)}b=document.createElement("th");if(0===o.length){b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals}w.appendChild(b);d.appendChild(w)}for(c in m)if(l.call(m,c)){g=m[c];w=document.createElement("tr");for(f in g)if(l.call(g,f)){C=g[f];T=v(m,parseInt(c),parseInt(f));if(-1!==T){b=document.createElement("th");b.className="pvtRowLabel";b.textContent=C;b.setAttribute("rowspan",T);parseInt(f)===p.length-1&&0!==o.length&&b.setAttribute("colspan",2);w.appendChild(b)}}for(f in s)if(l.call(s,f)){a=s[f];r=e.getAggregator(g,a);S=r.value();y=document.createElement("td");y.className="pvtVal row"+c+" col"+f;y.innerHTML=r.format(S);y.setAttribute("data-value",S);w.appendChild(y)}x=e.getAggregator(g,[]);S=x.value();y=document.createElement("td");y.className="pvtTotal rowTotal";y.innerHTML=x.format(S);y.setAttribute("data-value",S);y.setAttribute("data-for","row"+c);w.appendChild(y);d.appendChild(w)}w=document.createElement("tr");b=document.createElement("th");b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals;b.setAttribute("colspan",p.length+(0===o.length?0:1));w.appendChild(b);for(f in s)if(l.call(s,f)){a=s[f];x=e.getAggregator([],a);S=x.value();y=document.createElement("td");y.className="pvtTotal colTotal";y.innerHTML=x.format(S);y.setAttribute("data-value",S);y.setAttribute("data-for","col"+f);w.appendChild(y)}x=e.getAggregator([],[]);S=x.value();y=document.createElement("td");y.className="pvtGrandTotal";y.innerHTML=x.format(S);y.setAttribute("data-value",S);w.appendChild(y);d.appendChild(w);d.setAttribute("data-numrows",m.length);d.setAttribute("data-numcols",s.length);return d};t.fn.pivot=function(n,i){var o,a,s,l,u;o={cols:[],rows:[],filter:function(){return!0},aggregator:r.count()(),aggregatorName:"Count",derivedAttributes:{},renderer:g,rendererOptions:null,localeStrings:f.en.localeStrings};i=t.extend(o,i);l=null;try{s=new e(n,i);try{l=i.renderer(s,i.rendererOptions)}catch(c){a=c;"undefined"!=typeof console&&null!==console&&console.error(a.stack);l=t("<span>").html(i.localeStrings.renderError)}}catch(c){a=c;"undefined"!=typeof console&&null!==console&&console.error(a.stack);l=t("<span>").html(i.localeStrings.computeError)}u=this[0];for(;u.hasChildNodes();)u.removeChild(u.lastChild);return this.append(l)};t.fn.pivotUI=function(n,r,i,a){var s,u,c,h,p,g,m,v,y,b,x,w,C,S,T,k,_,M,D,L,A,N,E,j,I,P,H,O,R,F,W,z,q,U,B,V,X,G,$;null==i&&(i=!1);null==a&&(a="en");m={derivedAttributes:{},aggregators:f[a].aggregators,renderers:f[a].renderers,hiddenAttributes:[],menuLimit:200,cols:[],rows:[],vals:[],exclusions:{},unusedAttrsVertical:"auto",autoSortUnusedAttrs:!1,rendererOptions:{localeStrings:f[a].localeStrings},onRefresh:null,filter:function(){return!0},localeStrings:f[a].localeStrings};y=this.data("pivotUIOptions");C=null==y||i?t.extend(m,r):y;try{n=e.convertToArray(n);L=function(){var t,e;t=n[0];e=[];for(w in t)l.call(t,w)&&e.push(w);return e}();B=C.derivedAttributes;for(p in B)l.call(B,p)&&o.call(L,p)<0&&L.push(p);h={};for(H=0,W=L.length;W>H;H++){I=L[H];h[I]={}}e.forEachRecord(n,C.derivedAttributes,function(t){var e,n,r;r=[];for(w in t)if(l.call(t,w)){e=t[w];if(C.filter(t)){null==e&&(e="null");null==(n=h[w])[e]&&(n[e]=0);r.push(h[w][e]++)}}return r});E=t("<table cellpadding='5'>");M=t("<td>");_=t("<select class='pvtRenderer'>").appendTo(M).bind("change",function(){return T()});V=C.renderers;for(I in V)l.call(V,I)&&t("<option>").val(I).html(I).appendTo(_);g=t("<td class='pvtAxisContainer pvtUnused'>");D=function(){var t,e,n;n=[];for(t=0,e=L.length;e>t;t++){p=L[t];o.call(C.hiddenAttributes,p)<0&&n.push(p)}return n}();j=!1;if("auto"===C.unusedAttrsVertical){c=0;for(O=0,z=D.length;z>O;O++){s=D[O];c+=s.length}j=c>120}g.addClass(C.unusedAttrsVertical===!0||j?"pvtVertList":"pvtHorizList");P=function(e){var n,r,i,a,s,l,u,c,f,p,m,v,y,x,S;u=function(){var t;t=[];for(w in h[e])t.push(w);return t}();l=!1;v=t("<div>").addClass("pvtFilterBox").hide();v.append(t("<h4>").text(""+e+" ("+u.length+")"));if(u.length>C.menuLimit)v.append(t("<p>").html(C.localeStrings.tooMany));else{r=t("<p>").appendTo(v);r.append(t("<button>").html(C.localeStrings.selectAll).bind("click",function(){return v.find("input:visible").prop("checked",!0)}));r.append(t("<button>").html(C.localeStrings.selectNone).bind("click",function(){return v.find("input:visible").prop("checked",!1)}));r.append(t("<input>").addClass("pvtSearch").attr("placeholder",C.localeStrings.filterResults).bind("keyup",function(){var e;e=t(this).val().toLowerCase();return t(this).parents(".pvtFilterBox").find("label span").each(function(){var n;n=t(this).text().toLowerCase().indexOf(e);return-1!==n?t(this).parent().show():t(this).parent().hide()})}));i=t("<div>").addClass("pvtCheckContainer").appendTo(v);S=u.sort(d);for(y=0,x=S.length;x>y;y++){w=S[y];m=h[e][w];a=t("<label>");s=C.exclusions[e]?o.call(C.exclusions[e],w)>=0:!1;l||(l=s);t("<input type='checkbox' class='pvtFilter'>").attr("checked",!s).data("filter",[e,w]).appendTo(a);a.append(t("<span>").text(""+w+" ("+m+")"));i.append(t("<p>").append(a))}}p=function(){var e;e=t(v).find("[type='checkbox']").length-t(v).find("[type='checkbox']:checked").length;e>0?n.addClass("pvtFilteredAttribute"):n.removeClass("pvtFilteredAttribute");return u.length>C.menuLimit?v.toggle():v.toggle(0,T)};t("<p>").appendTo(v).append(t("<button>").text("OK").bind("click",p));c=function(e){v.css({left:e.pageX,top:e.pageY}).toggle();t(".pvtSearch").val("");return t("label").show()};f=t("<span class='pvtTriangle'>").html(" &#x25BE;").bind("click",c);n=t("<li class='axis_"+b+"'>").append(t("<span class='pvtAttr'>").text(e).data("attrName",e).append(f));l&&n.addClass("pvtFilteredAttribute");g.append(n).append(v);return n.bind("dblclick",c)};for(b in D){p=D[b];P(p)}A=t("<tr>").appendTo(E);u=t("<select class='pvtAggregator'>").bind("change",function(){return T()});X=C.aggregators;for(I in X)l.call(X,I)&&u.append(t("<option>").val(I).html(I));t("<td class='pvtVals'>").appendTo(A).append(u).append(t("<br>"));t("<td class='pvtAxisContainer pvtHorizList pvtCols'>").appendTo(A);N=t("<tr>").appendTo(E);N.append(t("<td valign='top' class='pvtAxisContainer pvtRows'>"));S=t("<td valign='top' class='pvtRendererArea'>").appendTo(N);if(C.unusedAttrsVertical===!0||j){E.find("tr:nth-child(1)").prepend(M);E.find("tr:nth-child(2)").prepend(g)}else E.prepend(t("<tr>").append(M).append(g));this.html(E);G=C.cols;for(R=0,q=G.length;q>R;R++){I=G[R];this.find(".pvtCols").append(this.find(".axis_"+D.indexOf(I)))}$=C.rows;for(F=0,U=$.length;U>F;F++){I=$[F];this.find(".pvtRows").append(this.find(".axis_"+D.indexOf(I)))}null!=C.aggregatorName&&this.find(".pvtAggregator").val(C.aggregatorName);null!=C.rendererName&&this.find(".pvtRenderer").val(C.rendererName);x=!0;k=function(e){return function(){var r,i,a,s,l,c,f,h,d,p,g,m,v,y;h={derivedAttributes:C.derivedAttributes,localeStrings:C.localeStrings,rendererOptions:C.rendererOptions,cols:[],rows:[]};l=null!=(y=C.aggregators[u.val()]([])().numInputs)?y:0;p=[];e.find(".pvtRows li span.pvtAttr").each(function(){return h.rows.push(t(this).data("attrName"))});e.find(".pvtCols li span.pvtAttr").each(function(){return h.cols.push(t(this).data("attrName"))});e.find(".pvtVals select.pvtAttrDropdown").each(function(){if(0===l)return t(this).remove();l--;return""!==t(this).val()?p.push(t(this).val()):void 0});if(0!==l){f=e.find(".pvtVals");for(I=m=0;l>=0?l>m:m>l;I=l>=0?++m:--m){s=t("<select class='pvtAttrDropdown'>").append(t("<option>")).bind("change",function(){return T()});for(v=0,g=D.length;g>v;v++){r=D[v];s.append(t("<option>").val(r).text(r))}f.append(s)}}if(x){p=C.vals;b=0;e.find(".pvtVals select.pvtAttrDropdown").each(function(){t(this).val(p[b]);return b++});x=!1}h.aggregatorName=u.val();h.vals=p;h.aggregator=C.aggregators[u.val()](p);h.renderer=C.renderers[_.val()];i={};e.find("input.pvtFilter").not(":checked").each(function(){var e;e=t(this).data("filter");return null!=i[e[0]]?i[e[0]].push(e[1]):i[e[0]]=[e[1]]});h.filter=function(t){var e,n;if(!C.filter(t))return!1;for(w in i){e=i[w];if(n=""+t[w],o.call(e,n)>=0)return!1}return!0};S.pivot(n,h);c=t.extend(C,{cols:h.cols,rows:h.rows,vals:p,exclusions:i,aggregatorName:u.val(),rendererName:_.val()});e.data("pivotUIOptions",c);if(C.autoSortUnusedAttrs){a=t.pivotUtilities.naturalSort;d=e.find("td.pvtUnused.pvtAxisContainer");t(d).children("li").sort(function(e,n){return a(t(e).text(),t(n).text())}).appendTo(d)}S.css("opacity",1);return null!=C.onRefresh?C.onRefresh(c):void 0}}(this);T=function(){return function(){S.css("opacity",.5);return setTimeout(k,10)}}(this);T();this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?T():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(Y){v=Y;"undefined"!=typeof console&&null!==console&&console.error(v.stack);this.html(C.localeStrings.uiRenderError)}return this};t.fn.heatmap=function(e){var n,r,i,o,a,s,l,u;null==e&&(e="heatmap");s=this.data("numrows");a=this.data("numcols");n=function(t,e,n){var r;r=function(){switch(t){case"red":return function(t){return"ff"+t+t};case"green":return function(t){return""+t+"ff"+t};case"blue":return function(t){return""+t+t+"ff"}}}();return function(t){var i,o;o=255-Math.round(255*(t-e)/(n-e));i=o.toString(16).split(".")[0];1===i.length&&(i=0+i);return r(i)}};r=function(e){return function(r,i){var o,a,s;a=function(n){return e.find(r).each(function(){var e;e=t(this).data("value");return null!=e&&isFinite(e)?n(e,t(this)):void 0})};s=[];a(function(t){return s.push(t)});o=n(i,Math.min.apply(Math,s),Math.max.apply(Math,s));return a(function(t,e){return e.css("background-color","#"+o(t))})}}(this);switch(e){case"heatmap":r(".pvtVal","red");break;case"rowheatmap":for(i=l=0;s>=0?s>l:l>s;i=s>=0?++l:--l)r(".pvtVal.row"+i,"red");break;case"colheatmap":for(o=u=0;a>=0?a>u:u>a;o=a>=0?++u:--u)r(".pvtVal.col"+o,"red")}r(".pvtTotal.rowTotal","red");r(".pvtTotal.colTotal","red");return this};return t.fn.barchart=function(){var e,n,r,i,o;i=this.data("numrows");r=this.data("numcols");e=function(e){return function(n){var r,i,o,a;r=function(r){return e.find(n).each(function(){var e;e=t(this).data("value");return null!=e&&isFinite(e)?r(e,t(this)):void 0})};a=[];r(function(t){return a.push(t)});i=Math.max.apply(Math,a);o=function(t){return 100*t/(1.4*i)};return r(function(e,n){var r,i;r=n.text();i=t("<div>").css({position:"relative",height:"55px"});i.append(t("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:o(e)+"%","background-color":"gray"}));i.append(t("<div>").text(r).css({position:"relative","padding-left":"5px","padding-right":"5px"}));return n.css({padding:0,"padding-top":"5px","text-align":"center"}).html(i)})}}(this);for(n=o=0;i>=0?i>o:o>i;n=i>=0?++o:--o)e(".pvtVal.row"+n);e(".pvtTotal.colTotal");return this}})}).call(this)},{jquery:19}],23:[function(e,n){(function(e){function r(){try{return l in e&&e[l]}catch(t){return!1}}function i(t){return t.replace(/^d/,"___$&").replace(p,"___")}var o,a={},s=e.document,l="localStorage",u="script";a.disabled=!1;a.version="1.3.17";a.set=function(){};a.get=function(){};a.has=function(t){return void 0!==a.get(t)};a.remove=function(){};a.clear=function(){};a.transact=function(t,e,n){if(null==n){n=e;e=null}null==e&&(e={});var r=a.get(t,e);n(r);a.set(t,r)};a.getAll=function(){};a.forEach=function(){};a.serialize=function(t){return JSON.stringify(t)};a.deserialize=function(t){if("string"!=typeof t)return void 0;try{return JSON.parse(t)}catch(e){return t||void 0}};if(r()){o=e[l];a.set=function(t,e){if(void 0===e)return a.remove(t);o.setItem(t,a.serialize(e));return e};a.get=function(t,e){var n=a.deserialize(o.getItem(t));return void 0===n?e:n};a.remove=function(t){o.removeItem(t)};a.clear=function(){o.clear()};a.getAll=function(){var t={};a.forEach(function(e,n){t[e]=n});return t};a.forEach=function(t){for(var e=0;e<o.length;e++){var n=o.key(e);t(n,a.get(n))}}}else if(s.documentElement.addBehavior){var c,f;try{f=new ActiveXObject("htmlfile");f.open();f.write("<"+u+">document.w=window</"+u+'><iframe src="/favicon.ico"></iframe>');f.close();c=f.w.frames[0].document;o=c.createElement("div")}catch(h){o=s.createElement("div");c=s.body}var d=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);e.unshift(o);c.appendChild(o);o.addBehavior("#default#userData");o.load(l);var n=t.apply(a,e);c.removeChild(o);return n}},p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");a.set=d(function(t,e,n){e=i(e);if(void 0===n)return a.remove(e);t.setAttribute(e,a.serialize(n));t.save(l);return n});a.get=d(function(t,e,n){e=i(e);var r=a.deserialize(t.getAttribute(e));return void 0===r?n:r});a.remove=d(function(t,e){e=i(e);t.removeAttribute(e);t.save(l)});a.clear=d(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(l);for(var n,r=0;n=e[r];r++)t.removeAttribute(n.name);t.save(l)});a.getAll=function(){var t={};a.forEach(function(e,n){t[e]=n});return t};a.forEach=d(function(t,e){for(var n,r=t.XMLDocument.documentElement.attributes,i=0;n=r[i];++i)e(n.name,a.deserialize(t.getAttribute(n.name))) })}try{var g="__storejs__";a.set(g,g);a.get(g)!=g&&(a.disabled=!0);a.remove(g)}catch(h){a.disabled=!0}a.enabled=!a.disabled;"undefined"!=typeof n&&n.exports&&this.module!==n?n.exports=a:"function"==typeof t&&t.amd?t(a):e.store=a})(Function("return this")())},{}],24:[function(t,e){e.exports={name:"yasgui-utils",version:"1.5.2",description:"Utils for YASGUI libs",main:"src/main.js",repository:{type:"git",url:"git://github.com/YASGUI/Utils.git"},licenses:[{type:"MIT",url:"http://yasgui.github.io/license.txt"}],author:"Laurens Rietveld",maintainers:[{name:"Laurens Rietveld",email:"[email protected]",web:"http://laurensrietveld.nl"}],bugs:{url:"https://github.com/YASGUI/Utils/issues"},homepage:"https://github.com/YASGUI/Utils",dependencies:{store:"^1.3.14"}}},{}],25:[function(t,e){window.console=window.console||{log:function(){}};e.exports={storage:t("./storage.js"),svg:t("./svg.js"),version:{"yasgui-utils":t("../package.json").version},nestedExists:function(t){for(var e=Array.prototype.slice.call(arguments,1),n=0;n<e.length;n++){if(!t||!t.hasOwnProperty(e[n]))return!1;t=t[e[n]]}return!0}}},{"../package.json":24,"./storage.js":26,"./svg.js":27}],26:[function(t,e){{var n=t("store"),r={day:function(){return 864e5},month:function(){30*r.day()},year:function(){12*r.month()}};e.exports={set:function(t,e,i){if(n.enabled&&t&&void 0!==e){"string"==typeof i&&(i=r[i]());e.documentElement&&(e=(new XMLSerializer).serializeToString(e.documentElement));n.set(t,{val:e,exp:i,time:(new Date).getTime()})}},remove:function(t){n.enabled&&t&&n.remove(t)},get:function(t){if(!n.enabled)return null;if(t){var e=n.get(t);return e?e.exp&&(new Date).getTime()-e.time>e.exp?null:e.val:null}return null}}}},{store:23}],27:[function(t,e){e.exports={draw:function(t,n){if(t){var r=e.exports.getElement(n);r&&(t.append?t.append(r):t.appendChild(r))}},getElement:function(t){if(t&&0==t.indexOf("<svg")){var e=new DOMParser,n=e.parseFromString(t,"text/xml"),r=n.documentElement,i=document.createElement("div");i.className="svgImg";i.appendChild(r);return i}return!1}}},{}],28:[function(t,e){e.exports={name:"yasgui-yasr",description:"Yet Another SPARQL Resultset GUI",version:"2.4.13",main:"src/main.js",licenses:[{type:"MIT",url:"http://yasr.yasgui.org/license.txt"}],author:"Laurens Rietveld",homepage:"http://yasr.yasgui.org",devDependencies:{browserify:"^6.1.0",gulp:"~3.6.0","gulp-bump":"^0.1.11","gulp-concat":"^2.4.1","gulp-connect":"^2.0.5","gulp-embedlr":"^0.5.2","gulp-filter":"^1.0.2","gulp-git":"^0.5.2","gulp-jsvalidate":"^0.2.0","gulp-livereload":"^1.3.1","gulp-minify-css":"0.3.11","gulp-notify":"^2.0.1","gulp-rename":"^1.2.0","gulp-streamify":"0.0.5","gulp-tag-version":"^1.1.0","gulp-uglify":"^1.0.1","require-dir":"^0.1.0","run-sequence":"^1.0.1","vinyl-buffer":"^1.0.0","vinyl-source-stream":"~0.1.1",watchify:"^0.6.4","gulp-sourcemaps":"^1.2.8",exorcist:"^0.1.6","vinyl-transform":"0.0.1","gulp-sass":"^1.2.2","bootstrap-sass":"^3.3.1","browserify-transform-tools":"^1.2.1","gulp-cssimport":"^1.3.1","gulp-html-replace":"^1.4.1","browserify-shim":"^3.8.1"},bugs:"https://github.com/YASGUI/YASR/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],maintainers:[{name:"Laurens Rietveld",email:"[email protected]",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"https://github.com/YASGUI/YASR.git"},dependencies:{jquery:"~ 1.11.0",codemirror:"^4.7.0","yasgui-utils":"^1.4.1",pivottable:"^1.2.2","jquery-ui":"^1.10.5",d3:"^3.4.13"},"browserify-shim":{google:"global:google"},browserify:{transform:["browserify-shim"]},optionalShim:{codemirror:{require:"codemirror",global:"CodeMirror"},jquery:{require:"jquery",global:"jQuery"},"../../lib/codemirror":{require:"codemirror",global:"CodeMirror"},"../lib/DataTables/media/js/jquery.dataTables.js":{require:"datatables",global:"jQuery"},datatables:{require:"datatables",global:"jQuery"},d3:{require:"d3",global:"d3"},"jquery-ui/sortable":{require:"jquery-ui/sortable",global:"jQuery"},pivottable:{require:"pivottable",global:"jQuery"}}}},{}],29:[function(t,e){"use strict";e.exports=function(t){var e='"',n=",",r="\n",i=t.head.vars,o=t.results.bindings,a=function(){for(var t=0;t<i.length;t++)u(i[t]);f+=r},s=function(){for(var t=0;t<o.length;t++){l(o[t]);f+=r}},l=function(t){for(var e=0;e<i.length;e++){var n=i[e];u(t.hasOwnProperty(n)?t[n].value:"")}},u=function(t){t.replace(e,e+e);c(t)&&(t=e+t+e);f+=" "+t+" "+n},c=function(t){var r=!1;t.match("[\\w|"+n+"|"+e+"]")&&(r=!0);return r},f="";a();s();return f}},{}],30:[function(t,e){"use strict";var n=t("jquery"),r=e.exports=function(e){var r=n("<div class='booleanResult'></div>"),i=function(){r.empty().appendTo(e.resultsContainer);var i=e.results.getBoolean(),o=null,a=null;if(i===!0){o="check";a="True"}else if(i===!1){o="cross";a="False"}else{r.width("140");a="Could not find boolean value in response"}o&&t("yasgui-utils").svg.draw(r,t("./imgs.js")[o]);n("<span></span>").text(a).appendTo(r)},o=function(){return e.results.getBoolean&&(e.results.getBoolean()===!0||0==e.results.getBoolean())};return{name:null,draw:i,hideFromSelection:!0,getPriority:10,canHandleResults:o}};r.version={"YASR-boolean":t("../package.json").version,jquery:n.fn.jquery}},{"../package.json":28,"./imgs.js":36,jquery:19,"yasgui-utils":25}],31:[function(t,e){"use strict";var n=t("jquery");e.exports={output:"table",useGoogleCharts:!0,outputPlugins:["table","error","boolean","rawResponse"],drawOutputSelector:!0,drawDownloadIcon:!0,getUsedPrefixes:null,persistency:{prefix:function(t){return"yasr_"+n(t.container).closest("[id]").attr("id")+"_"},outputSelector:function(){return"selector"},results:{id:function(t){return"results_"+n(t.container).closest("[id]").attr("id")},key:"results",maxSize:1e5}}}},{jquery:19}],32:[function(t,e){"use strict";var n=t("jquery"),r=e.exports=function(t){var e=n("<div class='errorResult'></div>"),i=n.extend(!0,{},r.defaults),o=function(){var t=null;if(i.tryQueryLink){var e=i.tryQueryLink();t=n("<button>",{"class":"yasr_btn yasr_tryQuery"}).text("Try query in new browser window").click(function(){window.open(e,"_blank");n(this).blur()})}return t},a=function(){var r=t.results.getException();e.empty().appendTo(t.resultsContainer);var a=n("<div>",{"class":"errorHeader"}).appendTo(e);if(0!==r.status){var s="Error";r.statusText&&r.statusText.length<100&&(s=r.statusText);s+=" (#"+r.status+")";a.append(n("<span>",{"class":"exception"}).text(s)).append(o());var l=null;r.responseText?l=r.responseText:"string"==typeof r&&(l=r);l&&e.append(n("<pre>").text(l))}else{a.append(o());e.append(n("<div>",{"class":"corsMessage"}).append(i.corsMessage))}},s=function(t){return t.results.getException()||!1};return{name:null,draw:a,getPriority:20,hideFromSelection:!0,canHandleResults:s}};r.defaults={corsMessage:"Unable to get response from endpoint",tryQueryLink:null}},{jquery:19}],33:[function(t,e){e.exports={GoogleTypeException:function(t,e){this.foundTypes=t;this.varName=e;this.toString=function(){var t="Conflicting data types found for variable "+this.varName+'. Assuming all values of this variable are "string".';t+=" To avoid this issue, cast the values in your SPARQL query to the intended xsd datatype";return t};this.toHtml=function(){var t="Conflicting data types found for variable <i>"+this.varName+'</i>. Assuming all values of this variable are "string".';t+=" As a result, several Google Charts will not render values of this particular variable.";t+=" To avoid this issue, cast the values in your SPARQL query to the intended xsd datatype";return t}}}},{}],34:[function(t,e){(function(n){var r=t("events").EventEmitter,i=(t("jquery"),!1),o=!1,a=function(){r.call(this);var t=this;this.init=function(){if(o||("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)||i)("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)?t.emit("initDone"):o&&t.emit("initError");else{i=!0;s("http://google.com/jsapi",function(){i=!1;t.emit("initDone")});var e=100,r=6e3,a=+new Date,l=function(){if(!("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null))if(+new Date-a>r){o=!0;i=!1;t.emit("initError")}else setTimeout(l,e)};l()}};this.googleLoad=function(){var e=function(){("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null).load("visualization","1",{packages:["corechart","charteditor"],callback:function(){t.emit("done")}})};if(i){t.once("initDone",e);t.once("initError",function(){t.emit("error","Could not load google loader")})}else if("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)e();else if(o)t.emit("error","Could not load google loader");else{t.once("initDone",e);t.once("initError",function(){t.emit("error","Could not load google loader")})}}},s=function(t,e){var n=document.createElement("script");n.type="text/javascript";n.readyState?n.onreadystatechange=function(){if("loaded"==n.readyState||"complete"==n.readyState){n.onreadystatechange=null;e()}}:n.onload=function(){e()};n.src=t;document.body.appendChild(n)};a.prototype=new r;e.exports=new a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{events:5,jquery:19}],35:[function(t,e){(function(n){"use strict";function r(t,e,n){function r(t,e,o){var l,u,c,f,h,d,p,g;if(null==t||null==e)return t===e;if(t.__placeholder__||e.__placeholder__)return!0;if(t===e)return 0!==t||1/t==1/e;l=i.call(t);if(i.call(e)!=l)return!1;switch(l){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;u=o.length;for(;u--;)if(o[u]==t)return!0;o.push(t);c=0;f=!0;if("[object Array]"==l){h=t.length;d=e.length;if(s){switch(n){case"===":f=h===d;break;case"<==":f=d>=h;break;case"<<=":f=d>h}c=h;s=!1}else{f=h===d;c=h}if(f)for(;c--&&(f=c in t==c in e&&r(t[c],e[c],o)););}else{if("constructor"in t!="constructor"in e||t.constructor!=e.constructor)return!1;for(p in t)if(a(t,p)){c++;if(!(f=a(e,p)&&r(t[p],e[p],o)))break}if(f){g=0;for(p in e)a(e,p)&&++g;if(s)f="<<="===n?g>c:"<=="===n?g>=c:c===g;else{s=!1;f=c===g}}}o.pop();return f}var i={}.toString,o={}.hasOwnProperty,a=function(t,e){return o.call(t,e)},s=!0;return r(t,e,[])}var i=t("jquery"),o=t("./utils.js"),a=t("yasgui-utils"),s=e.exports=function(e){var l=i.extend(!0,{},s.defaults),u=e.container.closest("[id]").attr("id");null==e.options.gchart&&(e.options.gchart={});var c=e.getPersistencyId("motionchart"),f=e.getPersistencyId("chartConfig");null==e.options.gchart.motionChartState&&(e.options.gchart.motionChartState=a.storage.get(c));null==e.options.gchart.chartConfig&&(e.options.gchart.chartConfig=a.storage.get(f));var h=null,d=function(t){var i="undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null;h=new i.visualization.ChartEditor;i.visualization.events.addListener(h,"ok",function(){var t,n;t=h.getChartWrapper();if(!r(t.getChartType,"MotionChart","===")){e.options.gchart.motionChartState=t.n;a.storage.set(c,e.options.gchart.motionChartState);t.setOption("state",e.options.gchart.motionChartState);i.visualization.events.addListener(t,"ready",function(){var n;n=t.getChart();i.visualization.events.addListener(n,"statechange",function(){e.options.gchart.motionChartState=n.getState();a.storage.set(c,e.options.gchart.motionChartState)})})}n=t.getDataTable();t.setDataTable(null);e.options.gchart.chartConfig=t.toJSON();a.storage.set(f,e.options.gchart.chartConfig);t.setDataTable(n);t.draw();e.updateHeader()});t&&t()};return{name:"Google Chart",hideFromSelection:!1,priority:7,canHandleResults:function(t){var e,n;return null!=(e=t.results)&&(n=e.getVariables())&&n.length>0},getDownloadInfo:function(){if(!e.results)return null;var t=e.resultsContainer.find("svg");if(t.length>0)return{getContent:function(){return t[0].outerHTML?t[0].outerHTML:i("<div>").append(t.clone()).html()},filename:"queryResults.svg",contentType:"image/svg+xml",buttonTitle:"Download SVG Image"};var n=e.resultsContainer.find(".google-visualization-table-table");return n.length>0?{getContent:function(){return n.tableToCsv()},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:void 0},getEmbedHtml:function(){if(!e.results)return null;var t=e.resultsContainer.find("svg").clone().removeAttr("height").removeAttr("width").css("height","").css("width","");if(0==t.length)return null;var n=t[0].outerHTML;n||(n=i("<div>").append(t.clone()).html());return'<div style="width: 800px; height: 600px;">\n'+n+"\n</div>"},draw:function(){var r=function(){e.resultsContainer.empty();var n=u+"_gchartWrapper",r=null;e.resultsContainer.append(i("<button>",{"class":"openGchartBtn yasr_btn"}).text("Chart Config").click(function(){h.openDialog(r)})).append(i("<div>",{id:n,"class":"gchartWrapper"}));var s=new google.visualization.DataTable,f=e.results.getAsJson();f.head.vars.forEach(function(n){var r="string";try{r=o.getGoogleTypeForBindings(f.results.bindings,n)}catch(i){if(!(i instanceof t("./exceptions.js").GoogleTypeException))throw i;e.warn(i.toHtml())}s.addColumn(r,n)});var d=null;e.options.getUsedPrefixes&&(d="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);f.results.bindings.forEach(function(t){var e=[];f.head.vars.forEach(function(n,r){e.push(o.castGoogleType(t[n],d,s.getColumnType(r)))});s.addRow(e)});if(e.options.gchart.chartConfig){r=new google.visualization.ChartWrapper(e.options.gchart.chartConfig);if("MotionChart"===r.getChartType()&&null!=e.options.gchart.motionChartState){r.setOption("state",e.options.gchart.motionChartState);google.visualization.events.addListener(r,"ready",function(){var t;t=r.getChart();google.visualization.events.addListener(t,"statechange",function(){e.options.gchart.motionChartState=t.getState();a.storage.set(c,e.options.gchart.motionChartState)})})}r.setDataTable(s)}else r=new google.visualization.ChartWrapper({chartType:"Table",dataTable:s,containerId:n});r.setOption("width",l.width);r.setOption("height",l.height);r.draw();google.visualization.events.addListener(r,"ready",e.updateHeader)};("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)&&("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null).visualization&&h?r():t("./gChartLoader.js").on("done",function(){d();r()}).on("error",function(){console.log("errorrr")}).googleLoad()}}};s.defaults={height:"600px",width:"100%",persistencyId:"gchart"}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./exceptions.js":33,"./gChartLoader.js":34,"./utils.js":49,jquery:19,"yasgui-utils":25}],36:[function(t,e){"use strict";e.exports={cross:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g> <path d="M83.288,88.13c-2.114,2.112-5.575,2.112-7.689,0L53.659,66.188c-2.114-2.112-5.573-2.112-7.687,0L24.251,87.907 c-2.113,2.114-5.571,2.114-7.686,0l-4.693-4.691c-2.114-2.114-2.114-5.573,0-7.688l21.719-21.721c2.113-2.114,2.113-5.573,0-7.686 L11.872,24.4c-2.114-2.113-2.114-5.571,0-7.686l4.842-4.842c2.113-2.114,5.571-2.114,7.686,0L46.12,33.591 c2.114,2.114,5.572,2.114,7.688,0l21.721-21.719c2.114-2.114,5.573-2.114,7.687,0l4.695,4.695c2.111,2.113,2.111,5.571-0.003,7.686 L66.188,45.973c-2.112,2.114-2.112,5.573,0,7.686L88.13,75.602c2.112,2.111,2.112,5.572,0,7.687L83.288,88.13z"/></g></svg>',check:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#000000" d="M14.301,49.982l22.606,17.047L84.361,4.903c2.614-3.733,7.76-4.64,11.493-2.026l0.627,0.462 c3.732,2.614,4.64,7.758,2.025,11.492l-51.783,79.77c-1.955,2.791-3.896,3.762-7.301,3.988c-3.405,0.225-5.464-1.039-7.508-3.084 L2.447,61.814c-3.263-3.262-3.263-8.553,0-11.814l0.041-0.019C5.75,46.718,11.039,46.718,14.301,49.982z"/></svg>',unsorted:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path7-9" d="m 8.8748339,52.571766 16.9382111,-0.222584 4.050851,-0.06665 15.719154,-0.222166 0.27778,-0.04246 0.43276,0.0017 0.41632,-0.06121 0.37532,-0.0611 0.47132,-0.119342 0.27767,-0.08206 0.55244,-0.198047 0.19707,-0.08043 0.61095,-0.259721 0.0988,-0.05825 0.019,-0.01914 0.59303,-0.356548 0.11787,-0.0788 0.49125,-0.337892 0.17994,-0.139779 0.37317,-0.336871 0.21862,-0.219786 0.31311,-0.31479 0.21993,-0.259387 c 0.92402,-1.126057 1.55249,-2.512251 1.78961,-4.016904 l 0.0573,-0.25754 0.0195,-0.374113 0.0179,-0.454719 0.0175,-0.05874 -0.0169,-0.258049 -0.0225,-0.493503 -0.0398,-0.355569 -0.0619,-0.414201 -0.098,-0.414812 -0.083,-0.353334 L 53.23955,41.1484 53.14185,40.850967 52.93977,40.377742 52.84157,40.161628 34.38021,4.2507375 C 33.211567,1.9401875 31.035446,0.48226552 28.639484,0.11316952 l -0.01843,-0.01834 -0.671963,-0.07882 -0.236871,0.0042 L 27.335984,-4.7826577e-7 27.220736,0.00379952 l -0.398804,0.0025 -0.313848,0.04043 -0.594474,0.07724 -0.09611,0.02147 C 23.424549,0.60716252 21.216017,2.1142355 20.013025,4.4296865 L 0.93967491,40.894479 c -2.08310801,3.997178 -0.588125,8.835482 3.35080799,10.819749 1.165535,0.613495 2.43199,0.88731 3.675026,0.864202 l 0.49845,-0.02325 0.410875,0.01658 z M 9.1502369,43.934401 9.0136999,43.910011 27.164145,9.2564625 44.70942,43.42818 l -14.765289,0.214677 -4.031106,0.0468 -16.7627881,0.244744 z" /></svg>',sortDesc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,0.12823506 0.09753,0.02006 c 2.39093,0.458209 4.599455,1.96811104 5.80244,4.28639004 L 52.785897,40.894525 c 2.088044,4.002139 0.590949,8.836902 -3.348692,10.821875 -1.329078,0.688721 -2.766603,0.943695 -4.133174,0.841768 l -0.454018,0.02 L 27.910392,52.354171 23.855313,52.281851 8.14393,52.061827 7.862608,52.021477 7.429856,52.021738 7.014241,51.959818 6.638216,51.900838 6.164776,51.779369 5.889216,51.699439 5.338907,51.500691 5.139719,51.419551 4.545064,51.145023 4.430618,51.105123 4.410168,51.084563 3.817138,50.730843 3.693615,50.647783 3.207314,50.310611 3.028071,50.174369 2.652795,49.833957 2.433471,49.613462 2.140099,49.318523 1.901127,49.041407 C 0.97781,47.916059 0.347935,46.528448 0.11153,45.021676 L 0.05352,44.766255 0.05172,44.371683 0.01894,43.936017 0,43.877277 0.01836,43.62206 0.03666,43.122889 0.0765,42.765905 0.13912,42.352413 0.23568,41.940425 0.32288,41.588517 0.481021,41.151945 0.579391,40.853806 0.77369,40.381268 0.876097,40.162336 19.338869,4.2542801 c 1.172169,-2.308419 3.34759,-3.76846504 5.740829,-4.17716604 l 0.01975,0.01985 0.69605,-0.09573 0.218437,0.0225 0.490791,-0.02132 0.39809,0.0046 0.315972,0.03973 0.594462,0.08149 z" /></svg>',sortAsc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,0.70898699,-0.70898699,-0.70522156,97.988199,58.704807)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,113.65778 0.09753,-0.0201 c 2.39093,-0.45821 4.599455,-1.96811 5.80244,-4.28639 L 52.785897,72.891487 c 2.088044,-4.002139 0.590949,-8.836902 -3.348692,-10.821875 -1.329078,-0.688721 -2.766603,-0.943695 -4.133174,-0.841768 l -0.454018,-0.02 -16.939621,0.223997 -4.055079,0.07232 -15.711383,0.220024 -0.281322,0.04035 -0.432752,-2.61e-4 -0.415615,0.06192 -0.376025,0.05898 -0.47344,0.121469 -0.27556,0.07993 -0.550309,0.198748 -0.199188,0.08114 -0.594655,0.274528 -0.114446,0.0399 -0.02045,0.02056 -0.59303,0.35372 -0.123523,0.08306 -0.486301,0.337172 -0.179243,0.136242 -0.375276,0.340412 -0.219324,0.220495 -0.293372,0.294939 -0.238972,0.277116 C 0.97781,65.869953 0.347935,67.257564 0.11153,68.764336 L 0.05352,69.019757 0.05172,69.414329 0.01894,69.849995 0,69.908735 l 0.01836,0.255217 0.0183,0.499171 0.03984,0.356984 0.06262,0.413492 0.09656,0.411988 0.0872,0.351908 0.158141,0.436572 0.09837,0.298139 0.194299,0.472538 0.102407,0.218932 18.462772,35.908054 c 1.172169,2.30842 3.34759,3.76847 5.740829,4.17717 l 0.01975,-0.0199 0.69605,0.0957 0.218437,-0.0225 0.490791,0.0213 0.39809,-0.005 0.315972,-0.0397 0.594462,-0.0815 z" /></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" xml:space="preserve"><g id="Captions"></g><g id="Your_Icon"> <path fill-rule="evenodd" fill="#000000" d="M88,84v-2c0-2.961-0.859-4-4-4H16c-2.961,0-4,0.98-4,4v2c0,3.102,1.039,4,4,4h68 C87.02,88,88,87.039,88,84z M58,12H42c-5,0-6,0.941-6,6v22H16l34,34l34-34H64V18C64,12.941,62.939,12,58,12z"/></g></svg>',move:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_11656_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="753" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="287" inkscape:window-y="249" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><polygon points="33,83 50,100 67,83 54,83 54,17 67,17 50,0 33,17 46,17 46,83 " transform="translate(-7.962963,-10)" /><polygon points="83,67 100,50 83,33 83,46 17,46 17,33 0,50 17,67 17,54 83,54 " transform="translate(-7.962963,-10)" /></svg>',fullscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><path d="m -7.962963,-10 v 38.889 l 16.667,-16.667 16.667,16.667 5.555,-5.555 -16.667,-16.667 16.667,-16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 92.037037,-10 v 38.889 l -16.667,-16.667 -16.666,16.667 -5.556,-5.555 16.666,-16.667 -16.666,-16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M -7.962963,90 V 51.111 l 16.667,16.666 16.667,-16.666 5.555,5.556 -16.667,16.666 16.667,16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M 92.037037,90 V 51.111 l -16.667,16.666 -16.666,-16.666 -5.556,5.556 16.666,16.666 -16.666,16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>',smallscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1855" inkscape:window-height="1056" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="Layer_1" /><path d="m 30.926037,28.889 0,-38.889 -16.667,16.667 -16.667,-16.667 -5.555,5.555 16.667,16.667 -16.667,16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,28.889 0,-38.889 16.667,16.667 16.666,-16.667 5.556,5.555 -16.666,16.667 16.666,16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 30.926037,51.111 0,38.889 -16.667,-16.666 -16.667,16.666 -5.555,-5.556 16.667,-16.666 -16.667,-16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,51.111 0,38.889 16.667,-16.666 16.666,16.666 5.556,-5.556 -16.666,-16.666 16.666,-16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>'} },{}],37:[function(t){t("./tableToCsv.js")},{"./tableToCsv.js":38}],38:[function(t){"use strict";var e=t("jquery");e.fn.tableToCsv=function(t){var n="";t=e.extend({quote:'"',delimiter:",",lineBreak:"\n"},t);var r=function(e){var n=!1;e.match("[\\w|"+t.delimiter+"|"+t.quote+"]")&&(n=!0);return n},i=function(e){e.replace(t.quote,t.quote+t.quote);r(e)&&(e=t.quote+e+t.quote);n+=" "+e+" "+t.delimiter},o=function(e){e.forEach(function(t){i(t)});n+=t.lineBreak},a=e(this),s={},l=0;a.find("tr:first *").each(function(){e(this).attr("colspan")?l+=+e(this).attr("colspan"):l++});a.find("tr").each(function(t,n){for(var r=e(n),i=[],a=0,u=0;l>u+a;u++)if(s[u]){i.push(s[u].text);s[u].rowSpan--;s[u].rowSpan||delete s[u]}else{var c=r.find(":nth-child("+(u+1)+")");console.log(c);var f=c.attr("colspan"),h=c.attr("rowspan");if(f&&!isNaN(f)){for(var d=0;f>d;d++)i.push(c.text());a+=f-1}else if(h&&!isNaN(h)){s[u+a]={rowSpan:h-1,text:c.text()};i.push(c.text());a++}else i.push(c.text())}o(i)});return n}},{jquery:19}],39:[function(t,e){"use strict";var n=t("jquery"),r=t("yasgui-utils");console=console||{log:function(){}};t("./jquery/extendJquery.js");var i=e.exports=function(e,o,a){var s={};s.options=n.extend(!0,{},i.defaults,o);s.container=n("<div class='yasr'></div>").appendTo(e);s.header=n("<div class='yasr_header'></div>").appendTo(s.container);s.resultsContainer=n("<div class='yasr_results'></div>").appendTo(s.container);s.storage=r.storage;var l=null;s.getPersistencyId=function(t){null===l&&(l=s.options.persistency&&s.options.persistency.prefix?"string"==typeof s.options.persistency.prefix?s.options.persistency.prefix:s.options.persistency.prefix(s):!1);return l&&t?l+("string"==typeof t?t:t(s)):null};s.options.useGoogleCharts&&t("./gChartLoader.js").once("initError",function(){s.options.useGoogleCharts=!1}).init();s.plugins={};for(var u in i.plugins)(s.options.useGoogleCharts||"gchart"!=u)&&(s.plugins[u]=new i.plugins[u](s));s.updateHeader=function(){var t=s.header.find(".yasr_downloadIcon").removeAttr("title"),e=s.header.find(".yasr_embedBtn"),n=s.plugins[s.options.output];if(n){var r=n.getDownloadInfo?n.getDownloadInfo():null;if(r){r.buttonTitle&&t.attr("title",r.buttonTitle);t.prop("disabled",!1);t.find("path").each(function(){this.style.fill="black"})}else{t.prop("disabled",!0).prop("title","Download not supported for this result representation");t.find("path").each(function(){this.style.fill="gray"})}var i=null;n.getEmbedHtml&&(i=n.getEmbedHtml());i&&i.length>0?e.show():e.hide()}};s.draw=function(t){if(!s.results)return!1;t||(t=s.options.output);var e=null,r=-1,i=[];for(var o in s.plugins)if(s.plugins[o].canHandleResults(s)){var a=s.plugins[o].getPriority;"function"==typeof a&&(a=a(s));if(null!=a&&void 0!=a&&a>r){r=a;e=o}}else i.push(o);c(i);if(t in s.plugins&&s.plugins[t].canHandleResults(s)){n(s.resultsContainer).empty();s.plugins[t].draw();return!0}if(e){n(s.resultsContainer).empty();s.plugins[e].draw();return!0}return!1};var c=function(t){s.header.find(".yasr_btnGroup .yasr_btn").removeClass("disabled");t.forEach(function(t){s.header.find(".yasr_btnGroup .select_"+t).addClass("disabled")})};s.somethingDrawn=function(){return!s.resultsContainer.is(":empty")};s.setResponse=function(e,n,i){try{s.results=t("./parsers/wrapper.js")(e,n,i)}catch(o){s.results={getException:function(){return o}}}s.draw();var a=s.getPersistencyId(s.options.persistency.results.key);a&&(s.results.getOriginalResponseAsString&&s.results.getOriginalResponseAsString().length<s.options.persistency.results.maxSize?r.storage.set(a,s.results.getAsStoreObject(),"month"):r.storage.remove(a))};var f=null,h=null,d=null;s.warn=function(t){if(!f){f=n("<div>",{"class":"toggableWarning"}).prependTo(s.container).hide();h=n("<span>",{"class":"toggleWarning"}).html("&times;").click(function(){f.hide(400)}).appendTo(f);d=n("<span>",{"class":"toggableMsg"}).appendTo(f)}d.empty();t instanceof n?d.append(t):d.html(t);f.show(400)};var p=null,g=function(){if(null===p){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;p=t&&Blob}return p},m=null,v=function(e){var i=function(){var t=n('<div class="yasr_btnGroup"></div>');n.each(e.plugins,function(i,o){if(!o.hideFromSelection){var a=o.name||i,s=n("<button class='yasr_btn'></button>").text(a).addClass("select_"+i).click(function(){t.find("button.selected").removeClass("selected");n(this).addClass("selected");e.options.output=i;var o=e.getPersistencyId(e.options.persistency.outputSelector);o&&r.storage.set(o,e.options.output,"month");f&&f.hide(400);e.draw();e.updateHeader()}).appendTo(t);e.options.output==i&&s.addClass("selected")}});t.children().length>1&&e.header.append(t)},o=function(){var r=function(t,e){var n=null,r=window.URL||window.webkitURL||window.mozURL||window.msURL;if(r&&Blob){var i=new Blob([t],{type:e});n=r.createObjectURL(i)}return n},i=n("<button class='yasr_btn yasr_downloadIcon btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").download)).click(function(){var i=e.plugins[e.options.output];if(i&&i.getDownloadInfo){var o=i.getDownloadInfo(),a=r(o.getContent(),o.contentType?o.contentType:"text/plain"),s=n("<a></a>",{href:a,download:o.filename});t("./utils.js").fireClick(s)}});e.header.append(i)},a=function(){var r=n("<button class='yasr_btn btn_fullscreen btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").fullscreen)).click(function(){e.container.addClass("yasr_fullscreen")});e.header.append(r)},s=function(){var r=n("<button class='yasr_btn btn_smallscreen btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").smallscreen)).click(function(){e.container.removeClass("yasr_fullscreen")});e.header.append(r)},l=function(){m=n("<button>",{"class":"yasr_btn yasr_embedBtn",title:"Get HTML snippet to embed results on a web page"}).text("</>").click(function(t){var r=e.plugins[e.options.output];if(r&&r.getEmbedHtml){var i=r.getEmbedHtml();t.stopPropagation();var o=n("<div class='yasr_embedPopup'></div>").appendTo(e.header);n("html").click(function(){o&&o.remove()});o.click(function(t){t.stopPropagation()});var a=n("<textarea>").val(i);a.focus(function(){var t=n(this);t.select();t.mouseup(function(){t.unbind("mouseup");return!1})});o.empty().append(a);var s=m.position(),l=s.top+m.outerHeight()+"px",u=Math.max(s.left+m.outerWidth()-o.outerWidth(),0)+"px";o.css("top",l).css("left",u)}});e.header.append(m)};a();s();e.options.drawOutputSelector&&i();e.options.drawDownloadIcon&&g()&&o();l()},y=s.getPersistencyId(s.options.persistency.outputSelector);if(y){var b=r.storage.get(y);b&&(s.options.output=b)}v(s);if(!a&&s.options.persistency&&s.options.persistency.results){var x,w=s.getPersistencyId(s.options.persistency.results.key);w&&(x=r.storage.get(w));if(!x&&s.options.persistency.results.id){var C="string"==typeof s.options.persistency.results.id?s.options.persistency.results.id:s.options.persistency.results.id(s);if(C){x=r.storage.get(C);x&&r.storage.remove(C)}}x&&(n.isArray(x)?s.setResponse.apply(this,x):s.setResponse(x))}a&&s.setResponse(a);s.updateHeader();return s};i.plugins={};i.registerOutput=function(t,e){i.plugins[t]=e};i.defaults=t("./defaults.js");i.version={YASR:t("../package.json").version,jquery:n.fn.jquery,"yasgui-utils":t("yasgui-utils").version};i.$=n;try{i.registerOutput("boolean",t("./boolean.js"))}catch(o){}try{i.registerOutput("rawResponse",t("./rawResponse.js"))}catch(o){}try{i.registerOutput("table",t("./table.js"))}catch(o){}try{i.registerOutput("error",t("./error.js"))}catch(o){}try{i.registerOutput("pivot",t("./pivot.js"))}catch(o){}try{i.registerOutput("gchart",t("./gchart.js"))}catch(o){}},{"../package.json":28,"./boolean.js":30,"./defaults.js":31,"./error.js":32,"./gChartLoader.js":34,"./gchart.js":35,"./imgs.js":36,"./jquery/extendJquery.js":37,"./parsers/wrapper.js":44,"./pivot.js":46,"./rawResponse.js":47,"./table.js":48,"./utils.js":49,jquery:19,"yasgui-utils":25}],40:[function(t,e){"use strict";t("jquery"),e.exports=function(e){return t("./dlv.js")(e,",")}},{"./dlv.js":41,jquery:19}],41:[function(t,e){"use strict";var n=t("jquery");t("../../lib/jquery.csv-0.71.js");e.exports=function(t,e){var r={},i=n.csv.toArrays(t,{separator:e}),o=function(t){return 0==t.indexOf("http")?"uri":null},a=function(){if(2==i.length&&1==i[0].length&&1==i[1].length&&"boolean"==i[0][0]&&("1"==i[1][0]||"0"==i[1][0])){r["boolean"]="1"==i[1][0]?!0:!1;return!0}return!1},s=function(){if(i.length>0&&i[0].length>0){r.head={vars:i[0]};return!0}return!1},l=function(){if(i.length>1){r.results={bindings:[]};for(var t=1;t<i.length;t++){for(var e={},n=0;n<i[t].length;n++){var a=r.head.vars[n];if(a){var s=i[t][n],l=o(s);e[a]={value:s};l&&(e[a].type=l)}}r.results.bindings.push(e)}r.head={vars:i[0]};return!0}return!1},u=a();if(!u){var c=s();c&&l()}return r}},{"../../lib/jquery.csv-0.71.js":4,jquery:19}],42:[function(t,e){"use strict";t("jquery"),e.exports=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return!1}return"object"==typeof t&&t.constructor==={}.constructor?t:!1}},{jquery:19}],43:[function(t,e){"use strict";t("jquery"),e.exports=function(e){return t("./dlv.js")(e," ")}},{"./dlv.js":41,jquery:19}],44:[function(t,e){"use strict";t("jquery"),e.exports=function(e,n,r){var i={xml:t("./xml.js"),json:t("./json.js"),tsv:t("./tsv.js"),csv:t("./csv.js")},o=null,a=null,s=null,l=null,u=null,c=function(){if("object"==typeof e){if(e.exception)u=e.exception;else if(void 0!=e.status&&(e.status>=300||0===e.status)){u={status:e.status};"string"==typeof r&&(u.errorString=r);e.responseText&&(u.responseText=e.responseText);e.statusText&&(u.statusText=e.statusText)}if(e.contentType)o=e.contentType.toLowerCase();else if(e.getResponseHeader&&e.getResponseHeader("content-type")){var t=e.getResponseHeader("content-type").trim().toLowerCase();t.length>0&&(o=t)}e.response?a=e.response:n||r||(a=e)}u||a||(a=e.responseText?e.responseText:e)},f=function(){if(s)return s;if(s===!1||u)return!1;var t=function(){if(o)if(o.indexOf("json")>-1){try{s=i.json(a)}catch(t){u=t}l="json"}else if(o.indexOf("xml")>-1){try{s=i.xml(a)}catch(t){u=t}l="xml"}else if(o.indexOf("csv")>-1){try{s=i.csv(a)}catch(t){u=t}l="csv"}else if(o.indexOf("tab-separated")>-1){try{s=i.tsv(a)}catch(t){u=t}l="tsv"}},e=function(){s=i.json(a);if(s)l="json";else try{s=i.xml(a);s&&(l="xml")}catch(t){}};t();s||e();s||(s=!1);return s},h=function(){var t=f();return t&&"head"in t?t.head.vars:null},d=function(){var t=f();return t&&"results"in t?t.results.bindings:null},p=function(){var t=f();return t&&"boolean"in t?t["boolean"]:null},g=function(){return a},m=function(){var t="";"string"==typeof a?t=a:"json"==l?t=JSON.stringify(a,void 0,2):"xml"==l&&(t=(new XMLSerializer).serializeToString(a));return t},v=function(){return u},y=function(){null==l&&f();return l},b=function(){var t={};if(e.status){t.status=e.status;t.responseText=e.responseText;t.statusText=e.statusText;t.contentType=o}else t=e;var i=n,a=void 0;"string"==typeof r&&(a=r);return[t,i,a]};c();s=f();return{getAsStoreObject:b,getAsJson:f,getOriginalResponse:g,getOriginalResponseAsString:m,getOriginalContentType:function(){return o},getVariables:h,getBindings:d,getBoolean:p,getType:y,getException:v}}},{"./csv.js":40,"./json.js":42,"./tsv.js":43,"./xml.js":45,jquery:19}],45:[function(t,e){"use strict";{var n=t("jquery");e.exports=function(t){var e=function(t){a.head={};for(var e=0;e<t.childNodes.length;e++){var n=t.childNodes[e];if("variable"==n.nodeName){a.head.vars||(a.head.vars=[]);var r=n.getAttribute("name");r&&a.head.vars.push(r)}}},r=function(t){a.results={};a.results.bindings=[];for(var e=0;e<t.childNodes.length;e++){for(var n=t.childNodes[e],r=null,i=0;i<n.childNodes.length;i++){var o=n.childNodes[i];if("binding"==o.nodeName){var s=o.getAttribute("name");if(s){r=r||{};r[s]={};for(var l=0;l<o.childNodes.length;l++){var u=o.childNodes[l],c=u.nodeName;if("#text"!=c){r[s].type=c;r[s].value=u.innerHTML;var f=u.getAttribute("datatype");f&&(r[s].datatype=f)}}}}}r&&a.results.bindings.push(r)}},i=function(t){a["boolean"]="true"==t.innerHTML?!0:!1},o=null;"string"==typeof t?o=n.parseXML(t):n.isXMLDoc(t)&&(o=t);var t=null;if(!(o.childNodes.length>0))return null;t=o.childNodes[0];for(var a={},s=0;s<t.childNodes.length;s++){var l=t.childNodes[s];"head"==l.nodeName&&e(l);"results"==l.nodeName&&r(l);"boolean"==l.nodeName&&i(l)}return a}}},{jquery:19}],46:[function(t,e){"use strict";var n=t("jquery"),r=t("./utils.js"),i=t("yasgui-utils"),o=t("./imgs.js");t("jquery-ui/sortable");t("pivottable");if(!n.fn.pivotUI)throw new Error("Pivot lib not loaded");var a=e.exports=function(e){var s=n.extend(!0,{},a.defaults);if(s.useD3Chart){try{var l=t("d3");l&&t("../node_modules/pivottable/dist/d3_renderers.js")}catch(u){}n.pivotUtilities.d3_renderers&&n.extend(!0,n.pivotUtilities.renderers,n.pivotUtilities.d3_renderers)}var c,f=null,h=function(){var t=e.results.getVariables();if(!s.mergeLabelsWithUris)return t;var n=[];f="string"==typeof s.mergeLabelsWithUris?s.mergeLabelsWithUris:"Label";t.forEach(function(e){-1!==e.indexOf(f,e.length-f.length)&&t.indexOf(e.substring(0,e.length-f.length))>=0||n.push(e)});return n},d=function(t){var n=h(),i=null;e.options.getUsedPrefixes&&(i="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);e.results.getBindings().forEach(function(e){var o={};n.forEach(function(t){if(t in e){var n=e[t].value;f&&e[t+f]?n=e[t+f].value:"uri"==e[t].type&&(n=r.uriToPrefixed(i,n));o[t]=n}else o[t]=null});t(o)})},p=e.getPersistencyId(s.persistencyId),g=function(){var t=i.storage.get(p);if(t){var r=e.results.getVariables(),o=!0;t.cols.forEach(function(t){r.indexOf(t)<0&&(o=!1)});o&&t.rows.forEach(function(t){r.indexOf(t)<0&&(o=!1)});if(!o){t.cols=[];t.rows=[]}n.pivotUtilities.renderers[t.rendererName]||delete t.rendererName}else t={};return t},m=function(){var r=function(){var t=function(t){if(p){var n={cols:t.cols,rows:t.rows,rendererName:t.rendererName,aggregatorName:t.aggregatorName,vals:t.vals};i.storage.set(p,n,"month")}t.rendererName.toLowerCase().indexOf(" chart")>=0?r.show():r.hide();e.updateHeader()},r=n("<button>",{"class":"openPivotGchart yasr_btn"}).text("Chart Config").click(function(){c.find('div[dir="ltr"]').dblclick()}).appendTo(e.resultsContainer);c=n("<div>",{"class":"pivotTable"}).appendTo(n(e.resultsContainer));var s=n.extend(!0,{},g(),a.defaults.pivotTable);s.onRefresh=function(){var e=s.onRefresh;return function(n){t(n);e&&e(n)}}();window.pivot=c.pivotUI(d,s);var l=n(i.svg.getElement(o.move));c.find(".pvtTriangle").replaceWith(l);n(".pvtCols").prepend(n("<div>",{"class":"containerHeader"}).text("Columns"));n(".pvtRows").prepend(n("<div>",{"class":"containerHeader"}).text("Rows"));n(".pvtUnused").prepend(n("<div>",{"class":"containerHeader"}).text("Available Variables"));n(".pvtVals").prepend(n("<div>",{"class":"containerHeader"}).text("Cells"));setTimeout(e.updateHeader,400)};e.options.useGoogleCharts&&s.useGoogleCharts&&!n.pivotUtilities.gchart_renderers?t("./gChartLoader.js").on("done",function(){try{t("../node_modules/pivottable/dist/gchart_renderers.js");n.extend(!0,n.pivotUtilities.renderers,n.pivotUtilities.gchart_renderers)}catch(e){s.useGoogleCharts=!1}r()}).on("error",function(){console.log("could not load gchart");s.useGoogleCharts=!1;r()}).googleLoad():r()},v=function(){return e.results&&e.results.getVariables&&e.results.getVariables()&&e.results.getVariables().length>0},y=function(){if(!e.results)return null;var t=e.resultsContainer.find(".pvtRendererArea svg");if(t.length>0)return{getContent:function(){return t[0].outerHTML?t[0].outerHTML:n("<div>").append(t.clone()).html()},filename:"queryResults.svg",contentType:"image/svg+xml",buttonTitle:"Download SVG Image"};var r=e.resultsContainer.find(".pvtRendererArea table");return r.length>0?{getContent:function(){return r.tableToCsv()},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:void 0},b=function(){if(!e.results)return null;var t=e.resultsContainer.find(".pvtRendererArea svg").clone().removeAttr("height").removeAttr("width").css("height","").css("width","");if(0==t.length)return null;var r=t[0].outerHTML;r||(r=n("<div>").append(t.clone()).html());return'<div style="width: 800px; height: 600px;">\n'+r+"\n</div>"};return{getDownloadInfo:y,getEmbedHtml:b,options:s,draw:m,name:"Pivot Table",canHandleResults:v,getPriority:4}};a.defaults={mergeLabelsWithUris:!1,useGoogleCharts:!0,useD3Chart:!0,persistencyId:"pivot",pivotTable:{}};a.version={"YASR-rawResponse":t("../package.json").version,jquery:n.fn.jquery}},{"../node_modules/pivottable/dist/d3_renderers.js":20,"../node_modules/pivottable/dist/gchart_renderers.js":21,"../package.json":28,"./gChartLoader.js":34,"./imgs.js":36,"./utils.js":49,d3:14,jquery:19,"jquery-ui/sortable":17,pivottable:22,"yasgui-utils":25}],47:[function(t,e){"use strict";var n=t("jquery"),r=t("codemirror");t("codemirror/addon/fold/foldcode.js");t("codemirror/addon/fold/foldgutter.js");t("codemirror/addon/fold/xml-fold.js");t("codemirror/addon/fold/brace-fold.js");t("codemirror/addon/edit/matchbrackets.js");t("codemirror/mode/xml/xml.js");t("codemirror/mode/javascript/javascript.js");var i=e.exports=function(t){var e=n.extend(!0,{},i.defaults),o=null,a=function(){var n=e.CodeMirror;n.value=t.results.getOriginalResponseAsString();var i=t.results.getType();if(i){"json"==i&&(i={name:"javascript",json:!0});n.mode=i}o=r(t.resultsContainer.get()[0],n);o.on("fold",function(){o.refresh()});o.on("unfold",function(){o.refresh()})},s=function(){if(!t.results)return!1;if(!t.results.getOriginalResponseAsString)return!1;var e=t.results.getOriginalResponseAsString();return e&&0!=e.length||!t.results.getException()?!0:!1},l=function(){if(!t.results)return null;var e=t.results.getOriginalContentType(),n=t.results.getType();return{getContent:function(){return t.results.getOriginalResponse()},filename:"queryResults"+(n?"."+n:""),contentType:e?e:"text/plain",buttonTitle:"Download raw response"}};return{draw:a,name:"Raw Response",canHandleResults:s,getPriority:2,getDownloadInfo:l}};i.defaults={CodeMirror:{readOnly:!0,lineNumbers:!0,lineWrapping:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]}};i.version={"YASR-rawResponse":t("../package.json").version,jquery:n.fn.jquery,CodeMirror:r.version}},{"../package.json":28,codemirror:11,"codemirror/addon/edit/matchbrackets.js":6,"codemirror/addon/fold/brace-fold.js":7,"codemirror/addon/fold/foldcode.js":8,"codemirror/addon/fold/foldgutter.js":9,"codemirror/addon/fold/xml-fold.js":10,"codemirror/mode/javascript/javascript.js":12,"codemirror/mode/xml/xml.js":13,jquery:19}],48:[function(t,e){"use strict";var n=t("jquery"),r=t("yasgui-utils"),i=t("./utils.js"),o=t("./imgs.js");t("../lib/DataTables/media/js/jquery.dataTables.js");t("../lib/colResizable-1.4.js");var a=e.exports=function(e){var i=null,s={name:"Table",getPriority:10},l=s.options=n.extend(!0,{},a.defaults),c=l.persistency?e.getPersistencyId(l.persistency.tableLength):null,f=function(){var t=[],n=e.results.getBindings(),r=e.results.getVariables(),i=null;e.options.getUsedPrefixes&&(i="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);for(var o=0;o<n.length;o++){var a=[];a.push("");for(var u=n[o],c=0;c<r.length;c++){var f=r[c];a.push(f in u?l.getCellContent?l.getCellContent(e,s,u,f,{rowId:o,colId:c,usedPrefixes:i}):"":"")}t.push(a)}return t},h=e.getPersistencyId("eventId")||"yasr_"+n(e.container).closest("[id]").attr("id"),d=function(){i.on("order.dt",function(){p()});c&&i.on("length.dt",function(t,e,n){r.storage.set(c,n,"month")});n.extend(!0,l.callbacks,l.handlers);i.delegate("td","click",function(t){if(l.callbacks&&l.callbacks.onCellClick){var e=l.callbacks.onCellClick(this,t);if(e===!1)return!1}}).delegate("td","mouseenter",function(t){l.callbacks&&l.callbacks.onCellMouseEnter&&l.callbacks.onCellMouseEnter(this,t);var e=n(this);l.fetchTitlesFromPreflabel&&void 0===e.attr("title")&&0==e.text().trim().indexOf("http")&&u(e)}).delegate("td","mouseleave",function(t){l.callbacks&&l.callbacks.onCellMouseLeave&&l.callbacks.onCellMouseLeave(this,t)});n(window).off("resize."+h);n(window).on("resize."+h,g);g()};s.draw=function(){i=n('<table cellpadding="0" cellspacing="0" border="0" class="resultsTable"></table>');n(e.resultsContainer).html(i);var t=l.datatable;t.data=f();t.columns=l.getColumns(e,s);var o=r.storage.get(c);o&&(t.pageLength=o);i.DataTable(n.extend(!0,{},t));p();d();i.colResizable();i.find("thead").outerHeight();n(e.resultsContainer).find(".JCLRgrip").height(i.find("thead").outerHeight());var a=e.header.outerHeight()-5;if(a>0){e.resultsContainer.find(".dataTables_wrapper").css("position","relative").css("top","-"+a+"px").css("margin-bottom","-"+a+"px");n(e.resultsContainer).find(".JCLRgrip").css("marginTop",a+"px")}};var p=function(){var t={sorting:"unsorted",sorting_asc:"sortAsc",sorting_desc:"sortDesc"};i.find(".sortIcons").remove();for(var e in t){var a=n("<div class='sortIcons'></div>");r.svg.draw(a,o[t[e]]);i.find("th."+e).append(a)}};s.canHandleResults=function(){return e.results&&e.results.getVariables&&e.results.getVariables()&&e.results.getVariables().length>0};s.getDownloadInfo=function(){return e.results?{getContent:function(){return t("./bindingsToCsv.js")(e.results.getAsJson())},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:null};var g=function(){var t=!0,n=e.container.find(".yasr_downloadIcon"),r=e.container.find(".dataTables_filter"),i=n.offset().left;if(i>0){var o=i+n.outerWidth(),a=r.offset().left;a>0&&o>a&&(t=!1)}t?r.css("visibility","visible"):r.css("visibility","hidden")};return s},s=function(t,e,n){var r=i.escapeHtmlEntities(n.value);if(n["xml:lang"])r='"'+r+'"<sup>@'+n["xml:lang"]+"</sup>";else if(n.datatype){var o="http://www.w3.org/2001/XMLSchema#",a=n.datatype;a=0===a.indexOf(o)?"xsd:"+a.substring(o.length):"&lt;"+a+"&gt;";r='"'+r+'"<sup>^^'+a+"</sup>"}return r},l=function(t,e,n,r,i){var o=n[r],a=null;if("uri"==o.type){var l=null,u=o.value,c=u;if(i.usedPrefixes)for(var f in i.usedPrefixes)if(0==c.indexOf(i.usedPrefixes[f])){c=f+":"+u.substring(i.usedPrefixes[f].length);break}if(e.options.mergeLabelsWithUris){var h="string"==typeof e.options.mergeLabelsWithUris?e.options.mergeLabelsWithUris:"Label";if(n[r+h]){c=s(t,e,n[r+h]);l=u}}a="<a "+(l?"title='"+u+"' ":"")+"class='uri' target='_blank' href='"+u+"'>"+c+"</a>"}else a="<span class='nonUri'>"+s(t,e,o)+"</span>";return"<div>"+a+"</div>"},u=function(t){var e=function(){t.attr("title","")};n.get("http://preflabel.org/api/v1/label/"+encodeURIComponent(t.text())+"?silent=true").success(function(n){"object"==typeof n&&n.label?t.attr("title",n.label):"string"==typeof n&&n.length>0?t.attr("title",n):e()}).fail(e)};a.defaults={getCellContent:l,persistency:{tableLength:"tableLength"},getColumns:function(t,e){var n=function(n){if(!e.options.mergeLabelsWithUris)return!0;var r="string"==typeof e.options.mergeLabelsWithUris?e.options.mergeLabelsWithUris:"Label";return-1!==n.indexOf(r,n.length-r.length)&&t.results.getVariables().indexOf(n.substring(0,n.length-r.length))>=0?!1:!0},r=[];r.push({title:""});t.results.getVariables().forEach(function(t){r.push({title:"<span>"+t+"</span>",visible:n(t)})});return r},fetchTitlesFromPreflabel:!0,mergeLabelsWithUris:!1,callbacks:{onCellMouseEnter:null,onCellMouseLeave:null,onCellClick:null},datatable:{autoWidth:!1,order:[],pageLength:50,lengthMenu:[[10,50,100,1e3,-1],[10,50,100,1e3,"All"]],lengthChange:!0,pagingType:"full_numbers",drawCallback:function(t){for(var e=0;e<t.aiDisplay.length;e++)n("td:eq(0)",t.aoData[t.aiDisplay[e]].nTr).html(e+1);var r=!1;n(t.nTableWrapper).find(".paginate_button").each(function(){-1==n(this).attr("class").indexOf("current")&&-1==n(this).attr("class").indexOf("disabled")&&(r=!0)});r?n(t.nTableWrapper).find(".dataTables_paginate").show():n(t.nTableWrapper).find(".dataTables_paginate").hide()},columnDefs:[{width:"32px",orderable:!1,targets:0}]}};a.version={"YASR-table":t("../package.json").version,jquery:n.fn.jquery,"jquery-datatables":n.fn.DataTable.version}},{"../lib/DataTables/media/js/jquery.dataTables.js":2,"../lib/colResizable-1.4.js":3,"../package.json":28,"./bindingsToCsv.js":29,"./imgs.js":36,"./utils.js":49,jquery:19,"yasgui-utils":25}],49:[function(t,e){"use strict";var n=t("jquery"),r=t("./exceptions.js").GoogleTypeException;e.exports={escapeHtmlEntities:function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},uriToPrefixed:function(t,e){if(t)for(var n in t)if(0==e.indexOf(t[n])){e=n+":"+e.substring(t[n].length);break}return e},getGoogleTypeForBinding:function(t){if(null==t)return null;if(null==t.type||"typed-literal"!==t.type&&"literal"!==t.type)return"string";switch(t.datatype){case"http://www.w3.org/2001/XMLSchema#float":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":return"number";case"http://www.w3.org/2001/XMLSchema#date":return"date";case"http://www.w3.org/2001/XMLSchema#dateTime":return"datetime";case"http://www.w3.org/2001/XMLSchema#time":return"timeofday";default:return"string"}},getGoogleTypeForBindings:function(t,n){var i={},o=0;t.forEach(function(t){var r=e.exports.getGoogleTypeForBinding(t[n]);if(null!=r){if(!(r in i)){i[r]=0;o++}i[r]++}});if(0==o)return"string";if(1!=o)throw new r(i,n);for(var a in i)return a},castGoogleType:function(t,n,r){if(null==t)return null;if("string"==r||null==t.type||"typed-literal"!==t.type&&"literal"!==t.type)return(t.type="uri")?e.exports.uriToPrefixed(n,t.value):t.value;switch(t.datatype){case"http://www.w3.org/2001/XMLSchema#float":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":return Number(t.value);case"http://www.w3.org/2001/XMLSchema#date":var o=i(t.value);if(o)return o;case"http://www.w3.org/2001/XMLSchema#dateTime":case"http://www.w3.org/2001/XMLSchema#time":return new Date(t.value);default:return t.value}},fireClick:function(t){t&&t.each(function(t,e){var r=n(e);if(document.dispatchEvent){var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,1,1,1,1,1,!1,!1,!1,!1,0,r[0]);r[0].dispatchEvent(i)}else document.fireEvent&&r[0].click()})}};var i=function(t){var e=new Date(t.replace(/(\d)([\+-]\d{2}:\d{2})/,"$1Z$2"));return isNaN(e)?null:e}},{"./exceptions.js":33,jquery:19}]},{},[1])(1)}); //# sourceMappingURL=yasr.bundled.min.js.map
src/routes/investor/InvestorDetails.js
medevelopment/updatemeadmin
import React, { Component } from 'react'; import s from './Investor.css'; import Link from '../../components/Link'; class InvestorDetails extends Component { constructor(props) { super(props); this.state = { loading: true }; } render() { let investor = this.props.client; let imgUrl = 'http://ec2-52-32-92-71.us-west-2.compute.amazonaws.com/uploads/' + investor.ProfileImage; let styles = { image_container: { backgroundImage: 'url(' + imgUrl + ')' } } return ( <div className="col-xs-12 col-sm-6 col-lg-4"> <div className={s.card}> <div className={s.card_image_container} style={styles.image_container}></div> <div className="card-block"> <h3 className={s.cardtitle}> {investor.ClientName} </h3> <div className={s.inline}> <p className="card-text">Name: {investor.ClientName}</p> <p className="card-text">Email: {investor.Email}</p> <p className="card-text">Phone: {investor.Phone}</p> <p className="card-text">joininig date: להוסיף בטבלה</p> </div> </div> </div> </div> ); } } export default InvestorDetails;
docs/pages/components/box.js
kybarg/material-ui
import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; const req = require.context('docs/src/pages/components/box', false, /\.(md|js|tsx)$/); const reqSource = require.context( '!raw-loader!../../src/pages/components/box', false, /\.(js|tsx)$/, ); const reqPrefix = 'pages/components/box'; export default function Page() { return <MarkdownDocs req={req} reqSource={reqSource} reqPrefix={reqPrefix} />; }
DefaultMarker.js
ptomasroos/react-native-multi-slider
import React from 'react'; import { View, StyleSheet, Platform, TouchableHighlight } from 'react-native'; class DefaultMarker extends React.Component { render() { return ( <TouchableHighlight> <View style={ this.props.enabled ? [ styles.markerStyle, this.props.markerStyle, this.props.pressed && styles.pressedMarkerStyle, this.props.pressed && this.props.pressedMarkerStyle, ] : [ styles.markerStyle, styles.disabled, this.props.disabledMarkerStyle, ] } /> </TouchableHighlight> ); } } const styles = StyleSheet.create({ markerStyle: { ...Platform.select({ ios: { height: 30, width: 30, borderRadius: 30, borderWidth: 1, borderColor: '#DDDDDD', backgroundColor: '#FFFFFF', shadowColor: '#000000', shadowOffset: { width: 0, height: 3, }, shadowRadius: 1, shadowOpacity: 0.2, }, android: { height: 12, width: 12, borderRadius: 12, backgroundColor: '#0D8675', }, web: { height: 30, width: 30, borderRadius: 30, borderWidth: 1, borderColor: '#DDDDDD', backgroundColor: '#FFFFFF', shadowColor: '#000000', shadowOffset: { width: 0, height: 3, }, shadowRadius: 1, shadowOpacity: 0.2, }, }), }, pressedMarkerStyle: { ...Platform.select({ web: {}, ios: {}, android: { height: 20, width: 20, borderRadius: 20, }, }), }, disabled: { backgroundColor: '#d3d3d3', }, }); export default DefaultMarker;
cm19/ReactJS/your-first-react-app-exercises-master/exercise-17/friend-detail/FriendFlipper.js
Brandon-J-Campbell/codemash
import React from 'react'; import classNames from 'classnames'; import ThemeContext from '../theme/context'; import styles from './FriendFlipper.css'; export default class FriendFlipper extends React.Component { state = { flipped: false, }; handleFlipped = () => { this.setState(prevProps => { return { flipped: !prevProps.flipped, }; }); }; render() { return ( <div className={styles.flipWrapper}> <div className={styles.flipper}> {this.state.flipped ? null : this.renderFront()} {!this.state.flipped ? null : this.renderBack()} </div> </div> ); } renderFront() { const { friend } = this.props; return ( <ThemeContext.Consumer> {({ theme }) => ( <div className={styles.front}> <div className={styles.frontContents}> <img src={friend.image} alt={friend.image} /> <button type="button" className={classNames(styles.flipperNav, styles[theme])} onClick={this.handleFlipped} > Details &gt; </button> </div> </div> )} </ThemeContext.Consumer> ); } renderBack() { const { friend } = this.props; return ( <ThemeContext.Consumer> {({ theme }) => ( <div className={styles.back}> <div className={classNames(styles.backContents, styles[theme])}> <img src={friend.image} alt={friend.image} /> <div className={styles.backDetails}> <h3> ID: {friend.id} </h3> <h3>Colors:</h3> <ul> {friend.colors.map(color => ( <li key={color}>{color}</li> ))} </ul> </div> <button type="button" className={classNames(styles.flipperNav, styles[theme])} onClick={this.handleFlipped} > &lt; Back </button> </div> </div> )} </ThemeContext.Consumer> ); } }
app/javascript/mastodon/features/ui/components/navigation_panel.js
tri-star/mastodon
import React from 'react'; import { NavLink, withRouter } from 'react-router-dom'; import { FormattedMessage } from 'react-intl'; import Icon from 'mastodon/components/icon'; import { profile_directory, showTrends } from 'mastodon/initial_state'; import NotificationsCounterIcon from './notifications_counter_icon'; import FollowRequestsNavLink from './follow_requests_nav_link'; import ListPanel from './list_panel'; import TrendsContainer from 'mastodon/features/getting_started/containers/trends_container'; const NavigationPanel = () => ( <div className='navigation-panel'> <NavLink className='column-link column-link--transparent' to='/timelines/home' data-preview-title-id='column.home' data-preview-icon='home' ><Icon className='column-link__icon' id='home' fixedWidth /><FormattedMessage id='tabs_bar.home' defaultMessage='Home' /></NavLink> <NavLink className='column-link column-link--transparent' to='/notifications' data-preview-title-id='column.notifications' data-preview-icon='bell' ><NotificationsCounterIcon className='column-link__icon' /><FormattedMessage id='tabs_bar.notifications' defaultMessage='Notifications' /></NavLink> <FollowRequestsNavLink /> <NavLink className='column-link column-link--transparent' to='/timelines/public/local' data-preview-title-id='column.community' data-preview-icon='users' ><Icon className='column-link__icon' id='users' fixedWidth /><FormattedMessage id='tabs_bar.local_timeline' defaultMessage='Local' /></NavLink> <NavLink className='column-link column-link--transparent' exact to='/timelines/public' data-preview-title-id='column.public' data-preview-icon='globe' ><Icon className='column-link__icon' id='globe' fixedWidth /><FormattedMessage id='tabs_bar.federated_timeline' defaultMessage='Federated' /></NavLink> <NavLink className='column-link column-link--transparent' to='/timelines/direct'><Icon className='column-link__icon' id='envelope' fixedWidth /><FormattedMessage id='navigation_bar.direct' defaultMessage='Direct messages' /></NavLink> <NavLink className='column-link column-link--transparent' to='/favourites'><Icon className='column-link__icon' id='star' fixedWidth /><FormattedMessage id='navigation_bar.favourites' defaultMessage='Favourites' /></NavLink> <NavLink className='column-link column-link--transparent' to='/bookmarks'><Icon className='column-link__icon' id='bookmark' fixedWidth /><FormattedMessage id='navigation_bar.bookmarks' defaultMessage='Bookmarks' /></NavLink> <NavLink className='column-link column-link--transparent' to='/lists'><Icon className='column-link__icon' id='list-ul' fixedWidth /><FormattedMessage id='navigation_bar.lists' defaultMessage='Lists' /></NavLink> {profile_directory && <NavLink className='column-link column-link--transparent' to='/directory'><Icon className='column-link__icon' id='address-book-o' fixedWidth /><FormattedMessage id='getting_started.directory' defaultMessage='Profile directory' /></NavLink>} <ListPanel /> <hr /> <a className='column-link column-link--transparent' href='/settings/preferences'><Icon className='column-link__icon' id='cog' fixedWidth /><FormattedMessage id='navigation_bar.preferences' defaultMessage='Preferences' /></a> <a className='column-link column-link--transparent' href='/relationships'><Icon className='column-link__icon' id='users' fixedWidth /><FormattedMessage id='navigation_bar.follows_and_followers' defaultMessage='Follows and followers' /></a> {showTrends && <div className='flex-spacer' />} {showTrends && <TrendsContainer />} </div> ); export default withRouter(NavigationPanel);
src/containers/ChatFeathers/ChatFeathers.js
hirzanalhakim/testKumparan
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { asyncConnect } from 'redux-connect'; import { connect } from 'react-redux'; import { withApp } from 'app'; import * as chatActions from 'redux/modules/chat'; @asyncConnect([{ promise: ({ store: { dispatch, getState } }) => { const state = getState(); if (state.online) { return dispatch(chatActions.load()); } } }]) @connect( state => ({ user: state.auth.user, messages: state.chat.messages }), { ...chatActions } ) @withApp export default class ChatFeathers extends Component { static propTypes = { app: PropTypes.object.isRequired, user: PropTypes.object.isRequired, addMessage: PropTypes.func.isRequired, messages: PropTypes.array.isRequired }; state = { message: '', error: null }; componentDidMount() { this.props.app.service('messages').on('created', this.props.addMessage); } componentWillUnmount() { this.props.app.service('messages').removeListener('created', this.props.addMessage); } handleSubmit = event => { event.preventDefault(); this.props.app.service('messages').create({ text: this.state.message }) .then(() => this.setState({ message: '', error: false })) .catch(error => { console.log(error); this.setState({ error: error.message || false }); }); } render() { const { user, messages } = this.props; const { error } = this.state; return ( <div className="container"> <h1>Chat</h1> {user && <div> <ul> {messages.map(msg => <li key={`chat.msg.${msg._id}`}>{msg.sentBy.email}: {msg.text}</li>)} </ul> <form onSubmit={this.handleSubmit}> <input type="text" ref={c => { this.message = c; }} placeholder="Enter your message" value={this.state.message} onChange={event => this.setState({ message: event.target.value })} /> <button className="btn" onClick={this.handleSubmit}>Send</button> {error && <div className="text-danger">{error}</div>} </form> </div> } </div> ); } }
client/src/App.js
juandaco/voting-app
/* eslint-disable no-lone-blocks */ // Dependencies import React, { Component } from 'react'; import { Layout, Content, Icon, FABButton } from 'react-mdl'; import fuzzysearch from 'fuzzysearch'; import Delay from 'react-delay'; // To fix Chart.js Bugs // My Components import MyHeader from './components/MyHeader'; import MyDrawer from './components/MyDrawer'; import PollCard from './components/PollCard'; import PopUpDialog from './components/PopUpDialog'; // Others import ApiCalls from './ApiCalls'; import appURL from './config'; class App extends Component { constructor() { super(); this.state = { searchValue: '', searchFocus: false, openDialog: false, dialogType: '', confirmationText: '', currentPollID: '', isUserAuth: false, username: '', userID: '', userIP: '', userPolls: [], userVisible: false, sharedPoll: '', pollData: [] }; // Method Bindings { this.handleSearchChange = this.handleSearchChange.bind(this); this.handleSearchKeys = this.handleSearchKeys.bind(this); this.showDialog = this.showDialog.bind(this); this.hideDialog = this.hideDialog.bind(this); this.confirmationDialog = this.confirmationDialog.bind(this); this.newOptionDialog = this.newOptionDialog.bind(this); this.pollDialog = this.pollDialog.bind(this); this.createPoll = this.createPoll.bind(this); this.userVoteDialog = this.userVoteDialog.bind(this); this.showUserDashboard = this.showUserDashboard.bind(this); this.getPolls = this.getPolls.bind(this); this.createPollOption = this.createPollOption.bind(this); this.loginUser = this.loginUser.bind(this); this.logoutUser = this.logoutUser.bind(this); this.setUpPollCards = this.setUpPollCards.bind(this); this.userVote = this.userVote.bind(this); this.verifyUserSession = this.verifyUserSession.bind(this); this.showAllPolls = this.showAllPolls.bind(this); this.aboutDialog = this.aboutDialog.bind(this); this.hideDrawer = this.hideDrawer.bind(this); this.deletePollDialog = this.deletePollDialog.bind(this); this.deletePoll = this.deletePoll.bind(this); this.sharePoll = this.sharePoll.bind(this); this.scrollContentToTop = this.scrollContentToTop.bind(this); this.setupTitle = this.setupTitle.bind(this); this.shareDialog = this.shareDialog.bind(this); this.loginDialog = this.loginDialog.bind(this); this.getUserIP = this.getUserIP.bind(this); } } /* Lifecycle Hooks */ componentDidMount() { this.getPolls(); this.verifyUserSession(); this.getUserIP(); // Get PollID from the URL const pollID = window.location.pathname.slice(7); if (pollID) { setTimeout( () => { this.setState({ sharedPoll: pollID }); }, 500 ); } } /* Poll Functions */ getPolls() { ApiCalls.getPolls().then(polls => { this.setState({ pollData: polls }); }); } getUserPolls() { ApiCalls.getUserPolls().then(resp => { this.setState({ userPolls: resp.polls }); }); } createPoll(poll) { this.hideDialog(); // Poll validation: Not Empty and at least 2 options poll.options = poll.options .split(/\n/) .filter((option, index, self) => { // Remove Empty lines and Duplicates if (option.trim()) { // Not empty line return self.indexOf(option) === index; } return false; }) .map(option => { return { name: option.trim(), votes: 0 }; }); const pollValidation = poll.title !== '' && poll.options.length >= 2; if (pollValidation) { poll.createdBy = this.state.username; ApiCalls.newPoll(poll).then(poll => { // No errors on the request if (!poll.errorMessage) { // Update pollData and userPolls let newPollData = this.state.pollData.slice(); newPollData.push(poll); let newUserPolls = this.state.userPolls.slice(); newUserPolls.push(poll._id); this.setState({ pollData: newPollData, userPolls: newUserPolls }); this.confirmationDialog('Poll Created'); } else { this.confirmationDialog(poll.errorMessage); this.verifyUserSession(); } }); } else { this.confirmationDialog( 'The Poll needs a title and at least two options separated by lines' ); } } createPollOption(option) { this.hideDialog(); ApiCalls.voteFor(option, this.state.currentPollID).then(result => { if (result.errorMessage) { this.confirmationDialog(result.errorMessage); this.verifyUserSession(); } else { this.getPolls(); } }); } showAllPolls(e) { // If User Clicked if (e) { window.history.pushState({}, 'Voting App', appURL); this.setState({ sharedPoll: '' }); } this.setState({ userVisible: false }); this.hideDrawer(); this.scrollContentToTop(); } sharePoll() { this.hideDialog(); // Get Radio Buttons Value const buttons = document.getElementsByName('shareService'); let shareService; buttons.forEach(option => { if (option.checked) { shareService = option.value; } }); const poll = this.state.pollData.find( poll => poll._id === this.state.currentPollID ); let w; let h; const pollURL = `${appURL}/polls/${poll._id}`; let shareURL; if (shareService === 'facebook') { h = 276; w = 550; shareURL = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(pollURL)}`; } else if (shareService === 'twitter') { // Twitter Web Intent h = 276; w = 550; const tweetText = `Check out this cool Poll: "${poll.title}"`; const hashtags = ['FreeCodeCamp', 'VotingApp', 'Pollster']; shareURL = `https://twitter.com/intent/tweet?text=${tweetText}&hashtags=${hashtags.join(',')}&url=${pollURL}`; } else if (shareService === 'google') { // Google Plus share w = 400; h = 520; shareURL = `https://plus.google.com/share?url=${pollURL}`; } const left = screen.width / 2 - w / 2; const top = screen.height / 2 - h / 2; const windowOptions = `width=${w}, height=${h}, top=${top}, left=${left}`; window.open(shareURL, 'Voting Tweet', windowOptions); } deletePoll() { ApiCalls.deletePoll(this.state.currentPollID).then(deletedPoll => { // Remove from pollData let newPollData = this.state.pollData.slice(); const indexOfPoll = newPollData.findIndex( poll => poll._id === deletedPoll._id ); newPollData.splice(indexOfPoll, 1); // Remove from userPolls let newUserPolls = this.state.userPolls.slice(); const indexOfUserPoll = newUserPolls.findIndex(poll => { return poll === deletedPoll._id; }); newUserPolls.splice(indexOfUserPoll, 1); // New State this.setState({ pollData: newPollData, userPolls: newUserPolls }); // Update View if (this.state.userVisible) { this.showUserDashboard(); } }); this.hideDialog(); } /* User Functions */ showUserDashboard(e) { // Verify if User Clicked if (e) { window.history.pushState({}, 'Voting App', appURL); this.setState({ sharedPoll: '', userVisible: true }); } // Set User Visible only when not displaying a particular Poll if (!this.state.sharedPoll) { this.setState({ userVisible: true }); } this.hideDrawer(); this.scrollContentToTop(); } loginUser() { this.hideDialog(); // Get Radio Buttons Value const radioButtons = document.getElementsByName('loginService'); let loginService; radioButtons.forEach(option => { if (option.checked) { loginService = option.value; } }); let w, h; if (loginService === 'github') { w = 360; h = 570; } else if (loginService === 'twitter') { w = 360; h = 560; } else if (loginService === 'google') { w = 460; h = 300; } else if (loginService === 'facebook') { w = 622; h = 560; } const left = screen.width / 2 - w / 2; const top = screen.height / 2 - h / 2; const windowOptions = `width=${w}, height=${h}, top=${top}, left=${left}`; const address = process.env.NODE_ENV === 'development' ? 'http://localhost:3001' : ''; const authURL = `${address}/auth/${loginService}`; const oAuthPopUp = window.open(authURL, 'Github OAuth', windowOptions); // For AutoClosing the popUp once we get an answer window.addEventListener( 'message', e => { if (e.data === 'closePopUp') { oAuthPopUp.close(); this.verifyUserSession(); window.removeEventListener('message', function(e) {}, false); } }, false ); } logoutUser() { ApiCalls.userLogout().then(resp => { this.setState({ isUserAuth: false, username: '', userID: '', userPolls: [], pollFilter: [], searchValue: '' }); this.hideDrawer(); this.confirmationDialog(resp.logoutMessage); this.showAllPolls(); }); } getUserIP() { // Get IP ApiCalls.getIP().then(resp => { this.setState({ userIP: resp.ip }); }); } verifyUserSession() { ApiCalls.verifyUser().then(resp => { if (resp.isUserAuth) { // Set Authenticated State this.setState({ isUserAuth: true, username: resp.username, userID: resp.userID }); this.getUserPolls(); // Bug Fix for React Chart.js not showing Canvas setTimeout( () => { this.showUserDashboard(); }, 350 ); } else { this.setState({ isUserAuth: false }); } }); } userVote(chosen, pollID) { // Get a Particular Poll with its Index let pollIndex; let poll = this.state.pollData.find((poll, i) => { pollIndex = i; return poll._id === pollID; }); // Find out if User or IP voted let userVoted = false; this.state.isUserAuth ? // User Logged (userVoted = poll.votedBy.includes(this.state.userID)) : // No user, check the IP (userVoted = poll.votedBy.includes(this.state.userIP)); if (!userVoted) { let optionIndex = poll.options.findIndex(option => { return option.name === chosen; }); // Copy pollData to avoid Mutations let newData = this.state.pollData.slice(); // Actual Vote newData[pollIndex].options[optionIndex].votes++; // Add the User to votedBy this.state.isUserAuth ? newData[pollIndex].votedBy.push(this.state.userID) : newData[pollIndex].votedBy.push(this.state.userIP); // Request Database Modification const identifier = this.state.userID || this.state.userIP; ApiCalls.voteFor(chosen, pollID, identifier) .then(results => { // Modify the State when successful this.setState({ pollData: newData }); this.userVoteDialog(chosen); }) .catch(err => { this.confirmationDialog( 'There was an error with your vote, please try again' ); }); } else { this.confirmationDialog('You already voted in this Poll'); } } /* PopUp Dialog Functions */ showDialog() { this.setState({ openDialog: true }); } hideDialog() { // this.getPolls(); this.setState({ openDialog: false }); } confirmationDialog(text) { this.setState({ dialogType: 'confirm', confirmationText: text }); this.showDialog(); } newOptionDialog(id) { if (this.state.isUserAuth) { this.setState({ currentPollID: id, dialogType: 'newOption' }); this.showDialog(); } else { this.confirmationDialog('You need to login first'); } } pollDialog() { if (this.state.isUserAuth) { this.setState({ dialogType: 'poll' }); this.showDialog(); } else { this.confirmationDialog('You need to login first.'); } } userVoteDialog(option) { this.confirmationDialog(`You voted for ${option}`); } aboutDialog() { this.setState({ dialogType: 'about' }); this.showDialog(); this.hideDrawer(); } deletePollDialog(pollID) { this.setState({ currentPollID: pollID, dialogType: 'delete' }); this.showDialog(); } shareDialog(pollID) { this.setState({ currentPollID: pollID, dialogType: 'share' }); this.showDialog(); } loginDialog() { this.setState({ dialogType: 'login' }); this.showDialog(); } /* UI Functions */ hideDrawer() { // Hacky way to hide the Drawer after a successful Login const drawer = document.getElementsByClassName('mdl-layout__drawer')[0]; drawer.classList.remove('is-visible'); drawer.setAttribute('aria-hidden', true); const obfus = document.getElementsByClassName('mdl-layout__obfuscator')[0]; obfus.classList.remove('is-visible'); } scrollContentToTop() { const content = document.getElementsByClassName('mdl-layout__content')[0]; content.scrollTop = 0; } setupTitle() { let title; if (this.state.sharedPoll && this.state.pollData.length) { const poll = this.state.pollData.find( poll => poll._id === this.state.sharedPoll ); title = poll.title; } else { title = this.state.userVisible ? 'My Polls' : 'All Polls'; } return title; } /* Search Funtions */ handleSearchChange(e) { const value = e.target.value; this.setState({ searchValue: value }); } handleSearchKeys(e) { const textInput = document.getElementById('textfield-Search'); if (e.keyCode === 27) { // Erase Search Text this.setState({ searchValue: '' }); textInput.blur(); } else if (e.keyCode === 13) { // Perform search textInput.blur(); } } setUpPollCards() { if (Array.isArray(this.state.pollData)) { return this.state.pollData.map(poll => { let pollData = { id: poll._id, pollTitle: poll.title, options: poll.options, createdBy: poll.createdBy }; let userVisible = true; userVisible = this.state.userVisible ? this.state.userPolls.includes(poll._id) : true; let searchVisible = true; if (this.state.searchValue) { searchVisible = fuzzysearch( this.state.searchValue.toLowerCase(), poll.title.toLowerCase() ); } let sharedVisible = !this.state.sharedPoll; if (poll._id === this.state.sharedPoll) sharedVisible = true; let showDelete = this.state.userPolls.includes(poll._id); return ( // The manual Delay fixes a bug in Chart.js ( <Delay wait={300} key={poll._id}> <PollCard key={poll._id} userVote={this.userVote} userVoteDialog={this.userVoteDialog} newOptionDialog={this.newOptionDialog} confirmationDialog={this.confirmationDialog} pollData={pollData} visible={userVisible && searchVisible && sharedVisible} showDelete={showDelete} shareDialog={this.shareDialog} deletePollDialog={this.deletePollDialog} /> </Delay> ) ); }); } else { return null; } } render() { return ( <div style={{ height: '100vh', position: 'relative' }}> <Layout fixedHeader fixedDrawer> <MyHeader title={this.setupTitle()} searchValue={this.state.searchValue} handleSearchChange={this.handleSearchChange} handleSearchKeys={this.handleSearchKeys} /> <MyDrawer username={this.state.username} userPollCount={this.state.userPolls.length} showUserDashboard={this.showUserDashboard} showAllPolls={this.showAllPolls} loginDialog={this.loginDialog} logoutUser={this.logoutUser} aboutDialog={this.aboutDialog} /> <Content style={{ display: 'flex', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'center' }} > {this.setUpPollCards()} {this.state.userPolls.length === 0 && this.state.userVisible ? <Delay wait={250}> <h4 style={{ marginTop: 200, lineHeight: 1.6, textAlign: 'center', color: 'rgba(128, 128, 128, 0.64)' }} > You don't have any polls! </h4> </Delay> : null} <FABButton colored accent style={{ position: 'fixed', bottom: 20, right: 20, zIndex: 1 }} onClick={this.pollDialog} > <Icon name="add" /> </FABButton> </Content> </Layout> <PopUpDialog open={this.state.openDialog} cancel={this.hideDialog} type={this.state.dialogType} confirmationText={this.state.confirmationText} createPoll={this.createPoll} createPollOption={this.createPollOption} currentPollID={this.state.currentPollID} sharePoll={this.sharePoll} loginUser={this.loginUser} deletePoll={this.deletePoll} /> </div> ); } } export default App;
assets/js/jquery.js
cvaderito/unibeam
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){ return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
app/js/components/ui/containers/form.js
blockstack/blockstack-browser
import React from 'react' import PropTypes from 'prop-types' import { ActionButtons } from '@components/ui/containers/button' import { Form } from '@components/ui/components/form' import { Field } from '@components/ui/containers/field' import { Formik, Field as FormikField } from 'formik' const Fields = ({ fields, errors, ...rest }) => fields.map(({ label, name, ...fieldProps }, i) => { return ( <FormikField label={label} name={name} render={fastFieldProps => ( <Field key={i} label={label} name={name} {...fieldProps} {...fastFieldProps.field} {...rest} error={ (fastFieldProps.meta && fastFieldProps.meta.touched && fastFieldProps.meta.error && fastFieldProps.meta.error) || (errors && errors[name]) } /> )} /> ) }) const FormWrapper = ({ actions, fields, errors, touched, handleSubmit, handleChange, handleBlur }) => { const fieldProps = { errors, touched, handleSubmit, handleChange, onBlur: handleBlur, handleBlur } return ( <Form noValidate> <Fields fields={fields} {...fieldProps} /> <ActionButtons {...actions} /> </Form> ) } const FormContainer = ({ initialValues, validationSchema, onSubmit, validate, validateOnBlur = false, validateOnChange = false, ...rest }) => { const props = validate ? { initialValues, onSubmit, validate, validateOnBlur, validateOnChange, ...rest } : { initialValues, validationSchema, onSubmit, validateOnBlur, validateOnChange, ...rest } return ( <Formik {...props}> {renderProps => <FormWrapper {...renderProps} {...rest} />} </Formik> ) } Fields.propTypes = { actions: PropTypes.array, fields: PropTypes.array, errors: PropTypes.object, touched: PropTypes.object, handleSubmit: PropTypes.func, handleChange: PropTypes.func, handleBlur: PropTypes.func } FormWrapper.propTypes = { actions: PropTypes.array, fields: PropTypes.array, errors: PropTypes.object, touched: PropTypes.object, handleSubmit: PropTypes.func, handleChange: PropTypes.func, handleBlur: PropTypes.func } FormContainer.propTypes = { initialValues: PropTypes.object, validationSchema: PropTypes.object, onSubmit: PropTypes.func, validate: PropTypes.func, validateOnBlur: PropTypes.bool, validateOnChange: PropTypes.bool } export { FormContainer }
sites/all/modules/jquery_update/replace/jquery/1.8/jquery.min.js
mfanpig/come2feed.me
/*! jQuery v1.8.2 jquery.com | jquery.org/license */ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
node_modules/browser-sync/node_modules/bs-recipes/recipes/webpack.react-hot-loader/app/js/main.js
joshapgar/the-apgar
import React from 'react'; // It's important to not define HelloWorld component right in this file // because in that case it will do full page reload on change import HelloWorld from './HelloWorld.jsx'; React.render(<HelloWorld />, document.getElementById('react-root'));
frontend/src/project/components/PairingBoard.spec.js
Pinwheeler/Parrit
import React from 'react' import { shallow } from 'enzyme' import PairingBoard from './PairingBoard.js' import PersonList from './PersonList' describe('<PairingBoard/>', () => { let wrapper, props const InnerPairingBoard = PairingBoard.DecoratedComponent.WrappedComponent beforeEach(() => { props = { id: 77, name: 'PairingBoard1', people: [ { name: 'George' }, { name: 'Hank Muchacho' } ], roles: [ { name: 'Interrupt' } ], exempt: false, editMode: false, editErrorMessage: 'some error message', isOver: false, renamePairingBoard: jasmine.createSpy('renamePairingBoardSpy'), deletePairingBoard: jasmine.createSpy('deletePairingBoardSpy'), moveRole: jasmine.createSpy('moveRoleSpy'), deleteRole: jasmine.createSpy('deleteRoleSpy'), setNewRoleModalOpen: jasmine.createSpy('setNewRoleModalOpen'), setPairingBoardEditMode: jasmine.createSpy('setPairingBoardEditModeSpy'), connectDropTarget: jasmine.createSpy('connectDropTargetSpy') } props.connectDropTarget.and.callFake(i => i) wrapper = shallow(<InnerPairingBoard {...props} />) }) it('renders the pairing board with only the pairing board class', () => { expect(wrapper.prop('className')).toBe('pairing-board') }) it('renders the pairing board header', () => { const pairingBoardHeader = wrapper.find('PairingBoardHeader') expect(pairingBoardHeader.prop('name')).toBe('PairingBoard1') expect(pairingBoardHeader.prop('exempt')).toBe(false) expect(pairingBoardHeader.prop('editMode')).toBe(false) expect(pairingBoardHeader.prop('editErrorMessage')).toBe('some error message') }) it('passes the header a rename function that calls renamePairingBoard with a callback that sets editMode to false', () => { const passedRenameFunction = wrapper.find('PairingBoardHeader').prop('renamePairingBoard') passedRenameFunction('SomeNewName') expect(props.renamePairingBoard).toHaveBeenCalledWith(77, 'SomeNewName', jasmine.anything()) const successCallback = props.renamePairingBoard.calls.mostRecent().args[2] successCallback() expect(props.setPairingBoardEditMode).toHaveBeenCalledWith(77, false) }) it('passes the header a delete function that calls deletePairingBoard', () => { const passedDeleteFunction = wrapper.find('PairingBoardHeader').prop('deletePairingBoard') passedDeleteFunction() expect(props.deletePairingBoard).toHaveBeenCalledWith(77) }) it('passes the header a enable edit mode function that sets editMode to true', () => { const passedEnableEditModeFunction = wrapper.find('PairingBoardHeader').prop('enableEditMode') passedEnableEditModeFunction() expect(props.setPairingBoardEditMode).toHaveBeenCalledWith(77, true) }) it('passes the header a open new role modal function that calls setNewRoleModalOpen', () => { const passedOpenNewRoleModalFunction = wrapper.find('PairingBoardHeader').prop('openNewRoleModal') passedOpenNewRoleModalFunction() expect(props.setNewRoleModalOpen).toHaveBeenCalledWith(77, true) }) it('renders the list of roles with curried methods', () => { const roles = wrapper.find('RoleList') expect(roles.prop('roles')).toBe(props.roles) roles.prop('moveRole')(123, { pairingBoardId: 444 }) expect(props.moveRole).toHaveBeenCalledWith(77, 123, { pairingBoardId: 444 }) roles.prop('deleteRole')(123) expect(props.deleteRole).toHaveBeenCalledWith(77, 123) }) it('renders the list of people', () => { const people = wrapper.find(PersonList) expect(people.prop('people')).toBe(props.people) }) it('adds the editing class when editMode is true', () => { props.editMode = true wrapper = shallow(<InnerPairingBoard {...props} />) expect(wrapper.prop('className')).toContain('editing') }) it('adds the exempt class when exempt is true', () => { props.exempt = true wrapper = shallow(<InnerPairingBoard {...props} />) expect(wrapper.prop('className')).toContain('exempt') }) it('adds the drop-target class when isOver is true', () => { props.isOver = true wrapper = shallow(<InnerPairingBoard {...props} />) expect(wrapper.prop('className')).toContain('drop-target') }) })
helene/assets/js/components/ShortForecast.js
voidpp/Helene
import React from 'react'; import {ComponentAsFactory, bind} from '../tools'; import WeatherStore from '../stores/WeatherStore'; import Lang from '../lang'; export class ShortForecast extends React.Component { constructor(props) { super(props); bind(this, this.onWeatherChange); this.state = { forecast: [] }; } componentDidMount() { WeatherStore.addChangeListener(this.onWeatherChange); } componentWillUnmount() { WeatherStore.removeChangeListener(this.onWeatherChange); } onWeatherChange() { this.setState({forecast: WeatherStore.data.forecast.slice(0,2)}); } getTimeLang(time) { let parts = time.split(' '); return Lang.t(parts[0]) + ' ' + Lang.t(parts[1]); } render() { let rows = []; for (let part of this.state.forecast) { rows.push( tr( td({colSpan: 2, className: 'time'}, this.getTimeLang(part.time)) ), tr( td({className: 'temp'}, part.temp + '°C'), td({className: 'image'}, img({src: part.svg})) ) ) } return table({className: 'short_forecast'}, ...rows); } } export default ComponentAsFactory(ShortForecast);
modules/isReactChildren.js
stonegithubs/react-router
var React = require('react'); function isValidChild(object) { return object == null || React.isValidElement(object); } function isReactChildren(object) { return isValidChild(object) || (Array.isArray(object) && object.every(isValidChild)); } module.exports = isReactChildren;
fields/components/columns/IdColumn.js
Freakland/keystone
import React from 'react'; import ItemsTableCell from '../../../admin/src/components/ItemsTableCell'; import ItemsTableValue from '../../../admin/src/components/ItemsTableValue'; var IdColumn = React.createClass({ displayName: 'IdColumn', propTypes: { col: React.PropTypes.object, data: React.PropTypes.object, list: React.PropTypes.object, }, renderValue () { let value = this.props.data.id; if (!value) return null; return ( <ItemsTableValue padded interior title={value} href={'/keystone/' + this.props.list.path + '/' + value} field={this.props.col.type}> {value} </ItemsTableValue> ); }, render () { return ( <ItemsTableCell> {this.renderValue()} </ItemsTableCell> ); } }); module.exports = IdColumn;
packages/material-ui-icons/src/SentimentVerySatisfiedRounded.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M8.88 9.94l.53.53c.29.29.77.29 1.06 0 .29-.29.29-.77 0-1.06l-.88-.88a.9959.9959 0 0 0-1.41 0l-.89.88c-.29.29-.29.77 0 1.06.29.29.77.29 1.06 0l.53-.53zM12 17.5c2.03 0 3.8-1.11 4.75-2.75.19-.33-.05-.75-.44-.75H7.69c-.38 0-.63.42-.44.75.95 1.64 2.72 2.75 4.75 2.75zM13.53 10.47c.29.29.77.29 1.06 0l.53-.53.53.53c.29.29.77.29 1.06 0 .29-.29.29-.77 0-1.06l-.88-.88a.9959.9959 0 0 0-1.41 0l-.88.88c-.3.29-.3.77-.01 1.06z" /><path d="M11.99 2C6.47 2 2 6.47 2 12s4.47 10 9.99 10S22 17.53 22 12 17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /></g></React.Fragment> , 'SentimentVerySatisfiedRounded');
src/svg-icons/editor/border-color.js
rscnt/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorBorderColor = (props) => ( <SvgIcon {...props}> <path d="M17.75 7L14 3.25l-10 10V17h3.75l10-10zm2.96-2.96c.39-.39.39-1.02 0-1.41L18.37.29c-.39-.39-1.02-.39-1.41 0L15 2.25 18.75 6l1.96-1.96z"/><path fillOpacity=".36" d="M0 20h24v4H0z"/> </SvgIcon> ); EditorBorderColor = pure(EditorBorderColor); EditorBorderColor.displayName = 'EditorBorderColor'; export default EditorBorderColor;
Blog/src/js/components/app.react.js
rcatlin/ryancatlin-info
import React from 'react'; import Header from './header.react'; import Menu from './menu.react'; export default class App extends React.Component { static get displayName() { return 'App'; } constructor(props) { super(props); App.propTypes = { children: React.PropTypes.object.isRequired }; } render() { return ( <div> <Menu /> <Header /> {this.props.children} </div> ); } }
src/MultiSelector/Option.js
appier/react-component-template
import React from 'react'; import classnames from 'classnames'; const Option = React.createClass({ getDefaultProps() { return { currentIndex: 0, index: 0, data: {}, selectValue: ()=>{}, updateCurrentIndex: ()=>{}, }; }, render(){ const {props} = this; const { currentIndex, index, data, selectValue, updateCurrentIndex, } = props; return ( <div className={classnames('option', {highlight: currentIndex === index})} onClick={()=>selectValue(data.key)} onMouseEnter={()=>updateCurrentIndex(index)} > <div className="value">{data.label}</div> </div> ); } }); export default Option;
src/svg-icons/action/done-all.js
matthewoates/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionDoneAll = (props) => ( <SvgIcon {...props}> <path d="M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/> </SvgIcon> ); ActionDoneAll = pure(ActionDoneAll); ActionDoneAll.displayName = 'ActionDoneAll'; ActionDoneAll.muiName = 'SvgIcon'; export default ActionDoneAll;
common/routes/Main/containers/UserTracks.js
kuguarpwnz/musix
import React from 'react'; import { connect } from 'react-redux'; import { addTrack } from '../actions/tracks'; import { getSearchTracks } from '../reducers/search'; import Playlist from '../components/Playlist'; const mapStateToProps = (state) => ({ userAudio: state.user.audio, searchAudio: getSearchTracks(state) }); const mapDispatchToProps = { addTrack }; const UserTracks = ({ userAudio, searchAudio, addTrack }) => ( <Playlist tracks={ searchAudio.length ? searchAudio : userAudio } onClick={addTrack} /> ); export default connect(mapStateToProps, mapDispatchToProps)(UserTracks);
demo/src/mockups/calculator/interfaces/calculator-interface.js
tuantle/hypertoxin
'use strict'; // eslint-disable-line import { Hf } from 'hyperflow'; import { Ht } from 'hypertoxin'; import React from 'react'; import ReactNative from 'react-native'; // eslint-disable-line import EVENT from '../events/calculator-event'; const KEYPADLABELS = [ [ `C`, `7`, `4`, `1`, `0` ], [ `±`, `8`, `5`, `2` ], [ `Pi`, `9`, `6`, `3`, `.` ], [ `÷`, `×`, `-`, `+`, `=` ] ]; const { BodyScreen, HeaderScreen, RowLayout, ColumnLayout, FlatButton, IconImage, HeadlineText, SubtitleText, CaptionText } = Ht; const CalculatorInterface = Hf.Interface.augment({ composites: [ Hf.React.ComponentComposite ], setup (done) { done(); }, render () { const component = this; const { navigation, screenProps } = component.props; const { Theme, shade } = screenProps.component.state; const { displayResult, displayComputes } = component.state; return ([ <HeaderScreen key = 'header-screen' shade = { shade } label = 'CALCULATOR APP' > <FlatButton room = 'content-left' overlay = 'transparent' corner = 'circular' onPress = {() => { component.outgoing(EVENT.ON.RESET).emit(); navigation.navigate(`mockupAppsHome`); }} > <IconImage room = 'content-middle' size = 'large' source = 'go-back' /> </FlatButton> </HeaderScreen>, <BodyScreen key = 'body-screen' shade = { shade } contentTopRoomAlignment = 'stretch' coverImageSource = { shade === `light` ? require(`../../../../assets/images/light-background-with-logo.png`) : require(`../../../../assets/images/dark-background-with-logo.png`) } > <ColumnLayout room = 'content-top' overlay = 'transparent-outline' roomAlignment = 'end' color = 'accent' corner = 'circular' margin = {{ top: 150, horizontal: 20, right: 10 }} > <HeadlineText room = 'content-right' size = 'large' indentation = { -10 } color = { Theme.color.palette.white }>{ displayResult }</HeadlineText> </ColumnLayout> <RowLayout room = 'content-middle' roomAlignment = 'stretch' margin = {{ horizontal: 20 }} > <RowLayout room = 'content-top' overlay = 'transparent' roomAlignment = 'end' margin = {{ bottom: 30 }} > <SubtitleText room = 'content-middle' size = 'small' color = { Theme.color.palette.grey }>{ `${displayComputes}` }</SubtitleText> <CaptionText room = 'content-middle' > Version: 0.6 </CaptionText> </RowLayout> <ColumnLayout room = 'content-middle' overlay = 'transparent' roomAlignment = 'start' margin = {{ horizontal: 40, bottom: 30 }} > { KEYPADLABELS.map((cellLabels, col) => { return ( <RowLayout key = { col } room = 'content-middle' overlay = 'transparent' roomAlignment = 'center' margin = {{ horizontal: 10 }} > { cellLabels.map((cellLabel, row) => { return ( <FlatButton room = 'content-middle' key = { cellLabel } label = { cellLabel } size = 'large' corner = 'round' overlay = 'opaque' color = {(() => { if (row === 0 && col < 3) { return `secondary`; } else if (col === 3) { return `accent`; } return `primary`; })()} onPress = {() => { if (cellLabel === `C`) { component.outgoing(EVENT.ON.RESET).emit(); } else if (cellLabel === `÷` || cellLabel === `×` || cellLabel === `+` || cellLabel === `-`) { component.outgoing(EVENT.ON.OPERATION).emit(() => cellLabel); } else if (Hf.isNumeric(cellLabel) || cellLabel === `.` || cellLabel === `Pi` || cellLabel === `±`) { component.outgoing(EVENT.ON.OPERAND).emit(() => cellLabel); } else if (cellLabel === `=`) { component.outgoing(EVENT.ON.COMPUTE).emit(); } }} /> ); }) } </RowLayout> ); }) } </ColumnLayout> </RowLayout> </BodyScreen> ]); } }); export default CalculatorInterface;
packages/material-ui-icons/src/TagFaces.js
Kagami/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0z" /><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z" /></React.Fragment> , 'TagFaces');
ajax/libs/react-datepicker/0.11.2/react-datepicker.js
jdh8/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react"), require("tether"), require("moment"), require("lodash"), require("react-onclickoutside")); else if(typeof define === 'function' && define.amd) define(["react", "tether", "moment", "lodash", "react-onclickoutside"], factory); else if(typeof exports === 'object') exports["DatePicker"] = factory(require("react"), require("tether"), require("moment"), require("lodash"), require("react-onclickoutside")); else root["DatePicker"] = factory(root["React"], root["Tether"], root["moment"], root["_"], root["OnClickOutside"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_8__, __WEBPACK_EXTERNAL_MODULE_9__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(1); var Popover = __webpack_require__(2); var DateUtil = __webpack_require__(4); var Calendar = __webpack_require__(5); var DateInput = __webpack_require__(10); var moment = __webpack_require__(7); var _ = __webpack_require__(8); var DatePicker = React.createClass({ displayName: "DatePicker", propTypes: { weekdays: React.PropTypes.arrayOf(React.PropTypes.string), locale: React.PropTypes.string, dateFormatCalendar: React.PropTypes.string, onChange: React.PropTypes.func.isRequired, onBlur: React.PropTypes.func }, getDefaultProps: function getDefaultProps() { return { weekdays: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], locale: "en", dateFormatCalendar: "MMMM YYYY", moment: moment, onChange: function onChange() {}, disabled: false }; }, getInitialState: function getInitialState() { return { focus: false, virtualFocus: false, selected: this.props.selected }; }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { this.setState({ selected: nextProps.selected }); }, shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { return !(_.isEqual(nextProps, this.props) && _.isEqual(nextState, this.state)); }, getValue: function getValue() { return this.state.selected; }, handleFocus: function handleFocus() { this.setState({ focus: true }); }, handleBlur: function handleBlur() { this.setState({ virtualFocus: false }); setTimeout((function () { if (!this.state.virtualFocus && typeof this.props.onBlur === "function") { this.props.onBlur(this.state.selected); this.hideCalendar(); } }).bind(this), 200); }, hideCalendar: function hideCalendar() { setTimeout((function () { this.setState({ focus: false }); }).bind(this), 0); }, handleSelect: function handleSelect(date) { this.setSelected(date); setTimeout((function () { this.hideCalendar(); }).bind(this), 200); }, setSelected: function setSelected(date) { var moment = date.moment(); this.props.onChange(moment); this.setState({ selected: moment, virtualFocus: true }); }, clearSelected: function clearSelected() { this.props.onChange(null); this.setState({ selected: null }); }, onInputClick: function onInputClick() { this.setState({ focus: true, virtualFocus: true }); }, calendar: function calendar() { if (this.state.focus) { return React.createElement( Popover, null, React.createElement(Calendar, { weekdays: this.props.weekdays, locale: this.props.locale, moment: this.props.moment, dateFormat: this.props.dateFormatCalendar, selected: this.state.selected, onSelect: this.handleSelect, hideCalendar: this.hideCalendar, minDate: this.props.minDate, maxDate: this.props.maxDate, excludeDates: this.props.excludeDates, weekStart: this.props.weekStart }) ); } }, render: function render() { return React.createElement( "div", null, React.createElement(DateInput, { name: this.props.name, date: this.state.selected, dateFormat: this.props.dateFormat, focus: this.state.focus, onFocus: this.handleFocus, onBlur: this.handleBlur, handleClick: this.onInputClick, handleEnter: this.hideCalendar, setSelected: this.setSelected, clearSelected: this.clearSelected, hideCalendar: this.hideCalendar, placeholderText: this.props.placeholderText, disabled: this.props.disabled, className: this.props.className, title: this.props.title }), this.props.disabled ? null : this.calendar() ); } }); module.exports = DatePicker; /***/ }, /* 1 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_1__; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(1); var Popover = React.createClass({ displayName: "Popover", componentWillMount: function componentWillMount() { var popoverContainer = document.createElement("span"); popoverContainer.className = "datepicker__container"; this._popoverElement = popoverContainer; document.querySelector("body").appendChild(this._popoverElement); }, componentDidMount: function componentDidMount() { this._renderPopover(); }, componentDidUpdate: function componentDidUpdate() { this._renderPopover(); }, _popoverComponent: function _popoverComponent() { var className = this.props.className; return React.createElement( "div", { className: className }, this.props.children ); }, _tetherOptions: function _tetherOptions() { return { element: this._popoverElement, target: this.getDOMNode().parentElement, attachment: "top left", targetAttachment: "bottom left", targetOffset: "10px 0", optimizations: { moveElement: false // always moves to <body> anyway! }, constraints: [{ to: "window", attachment: "together" }] }; }, _renderPopover: function _renderPopover() { React.render(this._popoverComponent(), this._popoverElement); if (this._tether != null) { this._tether.setOptions(this._tetherOptions()); } else if (window && document) { var Tether = __webpack_require__(3); this._tether = new Tether(this._tetherOptions()); } }, componentWillUnmount: function componentWillUnmount() { this._tether.destroy(); React.unmountComponentAtNode(this._popoverElement); if (this._popoverElement.parentNode) { this._popoverElement.parentNode.removeChild(this._popoverElement); } }, render: function render() { return React.createElement("span", null); } }); module.exports = Popover; /***/ }, /* 3 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_3__; /***/ }, /* 4 */ /***/ function(module, exports) { "use strict"; function DateUtil(date) { this._date = date; } DateUtil.prototype.isBefore = function (other) { return this._date.isBefore(other._date, "day"); }; DateUtil.prototype.isAfter = function (other) { return this._date.isAfter(other._date, "day"); }; DateUtil.prototype.sameDay = function (other) { return this._date.isSame(other._date, "day"); }; DateUtil.prototype.sameMonth = function (other) { return this._date.isSame(other._date, "month"); }; DateUtil.prototype.day = function () { return this._date.date(); }; DateUtil.prototype.mapDaysInWeek = function (callback) { var week = []; var firstDay = this._date.clone(); for (var i = 0; i < 7; i++) { var day = new DateUtil(firstDay.clone().add(i, "days")); week[i] = callback(day, i); } return week; }; DateUtil.prototype.mapWeeksInMonth = function (callback) { var month = []; var firstDay = this._date.clone().startOf("month").startOf("week"); for (var i = 0; i < 6; i++) { var weekStart = new DateUtil(firstDay.clone().add(i, "weeks")); month[i] = callback(weekStart, i); } return month; }; DateUtil.prototype.weekInMonth = function (other) { var firstDayInWeek = this._date.clone(); var lastDayInWeek = this._date.clone().weekday(7); return firstDayInWeek.isSame(other._date, "month") || lastDayInWeek.isSame(other._date, "month"); }; DateUtil.prototype.format = function () { return this._date.format.apply(this._date, arguments); }; DateUtil.prototype.localeFormat = function () { var args = Array.prototype.slice.call(arguments); var locale = args.shift(); return this._date.locale(locale).format.apply(this._date, args); }; DateUtil.prototype.addMonth = function () { return new DateUtil(this._date.clone().add(1, "month")); }; DateUtil.prototype.subtractMonth = function () { return new DateUtil(this._date.clone().subtract(1, "month")); }; DateUtil.prototype.clone = function () { return new DateUtil(this._date.clone()); }; DateUtil.prototype.safeClone = function (alternative) { if (!!this._date) return this.clone(); if (alternative === undefined) alternative = null; return new DateUtil(alternative); }; DateUtil.prototype.moment = function () { return this._date; }; module.exports = DateUtil; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(1); var Day = __webpack_require__(6); var DateUtil = __webpack_require__(4); var _ = __webpack_require__(8); var Calendar = React.createClass({ displayName: "Calendar", mixins: [__webpack_require__(9)], handleClickOutside: function handleClickOutside() { this.props.hideCalendar(); }, getInitialState: function getInitialState() { return { date: new DateUtil(this.props.selected).safeClone(this.props.moment()) }; }, getDefaultProps: function getDefaultProps() { return { weekStart: 1 }; }, componentWillMount: function componentWillMount() { this.initializeMomentLocale(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (nextProps.selected === null) { return; } // When the selected date changed if (nextProps.selected !== this.props.selected) { this.setState({ date: new DateUtil(nextProps.selected).clone() }); } }, initializeMomentLocale: function initializeMomentLocale() { var weekdays = this.props.weekdays.slice(0); weekdays = weekdays.concat(weekdays.splice(0, this.props.weekStart)); this.props.moment.locale(this.props.locale, { week: { dow: this.props.weekStart }, weekdaysMin: weekdays }); }, increaseMonth: function increaseMonth() { this.setState({ date: this.state.date.addMonth() }); }, decreaseMonth: function decreaseMonth() { this.setState({ date: this.state.date.subtractMonth() }); }, weeks: function weeks() { return this.state.date.mapWeeksInMonth(this.renderWeek); }, handleDayClick: function handleDayClick(day) { this.props.onSelect(day); }, renderWeek: function renderWeek(weekStart, key) { if (!weekStart.weekInMonth(this.state.date)) { return; } return React.createElement( "div", { key: key }, this.days(weekStart) ); }, renderDay: function renderDay(day, key) { var minDate = new DateUtil(this.props.minDate).safeClone(), maxDate = new DateUtil(this.props.maxDate).safeClone(), excludeDates, disabled; if (this.props.excludeDates && Array.isArray(this.props.excludeDates)) { excludeDates = _(this.props.excludeDates).map(function (date) { return new DateUtil(date).safeClone(); }); } disabled = day.isBefore(minDate) || day.isAfter(maxDate) || _(excludeDates).some(function (xDay) { return day.sameDay(xDay); }); return React.createElement(Day, { key: key, day: day, date: this.state.date, onClick: this.handleDayClick.bind(this, day), selected: new DateUtil(this.props.selected), disabled: disabled }); }, days: function days(weekStart) { return weekStart.mapDaysInWeek(this.renderDay); }, header: function header() { return this.props.moment.weekdaysMin().map(function (day, key) { return React.createElement( "div", { className: "datepicker__day", key: key }, day ); }); }, render: function render() { return React.createElement( "div", { className: "datepicker" }, React.createElement("div", { className: "datepicker__triangle" }), React.createElement( "div", { className: "datepicker__header" }, React.createElement("a", { className: "datepicker__navigation datepicker__navigation--previous", onClick: this.decreaseMonth }), React.createElement( "span", { className: "datepicker__current-month" }, this.state.date.localeFormat(this.props.locale, this.props.dateFormat) ), React.createElement("a", { className: "datepicker__navigation datepicker__navigation--next", onClick: this.increaseMonth }), React.createElement( "div", null, this.header() ) ), React.createElement( "div", { className: "datepicker__month" }, this.weeks() ) ); } }); module.exports = Calendar; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(1); var moment = __webpack_require__(7); var Day = React.createClass({ displayName: "Day", handleClick: function handleClick(event) { if (this.props.disabled) return; this.props.onClick(event); }, isWeekend: function isWeekend() { var weekday = this.props.day.moment().weekday(); return weekday === 5 || weekday === 6; }, render: function render() { var classes = ["datepicker__day"]; if (this.props.disabled) classes.push("datepicker__day--disabled"); if (this.props.day.sameDay(this.props.selected)) classes.push("datepicker__day--selected"); if (this.props.day.sameDay(moment())) classes.push("datepicker__day--today"); if (this.isWeekend()) { classes.push("datepicker__day--weekend"); } return React.createElement( "div", { className: classes.join(" "), onClick: this.handleClick }, this.props.day.day() ); } }); module.exports = Day; /***/ }, /* 7 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_7__; /***/ }, /* 8 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_8__; /***/ }, /* 9 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_9__; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(1); var DateUtil = __webpack_require__(4); var moment = __webpack_require__(7); var DateInput = React.createClass({ displayName: "DateInput", getDefaultProps: function getDefaultProps() { return { dateFormat: "YYYY-MM-DD", className: "datepicker__input", onBlur: function onBlur() {} }; }, getInitialState: function getInitialState() { return { value: this.safeDateFormat(this.props.date) }; }, componentDidMount: function componentDidMount() { this.toggleFocus(this.props.focus); }, componentWillReceiveProps: function componentWillReceiveProps(newProps) { this.toggleFocus(newProps.focus); this.setState({ value: this.safeDateFormat(newProps.date) }); }, toggleFocus: function toggleFocus(focus) { if (focus) { React.findDOMNode(this.refs.input).focus(); } else { React.findDOMNode(this.refs.input).blur(); } }, handleChange: function handleChange(event) { var date = moment(event.target.value, this.props.dateFormat, true); this.setState({ value: event.target.value }); if (date.isValid()) { this.props.setSelected(new DateUtil(date)); } else if (event.target.value === "") { this.props.clearSelected(); } }, safeDateFormat: function safeDateFormat(date) { return !!date ? date.format(this.props.dateFormat) : null; }, handleKeyDown: function handleKeyDown(event) { switch (event.key) { case "Enter": event.preventDefault(); this.props.handleEnter(); break; case "Escape": event.preventDefault(); this.props.hideCalendar(); break; } }, handleClick: function handleClick(event) { if (!this.props.disabled) { this.props.handleClick(event); } }, render: function render() { return React.createElement("input", { ref: "input", type: "text", name: this.props.name, value: this.state.value, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.props.onFocus, onBlur: this.props.onBlur, onChange: this.handleChange, className: "datepicker__input", placeholder: this.props.placeholderText }); } }); module.exports = DateInput; /***/ } /******/ ]) }); ;
themes/cgt/bower_components/modernizr/test/caniuse_files/jquery.min.js
mrogelja/website-concrete5
/*! * jQuery JavaScript Library v1.6.1 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Thu May 12 15:04:36 2011 -0400 */ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("<!doctype><html><body></body></html>");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bF.test(a)?d(a,e):b_(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bQ),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bD(a,b,c){var d=b==="width"?bx:by,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;f.each(d,function(){c||(e-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(f.css(a,"margin"+this))||0:e-=parseFloat(f.css(a,"border"+this+"Width"))||0});return e}function bn(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bm(a){f.nodeName(a,"input")?bl(a):a.getElementsByTagName&&f.grep(a.getElementsByTagName("input"),bl)}function bl(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bk(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bj(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bi(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bh(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(S.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(y,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?C.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(F)return F.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=D.call(arguments,2),g=function(){return a.apply(c,f.concat(D.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),x=e.uaMatch(w),x.browser&&(e.browser[x.browser]=!0,e.browser.version=x.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?z=function(){c.removeEventListener("DOMContentLoaded",z,!1),e.ready()}:c.attachEvent&&(z=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",z),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.addClass(a.call(this,b,c.attr("class")||""))});if(a&&typeof a=="string"){var b=(a||"").split(o);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(!e.className)e.className=a;else{var g=" "+e.className+" ",h=e.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);e.className=f.trim(h)}}}return this},removeClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(o);for(var d=0,e=this.length;d<e;d++){var g=this[d];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(n," ");for(var i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){var d=f(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem )});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,O(a.origType,a.selector),f.extend({},a,{handler:N,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,O(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?F:E):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F,this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var G=function(a){var b=a.relatedTarget;a.type=a.data;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&f.event.handle.apply(this,arguments)}catch(d){}},H=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?H:G,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?H:G)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&L("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&L("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var I,J=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||E,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=y.exec(h),k="",j&&(k=j[0],h=h.replace(y,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,M[h]?(a.push(M[h]+k),h=h+k):h=(M[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+O(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+O(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var P=/Until$/,Q=/^(?:parents|prevUntil|prevAll)/,R=/,/,S=/^.[^:#\[\.,]*$/,T=Array.prototype.slice,U=f.expr.match.POS,V={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=U.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/<tbody/i,bb=/<|&#?\w+;/,bc=/<(?:script|object|embed|option|style)/i,bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bh(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bn)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bc.test(a[0])&&(f.support.checkClone||!bd.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1></$2>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bm(k[i]);else bm(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bo=/alpha\([^)]*\)/i,bp=/opacity=([^)]*)/,bq=/-([a-z])/ig,br=/([A-Z]|^ms)/g,bs=/^-?\d+(?:px)?$/i,bt=/^-?\d/,bu=/^[+\-]=/,bv=/[^+\-\.\de]+/g,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB,bC=function(a,b){return b.toUpperCase()};f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0,widows:!0,orphans:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bu.test(d)&&(d=+d.replace(bv,"")+parseFloat(f.css(a,c))),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bq,bC)}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=bD(a,b,d):f.swap(a,bw,function(){e=bD(a,b,d)});if(e<=0){e=bz(a,b,b),e==="0px"&&bB&&(e=bB(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bs.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cv(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cm.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=cn.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this),f.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cq||cs(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!co&&(cr?(co=1,g=function(){co&&(cr(g),e.tick())},cr(g)):co=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cq||cs(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
docs/app/Examples/elements/Button/GroupVariations/ButtonExampleGroupOrSize.js
shengnian/shengnian-ui-react
import React from 'react' import { Button } from 'shengnian-ui-react' const ButtonExampleGroupOrSize = () => ( <Button.Group size='large'> <Button>One</Button> <Button.Or /> <Button>Three</Button> </Button.Group> ) export default ButtonExampleGroupOrSize
src/message/cachedMessageRender.js
nashvail/zulip-mobile
/* @flow */ import React from 'react'; import isEqual from 'lodash.isequal'; import type { RenderedSectionDescriptor } from '../types'; import MessageListSection from './MessageListSection'; import MessageListItem from './MessageListItem'; let lastRenderedMessages = null; let cachedRenderedData = {}; export default ( renderedMessages: RenderedSectionDescriptor[], onReplySelect?: () => void, ): Object => { if (lastRenderedMessages === renderedMessages) { return cachedRenderedData; } if (!isEqual(lastRenderedMessages, renderedMessages)) { const messageList: Object[] = React.Children.toArray( renderedMessages.reduce((result, section) => { result.push( <MessageListSection key={section.key} message={section.message} />, section.data.map(item => <MessageListItem onReplySelect={onReplySelect} {...item} />), ); return result; }, []), ); const stickyHeaderIndices = messageList .map((component, idx) => (component.type === MessageListSection ? idx + 1 : -1)) .filter(idx => idx !== -1); cachedRenderedData = { messageList, stickyHeaderIndices }; } lastRenderedMessages = renderedMessages; return cachedRenderedData; };
actor-apps/app-web/src/app/components/modals/invite-user/ContactItem.react.js
boneyao/actor-platform
import React from 'react'; import { PureRenderMixin } from 'react/addons'; import AvatarItem from 'components/common/AvatarItem.react'; var ContactItem = React.createClass({ displayName: 'ContactItem', propTypes: { contact: React.PropTypes.object, onSelect: React.PropTypes.func }, mixins: [PureRenderMixin], _onSelect() { this.props.onSelect(this.props.contact); }, render() { let contact = this.props.contact; return ( <li className="contacts__list__item row"> <AvatarItem image={contact.avatar} placeholder={contact.placeholder} size="small" title={contact.name}/> <div className="col-xs"> <span className="title"> {contact.name} </span> </div> <div className="controls"> <a className="material-icons" onClick={this._onSelect}>add</a> </div> </li> ); } }); export default ContactItem;
node_modules/react-icons/md/keyboard-hide.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const MdKeyboardHide = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m20 38.4l-6.6-6.8h13.2z m11.6-25v-3.4h-3.2v3.4h3.2z m0 5v-3.4h-3.2v3.4h3.2z m-5-5v-3.4h-3.2v3.4h3.2z m0 5v-3.4h-3.2v3.4h3.2z m0 6.6v-3.4h-13.2v3.4h13.2z m-15-11.6v-3.4h-3.2v3.4h3.2z m0 5v-3.4h-3.2v3.4h3.2z m1.8-3.4v3.4h3.2v-3.4h-3.2z m0-5v3.4h3.2v-3.4h-3.2z m5 5v3.4h3.2v-3.4h-3.2z m0-5v3.4h3.2v-3.4h-3.2z m15-5c1.8 0 3.2 1.6 3.2 3.4v16.6c0 1.8-1.4 3.4-3.2 3.4h-26.8c-1.8 0-3.2-1.6-3.2-3.4v-16.6c0-1.8 1.4-3.4 3.2-3.4h26.8z"/></g> </Icon> ) export default MdKeyboardHide
asteroids-scoreboard/src/index.js
lachok/asteroids
import React from 'react' import { render } from 'react-dom' import { Provider } from 'react-redux' import createStore from './createStore' import { updateScore } from './actions' import App from './App' import AsteroidsClient from './AsteroidsClient' import './main.less' import 'file?name=[name].[ext]!./index.html' const store = createStore() const scoreClient = new AsteroidsClient() scoreClient.connect('ws://ec2-52-28-1-127.eu-central-1.compute.amazonaws.com/news') const teams = [ { name: 'Team 1', players: ['XYZ', 'ABC'] }, { name: 'Team 2', players: ['OTH'] } ] const areFriends = (killer, victim, teams) => { for(let i = 0; i < teams.length; i++) { const players = teams[i].players if(players.includes(killer) && players.includes(victim)) return true } return false } scoreClient.on('frame', (frame) => { let firesRegex = /([A-Z]{3}) fires/ let shotAsteroidRegex = /([A-Z]{3}) shot ASTEROID/ let hitByAsteroidRegex = /ASTEROID hit ([A-Z]{3})/ let killedRegex = /([A-Z]{3}) killed ([A-Z]{3})/ if (frame && frame.length > 0) { let [, firesMatch] = firesRegex.exec(frame) || [] let [, shotAsteroidMatch] = shotAsteroidRegex.exec(frame) || [] let [, hitByAsteroidMatch] = hitByAsteroidRegex.exec(frame) || [] let [, killedByMatch, killedMatch] = killedRegex.exec(frame) || [] if(firesMatch) { store.dispatch(updateScore(firesMatch, 'fired')) } if(shotAsteroidMatch) { store.dispatch(updateScore(shotAsteroidMatch, 'shotAsteroid')) } if(hitByAsteroidMatch) { store.dispatch(updateScore(hitByAsteroidMatch, 'hitByAsteroid')) } if(killedMatch) { store.dispatch(updateScore(killedMatch, 'died')) } if(killedByMatch) { store.dispatch(updateScore(killedByMatch, 'killed' + (areFriends(killedMatch, killedByMatch, teams) ? 'Friend' : 'Enemy'))) } } }) render( <Provider store={store}> <App /> </Provider>, document.getElementById('app') )
ajax/libs/react-swipe/5.0.1/react-swipe.min.js
redmunds/cdnjs
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("swipe-js-iso")):"function"==typeof define&&define.amd?define("ReactSwipe",["react","swipe-js-iso"],t):"object"==typeof exports?exports.ReactSwipe=t(require("react"),require("swipe-js-iso")):e.ReactSwipe=t(e.React,e.Swipe)}(this,function(e,t){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),a=o(1),u=r(a),c=o(2),l=r(c),f=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return p(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props.swipeOptions;this.swipe=(0,l["default"])(this.refs.container,e)}},{key:"componentWillUnmount",value:function(){this.swipe.kill(),this.swipe=void 0}},{key:"next",value:function(){this.swipe.next()}},{key:"prev",value:function(){this.swipe.prev()}},{key:"render",value:function(){var e=this.props,t=e.id,o=e.className,r=e.style,n=e.children;return u["default"].createElement("div",{ref:"container",id:t,className:"react-swipe-container "+o,style:r.container},u["default"].createElement("div",{style:r.wrapper},u["default"].Children.map(n,function(e){return u["default"].cloneElement(e,{style:r.child})})))}}]),t}(a.Component);f.propTypes={swipeOptions:a.PropTypes.shape({startSlide:a.PropTypes.number,speed:a.PropTypes.number,auto:a.PropTypes.number,continuous:a.PropTypes.bool,disableScroll:a.PropTypes.bool,stopPropagation:a.PropTypes.bool,swiping:a.PropTypes.func,callback:a.PropTypes.func,transitionEnd:a.PropTypes.func}),style:a.PropTypes.shape({container:a.PropTypes.object,wrapper:a.PropTypes.object,child:a.PropTypes.object}),id:a.PropTypes.string,className:a.PropTypes.string},f.defaultProps={swipeOptions:{},style:{container:{overflow:"hidden",visibility:"hidden",position:"relative"},wrapper:{overflow:"hidden",position:"relative"},child:{"float":"left",width:"100%",position:"relative",transitionProperty:"transform"}}},t["default"]=f,e.exports=t["default"]},function(t,o){t.exports=e},function(e,o){e.exports=t}])});
ajax/libs/jplayer/2.6.0/popcorn.js
mzdani/cdnjs
(function(global, document) { // Popcorn.js does not support archaic browsers if ( !document.addEventListener ) { global.Popcorn = { isSupported: false }; var methods = ( "byId forEach extend effects error guid sizeOf isArray nop position disable enable destroy" + "addTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId " + "timeUpdate plugin removePlugin compose effect xhr getJSONP getScript" ).split(/\s+/); while ( methods.length ) { global.Popcorn[ methods.shift() ] = function() {}; } return; } var AP = Array.prototype, OP = Object.prototype, forEach = AP.forEach, slice = AP.slice, hasOwn = OP.hasOwnProperty, toString = OP.toString, // Copy global Popcorn (may not exist) _Popcorn = global.Popcorn, // Ready fn cache readyStack = [], readyBound = false, readyFired = false, // Non-public internal data object internal = { events: { hash: {}, apis: {} } }, // Non-public `requestAnimFrame` // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ requestAnimFrame = (function(){ return global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame || global.msRequestAnimationFrame || function( callback, element ) { global.setTimeout( callback, 16 ); }; }()), // Non-public `getKeys`, return an object's keys as an array getKeys = function( obj ) { return Object.keys ? Object.keys( obj ) : (function( obj ) { var item, list = []; for ( item in obj ) { if ( hasOwn.call( obj, item ) ) { list.push( item ); } } return list; })( obj ); }, Abstract = { // [[Put]] props from dictionary onto |this| // MUST BE CALLED FROM WITHIN A CONSTRUCTOR: // Abstract.put.call( this, dictionary ); put: function( dictionary ) { // For each own property of src, let key be the property key // and desc be the property descriptor of the property. for ( var key in dictionary ) { if ( dictionary.hasOwnProperty( key ) ) { this[ key ] = dictionary[ key ]; } } } }, // Declare constructor // Returns an instance object. Popcorn = function( entity, options ) { // Return new Popcorn object return new Popcorn.p.init( entity, options || null ); }; // Popcorn API version, automatically inserted via build system. Popcorn.version = "@VERSION"; // Boolean flag allowing a client to determine if Popcorn can be supported Popcorn.isSupported = true; // Instance caching Popcorn.instances = []; // Declare a shortcut (Popcorn.p) to and a definition of // the new prototype for our Popcorn constructor Popcorn.p = Popcorn.prototype = { init: function( entity, options ) { var matches, nodeName, self = this; // Supports Popcorn(function () { /../ }) // Originally proposed by Daniel Brooks if ( typeof entity === "function" ) { // If document ready has already fired if ( document.readyState === "complete" ) { entity( document, Popcorn ); return; } // Add `entity` fn to ready stack readyStack.push( entity ); // This process should happen once per page load if ( !readyBound ) { // set readyBound flag readyBound = true; var DOMContentLoaded = function() { readyFired = true; // Remove global DOM ready listener document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // Execute all ready function in the stack for ( var i = 0, readyStackLength = readyStack.length; i < readyStackLength; i++ ) { readyStack[ i ].call( document, Popcorn ); } // GC readyStack readyStack = null; }; // Register global DOM ready listener document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); } return; } if ( typeof entity === "string" ) { try { matches = document.querySelector( entity ); } catch( e ) { throw new Error( "Popcorn.js Error: Invalid media element selector: " + entity ); } } // Get media element by id or object reference this.media = matches || entity; // inner reference to this media element's nodeName string value nodeName = ( this.media.nodeName && this.media.nodeName.toLowerCase() ) || "video"; // Create an audio or video element property reference this[ nodeName ] = this.media; this.options = Popcorn.extend( {}, options ) || {}; // Resolve custom ID or default prefixed ID this.id = this.options.id || Popcorn.guid( nodeName ); // Throw if an attempt is made to use an ID that already exists if ( Popcorn.byId( this.id ) ) { throw new Error( "Popcorn.js Error: Cannot use duplicate ID (" + this.id + ")" ); } this.isDestroyed = false; this.data = { // data structure of all running: { cue: [] }, // Executed by either timeupdate event or in rAF loop timeUpdate: Popcorn.nop, // Allows disabling a plugin per instance disabled: {}, // Stores DOM event queues by type events: {}, // Stores Special event hooks data hooks: {}, // Store track event history data history: [], // Stores ad-hoc state related data] state: { volume: this.media.volume }, // Store track event object references by trackId trackRefs: {}, // Playback track event queues trackEvents: new TrackEvents( this ) }; // Register new instance Popcorn.instances.push( this ); // function to fire when video is ready var isReady = function() { // chrome bug: http://code.google.com/p/chromium/issues/detail?id=119598 // it is possible the video's time is less than 0 // this has the potential to call track events more than once, when they should not // start: 0, end: 1 will start, end, start again, when it should just start // just setting it to 0 if it is below 0 fixes this issue if ( self.media.currentTime < 0 ) { self.media.currentTime = 0; } self.media.removeEventListener( "loadedmetadata", isReady, false ); var duration, videoDurationPlus, runningPlugins, runningPlugin, rpLength, rpNatives; // Adding padding to the front and end of the arrays // this is so we do not fall off either end duration = self.media.duration; // Check for no duration info (NaN) videoDurationPlus = duration != duration ? Number.MAX_VALUE : duration + 1; Popcorn.addTrackEvent( self, { start: videoDurationPlus, end: videoDurationPlus }); if ( !self.isDestroyed ) { self.data.durationChange = function() { var newDuration = self.media.duration, newDurationPlus = newDuration + 1, byStart = self.data.trackEvents.byStart, byEnd = self.data.trackEvents.byEnd; // Remove old padding events byStart.pop(); byEnd.pop(); // Remove any internal tracking of events that have end times greater than duration // otherwise their end events will never be hit. for ( var k = byEnd.length - 1; k > 0; k-- ) { if ( byEnd[ k ].end > newDuration ) { self.removeTrackEvent( byEnd[ k ]._id ); } } // Remove any internal tracking of events that have end times greater than duration // otherwise their end events will never be hit. for ( var i = 0; i < byStart.length; i++ ) { if ( byStart[ i ].end > newDuration ) { self.removeTrackEvent( byStart[ i ]._id ); } } // References to byEnd/byStart are reset, so accessing it this way is // forced upon us. self.data.trackEvents.byEnd.push({ start: newDurationPlus, end: newDurationPlus }); self.data.trackEvents.byStart.push({ start: newDurationPlus, end: newDurationPlus }); }; // Listen for duration changes and adjust internal tracking of event timings self.media.addEventListener( "durationchange", self.data.durationChange, false ); } if ( self.options.frameAnimation ) { // if Popcorn is created with frameAnimation option set to true, // requestAnimFrame is used instead of "timeupdate" media event. // This is for greater frame time accuracy, theoretically up to // 60 frames per second as opposed to ~4 ( ~every 15-250ms) self.data.timeUpdate = function () { Popcorn.timeUpdate( self, {} ); // fire frame for each enabled active plugin of every type Popcorn.forEach( Popcorn.manifest, function( key, val ) { runningPlugins = self.data.running[ val ]; // ensure there are running plugins on this type on this instance if ( runningPlugins ) { rpLength = runningPlugins.length; for ( var i = 0; i < rpLength; i++ ) { runningPlugin = runningPlugins[ i ]; rpNatives = runningPlugin._natives; rpNatives && rpNatives.frame && rpNatives.frame.call( self, {}, runningPlugin, self.currentTime() ); } } }); self.emit( "timeupdate" ); !self.isDestroyed && requestAnimFrame( self.data.timeUpdate ); }; !self.isDestroyed && requestAnimFrame( self.data.timeUpdate ); } else { self.data.timeUpdate = function( event ) { Popcorn.timeUpdate( self, event ); }; if ( !self.isDestroyed ) { self.media.addEventListener( "timeupdate", self.data.timeUpdate, false ); } } }; self.media.addEventListener( "error", function() { self.error = self.media.error; }, false ); // http://www.whatwg.org/specs/web-apps/current-work/#dom-media-readystate // // If media is in readyState (rS) >= 1, we know the media's duration, // which is required before running the isReady function. // If rS is 0, attach a listener for "loadedmetadata", // ( Which indicates that the media has moved from rS 0 to 1 ) // // This has been changed from a check for rS 2 because // in certain conditions, Firefox can enter this code after dropping // to rS 1 from a higher state such as 2 or 3. This caused a "loadeddata" // listener to be attached to the media object, an event that had // already triggered and would not trigger again. This left Popcorn with an // instance that could never start a timeUpdate loop. if ( self.media.readyState >= 1 ) { isReady(); } else { self.media.addEventListener( "loadedmetadata", isReady, false ); } return this; } }; // Extend constructor prototype to instance prototype // Allows chaining methods to instances Popcorn.p.init.prototype = Popcorn.p; Popcorn.byId = function( str ) { var instances = Popcorn.instances, length = instances.length, i = 0; for ( ; i < length; i++ ) { if ( instances[ i ].id === str ) { return instances[ i ]; } } return null; }; Popcorn.forEach = function( obj, fn, context ) { if ( !obj || !fn ) { return {}; } context = context || this; var key, len; // Use native whenever possible if ( forEach && obj.forEach === forEach ) { return obj.forEach( fn, context ); } if ( toString.call( obj ) === "[object NodeList]" ) { for ( key = 0, len = obj.length; key < len; key++ ) { fn.call( context, obj[ key ], key, obj ); } return obj; } for ( key in obj ) { if ( hasOwn.call( obj, key ) ) { fn.call( context, obj[ key ], key, obj ); } } return obj; }; Popcorn.extend = function( obj ) { var dest = obj, src = slice.call( arguments, 1 ); Popcorn.forEach( src, function( copy ) { for ( var prop in copy ) { dest[ prop ] = copy[ prop ]; } }); return dest; }; // A Few reusable utils, memoized onto Popcorn Popcorn.extend( Popcorn, { noConflict: function( deep ) { if ( deep ) { global.Popcorn = _Popcorn; } return Popcorn; }, error: function( msg ) { throw new Error( msg ); }, guid: function( prefix ) { Popcorn.guid.counter++; return ( prefix ? prefix : "" ) + ( +new Date() + Popcorn.guid.counter ); }, sizeOf: function( obj ) { var size = 0; for ( var prop in obj ) { size++; } return size; }, isArray: Array.isArray || function( array ) { return toString.call( array ) === "[object Array]"; }, nop: function() {}, position: function( elem ) { if ( !elem.parentNode ) { return null; } var clientRect = elem.getBoundingClientRect(), bounds = {}, doc = elem.ownerDocument, docElem = document.documentElement, body = document.body, clientTop, clientLeft, scrollTop, scrollLeft, top, left; // Determine correct clientTop/Left clientTop = docElem.clientTop || body.clientTop || 0; clientLeft = docElem.clientLeft || body.clientLeft || 0; // Determine correct scrollTop/Left scrollTop = ( global.pageYOffset && docElem.scrollTop || body.scrollTop ); scrollLeft = ( global.pageXOffset && docElem.scrollLeft || body.scrollLeft ); // Temp top/left top = Math.ceil( clientRect.top + scrollTop - clientTop ); left = Math.ceil( clientRect.left + scrollLeft - clientLeft ); for ( var p in clientRect ) { bounds[ p ] = Math.round( clientRect[ p ] ); } return Popcorn.extend({}, bounds, { top: top, left: left }); }, disable: function( instance, plugin ) { if ( instance.data.disabled[ plugin ] ) { return; } instance.data.disabled[ plugin ] = true; if ( plugin in Popcorn.registryByName && instance.data.running[ plugin ] ) { for ( var i = instance.data.running[ plugin ].length - 1, event; i >= 0; i-- ) { event = instance.data.running[ plugin ][ i ]; event._natives.end.call( instance, null, event ); instance.emit( "trackend", Popcorn.extend({}, event, { plugin: event.type, type: "trackend" }) ); } } return instance; }, enable: function( instance, plugin ) { if ( !instance.data.disabled[ plugin ] ) { return; } instance.data.disabled[ plugin ] = false; if ( plugin in Popcorn.registryByName && instance.data.running[ plugin ] ) { for ( var i = instance.data.running[ plugin ].length - 1, event; i >= 0; i-- ) { event = instance.data.running[ plugin ][ i ]; event._natives.start.call( instance, null, event ); instance.emit( "trackstart", Popcorn.extend({}, event, { plugin: event.type, type: "trackstart", track: event }) ); } } return instance; }, destroy: function( instance ) { var events = instance.data.events, trackEvents = instance.data.trackEvents, singleEvent, item, fn, plugin; // Iterate through all events and remove them for ( item in events ) { singleEvent = events[ item ]; for ( fn in singleEvent ) { delete singleEvent[ fn ]; } events[ item ] = null; } // remove all plugins off the given instance for ( plugin in Popcorn.registryByName ) { Popcorn.removePlugin( instance, plugin ); } // Remove all data.trackEvents #1178 trackEvents.byStart.length = 0; trackEvents.byEnd.length = 0; if ( !instance.isDestroyed ) { instance.data.timeUpdate && instance.media.removeEventListener( "timeupdate", instance.data.timeUpdate, false ); instance.isDestroyed = true; } Popcorn.instances.splice( Popcorn.instances.indexOf( instance ), 1 ); } }); // Memoized GUID Counter Popcorn.guid.counter = 1; // Factory to implement getters, setters and controllers // as Popcorn instance methods. The IIFE will create and return // an object with defined methods Popcorn.extend(Popcorn.p, (function() { var methods = "load play pause currentTime playbackRate volume duration preload playbackRate " + "autoplay loop controls muted buffered readyState seeking paused played seekable ended", ret = {}; // Build methods, store in object that is returned and passed to extend Popcorn.forEach( methods.split( /\s+/g ), function( name ) { ret[ name ] = function( arg ) { var previous; if ( typeof this.media[ name ] === "function" ) { // Support for shorthanded play(n)/pause(n) jump to currentTime // If arg is not null or undefined and called by one of the // allowed shorthandable methods, then set the currentTime // Supports time as seconds or SMPTE if ( arg != null && /play|pause/.test( name ) ) { this.media.currentTime = Popcorn.util.toSeconds( arg ); } this.media[ name ](); return this; } if ( arg != null ) { // Capture the current value of the attribute property previous = this.media[ name ]; // Set the attribute property with the new value this.media[ name ] = arg; // If the new value is not the same as the old value // emit an "attrchanged event" if ( previous !== arg ) { this.emit( "attrchange", { attribute: name, previousValue: previous, currentValue: arg }); } return this; } return this.media[ name ]; }; }); return ret; })() ); Popcorn.forEach( "enable disable".split(" "), function( method ) { Popcorn.p[ method ] = function( plugin ) { return Popcorn[ method ]( this, plugin ); }; }); Popcorn.extend(Popcorn.p, { // Rounded currentTime roundTime: function() { return Math.round( this.media.currentTime ); }, // Attach an event to a single point in time exec: function( id, time, fn ) { var length = arguments.length, eventType = "trackadded", trackEvent, sec, options; // Check if first could possibly be a SMPTE string // p.cue( "smpte string", fn ); // try/catch avoid awful throw in Popcorn.util.toSeconds // TODO: Get rid of that, replace with NaN return? try { sec = Popcorn.util.toSeconds( id ); } catch ( e ) {} // If it can be converted into a number then // it's safe to assume that the string was SMPTE if ( typeof sec === "number" ) { id = sec; } // Shift arguments based on use case // // Back compat for: // p.cue( time, fn ); if ( typeof id === "number" && length === 2 ) { fn = time; time = id; id = Popcorn.guid( "cue" ); } else { // Support for new forms // p.cue( "empty-cue" ); if ( length === 1 ) { // Set a time for an empty cue. It's not important what // the time actually is, because the cue is a no-op time = -1; } else { // Get the TrackEvent that matches the given id. trackEvent = this.getTrackEvent( id ); if ( trackEvent ) { // remove existing cue so a new one can be added via trackEvents.add this.data.trackEvents.remove( id ); TrackEvent.end( this, trackEvent ); // Update track event references Popcorn.removeTrackEvent.ref( this, id ); eventType = "cuechange"; // p.cue( "my-id", 12 ); // p.cue( "my-id", function() { ... }); if ( typeof id === "string" && length === 2 ) { // p.cue( "my-id", 12 ); // The path will update the cue time. if ( typeof time === "number" ) { // Re-use existing TrackEvent start callback fn = trackEvent._natives.start; } // p.cue( "my-id", function() { ... }); // The path will update the cue function if ( typeof time === "function" ) { fn = time; // Re-use existing TrackEvent start time time = trackEvent.start; } } } else { if ( length >= 2 ) { // p.cue( "a", "00:00:00"); if ( typeof time === "string" ) { try { sec = Popcorn.util.toSeconds( time ); } catch ( e ) {} time = sec; } // p.cue( "b", 11 ); // p.cue( "b", 11, function() {} ); if ( typeof time === "number" ) { fn = fn || Popcorn.nop(); } // p.cue( "c", function() {}); if ( typeof time === "function" ) { fn = time; time = -1; } } } } } options = { id: id, start: time, end: time + 1, _running: false, _natives: { start: fn || Popcorn.nop, end: Popcorn.nop, type: "cue" } }; if ( trackEvent ) { options = Popcorn.extend( trackEvent, options ); } if ( eventType === "cuechange" ) { // Supports user defined track event id options._id = options.id || options._id || Popcorn.guid( options._natives.type ); this.data.trackEvents.add( options ); TrackEvent.start( this, options ); this.timeUpdate( this, null, true ); // Store references to user added trackevents in ref table Popcorn.addTrackEvent.ref( this, options ); this.emit( eventType, Popcorn.extend({}, options, { id: id, type: eventType, previousValue: { time: trackEvent.start, fn: trackEvent._natives.start }, currentValue: { time: time, fn: fn || Popcorn.nop }, track: trackEvent })); } else { // Creating a one second track event with an empty end Popcorn.addTrackEvent( this, options ); } return this; }, // Mute the calling media, optionally toggle mute: function( toggle ) { var event = toggle == null || toggle === true ? "muted" : "unmuted"; // If `toggle` is explicitly `false`, // unmute the media and restore the volume level if ( event === "unmuted" ) { this.media.muted = false; this.media.volume = this.data.state.volume; } // If `toggle` is either null or undefined, // save the current volume and mute the media element if ( event === "muted" ) { this.data.state.volume = this.media.volume; this.media.muted = true; } // Trigger either muted|unmuted event this.emit( event ); return this; }, // Convenience method, unmute the calling media unmute: function( toggle ) { return this.mute( toggle == null ? false : !toggle ); }, // Get the client bounding box of an instance element position: function() { return Popcorn.position( this.media ); }, // Toggle a plugin's playback behaviour (on or off) per instance toggle: function( plugin ) { return Popcorn[ this.data.disabled[ plugin ] ? "enable" : "disable" ]( this, plugin ); }, // Set default values for plugin options objects per instance defaults: function( plugin, defaults ) { // If an array of default configurations is provided, // iterate and apply each to this instance if ( Popcorn.isArray( plugin ) ) { Popcorn.forEach( plugin, function( obj ) { for ( var name in obj ) { this.defaults( name, obj[ name ] ); } }, this ); return this; } if ( !this.options.defaults ) { this.options.defaults = {}; } if ( !this.options.defaults[ plugin ] ) { this.options.defaults[ plugin ] = {}; } Popcorn.extend( this.options.defaults[ plugin ], defaults ); return this; } }); Popcorn.Events = { UIEvents: "blur focus focusin focusout load resize scroll unload", MouseEvents: "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave click dblclick", Events: "loadstart progress suspend emptied stalled play pause error " + "loadedmetadata loadeddata waiting playing canplay canplaythrough " + "seeking seeked timeupdate ended ratechange durationchange volumechange" }; Popcorn.Events.Natives = Popcorn.Events.UIEvents + " " + Popcorn.Events.MouseEvents + " " + Popcorn.Events.Events; internal.events.apiTypes = [ "UIEvents", "MouseEvents", "Events" ]; // Privately compile events table at load time (function( events, data ) { var apis = internal.events.apiTypes, eventsList = events.Natives.split( /\s+/g ), idx = 0, len = eventsList.length, prop; for( ; idx < len; idx++ ) { data.hash[ eventsList[idx] ] = true; } apis.forEach(function( val, idx ) { data.apis[ val ] = {}; var apiEvents = events[ val ].split( /\s+/g ), len = apiEvents.length, k = 0; for ( ; k < len; k++ ) { data.apis[ val ][ apiEvents[ k ] ] = true; } }); })( Popcorn.Events, internal.events ); Popcorn.events = { isNative: function( type ) { return !!internal.events.hash[ type ]; }, getInterface: function( type ) { if ( !Popcorn.events.isNative( type ) ) { return false; } var eventApi = internal.events, apis = eventApi.apiTypes, apihash = eventApi.apis, idx = 0, len = apis.length, api, tmp; for ( ; idx < len; idx++ ) { tmp = apis[ idx ]; if ( apihash[ tmp ][ type ] ) { api = tmp; break; } } return api; }, // Compile all native events to single array all: Popcorn.Events.Natives.split( /\s+/g ), // Defines all Event handling static functions fn: { trigger: function( type, data ) { var eventInterface, evt, clonedEvents, events = this.data.events[ type ]; // setup checks for custom event system if ( events ) { eventInterface = Popcorn.events.getInterface( type ); if ( eventInterface ) { evt = document.createEvent( eventInterface ); evt.initEvent( type, true, true, global, 1 ); this.media.dispatchEvent( evt ); return this; } // clone events in case callbacks remove callbacks themselves clonedEvents = events.slice(); // iterate through all callbacks while ( clonedEvents.length ) { clonedEvents.shift().call( this, data ); } } return this; }, listen: function( type, fn ) { var self = this, hasEvents = true, eventHook = Popcorn.events.hooks[ type ], origType = type, clonedEvents, tmp; if ( typeof fn !== "function" ) { throw new Error( "Popcorn.js Error: Listener is not a function" ); } // Setup event registry entry if ( !this.data.events[ type ] ) { this.data.events[ type ] = []; // Toggle if the previous assumption was untrue hasEvents = false; } // Check and setup event hooks if ( eventHook ) { // Execute hook add method if defined if ( eventHook.add ) { eventHook.add.call( this, {}, fn ); } // Reassign event type to our piggyback event type if defined if ( eventHook.bind ) { type = eventHook.bind; } // Reassign handler if defined if ( eventHook.handler ) { tmp = fn; fn = function wrapper( event ) { eventHook.handler.call( self, event, tmp ); }; } // assume the piggy back event is registered hasEvents = true; // Setup event registry entry if ( !this.data.events[ type ] ) { this.data.events[ type ] = []; // Toggle if the previous assumption was untrue hasEvents = false; } } // Register event and handler this.data.events[ type ].push( fn ); // only attach one event of any type if ( !hasEvents && Popcorn.events.all.indexOf( type ) > -1 ) { this.media.addEventListener( type, function( event ) { if ( self.data.events[ type ] ) { // clone events in case callbacks remove callbacks themselves clonedEvents = self.data.events[ type ].slice(); // iterate through all callbacks while ( clonedEvents.length ) { clonedEvents.shift().call( self, event ); } } }, false ); } return this; }, unlisten: function( type, fn ) { var ind, events = this.data.events[ type ]; if ( !events ) { return; // no listeners = nothing to do } if ( typeof fn === "string" ) { // legacy support for string-based removal -- not recommended for ( var i = 0; i < events.length; i++ ) { if ( events[ i ].name === fn ) { // decrement i because array length just got smaller events.splice( i--, 1 ); } } return this; } else if ( typeof fn === "function" ) { while( ind !== -1 ) { ind = events.indexOf( fn ); if ( ind !== -1 ) { events.splice( ind, 1 ); } } return this; } // if we got to this point, we are deleting all functions of this type this.data.events[ type ] = null; return this; } }, hooks: { canplayall: { bind: "canplaythrough", add: function( event, callback ) { var state = false; if ( this.media.readyState ) { // always call canplayall asynchronously setTimeout(function() { callback.call( this, event ); }.bind(this), 0 ); state = true; } this.data.hooks.canplayall = { fired: state }; }, // declare special handling instructions handler: function canplayall( event, callback ) { if ( !this.data.hooks.canplayall.fired ) { // trigger original user callback once callback.call( this, event ); this.data.hooks.canplayall.fired = true; } } } } }; // Extend Popcorn.events.fns (listen, unlisten, trigger) to all Popcorn instances // Extend aliases (on, off, emit) Popcorn.forEach( [ [ "trigger", "emit" ], [ "listen", "on" ], [ "unlisten", "off" ] ], function( key ) { Popcorn.p[ key[ 0 ] ] = Popcorn.p[ key[ 1 ] ] = Popcorn.events.fn[ key[ 0 ] ]; }); // Internal Only - construct simple "TrackEvent" // data type objects function TrackEvent( track ) { Abstract.put.call( this, track ); } // Determine if a TrackEvent's "start" and "trackstart" must be called. TrackEvent.start = function( instance, track ) { if ( track.end > instance.media.currentTime && track.start <= instance.media.currentTime && !track._running ) { track._running = true; instance.data.running[ track._natives.type ].push( track ); if ( !instance.data.disabled[ track._natives.type ] ) { track._natives.start.call( instance, null, track ); instance.emit( "trackstart", Popcorn.extend( {}, track, { plugin: track._natives.type, type: "trackstart", track: track }) ); } } }; // Determine if a TrackEvent's "end" and "trackend" must be called. TrackEvent.end = function( instance, track ) { var runningPlugins; if ( ( track.end <= instance.media.currentTime || track.start > instance.media.currentTime ) && track._running ) { runningPlugins = instance.data.running[ track._natives.type ]; track._running = false; runningPlugins.splice( runningPlugins.indexOf( track ), 1 ); if ( !instance.data.disabled[ track._natives.type ] ) { track._natives.end.call( instance, null, track ); instance.emit( "trackend", Popcorn.extend( {}, track, { plugin: track._natives.type, type: "trackend", track: track }) ); } } }; // Internal Only - construct "TrackEvents" // data type objects that are used by the Popcorn // instance, stored at p.data.trackEvents function TrackEvents( parent ) { this.parent = parent; this.byStart = [{ start: -1, end: -1 }]; this.byEnd = [{ start: -1, end: -1 }]; this.animating = []; this.startIndex = 0; this.endIndex = 0; this.previousUpdateTime = -1; this.count = 1; } function isMatch( obj, key, value ) { return obj[ key ] && obj[ key ] === value; } TrackEvents.prototype.where = function( params ) { return ( this.parent.getTrackEvents() || [] ).filter(function( event ) { var key, value; // If no explicit params, match all TrackEvents if ( !params ) { return true; } // Filter keys in params against both the top level properties // and the _natives properties for ( key in params ) { value = params[ key ]; if ( isMatch( event, key, value ) || isMatch( event._natives, key, value ) ) { return true; } } return false; }); }; TrackEvents.prototype.add = function( track ) { // Store this definition in an array sorted by times var byStart = this.byStart, byEnd = this.byEnd, startIndex, endIndex; // Push track event ids into the history if ( track && track._id ) { this.parent.data.history.push( track._id ); } track.start = Popcorn.util.toSeconds( track.start, this.parent.options.framerate ); track.end = Popcorn.util.toSeconds( track.end, this.parent.options.framerate ); for ( startIndex = byStart.length - 1; startIndex >= 0; startIndex-- ) { if ( track.start >= byStart[ startIndex ].start ) { byStart.splice( startIndex + 1, 0, track ); break; } } for ( endIndex = byEnd.length - 1; endIndex >= 0; endIndex-- ) { if ( track.end > byEnd[ endIndex ].end ) { byEnd.splice( endIndex + 1, 0, track ); break; } } // update startIndex and endIndex if ( startIndex <= this.parent.data.trackEvents.startIndex && track.start <= this.parent.data.trackEvents.previousUpdateTime ) { this.parent.data.trackEvents.startIndex++; } if ( endIndex <= this.parent.data.trackEvents.endIndex && track.end < this.parent.data.trackEvents.previousUpdateTime ) { this.parent.data.trackEvents.endIndex++; } this.count++; }; TrackEvents.prototype.remove = function( removeId, state ) { if ( removeId instanceof TrackEvent ) { removeId = removeId.id; } if ( typeof removeId === "object" ) { // Filter by key=val and remove all matching TrackEvents this.where( removeId ).forEach(function( event ) { // |this| refers to the calling Popcorn "parent" instance this.removeTrackEvent( event._id ); }, this.parent ); return this; } var start, end, animate, historyLen, track, length = this.byStart.length, index = 0, indexWasAt = 0, byStart = [], byEnd = [], animating = [], history = [], comparable = {}; state = state || {}; while ( --length > -1 ) { start = this.byStart[ index ]; end = this.byEnd[ index ]; // Padding events will not have _id properties. // These should be safely pushed onto the front and back of the // track event array if ( !start._id ) { byStart.push( start ); byEnd.push( end ); } // Filter for user track events (vs system track events) if ( start._id ) { // If not a matching start event for removal if ( start._id !== removeId ) { byStart.push( start ); } // If not a matching end event for removal if ( end._id !== removeId ) { byEnd.push( end ); } // If the _id is matched, capture the current index if ( start._id === removeId ) { indexWasAt = index; // cache the track event being removed track = start; } } // Increment the track index index++; } // Reset length to be used by the condition below to determine // if animating track events should also be filtered for removal. // Reset index below to be used by the reverse while as an // incrementing counter length = this.animating.length; index = 0; if ( length ) { while ( --length > -1 ) { animate = this.animating[ index ]; // Padding events will not have _id properties. // These should be safely pushed onto the front and back of the // track event array if ( !animate._id ) { animating.push( animate ); } // If not a matching animate event for removal if ( animate._id && animate._id !== removeId ) { animating.push( animate ); } // Increment the track index index++; } } // Update if ( indexWasAt <= this.startIndex ) { this.startIndex--; } if ( indexWasAt <= this.endIndex ) { this.endIndex--; } this.byStart = byStart; this.byEnd = byEnd; this.animating = animating; this.count--; historyLen = this.parent.data.history.length; for ( var i = 0; i < historyLen; i++ ) { if ( this.parent.data.history[ i ] !== removeId ) { history.push( this.parent.data.history[ i ] ); } } // Update ordered history array this.parent.data.history = history; }; // Helper function used to retrieve old values of properties that // are provided for update. function getPreviousProperties( oldOptions, newOptions ) { var matchProps = {}; for ( var prop in oldOptions ) { if ( hasOwn.call( newOptions, prop ) && hasOwn.call( oldOptions, prop ) ) { matchProps[ prop ] = oldOptions[ prop ]; } } return matchProps; } // Internal Only - Adds track events to the instance object Popcorn.addTrackEvent = function( obj, track ) { var temp; if ( track instanceof TrackEvent ) { return; } track = new TrackEvent( track ); // Determine if this track has default options set for it // If so, apply them to the track object if ( track && track._natives && track._natives.type && ( obj.options.defaults && obj.options.defaults[ track._natives.type ] ) ) { // To ensure that the TrackEvent Invariant Policy is enforced, // First, copy the properties of the newly created track event event // to a temporary holder temp = Popcorn.extend( {}, track ); // Next, copy the default onto the newly created trackevent, followed by the // temporary holder. Popcorn.extend( track, obj.options.defaults[ track._natives.type ], temp ); } if ( track._natives ) { // Supports user defined track event id track._id = track.id || track._id || Popcorn.guid( track._natives.type ); // Trigger _setup method if exists if ( track._natives._setup ) { track._natives._setup.call( obj, track ); obj.emit( "tracksetup", Popcorn.extend( {}, track, { plugin: track._natives.type, type: "tracksetup", track: track })); } } obj.data.trackEvents.add( track ); TrackEvent.start( obj, track ); this.timeUpdate( obj, null, true ); // Store references to user added trackevents in ref table if ( track._id ) { Popcorn.addTrackEvent.ref( obj, track ); } obj.emit( "trackadded", Popcorn.extend({}, track, track._natives ? { plugin: track._natives.type } : {}, { type: "trackadded", track: track })); }; // Internal Only - Adds track event references to the instance object's trackRefs hash table Popcorn.addTrackEvent.ref = function( obj, track ) { obj.data.trackRefs[ track._id ] = track; return obj; }; Popcorn.removeTrackEvent = function( obj, removeId ) { var track = obj.getTrackEvent( removeId ); if ( !track ) { return; } // If a _teardown function was defined, // enforce for track event removals if ( track._natives._teardown ) { track._natives._teardown.call( obj, track ); } obj.data.trackEvents.remove( removeId ); // Update track event references Popcorn.removeTrackEvent.ref( obj, removeId ); if ( track._natives ) { // Fire a trackremoved event obj.emit( "trackremoved", Popcorn.extend({}, track, { plugin: track._natives.type, type: "trackremoved", track: track })); } }; // Internal Only - Removes track event references from instance object's trackRefs hash table Popcorn.removeTrackEvent.ref = function( obj, removeId ) { delete obj.data.trackRefs[ removeId ]; return obj; }; // Return an array of track events bound to this instance object Popcorn.getTrackEvents = function( obj ) { var trackevents = [], refs = obj.data.trackEvents.byStart, length = refs.length, idx = 0, ref; for ( ; idx < length; idx++ ) { ref = refs[ idx ]; // Return only user attributed track event references if ( ref._id ) { trackevents.push( ref ); } } return trackevents; }; // Internal Only - Returns an instance object's trackRefs hash table Popcorn.getTrackEvents.ref = function( obj ) { return obj.data.trackRefs; }; // Return a single track event bound to this instance object Popcorn.getTrackEvent = function( obj, trackId ) { return obj.data.trackRefs[ trackId ]; }; // Internal Only - Returns an instance object's track reference by track id Popcorn.getTrackEvent.ref = function( obj, trackId ) { return obj.data.trackRefs[ trackId ]; }; Popcorn.getLastTrackEventId = function( obj ) { return obj.data.history[ obj.data.history.length - 1 ]; }; Popcorn.timeUpdate = function( obj, event ) { var currentTime = obj.media.currentTime, previousTime = obj.data.trackEvents.previousUpdateTime, tracks = obj.data.trackEvents, end = tracks.endIndex, start = tracks.startIndex, byStartLen = tracks.byStart.length, byEndLen = tracks.byEnd.length, registryByName = Popcorn.registryByName, trackstart = "trackstart", trackend = "trackend", byEnd, byStart, byAnimate, natives, type, runningPlugins; // Playbar advancing if ( previousTime <= currentTime ) { while ( tracks.byEnd[ end ] && tracks.byEnd[ end ].end <= currentTime ) { byEnd = tracks.byEnd[ end ]; natives = byEnd._natives; type = natives && natives.type; // If plugin does not exist on this instance, remove it if ( !natives || ( !!registryByName[ type ] || !!obj[ type ] ) ) { if ( byEnd._running === true ) { byEnd._running = false; runningPlugins = obj.data.running[ type ]; runningPlugins.splice( runningPlugins.indexOf( byEnd ), 1 ); if ( !obj.data.disabled[ type ] ) { natives.end.call( obj, event, byEnd ); obj.emit( trackend, Popcorn.extend({}, byEnd, { plugin: type, type: trackend, track: byEnd }) ); } } end++; } else { // remove track event Popcorn.removeTrackEvent( obj, byEnd._id ); return; } } while ( tracks.byStart[ start ] && tracks.byStart[ start ].start <= currentTime ) { byStart = tracks.byStart[ start ]; natives = byStart._natives; type = natives && natives.type; // If plugin does not exist on this instance, remove it if ( !natives || ( !!registryByName[ type ] || !!obj[ type ] ) ) { if ( byStart.end > currentTime && byStart._running === false ) { byStart._running = true; obj.data.running[ type ].push( byStart ); if ( !obj.data.disabled[ type ] ) { natives.start.call( obj, event, byStart ); obj.emit( trackstart, Popcorn.extend({}, byStart, { plugin: type, type: trackstart, track: byStart }) ); } } start++; } else { // remove track event Popcorn.removeTrackEvent( obj, byStart._id ); return; } } // Playbar receding } else if ( previousTime > currentTime ) { while ( tracks.byStart[ start ] && tracks.byStart[ start ].start > currentTime ) { byStart = tracks.byStart[ start ]; natives = byStart._natives; type = natives && natives.type; // if plugin does not exist on this instance, remove it if ( !natives || ( !!registryByName[ type ] || !!obj[ type ] ) ) { if ( byStart._running === true ) { byStart._running = false; runningPlugins = obj.data.running[ type ]; runningPlugins.splice( runningPlugins.indexOf( byStart ), 1 ); if ( !obj.data.disabled[ type ] ) { natives.end.call( obj, event, byStart ); obj.emit( trackend, Popcorn.extend({}, byStart, { plugin: type, type: trackend, track: byStart }) ); } } start--; } else { // remove track event Popcorn.removeTrackEvent( obj, byStart._id ); return; } } while ( tracks.byEnd[ end ] && tracks.byEnd[ end ].end > currentTime ) { byEnd = tracks.byEnd[ end ]; natives = byEnd._natives; type = natives && natives.type; // if plugin does not exist on this instance, remove it if ( !natives || ( !!registryByName[ type ] || !!obj[ type ] ) ) { if ( byEnd.start <= currentTime && byEnd._running === false ) { byEnd._running = true; obj.data.running[ type ].push( byEnd ); if ( !obj.data.disabled[ type ] ) { natives.start.call( obj, event, byEnd ); obj.emit( trackstart, Popcorn.extend({}, byEnd, { plugin: type, type: trackstart, track: byEnd }) ); } } end--; } else { // remove track event Popcorn.removeTrackEvent( obj, byEnd._id ); return; } } } tracks.endIndex = end; tracks.startIndex = start; tracks.previousUpdateTime = currentTime; //enforce index integrity if trackRemoved tracks.byStart.length < byStartLen && tracks.startIndex--; tracks.byEnd.length < byEndLen && tracks.endIndex--; }; // Map and Extend TrackEvent functions to all Popcorn instances Popcorn.extend( Popcorn.p, { getTrackEvents: function() { return Popcorn.getTrackEvents.call( null, this ); }, getTrackEvent: function( id ) { return Popcorn.getTrackEvent.call( null, this, id ); }, getLastTrackEventId: function() { return Popcorn.getLastTrackEventId.call( null, this ); }, removeTrackEvent: function( id ) { Popcorn.removeTrackEvent.call( null, this, id ); return this; }, removePlugin: function( name ) { Popcorn.removePlugin.call( null, this, name ); return this; }, timeUpdate: function( event ) { Popcorn.timeUpdate.call( null, this, event ); return this; }, destroy: function() { Popcorn.destroy.call( null, this ); return this; } }); // Plugin manifests Popcorn.manifest = {}; // Plugins are registered Popcorn.registry = []; Popcorn.registryByName = {}; // An interface for extending Popcorn // with plugin functionality Popcorn.plugin = function( name, definition, manifest ) { if ( Popcorn.protect.natives.indexOf( name.toLowerCase() ) >= 0 ) { Popcorn.error( "'" + name + "' is a protected function name" ); return; } // Provides some sugar, but ultimately extends // the definition into Popcorn.p var isfn = typeof definition === "function", blacklist = [ "start", "end", "type", "manifest" ], methods = [ "_setup", "_teardown", "start", "end", "frame" ], plugin = {}, setup; // combines calls of two function calls into one var combineFn = function( first, second ) { first = first || Popcorn.nop; second = second || Popcorn.nop; return function() { first.apply( this, arguments ); second.apply( this, arguments ); }; }; // If `manifest` arg is undefined, check for manifest within the `definition` object // If no `definition.manifest`, an empty object is a sufficient fallback Popcorn.manifest[ name ] = manifest = manifest || definition.manifest || {}; // apply safe, and empty default functions methods.forEach(function( method ) { definition[ method ] = safeTry( definition[ method ] || Popcorn.nop, name ); }); var pluginFn = function( setup, options ) { if ( !options ) { return this; } // When the "ranges" property is set and its value is an array, short-circuit // the pluginFn definition to recall itself with an options object generated from // each range object in the ranges array. (eg. { start: 15, end: 16 } ) if ( options.ranges && Popcorn.isArray(options.ranges) ) { Popcorn.forEach( options.ranges, function( range ) { // Create a fresh object, extend with current options // and start/end range object's properties // Works with in/out as well. var opts = Popcorn.extend( {}, options, range ); // Remove the ranges property to prevent infinitely // entering this condition delete opts.ranges; // Call the plugin with the newly created opts object this[ name ]( opts ); }, this); // Return the Popcorn instance to avoid creating an empty track event return this; } // Storing the plugin natives var natives = options._natives = {}, compose = "", originalOpts, manifestOpts; Popcorn.extend( natives, setup ); options._natives.type = options._natives.plugin = name; options._running = false; natives.start = natives.start || natives[ "in" ]; natives.end = natives.end || natives[ "out" ]; if ( options.once ) { natives.end = combineFn( natives.end, function() { this.removeTrackEvent( options._id ); }); } // extend teardown to always call end if running natives._teardown = combineFn(function() { var args = slice.call( arguments ), runningPlugins = this.data.running[ natives.type ]; // end function signature is not the same as teardown, // put null on the front of arguments for the event parameter args.unshift( null ); // only call end if event is running args[ 1 ]._running && runningPlugins.splice( runningPlugins.indexOf( options ), 1 ) && natives.end.apply( this, args ); args[ 1 ]._running = false; this.emit( "trackend", Popcorn.extend( {}, options, { plugin: natives.type, type: "trackend", track: Popcorn.getTrackEvent( this, options.id || options._id ) }) ); }, natives._teardown ); // extend teardown to always trigger trackteardown after teardown natives._teardown = combineFn( natives._teardown, function() { this.emit( "trackteardown", Popcorn.extend( {}, options, { plugin: name, type: "trackteardown", track: Popcorn.getTrackEvent( this, options.id || options._id ) })); }); // default to an empty string if no effect exists // split string into an array of effects options.compose = options.compose || []; if ( typeof options.compose === "string" ) { options.compose = options.compose.split( " " ); } options.effect = options.effect || []; if ( typeof options.effect === "string" ) { options.effect = options.effect.split( " " ); } // join the two arrays together options.compose = options.compose.concat( options.effect ); options.compose.forEach(function( composeOption ) { // if the requested compose is garbage, throw it away compose = Popcorn.compositions[ composeOption ] || {}; // extends previous functions with compose function methods.forEach(function( method ) { natives[ method ] = combineFn( natives[ method ], compose[ method ] ); }); }); // Ensure a manifest object, an empty object is a sufficient fallback options._natives.manifest = manifest; // Checks for expected properties if ( !( "start" in options ) ) { options.start = options[ "in" ] || 0; } if ( !options.end && options.end !== 0 ) { options.end = options[ "out" ] || Number.MAX_VALUE; } // Use hasOwn to detect non-inherited toString, since all // objects will receive a toString - its otherwise undetectable if ( !hasOwn.call( options, "toString" ) ) { options.toString = function() { var props = [ "start: " + options.start, "end: " + options.end, "id: " + (options.id || options._id) ]; // Matches null and undefined, allows: false, 0, "" and truthy if ( options.target != null ) { props.push( "target: " + options.target ); } return name + " ( " + props.join(", ") + " )"; }; } // Resolves 239, 241, 242 if ( !options.target ) { // Sometimes the manifest may be missing entirely // or it has an options object that doesn't have a `target` property manifestOpts = "options" in manifest && manifest.options; options.target = manifestOpts && "target" in manifestOpts && manifestOpts.target; } if ( !options._id && options._natives ) { // ensure an initial id is there before setup is called options._id = Popcorn.guid( options._natives.type ); } if ( options instanceof TrackEvent ) { if ( options._natives ) { // Supports user defined track event id options._id = options.id || options._id || Popcorn.guid( options._natives.type ); // Trigger _setup method if exists if ( options._natives._setup ) { options._natives._setup.call( this, options ); this.emit( "tracksetup", Popcorn.extend( {}, options, { plugin: options._natives.type, type: "tracksetup", track: options })); } } this.data.trackEvents.add( options ); TrackEvent.start( this, options ); this.timeUpdate( this, null, true ); // Store references to user added trackevents in ref table if ( options._id ) { Popcorn.addTrackEvent.ref( this, options ); } } else { // Create new track event for this instance Popcorn.addTrackEvent( this, options ); } // Future support for plugin event definitions // for all of the native events Popcorn.forEach( setup, function( callback, type ) { // Don't attempt to create events for certain properties: // "start", "end", "type", "manifest". Fixes #1365 if ( blacklist.indexOf( type ) === -1 ) { this.on( type, callback ); } }, this ); return this; }; // Extend Popcorn.p with new named definition // Assign new named definition Popcorn.p[ name ] = plugin[ name ] = function( id, options ) { var length = arguments.length, trackEvent, defaults, mergedSetupOpts, previousOpts, newOpts; // Shift arguments based on use case // // Back compat for: // p.plugin( options ); if ( id && !options ) { options = id; id = null; } else { // Get the trackEvent that matches the given id. trackEvent = this.getTrackEvent( id ); // If the track event does not exist, ensure that the options // object has a proper id if ( !trackEvent ) { options.id = id; // If the track event does exist, merge the updated properties } else { newOpts = options; previousOpts = getPreviousProperties( trackEvent, newOpts ); // Call the plugins defined update method if provided. Allows for // custom defined updating for a track event to be defined by the plugin author if ( trackEvent._natives._update ) { this.data.trackEvents.remove( trackEvent ); // It's safe to say that the intent of Start/End will never change // Update them first before calling update if ( hasOwn.call( options, "start" ) ) { trackEvent.start = options.start; } if ( hasOwn.call( options, "end" ) ) { trackEvent.end = options.end; } TrackEvent.end( this, trackEvent ); if ( isfn ) { definition.call( this, trackEvent ); } trackEvent._natives._update.call( this, trackEvent, options ); this.data.trackEvents.add( trackEvent ); TrackEvent.start( this, trackEvent ); } else { // This branch is taken when there is no explicitly defined // _update method for a plugin. Which will occur either explicitly or // as a result of the plugin definition being a function that _returns_ // a definition object. // // In either case, this path can ONLY be reached for TrackEvents that // already exist. // Directly update the TrackEvent instance. // This supports TrackEvent invariant enforcement. Popcorn.extend( trackEvent, options ); this.data.trackEvents.remove( id ); // If a _teardown function was defined, // enforce for track event removals if ( trackEvent._natives._teardown ) { trackEvent._natives._teardown.call( this, trackEvent ); } // Update track event references Popcorn.removeTrackEvent.ref( this, id ); if ( isfn ) { pluginFn.call( this, definition.call( this, trackEvent ), trackEvent ); } else { // Supports user defined track event id trackEvent._id = trackEvent.id || trackEvent._id || Popcorn.guid( trackEvent._natives.type ); if ( trackEvent._natives && trackEvent._natives._setup ) { trackEvent._natives._setup.call( this, trackEvent ); this.emit( "tracksetup", Popcorn.extend( {}, trackEvent, { plugin: trackEvent._natives.type, type: "tracksetup", track: trackEvent })); } this.data.trackEvents.add( trackEvent ); TrackEvent.start( this, trackEvent ); this.timeUpdate( this, null, true ); // Store references to user added trackevents in ref table Popcorn.addTrackEvent.ref( this, trackEvent ); } // Fire an event with change information this.emit( "trackchange", { id: trackEvent.id, type: "trackchange", previousValue: previousOpts, currentValue: trackEvent, track: trackEvent }); return this; } if ( trackEvent._natives.type !== "cue" ) { // Fire an event with change information this.emit( "trackchange", { id: trackEvent.id, type: "trackchange", previousValue: previousOpts, currentValue: newOpts, track: trackEvent }); } return this; } } this.data.running[ name ] = this.data.running[ name ] || []; // Merge with defaults if they exist, make sure per call is prioritized defaults = ( this.options.defaults && this.options.defaults[ name ] ) || {}; mergedSetupOpts = Popcorn.extend( {}, defaults, options ); pluginFn.call( this, isfn ? definition.call( this, mergedSetupOpts ) : definition, mergedSetupOpts ); return this; }; // if the manifest parameter exists we should extend it onto the definition object // so that it shows up when calling Popcorn.registry and Popcorn.registryByName if ( manifest ) { Popcorn.extend( definition, { manifest: manifest }); } // Push into the registry var entry = { fn: plugin[ name ], definition: definition, base: definition, parents: [], name: name }; Popcorn.registry.push( Popcorn.extend( plugin, entry, { type: name }) ); Popcorn.registryByName[ name ] = entry; return plugin; }; // Storage for plugin function errors Popcorn.plugin.errors = []; // Returns wrapped plugin function function safeTry( fn, pluginName ) { return function() { // When Popcorn.plugin.debug is true, do not suppress errors if ( Popcorn.plugin.debug ) { return fn.apply( this, arguments ); } try { return fn.apply( this, arguments ); } catch ( ex ) { // Push plugin function errors into logging queue Popcorn.plugin.errors.push({ plugin: pluginName, thrown: ex, source: fn.toString() }); // Trigger an error that the instance can listen for // and react to this.emit( "pluginerror", Popcorn.plugin.errors ); } }; } // Debug-mode flag for plugin development // True for Popcorn development versions, false for stable/tagged versions Popcorn.plugin.debug = ( Popcorn.version === "@" + "VERSION" ); // removePlugin( type ) removes all tracks of that from all instances of popcorn // removePlugin( obj, type ) removes all tracks of type from obj, where obj is a single instance of popcorn Popcorn.removePlugin = function( obj, name ) { // Check if we are removing plugin from an instance or from all of Popcorn if ( !name ) { // Fix the order name = obj; obj = Popcorn.p; if ( Popcorn.protect.natives.indexOf( name.toLowerCase() ) >= 0 ) { Popcorn.error( "'" + name + "' is a protected function name" ); return; } var registryLen = Popcorn.registry.length, registryIdx; // remove plugin reference from registry for ( registryIdx = 0; registryIdx < registryLen; registryIdx++ ) { if ( Popcorn.registry[ registryIdx ].name === name ) { Popcorn.registry.splice( registryIdx, 1 ); delete Popcorn.registryByName[ name ]; delete Popcorn.manifest[ name ]; // delete the plugin delete obj[ name ]; // plugin found and removed, stop checking, we are done return; } } } var byStart = obj.data.trackEvents.byStart, byEnd = obj.data.trackEvents.byEnd, animating = obj.data.trackEvents.animating, idx, sl; // remove all trackEvents for ( idx = 0, sl = byStart.length; idx < sl; idx++ ) { if ( byStart[ idx ] && byStart[ idx ]._natives && byStart[ idx ]._natives.type === name ) { byStart[ idx ]._natives._teardown && byStart[ idx ]._natives._teardown.call( obj, byStart[ idx ] ); byStart.splice( idx, 1 ); // update for loop if something removed, but keep checking idx--; sl--; if ( obj.data.trackEvents.startIndex <= idx ) { obj.data.trackEvents.startIndex--; obj.data.trackEvents.endIndex--; } } // clean any remaining references in the end index // we do this seperate from the above check because they might not be in the same order if ( byEnd[ idx ] && byEnd[ idx ]._natives && byEnd[ idx ]._natives.type === name ) { byEnd.splice( idx, 1 ); } } //remove all animating events for ( idx = 0, sl = animating.length; idx < sl; idx++ ) { if ( animating[ idx ] && animating[ idx ]._natives && animating[ idx ]._natives.type === name ) { animating.splice( idx, 1 ); // update for loop if something removed, but keep checking idx--; sl--; } } }; Popcorn.compositions = {}; // Plugin inheritance Popcorn.compose = function( name, definition, manifest ) { // If `manifest` arg is undefined, check for manifest within the `definition` object // If no `definition.manifest`, an empty object is a sufficient fallback Popcorn.manifest[ name ] = manifest = manifest || definition.manifest || {}; // register the effect by name Popcorn.compositions[ name ] = definition; }; Popcorn.plugin.effect = Popcorn.effect = Popcorn.compose; var rnaiveExpr = /^(?:\.|#|\[)/; // Basic DOM utilities and helpers API. See #1037 Popcorn.dom = { debug: false, // Popcorn.dom.find( selector, context ) // // Returns the first element that matches the specified selector // Optionally provide a context element, defaults to `document` // // eg. // Popcorn.dom.find("video") returns the first video element // Popcorn.dom.find("#foo") returns the first element with `id="foo"` // Popcorn.dom.find("foo") returns the first element with `id="foo"` // Note: Popcorn.dom.find("foo") is the only allowed deviation // from valid querySelector selector syntax // // Popcorn.dom.find(".baz") returns the first element with `class="baz"` // Popcorn.dom.find("[preload]") returns the first element with `preload="..."` // ... // See https://developer.mozilla.org/En/DOM/Document.querySelector // // find: function( selector, context ) { var node = null; // Default context is the `document` context = context || document; if ( selector ) { // If the selector does not begin with "#", "." or "[", // it could be either a nodeName or ID w/o "#" if ( !rnaiveExpr.test( selector ) ) { // Try finding an element that matches by ID first node = document.getElementById( selector ); // If a match was found by ID, return the element if ( node !== null ) { return node; } } // Assume no elements have been found yet // Catch any invalid selector syntax errors and bury them. try { node = context.querySelector( selector ); } catch ( e ) { if ( Popcorn.dom.debug ) { throw new Error(e); } } } return node; } }; // Cache references to reused RegExps var rparams = /\?/, // XHR Setup object setup = { ajax: null, url: "", data: "", dataType: "", success: Popcorn.nop, type: "GET", async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8" }; Popcorn.xhr = function( options ) { var settings; options.dataType = options.dataType && options.dataType.toLowerCase() || null; if ( options.dataType && ( options.dataType === "jsonp" || options.dataType === "script" ) ) { Popcorn.xhr.getJSONP( options.url, options.success, options.dataType === "script" ); return; } // Merge the "setup" defaults and custom "options" // into a new plain object. settings = Popcorn.extend( {}, setup, options ); // Create new XMLHttpRequest object settings.ajax = new XMLHttpRequest(); if ( settings.ajax ) { if ( settings.type === "GET" && settings.data ) { // append query string settings.url += ( rparams.test( settings.url ) ? "&" : "?" ) + settings.data; // Garbage collect and reset settings.data settings.data = null; } // Open the request settings.ajax.open( settings.type, settings.url, settings.async ); // For POST, set the content-type request header if ( settings.type === "POST" ) { settings.ajax.setRequestHeader( "Content-Type", settings.contentType ); } settings.ajax.send( settings.data || null ); return Popcorn.xhr.httpData( settings ); } }; Popcorn.xhr.httpData = function( settings ) { var data, json = null, parser, xml = null; settings.ajax.onreadystatechange = function() { if ( settings.ajax.readyState === 4 ) { try { json = JSON.parse( settings.ajax.responseText ); } catch( e ) { //suppress } data = { xml: settings.ajax.responseXML, text: settings.ajax.responseText, json: json }; // Normalize: data.xml is non-null in IE9 regardless of if response is valid xml if ( !data.xml || !data.xml.documentElement ) { data.xml = null; try { parser = new DOMParser(); xml = parser.parseFromString( settings.ajax.responseText, "text/xml" ); if ( !xml.getElementsByTagName( "parsererror" ).length ) { data.xml = xml; } } catch ( e ) { // data.xml remains null } } // If a dataType was specified, return that type of data if ( settings.dataType ) { data = data[ settings.dataType ]; } settings.success.call( settings.ajax, data ); } }; return data; }; Popcorn.xhr.getJSONP = function( url, success, isScript ) { var head = document.head || document.getElementsByTagName( "head" )[ 0 ] || document.documentElement, script = document.createElement( "script" ), isFired = false, params = [], rjsonp = /(=)\?(?=&|$)|\?\?/, replaceInUrl, prefix, paramStr, callback, callparam; if ( !isScript ) { // is there a calback already in the url callparam = url.match( /(callback=[^&]*)/ ); if ( callparam !== null && callparam.length ) { prefix = callparam[ 1 ].split( "=" )[ 1 ]; // Since we need to support developer specified callbacks // and placeholders in harmony, make sure matches to "callback=" // aren't just placeholders. // We coded ourselves into a corner here. // JSONP callbacks should never have been // allowed to have developer specified callbacks if ( prefix === "?" ) { prefix = "jsonp"; } // get the callback name callback = Popcorn.guid( prefix ); // replace existing callback name with unique callback name url = url.replace( /(callback=[^&]*)/, "callback=" + callback ); } else { callback = Popcorn.guid( "jsonp" ); if ( rjsonp.test( url ) ) { url = url.replace( rjsonp, "$1" + callback ); } // split on first question mark, // this is to capture the query string params = url.split( /\?(.+)?/ ); // rebuild url with callback url = params[ 0 ] + "?"; if ( params[ 1 ] ) { url += params[ 1 ] + "&"; } url += "callback=" + callback; } // Define the JSONP success callback globally window[ callback ] = function( data ) { // Fire success callbacks success && success( data ); isFired = true; }; } script.addEventListener( "load", function() { // Handling remote script loading callbacks if ( isScript ) { // getScript success && success(); } // Executing for JSONP requests if ( isFired ) { // Garbage collect the callback delete window[ callback ]; } // Garbage collect the script resource head.removeChild( script ); }, false ); script.addEventListener( "error", function( e ) { // Handling remote script loading callbacks success && success( { error: e } ); // Executing for JSONP requests if ( !isScript ) { // Garbage collect the callback delete window[ callback ]; } // Garbage collect the script resource head.removeChild( script ); }, false ); script.src = url; head.insertBefore( script, head.firstChild ); return; }; Popcorn.getJSONP = Popcorn.xhr.getJSONP; Popcorn.getScript = Popcorn.xhr.getScript = function( url, success ) { return Popcorn.xhr.getJSONP( url, success, true ); }; Popcorn.util = { // Simple function to parse a timestamp into seconds // Acceptable formats are: // HH:MM:SS.MMM // HH:MM:SS;FF // Hours and minutes are optional. They default to 0 toSeconds: function( timeStr, framerate ) { // Hours and minutes are optional // Seconds must be specified // Seconds can be followed by milliseconds OR by the frame information var validTimeFormat = /^([0-9]+:){0,2}[0-9]+([.;][0-9]+)?$/, errorMessage = "Invalid time format", digitPairs, lastIndex, lastPair, firstPair, frameInfo, frameTime; if ( typeof timeStr === "number" ) { return timeStr; } if ( typeof timeStr === "string" && !validTimeFormat.test( timeStr ) ) { Popcorn.error( errorMessage ); } digitPairs = timeStr.split( ":" ); lastIndex = digitPairs.length - 1; lastPair = digitPairs[ lastIndex ]; // Fix last element: if ( lastPair.indexOf( ";" ) > -1 ) { frameInfo = lastPair.split( ";" ); frameTime = 0; if ( framerate && ( typeof framerate === "number" ) ) { frameTime = parseFloat( frameInfo[ 1 ], 10 ) / framerate; } digitPairs[ lastIndex ] = parseInt( frameInfo[ 0 ], 10 ) + frameTime; } firstPair = digitPairs[ 0 ]; return { 1: parseFloat( firstPair, 10 ), 2: ( parseInt( firstPair, 10 ) * 60 ) + parseFloat( digitPairs[ 1 ], 10 ), 3: ( parseInt( firstPair, 10 ) * 3600 ) + ( parseInt( digitPairs[ 1 ], 10 ) * 60 ) + parseFloat( digitPairs[ 2 ], 10 ) }[ digitPairs.length || 1 ]; } }; // alias for exec function Popcorn.p.cue = Popcorn.p.exec; // Protected API methods Popcorn.protect = { natives: getKeys( Popcorn.p ).map(function( val ) { return val.toLowerCase(); }) }; // Setup logging for deprecated methods Popcorn.forEach({ // Deprecated: Recommended "listen": "on", "unlisten": "off", "trigger": "emit", "exec": "cue" }, function( recommend, api ) { var original = Popcorn.p[ api ]; // Override the deprecated api method with a method of the same name // that logs a warning and defers to the new recommended method Popcorn.p[ api ] = function() { if ( typeof console !== "undefined" && console.warn ) { console.warn( "Deprecated method '" + api + "', " + (recommend == null ? "do not use." : "use '" + recommend + "' instead." ) ); // Restore api after first warning Popcorn.p[ api ] = original; } return Popcorn.p[ recommend ].apply( this, [].slice.call( arguments ) ); }; }); // Exposes Popcorn to global context global.Popcorn = Popcorn; })(window, window.document);
client/lib/createRootComponent.js
nearform/vidi-dashboard
'use strict' import React from 'react' import {Provider} from 'react-redux' import thunkMiddleware from 'redux-thunk' import loggerMiddleware from 'redux-logger' import {combineReducers, createStore, applyMiddleware} from 'redux' import {browserHistory, Router, Route, IndexRoute} from 'react-router' import {routerReducer, routerMiddleware, syncHistoryWithStore} from 'react-router-redux' import authReducer from '../reducers/auth' import vidiReducer from '../reducers/vidi' import {logout, validateCookie} from '../actions/auth' import Shell from '../containers/shell' import Login from '../containers/login' import Overview from '../containers/overview' import Messages from '../containers/messages' import Sensors from '../containers/sensors' import ProcessById from '../containers/process_by_id' import Profile from '../containers/profile' const rootReducer = combineReducers({ routing: routerReducer, auth: authReducer, vidi: vidiReducer }) const buildStore = applyMiddleware( thunkMiddleware, routerMiddleware(browserHistory), loggerMiddleware() )(createStore) const initalState = { auth: { hasError: false, isLoggedIn: false } } const store = buildStore(rootReducer, initalState) const history = syncHistoryWithStore(browserHistory, store) export default function createRootComponent () { function requireAuth (nextState, replace, done) { validateCookie((allowed) => { if(!allowed) { replace({nextPathname: nextState.location.pathname, pathname: '/login', query: nextState.location.query}) } else { store.dispatch({type: 'AUTH_VALIDATED', isLoggedIn: true, hasError: false}) } done() }) } function handleLogout () { store.dispatch(logout()) } return ( <Provider store={store}> <Router history={history}> <Route path="/" component={Shell}> <IndexRoute component={Overview} onEnter={requireAuth}/> <Route path="sensors" component={Sensors} onEnter={requireAuth}/> <Route path="messages" component={Messages} onEnter={requireAuth}/> <Route path="process/:id" component={ProcessById} onEnter={requireAuth}/> <Route path="profile" component={Profile} onEnter={requireAuth}/> <Route path="login" component={Login} /> <Route path="logout" onEnter={handleLogout} /> </Route> </Router> </Provider> ) }
src/components/PlaylistManager/Panel/Meta.js
u-wave/web
/* eslint-disable jsx-a11y/label-has-for */ import cx from 'clsx'; import React from 'react'; import PropTypes from 'prop-types'; import { useTranslator } from '@u-wave/react-translate'; import Checkbox from '@mui/material/Checkbox'; import ActiveIcon from '@mui/icons-material/CheckBox'; import ActivateIcon from '@mui/icons-material/CheckBoxOutlineBlank'; import RenamePlaylistButton from './RenamePlaylistButton'; import DeletePlaylistButton from './DeletePlaylistButton'; import ShufflePlaylistButton from './ShufflePlaylistButton'; import PlaylistFilter from './PlaylistFilter'; const ID = 'playlist-meta-active'; function PlaylistMeta({ className, active, name, onShufflePlaylist, onActivatePlaylist, onRenamePlaylist, onDeletePlaylist, onNotDeletable, onFilter, }) { const { t } = useTranslator(); return ( <div className={cx('PlaylistMeta', className, active && 'PlaylistMeta--active')}> <div className="PlaylistMeta-name"> {name} </div> <label htmlFor={ID} className={cx('PlaylistMeta-active', active && 'is-active')}> <Checkbox id={ID} checked={active} disabled={active} onChange={active ? null : onActivatePlaylist} icon={<ActivateIcon />} checkedIcon={<ActiveIcon htmlColor="#fff" />} /> <span> {active ? t('playlists.active') : t('playlists.activate')} </span> </label> <PlaylistFilter onFilter={onFilter} /> <ShufflePlaylistButton onShuffle={onShufflePlaylist} /> <RenamePlaylistButton initialName={name} onRename={onRenamePlaylist} /> <DeletePlaylistButton active={active} onNotDeletable={onNotDeletable} onDelete={onDeletePlaylist} /> </div> ); } PlaylistMeta.propTypes = { className: PropTypes.string, active: PropTypes.bool.isRequired, name: PropTypes.string.isRequired, onShufflePlaylist: PropTypes.func.isRequired, onActivatePlaylist: PropTypes.func.isRequired, onRenamePlaylist: PropTypes.func.isRequired, onDeletePlaylist: PropTypes.func.isRequired, onNotDeletable: PropTypes.func.isRequired, onFilter: PropTypes.func.isRequired, }; export default PlaylistMeta;
client/src/index.js
Darkrender/raptor-ads
import React from 'react'; import { render } from 'react-dom'; import Root from './components/Root'; const appElement = document.getElementById('app'); render( <Root /> , appElement, );
Libraries/CustomComponents/ListView/ListView.js
leopardpan/react-native
/** * Copyright (c) 2015, Facebook, Inc. All rights reserved. * * Facebook, Inc. ("Facebook") owns all right, title and interest, including * all intellectual property and other proprietary rights, in and to the React * Native CustomComponents software (the "Software"). Subject to your * compliance with these terms, you are hereby granted a non-exclusive, * worldwide, royalty-free copyright license to (1) use and copy the Software; * and (2) reproduce and distribute the Software as part of your own software * ("Your Software"). Facebook reserves all rights not expressly granted to * you in this license agreement. * * THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. * IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR * EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @providesModule ListView */ 'use strict'; var ListViewDataSource = require('ListViewDataSource'); var React = require('React'); var RCTUIManager = require('NativeModules').UIManager; var RCTScrollViewManager = require('NativeModules').ScrollViewManager; var ScrollView = require('ScrollView'); var ScrollResponder = require('ScrollResponder'); var StaticRenderer = require('StaticRenderer'); var TimerMixin = require('react-timer-mixin'); var isEmpty = require('isEmpty'); var logError = require('logError'); var merge = require('merge'); var PropTypes = React.PropTypes; var DEFAULT_PAGE_SIZE = 1; var DEFAULT_INITIAL_ROWS = 10; var DEFAULT_SCROLL_RENDER_AHEAD = 1000; var DEFAULT_END_REACHED_THRESHOLD = 1000; var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50; var SCROLLVIEW_REF = 'listviewscroll'; /** * ListView - A core component designed for efficient display of vertically * scrolling lists of changing data. The minimal API is to create a * `ListView.DataSource`, populate it with a simple array of data blobs, and * instantiate a `ListView` component with that data source and a `renderRow` * callback which takes a blob from the data array and returns a renderable * component. * * Minimal example: * * ``` * getInitialState: function() { * var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); * return { * dataSource: ds.cloneWithRows(['row 1', 'row 2']), * }; * }, * * render: function() { * return ( * <ListView * dataSource={this.state.dataSource} * renderRow={(rowData) => <Text>{rowData}</Text>} * /> * ); * }, * ``` * * ListView also supports more advanced features, including sections with sticky * section headers, header and footer support, callbacks on reaching the end of * the available data (`onEndReached`) and on the set of rows that are visible * in the device viewport change (`onChangeVisibleRows`), and several * performance optimizations. * * There are a few performance operations designed to make ListView scroll * smoothly while dynamically loading potentially very large (or conceptually * infinite) data sets: * * * Only re-render changed rows - the rowHasChanged function provided to the * data source tells the ListView if it needs to re-render a row because the * source data has changed - see ListViewDataSource for more details. * * * Rate-limited row rendering - By default, only one row is rendered per * event-loop (customizable with the `pageSize` prop). This breaks up the * work into smaller chunks to reduce the chance of dropping frames while * rendering rows. */ var ListView = React.createClass({ mixins: [ScrollResponder.Mixin, TimerMixin], statics: { DataSource: ListViewDataSource, }, /** * You must provide a renderRow function. If you omit any of the other render * functions, ListView will simply skip rendering them. * * - renderRow(rowData, sectionID, rowID, highlightRow); * - renderSectionHeader(sectionData, sectionID); */ propTypes: { ...ScrollView.propTypes, dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired, /** * (sectionID, rowID, adjacentRowHighlighted) => renderable * If provided, a renderable component to be rendered as the separator * below each row but not the last row if there is a section header below. * Take a sectionID and rowID of the row above and whether its adjacent row * is highlighted. */ renderSeparator: PropTypes.func, /** * (rowData, sectionID, rowID, highlightRow) => renderable * Takes a data entry from the data source and its ids and should return * a renderable component to be rendered as the row. By default the data * is exactly what was put into the data source, but it's also possible to * provide custom extractors. ListView can be notified when a row is * being highlighted by calling highlightRow function. The separators above and * below will be hidden when a row is highlighted. The highlighted state of * a row can be reset by calling highlightRow(null). */ renderRow: PropTypes.func.isRequired, /** * How many rows to render on initial component mount. Use this to make * it so that the first screen worth of data apears at one time instead of * over the course of multiple frames. */ initialListSize: PropTypes.number, /** * Called when all rows have been rendered and the list has been scrolled * to within onEndReachedThreshold of the bottom. The native scroll * event is provided. */ onEndReached: PropTypes.func, /** * Threshold in pixels for onEndReached. */ onEndReachedThreshold: PropTypes.number, /** * Number of rows to render per event loop. */ pageSize: PropTypes.number, /** * () => renderable * * The header and footer are always rendered (if these props are provided) * on every render pass. If they are expensive to re-render, wrap them * in StaticContainer or other mechanism as appropriate. Footer is always * at the bottom of the list, and header at the top, on every render pass. */ renderFooter: PropTypes.func, renderHeader: PropTypes.func, /** * (sectionData, sectionID) => renderable * * If provided, a sticky header is rendered for this section. The sticky * behavior means that it will scroll with the content at the top of the * section until it reaches the top of the screen, at which point it will * stick to the top until it is pushed off the screen by the next section * header. */ renderSectionHeader: PropTypes.func, /** * (props) => renderable * * A function that returns the scrollable component in which the list rows * are rendered. Defaults to returning a ScrollView with the given props. */ renderScrollComponent: React.PropTypes.func.isRequired, /** * How early to start rendering rows before they come on screen, in * pixels. */ scrollRenderAheadDistance: React.PropTypes.number, /** * (visibleRows, changedRows) => void * * Called when the set of visible rows changes. `visibleRows` maps * { sectionID: { rowID: true }} for all the visible rows, and * `changedRows` maps { sectionID: { rowID: true | false }} for the rows * that have changed their visibility, with true indicating visible, and * false indicating the view has moved out of view. */ onChangeVisibleRows: React.PropTypes.func, /** * An experimental performance optimization for improving scroll perf of * large lists, used in conjunction with overflow: 'hidden' on the row * containers. Use at your own risk. */ removeClippedSubviews: React.PropTypes.bool, }, /** * Exports some data, e.g. for perf investigations or analytics. */ getMetrics: function() { return { contentLength: this.scrollProperties.contentLength, totalRows: this.props.dataSource.getRowCount(), renderedRows: this.state.curRenderedRowsCount, visibleRows: Object.keys(this._visibleRows).length, }; }, /** * Provides a handle to the underlying scroll responder to support operations * such as scrollTo. */ getScrollResponder: function() { return this.refs[SCROLLVIEW_REF] && this.refs[SCROLLVIEW_REF].getScrollResponder && this.refs[SCROLLVIEW_REF].getScrollResponder(); }, setNativeProps: function(props) { this.refs[SCROLLVIEW_REF].setNativeProps(props); }, /** * React life cycle hooks. */ getDefaultProps: function() { return { initialListSize: DEFAULT_INITIAL_ROWS, pageSize: DEFAULT_PAGE_SIZE, renderScrollComponent: props => <ScrollView {...props} />, scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD, onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD, }; }, getInitialState: function() { return { curRenderedRowsCount: this.props.initialListSize, prevRenderedRowsCount: 0, highlightedRow: {}, }; }, getInnerViewNode: function() { return this.refs[SCROLLVIEW_REF].getInnerViewNode(); }, componentWillMount: function() { // this data should never trigger a render pass, so don't put in state this.scrollProperties = { visibleLength: null, contentLength: null, offset: 0 }; this._childFrames = []; this._visibleRows = {}; }, componentDidMount: function() { // do this in animation frame until componentDidMount actually runs after // the component is laid out this.requestAnimationFrame(() => { this._measureAndUpdateScrollProps(); }); }, componentWillReceiveProps: function(nextProps) { if (this.props.dataSource !== nextProps.dataSource) { this.setState((state, props) => { var rowsToRender = Math.min( state.curRenderedRowsCount + props.pageSize, props.dataSource.getRowCount() ); return { prevRenderedRowsCount: 0, curRenderedRowsCount: rowsToRender, }; }); } }, componentDidUpdate: function() { this.requestAnimationFrame(() => { this._measureAndUpdateScrollProps(); }); }, onRowHighlighted: function(sectionID, rowID) { this.setState({highlightedRow: {sectionID, rowID}}); }, render: function() { var bodyComponents = []; var dataSource = this.props.dataSource; var allRowIDs = dataSource.rowIdentities; var rowCount = 0; var sectionHeaderIndices = []; var header = this.props.renderHeader && this.props.renderHeader(); var footer = this.props.renderFooter && this.props.renderFooter(); var totalIndex = header ? 1 : 0; for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) { var sectionID = dataSource.sectionIdentities[sectionIdx]; var rowIDs = allRowIDs[sectionIdx]; if (rowIDs.length === 0) { continue; } if (this.props.renderSectionHeader) { var shouldUpdateHeader = rowCount >= this.state.prevRenderedRowsCount && dataSource.sectionHeaderShouldUpdate(sectionIdx); bodyComponents.push( <StaticRenderer key={'s_' + sectionID} shouldUpdate={!!shouldUpdateHeader} render={this.props.renderSectionHeader.bind( null, dataSource.getSectionHeaderData(sectionIdx), sectionID )} /> ); sectionHeaderIndices.push(totalIndex++); } for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) { var rowID = rowIDs[rowIdx]; var comboID = sectionID + rowID; var shouldUpdateRow = rowCount >= this.state.prevRenderedRowsCount && dataSource.rowShouldUpdate(sectionIdx, rowIdx); var row = <StaticRenderer key={'r_' + comboID} shouldUpdate={!!shouldUpdateRow} render={this.props.renderRow.bind( null, dataSource.getRowData(sectionIdx, rowIdx), sectionID, rowID, this.onRowHighlighted )} />; bodyComponents.push(row); totalIndex++; if (this.props.renderSeparator && (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) { var adjacentRowHighlighted = this.state.highlightedRow.sectionID === sectionID && ( this.state.highlightedRow.rowID === rowID || this.state.highlightedRow.rowID === rowIDs[rowIdx + 1] ); var separator = this.props.renderSeparator( sectionID, rowID, adjacentRowHighlighted ); bodyComponents.push(separator); totalIndex++; } if (++rowCount === this.state.curRenderedRowsCount) { break; } } if (rowCount >= this.state.curRenderedRowsCount) { break; } } var { renderScrollComponent, ...props, } = this.props; if (!props.scrollEventThrottle) { props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE; } Object.assign(props, { onScroll: this._onScroll, stickyHeaderIndices: sectionHeaderIndices, // Do not pass these events downstream to ScrollView since they will be // registered in ListView's own ScrollResponder.Mixin onKeyboardWillShow: undefined, onKeyboardWillHide: undefined, onKeyboardDidShow: undefined, onKeyboardDidHide: undefined, }); // TODO(ide): Use function refs so we can compose with the scroll // component's original ref instead of clobbering it return React.cloneElement(renderScrollComponent(props), { ref: SCROLLVIEW_REF, }, header, bodyComponents, footer); }, /** * Private methods */ _measureAndUpdateScrollProps: function() { var scrollComponent = this.getScrollResponder(); if (!scrollComponent || !scrollComponent.getInnerViewNode) { return; } RCTUIManager.measureLayout( scrollComponent.getInnerViewNode(), React.findNodeHandle(scrollComponent), logError, this._setScrollContentLength ); RCTUIManager.measureLayoutRelativeToParent( React.findNodeHandle(scrollComponent), logError, this._setScrollVisibleLength ); // RCTScrollViewManager.calculateChildFrames is not available on // every platform RCTScrollViewManager && RCTScrollViewManager.calculateChildFrames && RCTScrollViewManager.calculateChildFrames( React.findNodeHandle(scrollComponent), this._updateChildFrames, ); }, _setScrollContentLength: function(left, top, width, height) { this.scrollProperties.contentLength = !this.props.horizontal ? height : width; }, _setScrollVisibleLength: function(left, top, width, height) { this.scrollProperties.visibleLength = !this.props.horizontal ? height : width; this._updateVisibleRows(); this._renderMoreRowsIfNeeded(); }, _updateChildFrames: function(childFrames) { this._updateVisibleRows(childFrames); }, _renderMoreRowsIfNeeded: function() { if (this.scrollProperties.contentLength === null || this.scrollProperties.visibleLength === null || this.state.curRenderedRowsCount === this.props.dataSource.getRowCount()) { return; } var distanceFromEnd = this._getDistanceFromEnd(this.scrollProperties); if (distanceFromEnd < this.props.scrollRenderAheadDistance) { this._pageInNewRows(); } }, _pageInNewRows: function() { this.setState((state, props) => { var rowsToRender = Math.min( state.curRenderedRowsCount + props.pageSize, props.dataSource.getRowCount() ); return { prevRenderedRowsCount: state.curRenderedRowsCount, curRenderedRowsCount: rowsToRender }; }, () => { this._measureAndUpdateScrollProps(); this.setState(state => ({ prevRenderedRowsCount: state.curRenderedRowsCount, })); }); }, _getDistanceFromEnd: function(scrollProperties) { return scrollProperties.contentLength - scrollProperties.visibleLength - scrollProperties.offset; }, _updateVisibleRows: function(updatedFrames) { if (!this.props.onChangeVisibleRows) { return; // No need to compute visible rows if there is no callback } if (updatedFrames) { updatedFrames.forEach((newFrame) => { this._childFrames[newFrame.index] = merge(newFrame); }); } var isVertical = !this.props.horizontal; var dataSource = this.props.dataSource; var visibleMin = this.scrollProperties.offset; var visibleMax = visibleMin + this.scrollProperties.visibleLength; var allRowIDs = dataSource.rowIdentities; var header = this.props.renderHeader && this.props.renderHeader(); var totalIndex = header ? 1 : 0; var visibilityChanged = false; var changedRows = {}; for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) { var rowIDs = allRowIDs[sectionIdx]; if (rowIDs.length === 0) { continue; } var sectionID = dataSource.sectionIdentities[sectionIdx]; if (this.props.renderSectionHeader) { totalIndex++; } var visibleSection = this._visibleRows[sectionID]; if (!visibleSection) { visibleSection = {}; } for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) { var rowID = rowIDs[rowIdx]; var frame = this._childFrames[totalIndex]; totalIndex++; if (!frame) { break; } var rowVisible = visibleSection[rowID]; var min = isVertical ? frame.y : frame.x; var max = min + (isVertical ? frame.height : frame.width); if (min > visibleMax || max < visibleMin) { if (rowVisible) { visibilityChanged = true; delete visibleSection[rowID]; if (!changedRows[sectionID]) { changedRows[sectionID] = {}; } changedRows[sectionID][rowID] = false; } } else if (!rowVisible) { visibilityChanged = true; visibleSection[rowID] = true; if (!changedRows[sectionID]) { changedRows[sectionID] = {}; } changedRows[sectionID][rowID] = true; } } if (!isEmpty(visibleSection)) { this._visibleRows[sectionID] = visibleSection; } else if (this._visibleRows[sectionID]) { delete this._visibleRows[sectionID]; } } visibilityChanged && this.props.onChangeVisibleRows(this._visibleRows, changedRows); }, _onScroll: function(e) { var isVertical = !this.props.horizontal; this.scrollProperties.visibleLength = e.nativeEvent.layoutMeasurement[ isVertical ? 'height' : 'width' ]; this.scrollProperties.contentLength = e.nativeEvent.contentSize[ isVertical ? 'height' : 'width' ]; this.scrollProperties.offset = e.nativeEvent.contentOffset[ isVertical ? 'y' : 'x' ]; this._updateVisibleRows(e.nativeEvent.updatedChildFrames); var nearEnd = this._getDistanceFromEnd(this.scrollProperties) < this.props.onEndReachedThreshold; if (nearEnd && this.props.onEndReached && this.scrollProperties.contentLength !== this._sentEndForContentLength && this.state.curRenderedRowsCount === this.props.dataSource.getRowCount()) { this._sentEndForContentLength = this.scrollProperties.contentLength; this.props.onEndReached(e); } else { this._renderMoreRowsIfNeeded(); } this.props.onScroll && this.props.onScroll(e); }, }); module.exports = ListView;
course/format/amd/src/local/content/section.js
grabs/moodle
// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Course section format component. * * @module core_courseformat/local/content/section * @class core_courseformat/local/content/section * @copyright 2021 Ferran Recio <[email protected]> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Header from 'core_courseformat/local/content/section/header'; import DndSection from 'core_courseformat/local/courseeditor/dndsection'; export default class extends DndSection { /** * Constructor hook. */ create() { // Optional component name for debugging. this.name = 'content_section'; // Default query selectors. this.selectors = { SECTION_ITEM: `[data-for='section_title']`, CM: `[data-for="cmitem"]`, SECTIONINFO: `[data-for="sectioninfo"]`, }; // Most classes will be loaded later by DndCmItem. this.classes = { LOCKED: 'editinprogress', HASDESCRIPTION: 'description', }; // We need our id to watch specific events. this.id = this.element.dataset.id; } /** * Initial state ready method. * * @param {Object} state the initial state */ stateReady(state) { this.configState(state); // Drag and drop is only available for components compatible course formats. if (this.reactive.isEditing && this.reactive.supportComponents) { // Section zero and other formats sections may not have a title to drag. const sectionItem = this.getElement(this.selectors.SECTION_ITEM); if (sectionItem) { // Init the inner dragable element. const headerComponent = new Header({ ...this, element: sectionItem, fullregion: this.element, }); this.configDragDrop(headerComponent); } } } /** * Component watchers. * * @returns {Array} of watchers */ getWatchers() { return [ {watch: `section[${this.id}]:updated`, handler: this._refreshSection}, ]; } /** * Validate if the drop data can be dropped over the component. * * @param {Object} dropdata the exported drop data. * @returns {boolean} */ validateDropData(dropdata) { // If the format uses one section per page sections dropping in the content is ignored. if (dropdata?.type === 'section' && this.reactive.sectionReturn != 0) { return false; } return super.validateDropData(dropdata); } /** * Get the last CM element of that section. * * @returns {element|null} */ getLastCm() { const cms = this.getElements(this.selectors.CM); // DndUpload may add extra elements so :last-child selector cannot be used. if (!cms || cms.length === 0) { return null; } return cms[cms.length - 1]; } /** * Update a course index section using the state information. * * @param {object} param * @param {Object} param.element details the update details. */ _refreshSection({element}) { // Update classes. this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false); this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false); this.locked = element.locked; // The description box classes depends on the section state. const sectioninfo = this.getElement(this.selectors.SECTIONINFO); if (sectioninfo) { sectioninfo.classList.toggle(this.classes.HASDESCRIPTION, element.hasrestrictions); } } }
ajax/libs/yui/3.8.0/event-focus/event-focus-coverage.js
gogoleva/cdnjs
if (typeof _yuitest_coverage == "undefined"){ _yuitest_coverage = {}; _yuitest_coverline = function(src, line){ var coverage = _yuitest_coverage[src]; if (!coverage.lines[line]){ coverage.calledLines++; } coverage.lines[line]++; }; _yuitest_coverfunc = function(src, name, line){ var coverage = _yuitest_coverage[src], funcId = name + ":" + line; if (!coverage.functions[funcId]){ coverage.calledFunctions++; } coverage.functions[funcId]++; }; } _yuitest_coverage["build/event-focus/event-focus.js"] = { lines: {}, functions: {}, coveredLines: 0, calledLines: 0, coveredFunctions: 0, calledFunctions: 0, path: "build/event-focus/event-focus.js", code: [] }; _yuitest_coverage["build/event-focus/event-focus.js"].code=["YUI.add('event-focus', function (Y, NAME) {","","/**"," * Adds bubbling and delegation support to DOM events focus and blur."," * "," * @module event"," * @submodule event-focus"," */","var Event = Y.Event,",""," YLang = Y.Lang,",""," isString = YLang.isString,",""," arrayIndex = Y.Array.indexOf,",""," useActivate = (function() {",""," // Changing the structure of this test, so that it doesn't use inline JS in HTML,"," // which throws an exception in Win8 packaged apps, due to additional security restrictions:"," // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences",""," var supported = false,"," doc = Y.config.doc,"," p;",""," if (doc) {",""," p = doc.createElement(\"p\");"," p.setAttribute(\"onbeforeactivate\", \";\");",""," // onbeforeactivate is a function in IE8+."," // onbeforeactivate is a string in IE6,7 (unfortunate, otherwise we could have just checked for function below)."," // onbeforeactivate is a function in IE10, in a Win8 App environment (no exception running the test).",""," // onbeforeactivate is undefined in Webkit/Gecko."," // onbeforeactivate is a function in Webkit/Gecko if it's a supported event (e.g. onclick).",""," supported = (p.onbeforeactivate !== undefined);"," }",""," return supported;"," }());","","function define(type, proxy, directEvent) {"," var nodeDataKey = '_' + type + 'Notifiers';",""," Y.Event.define(type, {",""," _useActivate : useActivate,",""," _attach: function (el, notifier, delegate) {"," if (Y.DOM.isWindow(el)) {"," return Event._attach([type, function (e) {"," notifier.fire(e);"," }, el]);"," } else {"," return Event._attach("," [proxy, this._proxy, el, this, notifier, delegate],"," { capture: true });"," }"," },",""," _proxy: function (e, notifier, delegate) {"," var target = e.target,"," currentTarget = e.currentTarget,"," notifiers = target.getData(nodeDataKey),"," yuid = Y.stamp(currentTarget._node),"," defer = (useActivate || target !== currentTarget),"," directSub;"," "," notifier.currentTarget = (delegate) ? target : currentTarget;"," notifier.container = (delegate) ? currentTarget : null;",""," // Maintain a list to handle subscriptions from nested"," // containers div#a>div#b>input #a.on(focus..) #b.on(focus..),"," // use one focus or blur subscription that fires notifiers from"," // #b then #a to emulate bubble sequence."," if (!notifiers) {"," notifiers = {};"," target.setData(nodeDataKey, notifiers);",""," // only subscribe to the element's focus if the target is"," // not the current target ("," if (defer) {"," directSub = Event._attach("," [directEvent, this._notify, target._node]).sub;"," directSub.once = true;"," }"," } else {"," // In old IE, defer is always true. In capture-phase browsers,"," // The delegate subscriptions will be encountered first, which"," // will establish the notifiers data and direct subscription"," // on the node. If there is also a direct subscription to the"," // node's focus/blur, it should not call _notify because the"," // direct subscription from the delegate sub(s) exists, which"," // will call _notify. So this avoids _notify being called"," // twice, unnecessarily."," defer = true;"," }",""," if (!notifiers[yuid]) {"," notifiers[yuid] = [];"," }",""," notifiers[yuid].push(notifier);",""," if (!defer) {"," this._notify(e);"," }"," },",""," _notify: function (e, container) {"," var currentTarget = e.currentTarget,"," notifierData = currentTarget.getData(nodeDataKey),"," axisNodes = currentTarget.ancestors(),"," doc = currentTarget.get('ownerDocument'),"," delegates = [],"," // Used to escape loops when there are no more"," // notifiers to consider"," count = notifierData ?"," Y.Object.keys(notifierData).length :"," 0,"," target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret;",""," // clear the notifications list (mainly for delegation)"," currentTarget.clearData(nodeDataKey);",""," // Order the delegate subs by their placement in the parent axis"," axisNodes.push(currentTarget);"," // document.get('ownerDocument') returns null"," // which we'll use to prevent having duplicate Nodes in the list"," if (doc) {"," axisNodes.unshift(doc);"," }",""," // ancestors() returns the Nodes from top to bottom"," axisNodes._nodes.reverse();",""," if (count) {"," // Store the count for step 2"," tmp = count;"," axisNodes.some(function (node) {"," var yuid = Y.stamp(node),"," notifiers = notifierData[yuid],"," i, len;",""," if (notifiers) {"," count--;"," for (i = 0, len = notifiers.length; i < len; ++i) {"," if (notifiers[i].handle.sub.filter) {"," delegates.push(notifiers[i]);"," }"," }"," }",""," return !count;"," });"," count = tmp;"," }",""," // Walk up the parent axis, notifying direct subscriptions and"," // testing delegate filters."," while (count && (target = axisNodes.shift())) {"," yuid = Y.stamp(target);",""," notifiers = notifierData[yuid];",""," if (notifiers) {"," for (i = 0, len = notifiers.length; i < len; ++i) {"," notifier = notifiers[i];"," sub = notifier.handle.sub;"," match = true;",""," e.currentTarget = target;",""," if (sub.filter) {"," match = sub.filter.apply(target,"," [target, e].concat(sub.args || []));",""," // No longer necessary to test against this"," // delegate subscription for the nodes along"," // the parent axis."," delegates.splice("," arrayIndex(delegates, notifier), 1);"," }",""," if (match) {"," // undefined for direct subs"," e.container = notifier.container;"," ret = notifier.fire(e);"," }",""," if (ret === false || e.stopped === 2) {"," break;"," }"," }"," "," delete notifiers[yuid];"," count--;"," }",""," if (e.stopped !== 2) {"," // delegates come after subs targeting this specific node"," // because they would not normally report until they'd"," // bubbled to the container node."," for (i = 0, len = delegates.length; i < len; ++i) {"," notifier = delegates[i];"," sub = notifier.handle.sub;",""," if (sub.filter.apply(target,"," [target, e].concat(sub.args || []))) {",""," e.container = notifier.container;"," e.currentTarget = target;"," ret = notifier.fire(e);"," }",""," if (ret === false || e.stopped === 2) {"," break;"," }"," }"," }",""," if (e.stopped) {"," break;"," }"," }"," },",""," on: function (node, sub, notifier) {"," sub.handle = this._attach(node._node, notifier);"," },",""," detach: function (node, sub) {"," sub.handle.detach();"," },",""," delegate: function (node, sub, notifier, filter) {"," if (isString(filter)) {"," sub.filter = function (target) {"," return Y.Selector.test(target._node, filter,"," node === target ? null : node._node);"," };"," }",""," sub.handle = this._attach(node._node, notifier, true);"," },",""," detachDelegate: function (node, sub) {"," sub.handle.detach();"," }"," }, true);","}","","// For IE, we need to defer to focusin rather than focus because","// `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate,","// el.onfocusin, doSomething, then el.onfocus. All others support capture","// phase focus, which executes before doSomething. To guarantee consistent","// behavior for this use case, IE's direct subscriptions are made against","// focusin so subscribers will be notified before js following el.focus() is","// executed.","if (useActivate) {"," // name capture phase direct subscription"," define(\"focus\", \"beforeactivate\", \"focusin\");"," define(\"blur\", \"beforedeactivate\", \"focusout\");","} else {"," define(\"focus\", \"focus\", \"focus\");"," define(\"blur\", \"blur\", \"blur\");","}","","","}, '@VERSION@', {\"requires\": [\"event-synthetic\"]});"]; _yuitest_coverage["build/event-focus/event-focus.js"].lines = {"1":0,"9":0,"23":0,"27":0,"29":0,"30":0,"39":0,"42":0,"45":0,"46":0,"48":0,"53":0,"54":0,"55":0,"58":0,"65":0,"72":0,"73":0,"79":0,"80":0,"81":0,"85":0,"86":0,"88":0,"99":0,"102":0,"103":0,"106":0,"108":0,"109":0,"114":0,"127":0,"130":0,"133":0,"134":0,"138":0,"140":0,"142":0,"143":0,"144":0,"148":0,"149":0,"150":0,"151":0,"152":0,"157":0,"159":0,"164":0,"165":0,"167":0,"169":0,"170":0,"171":0,"172":0,"173":0,"175":0,"177":0,"178":0,"184":0,"188":0,"190":0,"191":0,"194":0,"195":0,"199":0,"200":0,"203":0,"207":0,"208":0,"209":0,"211":0,"214":0,"215":0,"216":0,"219":0,"220":0,"225":0,"226":0,"232":0,"236":0,"240":0,"241":0,"242":0,"247":0,"251":0,"263":0,"265":0,"266":0,"268":0,"269":0}; _yuitest_coverage["build/event-focus/event-focus.js"].functions = {"(anonymous 2):17":0,"(anonymous 3):54":0,"_attach:52":0,"_proxy:64":0,"(anonymous 4):143":0,"_notify:113":0,"on:231":0,"detach:235":0,"filter:241":0,"delegate:239":0,"detachDelegate:250":0,"define:45":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-focus/event-focus.js"].coveredLines = 90; _yuitest_coverage["build/event-focus/event-focus.js"].coveredFunctions = 13; _yuitest_coverline("build/event-focus/event-focus.js", 1); YUI.add('event-focus', function (Y, NAME) { /** * Adds bubbling and delegation support to DOM events focus and blur. * * @module event * @submodule event-focus */ _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 1)", 1); _yuitest_coverline("build/event-focus/event-focus.js", 9); var Event = Y.Event, YLang = Y.Lang, isString = YLang.isString, arrayIndex = Y.Array.indexOf, useActivate = (function() { // Changing the structure of this test, so that it doesn't use inline JS in HTML, // which throws an exception in Win8 packaged apps, due to additional security restrictions: // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 2)", 17); _yuitest_coverline("build/event-focus/event-focus.js", 23); var supported = false, doc = Y.config.doc, p; _yuitest_coverline("build/event-focus/event-focus.js", 27); if (doc) { _yuitest_coverline("build/event-focus/event-focus.js", 29); p = doc.createElement("p"); _yuitest_coverline("build/event-focus/event-focus.js", 30); p.setAttribute("onbeforeactivate", ";"); // onbeforeactivate is a function in IE8+. // onbeforeactivate is a string in IE6,7 (unfortunate, otherwise we could have just checked for function below). // onbeforeactivate is a function in IE10, in a Win8 App environment (no exception running the test). // onbeforeactivate is undefined in Webkit/Gecko. // onbeforeactivate is a function in Webkit/Gecko if it's a supported event (e.g. onclick). _yuitest_coverline("build/event-focus/event-focus.js", 39); supported = (p.onbeforeactivate !== undefined); } _yuitest_coverline("build/event-focus/event-focus.js", 42); return supported; }()); _yuitest_coverline("build/event-focus/event-focus.js", 45); function define(type, proxy, directEvent) { _yuitest_coverfunc("build/event-focus/event-focus.js", "define", 45); _yuitest_coverline("build/event-focus/event-focus.js", 46); var nodeDataKey = '_' + type + 'Notifiers'; _yuitest_coverline("build/event-focus/event-focus.js", 48); Y.Event.define(type, { _useActivate : useActivate, _attach: function (el, notifier, delegate) { _yuitest_coverfunc("build/event-focus/event-focus.js", "_attach", 52); _yuitest_coverline("build/event-focus/event-focus.js", 53); if (Y.DOM.isWindow(el)) { _yuitest_coverline("build/event-focus/event-focus.js", 54); return Event._attach([type, function (e) { _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 3)", 54); _yuitest_coverline("build/event-focus/event-focus.js", 55); notifier.fire(e); }, el]); } else { _yuitest_coverline("build/event-focus/event-focus.js", 58); return Event._attach( [proxy, this._proxy, el, this, notifier, delegate], { capture: true }); } }, _proxy: function (e, notifier, delegate) { _yuitest_coverfunc("build/event-focus/event-focus.js", "_proxy", 64); _yuitest_coverline("build/event-focus/event-focus.js", 65); var target = e.target, currentTarget = e.currentTarget, notifiers = target.getData(nodeDataKey), yuid = Y.stamp(currentTarget._node), defer = (useActivate || target !== currentTarget), directSub; _yuitest_coverline("build/event-focus/event-focus.js", 72); notifier.currentTarget = (delegate) ? target : currentTarget; _yuitest_coverline("build/event-focus/event-focus.js", 73); notifier.container = (delegate) ? currentTarget : null; // Maintain a list to handle subscriptions from nested // containers div#a>div#b>input #a.on(focus..) #b.on(focus..), // use one focus or blur subscription that fires notifiers from // #b then #a to emulate bubble sequence. _yuitest_coverline("build/event-focus/event-focus.js", 79); if (!notifiers) { _yuitest_coverline("build/event-focus/event-focus.js", 80); notifiers = {}; _yuitest_coverline("build/event-focus/event-focus.js", 81); target.setData(nodeDataKey, notifiers); // only subscribe to the element's focus if the target is // not the current target ( _yuitest_coverline("build/event-focus/event-focus.js", 85); if (defer) { _yuitest_coverline("build/event-focus/event-focus.js", 86); directSub = Event._attach( [directEvent, this._notify, target._node]).sub; _yuitest_coverline("build/event-focus/event-focus.js", 88); directSub.once = true; } } else { // In old IE, defer is always true. In capture-phase browsers, // The delegate subscriptions will be encountered first, which // will establish the notifiers data and direct subscription // on the node. If there is also a direct subscription to the // node's focus/blur, it should not call _notify because the // direct subscription from the delegate sub(s) exists, which // will call _notify. So this avoids _notify being called // twice, unnecessarily. _yuitest_coverline("build/event-focus/event-focus.js", 99); defer = true; } _yuitest_coverline("build/event-focus/event-focus.js", 102); if (!notifiers[yuid]) { _yuitest_coverline("build/event-focus/event-focus.js", 103); notifiers[yuid] = []; } _yuitest_coverline("build/event-focus/event-focus.js", 106); notifiers[yuid].push(notifier); _yuitest_coverline("build/event-focus/event-focus.js", 108); if (!defer) { _yuitest_coverline("build/event-focus/event-focus.js", 109); this._notify(e); } }, _notify: function (e, container) { _yuitest_coverfunc("build/event-focus/event-focus.js", "_notify", 113); _yuitest_coverline("build/event-focus/event-focus.js", 114); var currentTarget = e.currentTarget, notifierData = currentTarget.getData(nodeDataKey), axisNodes = currentTarget.ancestors(), doc = currentTarget.get('ownerDocument'), delegates = [], // Used to escape loops when there are no more // notifiers to consider count = notifierData ? Y.Object.keys(notifierData).length : 0, target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret; // clear the notifications list (mainly for delegation) _yuitest_coverline("build/event-focus/event-focus.js", 127); currentTarget.clearData(nodeDataKey); // Order the delegate subs by their placement in the parent axis _yuitest_coverline("build/event-focus/event-focus.js", 130); axisNodes.push(currentTarget); // document.get('ownerDocument') returns null // which we'll use to prevent having duplicate Nodes in the list _yuitest_coverline("build/event-focus/event-focus.js", 133); if (doc) { _yuitest_coverline("build/event-focus/event-focus.js", 134); axisNodes.unshift(doc); } // ancestors() returns the Nodes from top to bottom _yuitest_coverline("build/event-focus/event-focus.js", 138); axisNodes._nodes.reverse(); _yuitest_coverline("build/event-focus/event-focus.js", 140); if (count) { // Store the count for step 2 _yuitest_coverline("build/event-focus/event-focus.js", 142); tmp = count; _yuitest_coverline("build/event-focus/event-focus.js", 143); axisNodes.some(function (node) { _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 4)", 143); _yuitest_coverline("build/event-focus/event-focus.js", 144); var yuid = Y.stamp(node), notifiers = notifierData[yuid], i, len; _yuitest_coverline("build/event-focus/event-focus.js", 148); if (notifiers) { _yuitest_coverline("build/event-focus/event-focus.js", 149); count--; _yuitest_coverline("build/event-focus/event-focus.js", 150); for (i = 0, len = notifiers.length; i < len; ++i) { _yuitest_coverline("build/event-focus/event-focus.js", 151); if (notifiers[i].handle.sub.filter) { _yuitest_coverline("build/event-focus/event-focus.js", 152); delegates.push(notifiers[i]); } } } _yuitest_coverline("build/event-focus/event-focus.js", 157); return !count; }); _yuitest_coverline("build/event-focus/event-focus.js", 159); count = tmp; } // Walk up the parent axis, notifying direct subscriptions and // testing delegate filters. _yuitest_coverline("build/event-focus/event-focus.js", 164); while (count && (target = axisNodes.shift())) { _yuitest_coverline("build/event-focus/event-focus.js", 165); yuid = Y.stamp(target); _yuitest_coverline("build/event-focus/event-focus.js", 167); notifiers = notifierData[yuid]; _yuitest_coverline("build/event-focus/event-focus.js", 169); if (notifiers) { _yuitest_coverline("build/event-focus/event-focus.js", 170); for (i = 0, len = notifiers.length; i < len; ++i) { _yuitest_coverline("build/event-focus/event-focus.js", 171); notifier = notifiers[i]; _yuitest_coverline("build/event-focus/event-focus.js", 172); sub = notifier.handle.sub; _yuitest_coverline("build/event-focus/event-focus.js", 173); match = true; _yuitest_coverline("build/event-focus/event-focus.js", 175); e.currentTarget = target; _yuitest_coverline("build/event-focus/event-focus.js", 177); if (sub.filter) { _yuitest_coverline("build/event-focus/event-focus.js", 178); match = sub.filter.apply(target, [target, e].concat(sub.args || [])); // No longer necessary to test against this // delegate subscription for the nodes along // the parent axis. _yuitest_coverline("build/event-focus/event-focus.js", 184); delegates.splice( arrayIndex(delegates, notifier), 1); } _yuitest_coverline("build/event-focus/event-focus.js", 188); if (match) { // undefined for direct subs _yuitest_coverline("build/event-focus/event-focus.js", 190); e.container = notifier.container; _yuitest_coverline("build/event-focus/event-focus.js", 191); ret = notifier.fire(e); } _yuitest_coverline("build/event-focus/event-focus.js", 194); if (ret === false || e.stopped === 2) { _yuitest_coverline("build/event-focus/event-focus.js", 195); break; } } _yuitest_coverline("build/event-focus/event-focus.js", 199); delete notifiers[yuid]; _yuitest_coverline("build/event-focus/event-focus.js", 200); count--; } _yuitest_coverline("build/event-focus/event-focus.js", 203); if (e.stopped !== 2) { // delegates come after subs targeting this specific node // because they would not normally report until they'd // bubbled to the container node. _yuitest_coverline("build/event-focus/event-focus.js", 207); for (i = 0, len = delegates.length; i < len; ++i) { _yuitest_coverline("build/event-focus/event-focus.js", 208); notifier = delegates[i]; _yuitest_coverline("build/event-focus/event-focus.js", 209); sub = notifier.handle.sub; _yuitest_coverline("build/event-focus/event-focus.js", 211); if (sub.filter.apply(target, [target, e].concat(sub.args || []))) { _yuitest_coverline("build/event-focus/event-focus.js", 214); e.container = notifier.container; _yuitest_coverline("build/event-focus/event-focus.js", 215); e.currentTarget = target; _yuitest_coverline("build/event-focus/event-focus.js", 216); ret = notifier.fire(e); } _yuitest_coverline("build/event-focus/event-focus.js", 219); if (ret === false || e.stopped === 2) { _yuitest_coverline("build/event-focus/event-focus.js", 220); break; } } } _yuitest_coverline("build/event-focus/event-focus.js", 225); if (e.stopped) { _yuitest_coverline("build/event-focus/event-focus.js", 226); break; } } }, on: function (node, sub, notifier) { _yuitest_coverfunc("build/event-focus/event-focus.js", "on", 231); _yuitest_coverline("build/event-focus/event-focus.js", 232); sub.handle = this._attach(node._node, notifier); }, detach: function (node, sub) { _yuitest_coverfunc("build/event-focus/event-focus.js", "detach", 235); _yuitest_coverline("build/event-focus/event-focus.js", 236); sub.handle.detach(); }, delegate: function (node, sub, notifier, filter) { _yuitest_coverfunc("build/event-focus/event-focus.js", "delegate", 239); _yuitest_coverline("build/event-focus/event-focus.js", 240); if (isString(filter)) { _yuitest_coverline("build/event-focus/event-focus.js", 241); sub.filter = function (target) { _yuitest_coverfunc("build/event-focus/event-focus.js", "filter", 241); _yuitest_coverline("build/event-focus/event-focus.js", 242); return Y.Selector.test(target._node, filter, node === target ? null : node._node); }; } _yuitest_coverline("build/event-focus/event-focus.js", 247); sub.handle = this._attach(node._node, notifier, true); }, detachDelegate: function (node, sub) { _yuitest_coverfunc("build/event-focus/event-focus.js", "detachDelegate", 250); _yuitest_coverline("build/event-focus/event-focus.js", 251); sub.handle.detach(); } }, true); } // For IE, we need to defer to focusin rather than focus because // `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate, // el.onfocusin, doSomething, then el.onfocus. All others support capture // phase focus, which executes before doSomething. To guarantee consistent // behavior for this use case, IE's direct subscriptions are made against // focusin so subscribers will be notified before js following el.focus() is // executed. _yuitest_coverline("build/event-focus/event-focus.js", 263); if (useActivate) { // name capture phase direct subscription _yuitest_coverline("build/event-focus/event-focus.js", 265); define("focus", "beforeactivate", "focusin"); _yuitest_coverline("build/event-focus/event-focus.js", 266); define("blur", "beforedeactivate", "focusout"); } else { _yuitest_coverline("build/event-focus/event-focus.js", 268); define("focus", "focus", "focus"); _yuitest_coverline("build/event-focus/event-focus.js", 269); define("blur", "blur", "blur"); } }, '@VERSION@', {"requires": ["event-synthetic"]});
src/utils/defaultMenuRenderer.js
matroid/react-select
import classNames from 'classnames'; import React from 'react'; function menuRenderer ({ focusedOption, instancePrefix, labelKey, onFocus, onSelect, optionClassName, optionComponent, optionRenderer, options, valueArray, valueKey, onOptionRef }) { let Option = optionComponent; return options.map((option, i) => { let isSelected = valueArray && valueArray.indexOf(option) > -1; let isFocused = option === focusedOption; let optionClass = classNames(optionClassName, { 'Select-option': true, 'is-selected': isSelected, 'is-focused': isFocused, 'is-disabled': option.disabled, }); return ( <Option className={optionClass} instancePrefix={instancePrefix} isDisabled={option.disabled} isFocused={isFocused} isSelected={isSelected} key={`option-${i}-${option[valueKey]}`} onFocus={onFocus} onSelect={onSelect} option={option} optionIndex={i} ref={ref => { onOptionRef(ref, isFocused); }} > {optionRenderer(option, i)} </Option> ); }); } module.exports = menuRenderer;
ajax/libs/antd-mobile/1.6.3/antd-mobile.min.js
him2him2/cdnjs
/*! * antd-mobile v1.6.3 * * Copyright 2015-present, Alipay, Inc. * All rights reserved. */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports["antd-mobile"]=t(require("react"),require("react-dom")):e["antd-mobile"]=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,o){r.apply(this,[e,t,o].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){e.exports=n(139)},function(t,n){t.exports=e},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(253),i=r(o),a=n(250),s=r(a),l=n(31),u=r(l);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":(0,u.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(i.default?(0,i.default)(e,t):e.__proto__=t)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(31),i=r(o);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(97),i=r(o);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(249),i=r(o);t.default=i.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){var r,o;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var a in r)i.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var i={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=n:(r=[],o=function(){return n}.apply(t,r),!(void 0!==o&&(e.exports=o)))}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(97),i=r(o);t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){e.exports=n(374)()},function(e,t,n){"use strict";n(359),n(348)},function(e,n){e.exports=t},function(e,t,n){var r=n(500),o=new r;document.body?o.elem=o.render(document.body):document.addEventListener("DOMContentLoaded",function(){o.elem=o.render(document.body)},!1),e.exports=o},function(e,t,n){"use strict";var r=n(1),o=n(301);if("undefined"==typeof r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new r.Component).updater;e.exports=o(r.Component,r.isValidElement,i)},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t){var n=e.exports={version:"2.5.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n=(0,a.default)({},e),r=0;r<t.length;r++){var o=t[r];delete n[o]}return n}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return Object.keys(e).forEach(function(t){return e[t]=t}),e}function i(e,t){var n={};return t.forEach(function(t){n[t]=e[t]}),n}function a(e){var t=e;t.nativeEvent&&(t=t.nativeEvent);var n=t.touches,r=t.changedTouches,o=n&&n.length>0,i=r&&r.length>0;return!o&&i?r[0]:o?n[0]:t}function s(){return Date.now()-I>=A}Object.defineProperty(t,"__esModule",{value:!0});var l=n(6),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(11),x=r(b),C=n(430),S=r(C),E=o({NOT_RESPONDER:null,RESPONDER_INACTIVE_PRESS_IN:null,RESPONDER_INACTIVE_PRESS_OUT:null,RESPONDER_ACTIVE_PRESS_IN:null,RESPONDER_ACTIVE_PRESS_OUT:null,RESPONDER_ACTIVE_LONG_PRESS_IN:null,RESPONDER_ACTIVE_LONG_PRESS_OUT:null,ERROR:null}),w={RESPONDER_ACTIVE_PRESS_OUT:!0,RESPONDER_ACTIVE_PRESS_IN:!0},O={RESPONDER_INACTIVE_PRESS_IN:!0,RESPONDER_ACTIVE_PRESS_IN:!0,RESPONDER_ACTIVE_LONG_PRESS_IN:!0},P={RESPONDER_ACTIVE_LONG_PRESS_IN:!0},k=o({DELAY:null,RESPONDER_GRANT:null,RESPONDER_RELEASE:null,RESPONDER_TERMINATED:null,ENTER_PRESS_RECT:null,LEAVE_PRESS_RECT:null,LONG_PRESS_DETECTED:null}),T={NOT_RESPONDER:{DELAY:E.ERROR,RESPONDER_GRANT:E.RESPONDER_INACTIVE_PRESS_IN,RESPONDER_RELEASE:E.ERROR,RESPONDER_TERMINATED:E.ERROR,ENTER_PRESS_RECT:E.ERROR,LEAVE_PRESS_RECT:E.ERROR,LONG_PRESS_DETECTED:E.ERROR},RESPONDER_INACTIVE_PRESS_IN:{DELAY:E.RESPONDER_ACTIVE_PRESS_IN,RESPONDER_GRANT:E.ERROR,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.RESPONDER_INACTIVE_PRESS_IN,LEAVE_PRESS_RECT:E.RESPONDER_INACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:E.ERROR},RESPONDER_INACTIVE_PRESS_OUT:{DELAY:E.RESPONDER_ACTIVE_PRESS_OUT,RESPONDER_GRANT:E.ERROR,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.RESPONDER_INACTIVE_PRESS_IN,LEAVE_PRESS_RECT:E.RESPONDER_INACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:E.ERROR},RESPONDER_ACTIVE_PRESS_IN:{DELAY:E.ERROR,RESPONDER_GRANT:E.ERROR,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.RESPONDER_ACTIVE_PRESS_IN,LEAVE_PRESS_RECT:E.RESPONDER_ACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:E.RESPONDER_ACTIVE_LONG_PRESS_IN},RESPONDER_ACTIVE_PRESS_OUT:{DELAY:E.ERROR,RESPONDER_GRANT:E.ERROR,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.RESPONDER_ACTIVE_PRESS_IN,LEAVE_PRESS_RECT:E.RESPONDER_ACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:E.ERROR},RESPONDER_ACTIVE_LONG_PRESS_IN:{DELAY:E.ERROR,RESPONDER_GRANT:E.ERROR,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.RESPONDER_ACTIVE_LONG_PRESS_IN,LEAVE_PRESS_RECT:E.RESPONDER_ACTIVE_LONG_PRESS_OUT,LONG_PRESS_DETECTED:E.RESPONDER_ACTIVE_LONG_PRESS_IN},RESPONDER_ACTIVE_LONG_PRESS_OUT:{DELAY:E.ERROR,RESPONDER_GRANT:E.ERROR,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.RESPONDER_ACTIVE_LONG_PRESS_IN,LEAVE_PRESS_RECT:E.RESPONDER_ACTIVE_LONG_PRESS_OUT,LONG_PRESS_DETECTED:E.ERROR},error:{DELAY:E.NOT_RESPONDER,RESPONDER_GRANT:E.RESPONDER_INACTIVE_PRESS_IN,RESPONDER_RELEASE:E.NOT_RESPONDER,RESPONDER_TERMINATED:E.NOT_RESPONDER,ENTER_PRESS_RECT:E.NOT_RESPONDER,LEAVE_PRESS_RECT:E.NOT_RESPONDER,LONG_PRESS_DETECTED:E.NOT_RESPONDER}},M=130,N=20,R=500,D=R-M,j=10,I=0,A=200,L=function(e){function t(){(0,d.default)(this,t);var e=(0,m.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={active:!1},e.onTouchStart=function(t){e.callChildEvent("onTouchStart",t),e.lockMouse=!0,e.releaseLockTimer&&clearTimeout(e.releaseLockTimer),e.touchableHandleResponderGrant(t.nativeEvent)},e.onTouchMove=function(t){e.callChildEvent("onTouchMove",t),e.touchableHandleResponderMove(t.nativeEvent)},e.onTouchEnd=function(t){e.callChildEvent("onTouchEnd",t),e.releaseLockTimer=setTimeout(function(){e.lockMouse=!1},300),e.touchableHandleResponderRelease(new S.default(t.nativeEvent))},e.onTouchCancel=function(t){e.callChildEvent("onTouchCancel",t),e.releaseLockTimer=setTimeout(function(){e.lockMouse=!1},300),e.touchableHandleResponderTerminate(t.nativeEvent)},e.onMouseDown=function(t){e.callChildEvent("onMouseDown",t),e.lockMouse||(e.touchableHandleResponderGrant(t.nativeEvent),document.addEventListener("mousemove",e.touchableHandleResponderMove,!1),document.addEventListener("mouseup",e.onMouseUp,!1))},e.onMouseUp=function(t){document.removeEventListener("mousemove",e.touchableHandleResponderMove,!1),document.removeEventListener("mouseup",e.onMouseUp,!1),e.touchableHandleResponderRelease(new S.default(t))},e.touchableHandleResponderMove=function(t){if(e.touchable.startMouse&&e.touchable.dimensionsOnActivate&&e.touchable.touchState!==E.NOT_RESPONDER&&e.touchable.touchState!==E.RESPONDER_INACTIVE_PRESS_IN){var n=a(t),r=n&&n.pageX,o=n&&n.pageY;if(e.pressInLocation){var i=e._getDistanceBetweenPoints(r,o,e.pressInLocation.pageX,e.pressInLocation.pageY);i>j&&e._cancelLongPressDelayTimeout()}if(e.checkTouchWithinActive(t)){e._receiveSignal(k.ENTER_PRESS_RECT,t);var s=e.touchable.touchState;s===E.RESPONDER_INACTIVE_PRESS_IN&&e._cancelLongPressDelayTimeout()}else e._cancelLongPressDelayTimeout(),e._receiveSignal(k.LEAVE_PRESS_RECT,t)}},e}return(0,y.default)(t,e),(0,p.default)(t,[{key:"componentWillMount",value:function(){this.touchable={touchState:void 0}}},{key:"componentDidMount",value:function(){this.root=x.default.findDOMNode(this)}},{key:"componentDidUpdate",value:function(){this.root=x.default.findDOMNode(this),this.props.disabled&&this.state.active&&this.setState({active:!1})}},{key:"componentWillUnmount",value:function(){this.releaseLockTimer&&clearTimeout(this.releaseLockTimer),this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout),this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout),this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout)}},{key:"callChildEvent",value:function(e,t){var n=_.default.Children.only(this.props.children).props[e];n&&n(t)}},{key:"_remeasureMetricsOnInit",value:function(e){var t=this.root,n=a(e),r=t.getBoundingClientRect();this.touchable={touchState:this.touchable.touchState,startMouse:{pageX:n.pageX,pageY:n.pageY},positionOnGrant:{left:r.left+window.pageXOffset,top:r.top+window.pageYOffset,width:r.width,height:r.height,clientLeft:r.left,clientTop:r.top}}}},{key:"touchableHandleResponderGrant",value:function(e){var t=this;if(this.touchable.touchState=E.NOT_RESPONDER,this.pressOutDelayTimeout&&(clearTimeout(this.pressOutDelayTimeout),this.pressOutDelayTimeout=null),!this.props.fixClickPenetration||s()){this._remeasureMetricsOnInit(e),this._receiveSignal(k.RESPONDER_GRANT,e);var n=this.props,r=n.delayPressIn,o=n.delayLongPress;r?this.touchableDelayTimeout=setTimeout(function(){t._handleDelay(e)},r):this._handleDelay(e);var i=new S.default(e);this.longPressDelayTimeout=setTimeout(function(){t._handleLongDelay(i)},o+r)}}},{key:"checkScroll",value:function(e){var t=this.touchable.positionOnGrant,n=this.root.getBoundingClientRect();if(n.left!==t.clientLeft||n.top!==t.clientTop)return this._receiveSignal(k.RESPONDER_TERMINATED,e),!1}},{key:"touchableHandleResponderRelease",value:function(e){if(this.touchable.startMouse){var t=a(e);return Math.abs(t.pageX-this.touchable.startMouse.pageX)>30||Math.abs(t.pageY-this.touchable.startMouse.pageY)>30?void this._receiveSignal(k.RESPONDER_TERMINATED,e):void(this.checkScroll(e)!==!1&&this._receiveSignal(k.RESPONDER_RELEASE,e))}}},{key:"touchableHandleResponderTerminate",value:function(e){this.touchable.startMouse&&this._receiveSignal(k.RESPONDER_TERMINATED,e)}},{key:"checkTouchWithinActive",value:function(e){var t=this.touchable.positionOnGrant,n=this.props,r=n.pressRetentionOffset,o=void 0===r?{}:r,i=n.hitSlop,s=o.left,l=o.top,u=o.right,c=o.bottom;i&&(s+=i.left,l+=i.top,u+=i.right,c+=i.bottom);var d=a(e),f=d&&d.pageX,p=d&&d.pageY;return f>t.left-s&&p>t.top-l&&f<t.left+t.width+u&&p<t.top+t.height+c}},{key:"callProp",value:function(e,t){this.props[e]&&!this.props.disabled&&this.props[e](t)}},{key:"touchableHandleActivePressIn",value:function(e){this.setActive(!0),this.callProp("onPressIn",e)}},{key:"touchableHandleActivePressOut",value:function(e){this.setActive(!1),this.callProp("onPressOut",e)}},{key:"touchableHandlePress",value:function(e){(0,C.shouldFirePress)(e)&&this.callProp("onPress",e),I=Date.now()}},{key:"touchableHandleLongPress",value:function(e){(0,C.shouldFirePress)(e)&&this.callProp("onLongPress",e)}},{key:"setActive",value:function(e){(this.props.activeClassName||this.props.activeStyle)&&this.setState({active:e})}},{key:"_remeasureMetricsOnActivation",value:function(){this.touchable.dimensionsOnActivate=this.touchable.positionOnGrant}},{key:"_handleDelay",value:function(e){this.touchableDelayTimeout=null,this._receiveSignal(k.DELAY,e)}},{key:"_handleLongDelay",value:function(e){this.longPressDelayTimeout=null;var t=this.touchable.touchState;t!==E.RESPONDER_ACTIVE_PRESS_IN&&t!==E.RESPONDER_ACTIVE_LONG_PRESS_IN?console.error("Attempted to transition from state `"+t+"` to `"+E.RESPONDER_ACTIVE_LONG_PRESS_IN+"`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled."):this._receiveSignal(k.LONG_PRESS_DETECTED,e)}},{key:"_receiveSignal",value:function(e,t){var n=this.touchable.touchState,r=T[n]&&T[n][e];r&&r!==E.ERROR&&n!==r&&(this._performSideEffectsForTransition(n,r,e,t),this.touchable.touchState=r)}},{key:"_cancelLongPressDelayTimeout",value:function(){this.longPressDelayTimeout&&(clearTimeout(this.longPressDelayTimeout),this.longPressDelayTimeout=null)}},{key:"_isHighlight",value:function(e){return e===E.RESPONDER_ACTIVE_PRESS_IN||e===E.RESPONDER_ACTIVE_LONG_PRESS_IN}},{key:"_savePressInLocation",value:function(e){var t=a(e),n=t&&t.pageX,r=t&&t.pageY;this.pressInLocation={pageX:n,pageY:r}}},{key:"_getDistanceBetweenPoints",value:function(e,t,n,r){var o=e-n,i=t-r;return Math.sqrt(o*o+i*i)}},{key:"_performSideEffectsForTransition",value:function(e,t,n,r){var o=this._isHighlight(e),i=this._isHighlight(t),a=n===k.RESPONDER_TERMINATED||n===k.RESPONDER_RELEASE;if(a&&this._cancelLongPressDelayTimeout(),!w[e]&&w[t]&&this._remeasureMetricsOnActivation(),O[e]&&n===k.LONG_PRESS_DETECTED&&this.touchableHandleLongPress(r),i&&!o?this._startHighlight(r):!i&&o&&this._endHighlight(r),O[e]&&n===k.RESPONDER_RELEASE){var s=!!this.props.onLongPress,l=P[e]&&(!s||!this.props.longPressCancelsPress),u=!P[e]||l;u&&(i||o||(this._startHighlight(r),this._endHighlight(r)),this.touchableHandlePress(r))}this.touchableDelayTimeout&&(clearTimeout(this.touchableDelayTimeout),this.touchableDelayTimeout=null)}},{key:"_startHighlight",value:function(e){this._savePressInLocation(e),this.touchableHandleActivePressIn(e)}},{key:"_endHighlight",value:function(e){var t=this;this.props.delayPressOut?this.pressOutDelayTimeout=setTimeout(function(){t.touchableHandleActivePressOut(e)},this.props.delayPressOut):this.touchableHandleActivePressOut(e)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.disabled,r=e.activeStyle,o=e.activeClassName,a=n?void 0:i(this,["onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onMouseDown"]),s=_.default.Children.only(t);if(!n&&this.state.active){var l=s.props,c=l.style,d=l.className;return r&&(c=(0,u.default)({},c,r)),o&&(d?d+=" "+o:d=o),_.default.cloneElement(s,(0,u.default)({className:d,style:c},a))}return _.default.cloneElement(s,a)}}]),t}(_.default.Component);t.default=L,L.defaultProps={fixClickPenetration:!1,disabled:!1,delayPressIn:M,delayLongPress:D,delayPressOut:100,pressRetentionOffset:{left:N,right:N,top:N,bottom:N},hitSlop:void 0,longPressCancelsPress:!0},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x="Icon props.type is invalid, have you set svg-sprite-loader correctly? see https://goo.gl/kN8oiw",C=function(e){function t(){(0,u.default)(this,t);var e=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.renderSvg=function(){var t=e.props.type,r=void 0;try{r=n(134)("./"+t+".svg")}catch(e){}finally{return r}},e}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.type,r=t.className,o=t.style,a=t.size,l=b(t,["type","className","style","size"]);if(!n||"string"!=typeof n)return console.error(x),null;var u=this.renderSvg(),c=void 0;u?(/^#/.test(u)||console.error(x),u="#"+n):(c=!0,u=n,/^#/.test(n)||console.error(x));var d=(0,_.default)((e={"am-icon":!0},(0,s.default)(e,"am-icon-"+(c?n.substr(1):n),!0),(0,s.default)(e,"am-icon-"+a,!0),(0,s.default)(e,r,!!r),e));return y.default.createElement("svg",(0,i.default)({className:d,style:o},l),y.default.createElement("use",{xlinkHref:u}))}}]),t}(y.default.Component);t.default=C,C.defaultProps={size:"md"},e.exports=t.default},[506,323],function(e,t,n){var r=n(69)("wks"),o=n(48),i=n(22).Symbol,a="function"==typeof i,s=e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))};s.store=r},function(e,t,n){var r=n(22),o=n(15),i=n(60),a=n(34),s="prototype",l=function(e,t,n){var u,c,d,f=e&l.F,p=e&l.G,h=e&l.S,m=e&l.P,v=e&l.B,y=e&l.W,g=p?o:o[t]||(o[t]={}),_=g[s],b=p?r:h?r[t]:(r[t]||{})[s];p&&(n=t);for(u in n)c=!f&&b&&void 0!==b[u],c&&u in g||(d=c?b[u]:n[u],g[u]=p&&"function"!=typeof b[u]?n[u]:v&&c?i(d,r):y&&b[u]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[s]=e[s],t}(d):m&&"function"==typeof d?i(Function.call,d):d,m&&((g.virtual||(g.virtual={}))[u]=d,e&l.R&&_&&!_[u]&&a(_,u,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(32),o=n(101),i=n(71),a=Object.defineProperty;t.f=n(26)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(102),o=n(61);e.exports=function(e){return r(o(e))}},[503,327],function(e,t,n){e.exports=!n(33)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){/* object-assign (c) Sindre Sorhus @license MIT */ "use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,s,l=n(e),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var c in r)i.call(r,c)&&(l[c]=r[c]);if(o){s=o(r);for(var d=0;d<s.length;d++)a.call(r,s[d])&&(l[s[d]]=r[s[d]])}}return l}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(178),_=r(g),b=n(7),x=r(b),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},S=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.children,o=t.className,a=t.style,l=t.renderHeader,u=t.renderFooter,c=C(t,["prefixCls","children","className","style","renderHeader","renderFooter"]),d=(0,x.default)((e={},(0,s.default)(e,n,!0),(0,s.default)(e,o,o),e));return y.default.createElement("div",(0,i.default)({className:d,style:a},c),l?y.default.createElement("div",{className:n+"-header"},"function"==typeof l?l():l):null,r?y.default.createElement("div",{className:n+"-body"},r):null,u?y.default.createElement("div",{className:n+"-footer"},"function"==typeof u?u():u):null)}}]),t}(y.default.Component);t.default=S,S.Item=_.default,S.defaultProps={prefixCls:"am-list"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(255),i=r(o),a=n(254),s=r(a),l="function"==typeof s.default&&"symbol"==typeof i.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===l(i.default)?function(e){return"undefined"==typeof e?"undefined":l(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":"undefined"==typeof e?"undefined":l(e)}},function(e,t,n){var r=n(38);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(23),o=n(41);e.exports=n(26)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Object.keys(e).reduce(function(t,n){return"aria-"!==n.substr(0,5)&&"data-"!==n.substr(0,5)&&"role"!==n||(t[n]=e[n]),t},{})},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(162),i=r(o),a=n(163),s=r(a);i.default.Item=s.default,t.default=i.default,e.exports=t.default},[503,321],function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports={}},function(e,t,n){var r=n(106),o=n(62);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";function r(e,t){return e+t}function o(e,t,n){var r=n;{if("object"!==("undefined"==typeof t?"undefined":O(t)))return"undefined"!=typeof r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):T(e,t);for(var i in t)t.hasOwnProperty(i)&&o(e,i,t[i])}}function i(e){var t=void 0,n=void 0,r=void 0,o=e.ownerDocument,i=o.body,a=o&&o.documentElement;return t=e.getBoundingClientRect(),n=t.left,r=t.top,n-=a.clientLeft||i.clientLeft||0,r-=a.clientTop||i.clientTop||0,{left:n,top:r}}function a(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}function s(e){return a(e)}function l(e){return a(e,!0)}function u(e){var t=i(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=s(r),t.top+=l(r),t}function c(e){return null!==e&&void 0!==e&&e==e.window}function d(e){return c(e)?e.document:9===e.nodeType?e:e.ownerDocument}function f(e,t,n){var r=n,o="",i=d(e);return r=r||i.defaultView.getComputedStyle(e,null),r&&(o=r.getPropertyValue(t)||r[t]),o}function p(e,t){var n=e[R]&&e[R][t];if(M.test(n)&&!N.test(t)){var r=e.style,o=r[j],i=e[D][j];e[D][j]=e[R][j],r[j]="fontSize"===t?"1em":n||0,n=r.pixelLeft+I,r[j]=o,e[D][j]=i}return""===n?"auto":n}function h(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function m(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function v(e,t,n){"static"===o(e,"position")&&(e.style.position="relative");var i=-999,a=-999,s=h("left",n),l=h("top",n),c=m(s),d=m(l);"left"!==s&&(i=999),"top"!==l&&(a=999);var f="",p=u(e);("left"in t||"top"in t)&&(f=(0,P.getTransitionProperty)(e)||"",(0,P.setTransitionProperty)(e,"none")),"left"in t&&(e.style[c]="",e.style[s]=i+"px"),"top"in t&&(e.style[d]="",e.style[l]=a+"px");var v=u(e),y={};for(var g in t)if(t.hasOwnProperty(g)){var _=h(g,n),b="left"===g?i:a,x=p[g]-v[g];_===g?y[_]=b+x:y[_]=b-x}o(e,y),r(e.offsetTop,e.offsetLeft),("left"in t||"top"in t)&&(0,P.setTransitionProperty)(e,f);var C={};for(var S in t)if(t.hasOwnProperty(S)){var E=h(S,n),w=t[S]-p[S];S===E?C[E]=y[E]+w:C[E]=y[E]-w}o(e,C)}function y(e,t){var n=u(e),r=(0,P.getTransformXY)(e),o={x:r.x,y:r.y};"left"in t&&(o.x=r.x+t.left-n.left),"top"in t&&(o.y=r.y+t.top-n.top),(0,P.setTransformXY)(e,o)}function g(e,t,n){n.useCssRight||n.useCssBottom?v(e,t,n):n.useCssTransform&&(0,P.getTransformName)()in document.body.style?y(e,t,n):v(e,t,n)}function _(e,t){for(var n=0;n<e.length;n++)t(e[n])}function b(e){return"border-box"===T(e,"boxSizing")}function x(e,t,n){var r={},o=e.style,i=void 0;for(i in t)t.hasOwnProperty(i)&&(r[i]=o[i],o[i]=t[i]);n.call(e);for(i in t)t.hasOwnProperty(i)&&(o[i]=r[i])}function C(e,t,n){var r=0,o=void 0,i=void 0,a=void 0;for(i=0;i<t.length;i++)if(o=t[i])for(a=0;a<n.length;a++){var s=void 0;s="border"===o?""+o+n[a]+"Width":o+n[a],r+=parseFloat(T(e,s))||0}return r}function S(e,t,n){var r=n;if(c(e))return"width"===t?B.viewportWidth(e):B.viewportHeight(e);if(9===e.nodeType)return"width"===t?B.docWidth(e):B.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?e.offsetWidth:e.offsetHeight,a=T(e),s=b(e,a),l=0;(null===i||void 0===i||i<=0)&&(i=void 0,l=T(e,t),(null===l||void 0===l||Number(l)<0)&&(l=e.style[t]||0),l=parseFloat(l)||0),void 0===r&&(r=s?W:L);var u=void 0!==i||s,d=i||l;return r===L?u?d-C(e,["border","padding"],o,a):l:u?r===W?d:d+(r===V?-C(e,["border"],o,a):C(e,["margin"],o,a)):l+C(e,A.slice(r),o,a)}function E(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=void 0,o=t[0];return 0!==o.offsetWidth?r=S.apply(void 0,t):x(o,Y,function(){r=S.apply(void 0,t)}),r}function w(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Object.defineProperty(t,"__esModule",{value:!0});var O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P=n(309),k=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,T=void 0,M=new RegExp("^("+k+")(?!px)[a-z%]+$","i"),N=/^(top|right|bottom|left)$/,R="currentStyle",D="runtimeStyle",j="left",I="px";"undefined"!=typeof window&&(T=window.getComputedStyle?f:p);var A=["margin","border","padding"],L=-1,V=2,W=1,H=0,B={};_(["Width","Height"],function(e){B["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],B["viewport"+e](n))},B["viewport"+e]=function(t){var n="client"+e,r=t.document,o=r.body,i=r.documentElement,a=i[n];return"CSS1Compat"===r.compatMode&&a||o&&o[n]||a}});var Y={position:"absolute",visibility:"hidden",display:"block"};_(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);B["outer"+t]=function(t,n){return t&&E(t,e,n?H:W)};var n="width"===e?["Left","Right"]:["Top","Bottom"];B[e]=function(t,r){var i=r;{if(void 0===i)return t&&E(t,e,L);if(t){var a=T(t),s=b(t);return s&&(i+=C(t,["padding","border"],n,a)),o(t,e,i)}}}});var F={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:d,offset:function(e,t,n){return"undefined"==typeof t?u(e):void g(e,t,n||{})},isWindow:c,each:_,css:o,clone:function(e){var t=void 0,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);var r=e.overflow;if(r)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:w,getWindowScrollLeft:function(e){return s(e)},getWindowScrollTop:function(e){return l(e)},merge:function(){for(var e={},t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var o=0;o<n.length;o++)F.mix(e,n[o]);return e},viewportWidth:0,viewportHeight:0};w(F,B),t.default=F,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(13),s=r(a),l=n(389),u=r(l),c=n(128),d=r(c),f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},p=(0,s.default)({displayName:"DialogWrap",mixins:[(0,d.default)({isVisible:function(e){return e.props.visible},autoDestroy:!1,getComponent:function(e,t){return i.default.createElement(u.default,f({},e.props,t,{key:"dialog"}))},getContainer:function(e){if(e.props.getContainer)return e.props.getContainer();var t=document.createElement("div");return document.body.appendChild(t),t}})],getDefaultProps:function(){return{visible:!1}},shouldComponentUpdate:function(e){var t=e.visible;return!(!this.props.visible&&!t)},componentWillUnmount:function(){this.props.visible?this.renderComponent({afterClose:this.removeContainer,onClose:function(){},visible:!1}):this.removeContainer()},getElement:function(e){return this._component.getElement(e)},render:function(){return null}});t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return"android"===e||"cross"===e&&"undefined"!=typeof window&&!!navigator.userAgent.match(/Android/i)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i),s=n(8),l=r(s),u=n(2),c=r(u),d=n(5),f=r(d),p=n(4),h=r(p),m=n(3),v=r(m),y=n(1),g=r(y),_=n(43),b=r(_),x=n(7),C=r(x),S=n(17),E=r(S),w=n(184),O=n(16),P=r(O),k=function(e){function t(e){(0,c.default)(this,t);var n=(0,h.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isAndroid:o(e.platform)},n}return(0,v.default)(t,e),(0,f.default)(t,[{key:"isInModal",value:function(e){if(/\biPhone\b|\biPod\b/i.test(navigator.userAgent)){var t=this.props.prefixCls,n=function(e){for(;e.parentNode&&e.parentNode!==document.body;){if(e.classList.contains(t))return e;e=e.parentNode}}(e.target);return n||e.preventDefault(),!0}}},{key:"renderFooterButton",value:function(e,t,n){var r={};if(e.style&&(r=e.style,"string"==typeof r)){var o={cancel:{},default:{},destructive:{color:"red"}};r=o[r]||{}}var i=function(t){t.preventDefault(),e.onPress&&e.onPress()};return g.default.createElement(E.default,{activeClassName:t+"-button-active",key:n},g.default.createElement("a",{className:t+"-button",role:"button",style:r,href:"#",onClick:i},e.text||"Button"))}},{key:"componentDidMount",value:function(){var e=o(this.props.platform);e!==this.state.isAndroid&&this.setState({isAndroid:e})}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.prefixCls,o=n.className,i=n.transparent,s=n.animated,u=n.transitionName,c=n.maskTransitionName,d=n.style,f=n.footer,p=void 0===f?[]:f,h=n.closable,m=n.operation,v=this.state.isAndroid,y=(0,C.default)((e={},(0,l.default)(e,o,!!o),(0,l.default)(e,r+"-transparent",i),(0,l.default)(e,r+"-android",v),e)),_=u||(s?i?"am-fade":"am-slide-up":null),x=c||(s?i?"am-fade":"am-slide-up":null),S=r+"-button-group-"+(2!==p.length||m?"v":"h"),E=p.length?g.default.createElement("div",{className:S,role:"group"},p.map(function(e,n){return t.renderFooterButton(e,r,n)})):null,w=i?(0,a.default)({width:"5.4rem",height:"auto"},d):(0,a.default)({width:"100%",height:"100%"},d),O=(0,P.default)(this.props,["prefixCls","className","transparent","animated","transitionName","maskTransitionName","style","footer","touchFeedback","wrapProps"]),k={onTouchStart:function(e){return t.isInModal(e)}};return g.default.createElement(b.default,(0,a.default)({prefixCls:r,className:y,transitionName:_,maskTransitionName:x,style:w,footer:E,wrapProps:k,closable:h},O))}}]),t}(w.ModalComponent);t.default=k,k.defaultProps={prefixCls:"am-modal",transparent:!1,animated:!0,style:{},onShow:function(){},footer:[],closable:!1,operation:!1,platform:"cross"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(248),i=r(o);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,i.default)(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(61);e.exports=function(e){return Object(r(e))}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,l){if(o(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,a,s,l],d=0;u=new Error(t.replace(/%s/g,function(){return c[d++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children;return _.default.isValidElement(t)&&!t.key?_.default.cloneElement(t,{key:P}):t}function i(){}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a),l=n(8),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(9),x=r(b),C=n(382),S=n(381),E=r(S),w=n(117),O=r(w),P="rc_animate_"+Date.now(),k=function(e){function t(e){(0,d.default)(this,t);var n=(0,m.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return T.call(n),n.currentlyAnimatingKeys={},n.keysToEnter=[],n.keysToLeave=[],n.state={children:(0,C.toArrayChildren)(o(n.props))},n.childrenRefs={},n}return(0,y.default)(t,e),(0,p.default)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.showProp,n=this.state.children;t&&(n=n.filter(function(e){return!!e.props[t]})),n.forEach(function(t){t&&e.performAppear(t.key)})}},{key:"componentWillReceiveProps",value:function(e){var t=this;this.nextProps=e;var n=(0,C.toArrayChildren)(o(e)),r=this.props;r.exclusive&&Object.keys(this.currentlyAnimatingKeys).forEach(function(e){t.stop(e)});var i=r.showProp,a=this.currentlyAnimatingKeys,s=r.exclusive?(0,C.toArrayChildren)(o(r)):this.state.children,l=[];i?(s.forEach(function(e){var t=e&&(0,C.findChildInChildrenByKey)(n,e.key),r=void 0;r=t&&t.props[i]||!e.props[i]?t:_.default.cloneElement(t||e,(0,u.default)({},i,!0)),r&&l.push(r)}),n.forEach(function(e){e&&(0,C.findChildInChildrenByKey)(s,e.key)||l.push(e)})):l=(0,C.mergeChildren)(s,n),this.setState({children:l}),n.forEach(function(e){var n=e&&e.key;if(!e||!a[n]){var r=e&&(0,C.findChildInChildrenByKey)(s,n);if(i){var o=e.props[i];if(r){var l=(0,C.findShownChildInChildrenByKey)(s,n,i);!l&&o&&t.keysToEnter.push(n)}else o&&t.keysToEnter.push(n)}else r||t.keysToEnter.push(n)}}),s.forEach(function(e){var r=e&&e.key;if(!e||!a[r]){var o=e&&(0,C.findChildInChildrenByKey)(n,r);if(i){var s=e.props[i];if(o){var l=(0,C.findShownChildInChildrenByKey)(n,r,i);!l&&s&&t.keysToLeave.push(r)}else s&&t.keysToLeave.push(r)}else o||t.keysToLeave.push(r)}})}},{key:"componentDidUpdate",value:function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var t=this.keysToLeave;this.keysToLeave=[],t.forEach(this.performLeave)}},{key:"isValidChildByKey",value:function(e,t){var n=this.props.showProp;return n?(0,C.findShownChildInChildrenByKey)(e,t,n):(0,C.findChildInChildrenByKey)(e,t)}},{key:"stop",value:function(e){delete this.currentlyAnimatingKeys[e];var t=this.childrenRefs[e];t&&t.stop()}},{key:"render",value:function(){var e=this,t=this.props;this.nextProps=t;var n=this.state.children,r=null;n&&(r=n.map(function(n){if(null===n||void 0===n)return n;if(!n.key)throw new Error("must set key for <rc-animate> children");return _.default.createElement(E.default,{key:n.key,ref:function(t){return e.childrenRefs[n.key]=t},animation:t.animation,transitionName:t.transitionName,transitionEnter:t.transitionEnter,transitionAppear:t.transitionAppear,transitionLeave:t.transitionLeave},n)}));var o=t.component;if(o){var i=t;return"string"==typeof o&&(i=(0,s.default)({className:t.className,style:t.style},t.componentProps)),_.default.createElement(o,i,r)}return r[0]||null}}]),t}(_.default.Component);k.propTypes={component:x.default.any,componentProps:x.default.object,animation:x.default.object,transitionName:x.default.oneOfType([x.default.string,x.default.object]),transitionEnter:x.default.bool,transitionAppear:x.default.bool,exclusive:x.default.bool,transitionLeave:x.default.bool,onEnd:x.default.func,onEnter:x.default.func,onLeave:x.default.func,onAppear:x.default.func,showProp:x.default.string},k.defaultProps={animation:{},component:"span",componentProps:{},transitionEnter:!0,transitionLeave:!0,transitionAppear:!1,onEnd:i,onEnter:i,onLeave:i,onAppear:i};var T=function(){var e=this;this.performEnter=function(t){e.childrenRefs[t]&&(e.currentlyAnimatingKeys[t]=!0,e.childrenRefs[t].componentWillEnter(e.handleDoneAdding.bind(e,t,"enter")))},this.performAppear=function(t){e.childrenRefs[t]&&(e.currentlyAnimatingKeys[t]=!0,e.childrenRefs[t].componentWillAppear(e.handleDoneAdding.bind(e,t,"appear")))},this.handleDoneAdding=function(t,n){var r=e.props;if(delete e.currentlyAnimatingKeys[t],!r.exclusive||r===e.nextProps){var i=(0,C.toArrayChildren)(o(r));e.isValidChildByKey(i,t)?"appear"===n?O.default.allowAppearCallback(r)&&(r.onAppear(t),r.onEnd(t,!0)):O.default.allowEnterCallback(r)&&(r.onEnter(t),r.onEnd(t,!0)):e.performLeave(t)}},this.performLeave=function(t){e.childrenRefs[t]&&(e.currentlyAnimatingKeys[t]=!0,e.childrenRefs[t].componentWillLeave(e.handleDoneLeaving.bind(e,t)))},this.handleDoneLeaving=function(t){var n=e.props;if(delete e.currentlyAnimatingKeys[t],!n.exclusive||n===e.nextProps){var r=(0,C.toArrayChildren)(o(n));if(e.isValidChildByKey(r,t))e.performEnter(t);else{var i=function(){O.default.allowLeaveCallback(n)&&(n.onLeave(t),n.onEnd(t,!1))};(0,C.isSameChildren)(e.state.children,r,n.showProp)?i():e.setState({children:r},i)}}}};t.default=k,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(1),u=r(l),c=n(13),d=r(c),f=n(9),p=r(f),h=n(7),m=r(h),v=n(52),y=(0,d.default)({displayName:"TabContent",propTypes:{animated:p.default.bool,animatedWithMargin:p.default.bool,prefixCls:p.default.string,children:p.default.any,activeKey:p.default.string,style:p.default.any,tabBarPosition:p.default.string},getDefaultProps:function(){return{animated:!0}},getTabPanes:function(){var e=this.props,t=e.activeKey,n=e.children,r=[];return u.default.Children.forEach(n,function(n){if(n){var o=n.key,i=t===o;r.push(u.default.cloneElement(n,{active:i,destroyInactiveTabPane:e.destroyInactiveTabPane,rootPrefixCls:e.prefixCls}))}}),r},render:function(){var e,t=this.props,n=t.prefixCls,r=t.children,o=t.activeKey,a=t.tabBarPosition,l=t.animated,c=t.animatedWithMargin,d=t.style,f=(0,m.default)((e={},(0,s.default)(e,n+"-content",!0),(0,s.default)(e,l?n+"-content-animated":n+"-content-no-animated",!0),e));if(l){var p=(0,v.getActiveIndex)(r,o);if(p!==-1){var h=c?(0,v.getMarginStyle)(p,a):(0,v.getTransformPropValue)((0,v.getTransformByIndex)(p,a));d=(0,i.default)({},d,h)}else d=(0,i.default)({},d,{display:"none"})}return u.default.createElement("div",{className:f,style:d},this.getTabPanes())}});t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=[];return _.default.Children.forEach(e,function(e){e&&t.push(e)}),t}function i(e,t){for(var n=o(e),r=0;r<n.length;r++)if(n[r].key===t)return r;return-1}function a(e,t){var n=o(e);return n[t].key}function s(e,t){e.transform=t,e.webkitTransform=t,e.mozTransform=t}function l(e){return"transform"in e||"webkitTransform"in e||"MozTransform"in e}function u(e,t){e.transition=t,e.webkitTransition=t,e.MozTransition=t}function c(e){return{transform:e,WebkitTransform:e,MozTransform:e}}function d(e){return"left"===e||"right"===e}function f(e,t){var n=d(t)?"translateY":"translateX";return n+"("+100*-e+"%) translateZ(0)"}function p(e,t){var n=d(t)?"marginTop":"marginLeft";return(0,y.default)({},n,100*-e+"%")}function h(e,t){return+getComputedStyle(e).getPropertyValue(t).replace("px","")}function m(e,t,n){t=n?"0px, "+t+"px, 0px":t+"px, 0px, 0px",s(e.style,"translate3d("+t+")")}Object.defineProperty(t,"__esModule",{value:!0});var v=n(8),y=r(v);t.toArray=o,t.getActiveIndex=i,t.getActiveKey=a,t.setTransform=s,t.isTransformSupported=l,t.setTransition=u,t.getTransformPropValue=c,t.isVertical=d,t.getTransformByIndex=f,t.getMarginStyle=p,t.getStyle=h,t.setPxStyle=m;var g=n(1),_=r(g)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r=l.default.unstable_batchedUpdates?function(e){l.default.unstable_batchedUpdates(n,e)}:n;return(0,a.default)(e,t,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(137),a=r(i),s=n(11),l=r(s);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r){var o={};if(t&&t.antLocale&&t.antLocale[n])o=t.antLocale[n];else{var i=r();o=i.default||i}var a=(0,s.default)({},o);return e.locale&&(a=(0,s.default)({},a,e.locale),e.locale.lang&&(a.lang=(0,s.default)({},o.lang,e.locale.lang))),a}function i(e){var t=e.antLocale&&e.antLocale.locale;return e.antLocale&&e.antLocale.exist&&!t?"zh-cn":t}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a);t.getComponentLocale=o,t.getLocaleCode=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return"string"==typeof e}function i(e){return o(e.type)&&k(e.props.children)?_.default.cloneElement(e,{},e.props.children.split("").join(" ")):o(e)?(k(e)&&(e=e.split("").join(" ")),_.default.createElement("span",null,e)):e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a),l=n(8),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(7),x=r(b),C=n(18),S=r(C),E=n(17),w=r(E),O=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},P=/^[\u4e00-\u9fa5]{2}$/,k=P.test.bind(P),T=function(e){function t(){return(0,d.default)(this,t),(0,m.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.className,o=t.prefixCls,a=t.type,l=t.size,c=t.inline,d=t.across,f=t.disabled,p=t.icon,h=t.loading,m=t.activeStyle,v=t.activeClassName,y=t.onClick,g=t.delayPressIn,b=t.delayPressOut,C=O(t,["children","className","prefixCls","type","size","inline","across","disabled","icon","loading","activeStyle","activeClassName","onClick","delayPressIn","delayPressOut"]),E=(e={},(0,u.default)(e,r,r),(0,u.default)(e,o,!0),(0,u.default)(e,o+"-primary","primary"===a),(0,u.default)(e,o+"-ghost","ghost"===a),(0,u.default)(e,o+"-warning","warning"===a),(0,u.default)(e,o+"-small","small"===l),(0,u.default)(e,o+"-inline",c),(0,u.default)(e,o+"-across",d),(0,u.default)(e,o+"-disabled",f),(0,u.default)(e,o+"-loading",h),e),P=h?"loading":p,k=_.default.Children.map(n,i);P&&(E[o+"-icon"]=!0);var T={};return g&&(T.delayPressIn=g),b&&(T.delayPressOut=b),_.default.createElement(w.default,(0,s.default)({activeClassName:v||(m?o+"-active":void 0),disabled:f,activeStyle:m},T),_.default.createElement("a",(0,s.default)({role:"button",className:(0,x.default)(E)},C,{onClick:f?void 0:y,"aria-disabled":f}),P?_.default.createElement(S.default,{"aria-hidden":"true",type:P,size:"small"===l?"xxs":"md"}):null,k))}}]),t}(_.default.Component);T.defaultProps={prefixCls:"am-button",size:"large",inline:!1,across:!1,disabled:!1,loading:!1,activeStyle:{}},t.default=T,e.exports=t.default},[504,315],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(118),y=r(v),g=n(16),_=r(g),b=n(7),x=r(b),C=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.style,a=t.children,s=(0,x.default)((e={},(0,i.default)(e,r,!!r),(0,i.default)(e,n+"-wrapper",!0),e)),l=m.default.createElement("label",{className:s,style:o},m.default.createElement(y.default,(0,_.default)(this.props,["className","style"])),a);return this.props.wrapLabel?l:m.default.createElement(y.default,this.props)}}]),t}(m.default.Component);t.default=C,C.defaultProps={prefixCls:"am-checkbox",wrapLabel:!0},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(118),_=r(g),b=n(16),x=r(b),C=n(7),S=r(C),E=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.style,a=t.children,l=(0,S.default)((e={},(0,s.default)(e,r,!!r),(0,s.default)(e,n+"-wrapper",!0),e)),u=y.default.createElement("label",{className:l,style:o},y.default.createElement(_.default,(0,i.default)({},(0,x.default)(this.props,["className","style"]),{type:"radio"})),a);return this.props.wrapLabel?u:y.default.createElement(_.default,(0,i.default)({},this.props,{type:"radio"}))}}]),t}(y.default.Component);t.default=E,E.defaultProps={prefixCls:"am-radio",wrapLabel:!0},e.exports=t.default},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(266);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){e.exports=!0},function(e,t,n){var r=n(32),o=n(282),i=n(62),a=n(68)("IE_PROTO"),s=function(){},l="prototype",u=function(){var e,t=n(100)("iframe"),r=i.length,o="<",a=">";for(t.style.display="none",n(272).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+a+"document.F=Object"+o+"/script"+a),e.close(),u=e.F;r--;)delete u[l][i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=r(e),n=new s,s[l]=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(46),o=n(41),i=n(24),a=n(71),s=n(27),l=n(101),u=Object.getOwnPropertyDescriptor;t.f=n(26)?u:function(e,t){if(e=i(e),t=a(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(23).f,o=n(27),i=n(20)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(69)("keys"),o=n(48);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(22),o="__core-js_shared__",i=r[o]||(r[o]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(38);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(22),o=n(15),i=n(63),a=n(73),s=n(23).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){t.f=n(20)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(393),i=r(o);t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return Object.keys(t).some(function(n){return e.target===(0,y.findDOMNode)(t[n])})}function i(e,t){var n=t.min,r=t.max;return e<n||e>r}function a(e){return e.touches.length>1||"touchend"===e.type.toLowerCase()&&e.touches.length>0}function s(e,t){var n=t.marks,r=t.step,o=t.min,i=Object.keys(n).map(parseFloat);if(null!==r){var a=Math.round((e-o)/r)*r+o;i.push(a)}var s=i.map(function(t){return Math.abs(e-t)});return i[s.indexOf(Math.min.apply(Math,(0,v.default)(s)))]}function l(e){var t=e.toString(),n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n}function u(e,t){return e?t.clientY:t.pageX}function c(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function d(e,t){var n=t.getBoundingClientRect();return e?n.top+.5*n.height:n.left+.5*n.width}function f(e,t){var n=t.max,r=t.min;return e<=r?r:e>=n?n:e}function p(e,t){var n=t.step,r=s(e,t);return null===n?r:parseFloat(r.toFixed(l(n)))}function h(e){e.stopPropagation(),e.preventDefault()}Object.defineProperty(t,"__esModule",{value:!0});var m=n(45),v=r(m);t.isEventFromHandle=o,t.isValueOutOfRange=i,t.isNotTouchEvent=a,t.getClosestPoint=s,t.getPrecision=l,t.getMousePosition=u,t.getTouchPosition=c,t.getHandleCenterPosition=d,t.ensureValueInRange=f,t.ensureValuePrecision=p,t.pauseEvent=h;var y=n(11)},function(e,t,n){"use strict";var r=n(115);e.exports=function(e,t,n,o){var i=n?n.call(o,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1; var a=r(e),s=r(t),l=a.length;if(l!==s.length)return!1;o=o||null;for(var u=Object.prototype.hasOwnProperty.bind(t),c=0;c<l;c++){var d=a[c];if(!u(d))return!1;var f=e[d],p=t[d],h=n?n.call(o,f,p,d):void 0;if(h===!1||void 0===h&&f!==p)return!1}return!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(14),s=r(a),l=n(6),u=r(l),c=n(1),d=r(c),f=n(7),p=r(f),h=n(29),m=r(h),v=n(78),y=r(v);t.default={getDefaultProps:function(){return{styles:{}}},onTabClick:function(e){this.props.onTabClick(e)},getTabs:function(){var e=this,t=this.props,n=t.panels,r=t.activeKey,o=t.prefixCls,i=[];return d.default.Children.forEach(n,function(t){if(t){var n=t.key,a=r===n?o+"-tab-active":"";a+=" "+o+"-tab";var s={};t.props.disabled?a+=" "+o+"-tab-disabled":s={onClick:e.onTabClick.bind(e,n)};var l={};r===n&&(l.ref="activeTab"),(0,m.default)("tab"in t.props,"There must be `tab` property on children of Tabs."),i.push(d.default.createElement("div",(0,u.default)({role:"tab","aria-disabled":t.props.disabled?"true":"false","aria-selected":r===n?"true":"false"},s,{className:a,key:n},l),t.props.tab))}}),i},getRootNode:function(e){var t=this.props,n=t.prefixCls,r=t.onKeyDown,o=t.className,a=t.extraContent,l=t.style,f=t.tabBarPosition,h=(0,s.default)(t,["prefixCls","onKeyDown","className","extraContent","style","tabBarPosition"]),m=(0,p.default)(n+"-bar",(0,i.default)({},o,!!o)),v="top"===f||"bottom"===f,g=v?{float:"right"}:{},_=a&&a.props?a.props.style:{},b=e;return a&&(b=[(0,c.cloneElement)(a,{key:"extra",style:(0,u.default)({},g,_)}),(0,c.cloneElement)(e,{key:"content"})],b=v?b:b.reverse()),d.default.createElement("div",(0,u.default)({role:"tablist",className:m,tabIndex:"0",ref:"root",onKeyDown:r,style:l},(0,y.default)(h)),b)}},e.exports=t.default},function(e,t){"use strict";function n(e){var t={},n=function(n){r.indexOf(n)>-1||o.indexOf(n)>-1?t[n]=e[n]:i.map(function(e){return new RegExp("^"+e)}).some(function(e){return n.replace(e,"")!==n})&&(t[n]=e[n])};for(var a in e)n(a);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var r="accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap".replace(/\s+/g," ").replace(/\t|\n|\r/g,"").split(" "),o="onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError".replace(/\s+/g," ").replace(/\t|\n|\r/g,"").split(" "),i=["data","aria"];e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.RefreshControl=t.IndexedList=t.DataSource=void 0;var o=n(131),i=r(o),a=n(456),s=r(a),l=n(459),u=r(l);i.default.IndexedList=s.default,i.default.RefreshControl=u.default;var c=i.default.DataSource;t.DataSource=c,t.IndexedList=s.default,t.RefreshControl=u.default,t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(1),s=r(a),l=n(7),u=r(l),c=n(13),d=r(c),f=n(467),p=r(f),h=n(466),m=r(h),v=(0,d.default)({mixins:[m.default],render:function(){var e=this,t=this.props,n=t.prefixCls,r=t.pickerPrefixCls,o=t.className,a=t.rootNativeProps,l=t.disabled,c=t.pickerItemStyle,d=t.indicatorStyle,f=t.pure,h=t.children,m=this.getValue(),v=h.map(function(t,o){return s.default.createElement("div",{key:t.key||o,className:n+"-item"},s.default.createElement(p.default,(0,i.default)({itemStyle:c,disabled:l,pure:f,indicatorStyle:d,prefixCls:r,selectedValue:m[o],onValueChange:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.onValueChange.apply(e,[o].concat(n))}},t.props)))});return s.default.createElement("div",(0,i.default)({},a,{className:(0,u.default)(o,n)}),v)}});t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){e.transform=t,e.webkitTransform=t,e.MozTransform=t}function i(e,t){e.transformOrigin=t,e.webkitTransformOrigin=t,e.MozTransformOrigin=t}function a(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0,a=void 0,s=void 0,u=void 0,f=void 0,p=void 0,h=void 0,m=void 0;this.content=e,this.container=e.parentNode,this.options=(0,l.default)({},n,{scrollingComplete:function(){t.clearScrollbarTimer(),t.timer=setTimeout(function(){t._destroyed||(n.scrollingComplete&&n.scrollingComplete(),r&&["x","y"].forEach(function(e){r[e]&&t.setScrollbarOpacity(e,0)}))},0)}}),this.options.scrollbars&&(r=this.scrollbars={},a=this.indicators={},s=this.indicatorsSize={},u=this.scrollbarsSize={},f=this.indicatorsPos={},p=this.scrollbarsOpacity={},h=this.contentSize={},m=this.clientSize={},["x","y"].forEach(function(e){var n="x"===e?"scrollingX":"scrollingY";t.options[n]!==!1&&(r[e]=document.createElement("div"),r[e].className="zscroller-scrollbar-"+e,a[e]=document.createElement("div"),a[e].className="zscroller-indicator-"+e,r[e].appendChild(a[e]),s[e]=-1,p[e]=0,f[e]=0,t.container.appendChild(r[e]))}));var v=!0,y=e.style;this.scroller=new c.default(function(e,i,a){!v&&n.onScroll&&n.onScroll(),o(y,"translate3d("+-e+"px,"+-i+"px,0) scale("+a+")"),r&&["x","y"].forEach(function(n){if(r[n]){var o="x"===n?e:i;if(m[n]>=h[n])t.setScrollbarOpacity(n,0);else{v||t.setScrollbarOpacity(n,1);var a=m[n]/h[n]*u[n],s=a,l=void 0;o<0?(s=Math.max(a+o,d),l=0):o>h[n]-m[n]?(s=Math.max(a+h[n]-m[n]-o,d),l=u[n]-s):l=o/h[n]*u[n],t.setIndicatorSize(n,s),t.setIndicatorPos(n,l)}}}),v=!1},this.options),this.bindEvents(),i(e.style,"left top"),this.reflow()}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),l=r(s),u=n(502),c=r(u),d=8;a.prototype.setDisabled=function(e){this.disabled=e},a.prototype.clearScrollbarTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},a.prototype.setScrollbarOpacity=function(e,t){this.scrollbarsOpacity[e]!==t&&(this.scrollbars[e].style.opacity=t,this.scrollbarsOpacity[e]=t)},a.prototype.setIndicatorPos=function(e,t){this.indicatorsPos[e]!==t&&("x"===e?o(this.indicators[e].style,"translate3d("+t+"px,0,0)"):o(this.indicators[e].style,"translate3d(0, "+t+"px,0)"),this.indicatorsPos[e]=t)},a.prototype.setIndicatorSize=function(e,t){this.indicatorsSize[e]!==t&&(this.indicators[e].style["x"===e?"width":"height"]=t+"px",this.indicatorsSize[e]=t)},a.prototype.reflow=function(){this.scrollbars&&(this.contentSize.x=this.content.offsetWidth,this.contentSize.y=this.content.offsetHeight,this.clientSize.x=this.container.clientWidth,this.clientSize.y=this.container.clientHeight,this.scrollbars.x&&(this.scrollbarsSize.x=this.scrollbars.x.offsetWidth),this.scrollbars.y&&(this.scrollbarsSize.y=this.scrollbars.y.offsetHeight)),this.scroller.setDimensions(this.container.clientWidth,this.container.clientHeight,this.content.offsetWidth,this.content.offsetHeight);var e=this.container.getBoundingClientRect();this.scroller.setPosition(e.x+this.container.clientLeft,e.y+this.container.clientTop)},a.prototype.destroy=function(){this._destroyed=!0,window.removeEventListener("resize",this.onResize,!1),this.container.removeEventListener("touchstart",this.onTouchStart,!1),this.container.removeEventListener("touchmove",this.onTouchMove,!1),this.container.removeEventListener("touchend",this.onTouchEnd,!1),this.container.removeEventListener("touchcancel",this.onTouchCancel,!1),this.container.removeEventListener("mousedown",this.onMouseDown,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.container.removeEventListener("mousewheel",this.onMouseWheel,!1)},a.prototype.bindEvents=function(){var e=this,t=this;window.addEventListener("resize",this.onResize=function(){t.reflow()},!1);var n=!1,r=void 0;this.container.addEventListener("touchstart",this.onTouchStart=function(o){n=!0,r&&(clearTimeout(r),r=null),o.touches[0]&&o.touches[0].target&&o.touches[0].target.tagName.match(/input|textarea|select/i)||e.disabled||(e.clearScrollbarTimer(),t.reflow(),t.scroller.doTouchStart(o.touches,o.timeStamp))},!1),this.container.addEventListener("touchmove",this.onTouchMove=function(n){e.options.preventDefaultOnTouchMove!==!1&&n.preventDefault(),t.scroller.doTouchMove(n.touches,n.timeStamp,n.scale)},!1),this.container.addEventListener("touchend",this.onTouchEnd=function(e){t.scroller.doTouchEnd(e.timeStamp),r=setTimeout(function(){n=!1},300)},!1),this.container.addEventListener("touchcancel",this.onTouchCancel=function(e){t.scroller.doTouchEnd(e.timeStamp),r=setTimeout(function(){n=!1},300)},!1),this.onMouseUp=function(n){t.scroller.doTouchEnd(n.timeStamp),document.removeEventListener("mousemove",e.onMouseMove,!1),document.removeEventListener("mouseup",e.onMouseUp,!1)},this.onMouseMove=function(e){t.scroller.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp)},this.container.addEventListener("mousedown",this.onMouseDown=function(r){n||r.target.tagName.match(/input|textarea|select/i)||e.disabled||(e.clearScrollbarTimer(),t.scroller.doTouchStart([{pageX:r.pageX,pageY:r.pageY}],r.timeStamp),t.reflow(),r.preventDefault(),document.addEventListener("mousemove",e.onMouseMove,!1),document.addEventListener("mouseup",e.onMouseUp,!1))},!1),this.container.addEventListener("mousewheel",this.onMouseWheel=function(e){t.options.zooming&&(t.scroller.doMouseZoom(e.wheelDelta,e.timeStamp,e.pageX,e.pageY),e.preventDefault())},!1)},t.default=a,e.exports=t.default},function(e,t){function n(e,t,n){n=n||{},n.childrenKeyName=n.childrenKeyName||"children";var r,o=e||[],i=[],a=0;do{var r=o.filter(function(e){return t(e,a)})[0];if(!r)break;i.push(r),o=r[n.childrenKeyName]||[],a+=1}while(o.length>0);return i}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t,n=this.props,r=n.className,o=n.prefixCls,a=n.children,l=n.text,u=n.size,c=n.overflowCount,d=n.dot,f=n.corner,p=n.hot,h=b(n,["className","prefixCls","children","text","size","overflowCount","dot","corner","hot"]);c=c,l="number"==typeof l&&l>c?c+"+":l,d&&(l="");var m=(0,_.default)((e={},(0,s.default)(e,o+"-dot",d),(0,s.default)(e,o+"-dot-large",d&&"large"===u),(0,s.default)(e,o+"-text",!d&&!f),(0,s.default)(e,o+"-corner",f),(0,s.default)(e,o+"-corner-large",f&&"large"===u),e)),v=(0,_.default)((t={},(0,s.default)(t,r,!!r),(0,s.default)(t,o,!0),(0,s.default)(t,o+"-not-a-wrapper",!a),(0,s.default)(t,o+"-corner-wrapper",f),(0,s.default)(t,o+"-hot",!!p),(0,s.default)(t,o+"-corner-wrapper-large",f&&"large"===u),t));return y.default.createElement("span",{className:v},a,(l||d)&&y.default.createElement("sup",(0,i.default)({className:m},h),l))}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-badge",size:"small",overflowCount:99,dot:!1,corner:!1},e.exports=t.default},[503,314],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(6),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(13),_=r(g),b=n(7),x=r(b),C=n(463),S=r(C),E=n(16),w=r(E),O=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.setState({selectedIndex:e},function(){n.props.afterChange&&n.props.afterChange(e)})},n.state={selectedIndex:n.props.selectedIndex},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.className,r=t.prefixCls,o=t.dotStyle,a=t.dotActiveStyle,l=t.infinite,u=t.selectedIndex,c=t.beforeChange,d=t.dots,f=t.vertical,p=(0,w.default)(this.props,["infinite","selectedIndex","beforeChange","afterChange","dots"]),h=(0,s.default)({},p,{wrapAround:l,slideIndex:u,beforeSlide:c}),m=[],v=this.state.selectedIndex;d&&(m=[{component:(0,_.default)({displayName:"component",render:function(){for(var e=this.props,t=e.slideCount,n=e.slidesToScroll,s=[],l=0;l<t;l+=n)s.push(l);var u=s.map(function(e){var t,n=(0,x.default)((t={},(0,i.default)(t,r+"-wrap-dot",!0),(0,i.default)(t,r+"-wrap-dot-active",e===v),t)),s=e===v?a:o;return y.default.createElement("div",{className:n,key:e},y.default.createElement("span",{style:s}))});return y.default.createElement("div",{className:r+"-wrap"},u)}}),position:"BottomCenter"}]);var g=(0,x.default)((e={},(0,i.default)(e,n,n),(0,i.default)(e,r,!0),(0,i.default)(e,r+"-vertical",f),e));return y.default.createElement(S.default,(0,s.default)({},h,{className:g,decorators:m,afterSlide:this.onChange}))}}]),t}(y.default.Component);t.default=O,O.defaultProps={prefixCls:"am-carousel",dots:!0,arrows:!1,autoplay:!1,infinite:!1,edgeEasing:"linear",cellAlign:"center",selectedIndex:0,dotStyle:{},dotActiveStyle:{}},e.exports=t.default},[503,317],[505,318],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e.renderHeader,r=e.renderFooter,o=e.renderSectionHeader,i=e.renderBodyComponent,s=u(e,["renderHeader","renderFooter","renderSectionHeader","renderBodyComponent"]),l=e.listPrefixCls,d={renderHeader:null,renderFooter:null,renderSectionHeader:null,renderBodyComponent:i||function(){return a.default.createElement("div",{className:l+"-body"})}};return n&&(d.renderHeader=function(){return a.default.createElement("div",{className:l+"-header"},n())}),r&&(d.renderFooter=function(){return a.default.createElement("div",{className:l+"-footer"},r())}),o&&(d.renderSectionHeader=t?function(e,t){return a.default.createElement("div",null,a.default.createElement(c,{prefixCls:l},o(e,t)))}:function(e,t){return a.default.createElement(c,{prefixCls:l},o(e,t))}),{restProps:s,extraProps:d}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(1),a=r(i),s=n(30),l=r(s),u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},c=l.default.Item;e.exports=t.default},[503,334],function(e,t,n){"use strict";n(89),n(335)},[505,339],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t;return v&&(v.destroy(),v=null),v=d.default.newInstance({prefixCls:y,style:{},transitionName:"am-fade",className:(0,m.default)((t={},(0,s.default)(t,y+"-mask",e),(0,s.default)(t,y+"-nomask",!e),t))})}function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s={info:"",success:n(499),fail:n(498),offline:n(497),loading:"loading"}[t],l=o(a);l.notice({duration:r,style:{},content:s?u.default.createElement("div",{className:y+"-text "+y+"-text-icon",role:"alert","aria-live":"assertive"},u.default.createElement(p.default,{type:s,size:"lg"}),u.default.createElement("div",{className:y+"-text-info"},e)):u.default.createElement("div",{className:y+"-text",role:"alert","aria-live":"assertive"},u.default.createElement("div",null,e)),onClose:function(){i&&i(),l.destroy(),l=null,v=null}})}Object.defineProperty(t,"__esModule",{value:!0});var a=n(8),s=r(a),l=n(1),u=r(l),c=n(399),d=r(c),f=n(18),p=r(f),h=n(7),m=r(h),v=void 0,y="am-toast";t.default={SHORT:3,LONG:8,show:function(e,t,n){return i(e,"info",t,function(){},n)},info:function(e,t,n,r){return i(e,"info",t,n,r)},success:function(e,t,n,r){return i(e,"success",t,n,r)},fail:function(e,t,n,r){return i(e,"fail",t,n,r)},offline:function(e,t,n,r){return i(e,"offline",t,n,r)},loading:function(e,t,n,r){return i(e,"loading",t,n,r)},hide:function(){v&&(v.destroy(),v=null)}},e.exports=t.default},[504,356],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},y=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=(0,i.default)({},this.props);if(Array.isArray(e.style)){var t={};e.style.forEach(function(e){t=(0,i.default)({},t,e)}),e.style=t}var n=e.Component,r=v(e,["Component"]);return m.default.createElement(n,r)}}]),t}(m.default.Component);t.default=y,y.defaultProps={Component:"div"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(7),y=r(v),g=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.size,o=t.className,a=t.children,s=t.style,l=(0,y.default)((e={},(0,i.default)(e,""+n,!0),(0,i.default)(e,n+"-"+r,!0),(0,i.default)(e,o,!!o),e));return m.default.createElement("div",{className:l,style:s},a)}}]),t}(m.default.Component);t.default=g,g.defaultProps={prefixCls:"am-wingblank",size:"lg"},e.exports=t.default},[503,358],function(e,t,n){e.exports={default:n(260),__esModule:!0}},function(e,t,n){function r(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}try{var o=n(99)}catch(e){var o=n(99)}var i=/\s+/,a=Object.prototype.toString;e.exports=function(e){return new r(e)},r.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),n=o(t,e);return~n||t.push(e),this.el.className=t.join(" "),this},r.prototype.remove=function(e){if("[object RegExp]"==a.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=o(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},r.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},r.prototype.toggle=function(e,t){return this.list?("undefined"!=typeof t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):("undefined"!=typeof t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},r.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),n=t.split(i);return""===n[0]&&n.shift(),n},r.prototype.has=r.prototype.contains=function(e){return this.list?this.list.contains(e):!!~o(this.array(),e)}},function(e,t){e.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},function(e,t,n){var r=n(38),o=n(22).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){e.exports=!n(26)&&!n(33)(function(){return 7!=Object.defineProperty(n(100)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(59);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(63),o=n(21),i=n(108),a=n(34),s=n(27),l=n(39),u=n(276),c=n(67),d=n(105),f=n(20)("iterator"),p=!([].keys&&"next"in[].keys()),h="@@iterator",m="keys",v="values",y=function(){return this};e.exports=function(e,t,n,g,_,b,x){u(n,t,g);var C,S,E,w=function(e){if(!p&&e in T)return T[e];switch(e){case m:return function(){return new n(this,e)};case v:return function(){return new n(this,e)}}return function(){return new n(this,e)}},O=t+" Iterator",P=_==v,k=!1,T=e.prototype,M=T[f]||T[h]||_&&T[_],N=M||w(_),R=_?P?w("entries"):N:void 0,D="Array"==t?T.entries||M:M;if(D&&(E=d(D.call(new e)),E!==Object.prototype&&E.next&&(c(E,O,!0),r||s(E,f)||a(E,f,y))),P&&M&&M.name!==v&&(k=!0,N=function(){return M.call(this)}),r&&!x||!p&&!k&&T[f]||a(T,f,N),l[t]=N,l[O]=y,_)if(C={values:P?N:w(v),keys:b?N:w(m),entries:R},x)for(S in C)S in T||i(T,S,C[S]);else o(o.P+o.F*(p||k),t,C);return C}},function(e,t,n){var r=n(106),o=n(62).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(27),o=n(47),i=n(68)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(27),o=n(24),i=n(268)(!1),a=n(68)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),l=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){var r=n(21),o=n(15),i=n(33);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){e.exports=n(34)},function(e,t,n){var r=n(70),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";var r=n(285)(!0);n(103)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n=window.getComputedStyle(e,null),r="",o=0;o<h.length&&!(r=n.getPropertyValue(h[o]+t));o++);return r}function i(e){if(f){var t=parseFloat(o(e,"transition-delay"))||0,n=parseFloat(o(e,"transition-duration"))||0,r=parseFloat(o(e,"animation-delay"))||0,i=parseFloat(o(e,"animation-duration"))||0,a=Math.max(n+t,i+r);e.rcEndAnimTimeout=setTimeout(function(){e.rcEndAnimTimeout=null,e.rcEndListener&&e.rcEndListener()},1e3*a+200)}}function a(e){e.rcEndAnimTimeout&&(clearTimeout(e.rcEndAnimTimeout),e.rcEndAnimTimeout=null)}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=n(302),u=r(l),c=n(98),d=r(c),f=0!==u.default.endEvents.length,p=["Webkit","Moz","O","ms"],h=["-webkit-","-moz-","-o-","ms-",""],m=function(e,t,n){var r="object"===("undefined"==typeof t?"undefined":s(t)),o=r?t.name:t,l=r?t.active:t+"-active",c=n,f=void 0,p=void 0,h=(0,d.default)(e);return n&&"[object Object]"===Object.prototype.toString.call(n)&&(c=n.end,f=n.start,p=n.active),e.rcEndListener&&e.rcEndListener(),e.rcEndListener=function(t){t&&t.target!==e||(e.rcAnimTimeout&&(clearTimeout(e.rcAnimTimeout),e.rcAnimTimeout=null),a(e),h.remove(o),h.remove(l),u.default.removeEndEventListener(e,e.rcEndListener),e.rcEndListener=null,c&&c())},u.default.addEndEventListener(e,e.rcEndListener),f&&f(),h.add(o),e.rcAnimTimeout=setTimeout(function(){e.rcAnimTimeout=null,h.add(l),p&&setTimeout(p,0),i(e)},30),{stop:function(){e.rcEndListener&&e.rcEndListener()}}};m.style=function(e,t,n){e.rcEndListener&&e.rcEndListener(),e.rcEndListener=function(t){t&&t.target!==e||(e.rcAnimTimeout&&(clearTimeout(e.rcAnimTimeout),e.rcAnimTimeout=null),a(e),u.default.removeEndEventListener(e,e.rcEndListener),e.rcEndListener=null,n&&n())},u.default.addEndEventListener(e,e.rcEndListener),e.rcAnimTimeout=setTimeout(function(){for(var n in t)t.hasOwnProperty(n)&&(e.style[n]=t[n]);e.rcAnimTimeout=null,i(e)},0)},m.setTransition=function(e,t,n){var r=t,o=n;void 0===n&&(o=r,r=""),r=r||"",p.forEach(function(t){e.style[t+"Transition"+r]=o})},m.isCssAnimationSupported=f,t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(a.default.isWindow(e)||9===e.nodeType)return null;var t=a.default.getDocument(e),n=t.body,r=void 0,o=a.default.css(e,"position"),i="fixed"===o||"absolute"===o;if(!i)return"html"===e.nodeName.toLowerCase()?null:e.parentNode;for(r=e.parentNode;r&&r!==n;r=r.parentNode)if(o=a.default.css(r,"position"),"static"!==o)return r;return null}Object.defineProperty(t,"__esModule",{value:!0});var i=n(42),a=r(i);t.default=o,e.exports=t.default},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=n(113),o=r;e.exports=o},function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}function o(e){return null!=e&&a(g(e))}function i(e,t){return e="number"==typeof e||p.test(e)?+e:-1,t=null==t?y:t,e>-1&&e%1==0&&e<t}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=y}function s(e){for(var t=u(e),n=t.length,r=n&&e.length,o=!!r&&a(r)&&(f(e)||d(e)),s=-1,l=[];++s<n;){var c=t[s];(o&&i(c,r)||m.call(e,c))&&l.push(c)}return l}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function u(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&a(t)&&(f(e)||d(e))&&t||0;for(var n=e.constructor,r=-1,o="function"==typeof n&&n.prototype===e,s=Array(t),u=t>0;++r<t;)s[r]=r+"";for(var c in e)u&&i(c,t)||"constructor"==c&&(o||!m.call(e,c))||s.push(c);return s}var c=n(367),d=n(370),f=n(371),p=/^\d+$/,h=Object.prototype,m=h.hasOwnProperty,v=c(Object,"keys"),y=9007199254740991,g=r("length"),_=v?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&o(e)?s(e):l(e)?v(e):[]}:s;e.exports=_},function(e,t){!function(n,r){"object"==typeof t&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):n.moment=r()}(this,function(){"use strict";function t(){return br.apply(null,arguments)}function n(e){br=e}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){var t;for(t in e)return!1;return!0}function a(e){return void 0===e}function s(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function d(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,n,r){return _t(e,t,n,r,!0).utc()}function p(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=p()),e._pf}function m(e){if(null==e._isValid){var t=h(e),n=Cr.call(t.parsedDateParts,function(e){return null!=e}),r=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function v(e){var t=f(NaN);return null!=e?d(h(t),e):h(t).userInvalidated=!0,t}function y(e,t){var n,r,o;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=h(t)),a(t._locale)||(e._locale=t._locale),Sr.length>0)for(n=0;n<Sr.length;n++)r=Sr[n],o=t[r],a(o)||(e[r]=o);return e}function g(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Er===!1&&(Er=!0,t.updateOffset(this),Er=!1)}function _(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function b(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function x(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=b(t)),n}function C(e,t,n){var r,o=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0;for(r=0;r<o;r++)(n&&e[r]!==t[r]||!n&&x(e[r])!==x(t[r]))&&a++;return a+i}function S(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function E(e,n){var r=!0;return d(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),r){for(var o,i=[],a=0;a<arguments.length;a++){if(o="","object"==typeof arguments[a]){o+="\n["+a+"] ";for(var s in arguments[0])o+=s+": "+arguments[0][s]+", ";o=o.slice(0,-2)}else o=arguments[a];i.push(o)}S(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),r=!1}return n.apply(this,arguments)},n)}function w(e,n){null!=t.deprecationHandler&&t.deprecationHandler(e,n),wr[e]||(S(n),wr[e]=!0)}function O(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function P(e){var t,n;for(n in e)t=e[n],O(t)?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function k(e,t){var n,r=d({},e);for(n in t)c(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},d(r[n],e[n]),d(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)c(e,n)&&!c(t,n)&&o(e[n])&&(r[n]=d({},r[n]));return r}function T(e){null!=e&&this.set(e)}function M(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return O(r)?r.call(t,n):r}function N(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 R(){return this._invalidDate}function D(e){return this._ordinal.replace("%d",e)}function j(e,t,n,r){var o=this._relativeTime[n];return O(o)?o(e,t,n,r):o.replace(/%d/i,e)}function I(e,t){var n=this._relativeTime[e>0?"future":"past"];return O(n)?n(t):n.replace(/%s/i,t)}function A(e,t){var n=e.toLowerCase();Ir[n]=Ir[n+"s"]=Ir[t]=e}function L(e){return"string"==typeof e?Ir[e]||Ir[e.toLowerCase()]:void 0}function V(e){var t,n,r={};for(n in e)c(e,n)&&(t=L(n),t&&(r[t]=e[n]));return r}function W(e,t){Ar[e]=t}function H(e){var t=[];for(var n in e)t.push({unit:n,priority:Ar[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function B(e,n){return function(r){return null!=r?(F(this,e,r),t.updateOffset(this,n),this):Y(this,e)}}function Y(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function F(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function z(e){return e=L(e),O(this[e])?this[e]():this}function U(e,t){if("object"==typeof e){e=V(e);for(var n=H(e),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit])}else if(e=L(e),O(this[e]))return this[e](t);return this}function K(e,t,n){var r=""+Math.abs(e),o=t-r.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}function X(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(Hr[e]=o),t&&(Hr[t[0]]=function(){return K(o.apply(this,arguments),t[1],t[2])}),n&&(Hr[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function G(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function q(e){var t,n,r=e.match(Lr);for(t=0,n=r.length;t<n;t++)Hr[r[t]]?r[t]=Hr[r[t]]:r[t]=G(r[t]);return function(t){var o,i="";for(o=0;o<n;o++)i+=O(r[o])?r[o].call(t,e):r[o];return i}}function Z(e,t){return e.isValid()?(t=$(t,e.localeData()),Wr[t]=Wr[t]||q(t),Wr[t](e)):e.localeData().invalidDate()}function $(e,t){function n(e){return t.longDateFormat(e)||e}var r=5;for(Vr.lastIndex=0;r>=0&&Vr.test(e);)e=e.replace(Vr,n),Vr.lastIndex=0,r-=1;return e}function Q(e,t,n){oo[e]=O(t)?t:function(e,r){return e&&n?n:t}}function J(e,t){return c(oo,e)?oo[e](t._strict,t._locale):new RegExp(ee(e))}function ee(e){return te(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,o){return t||n||r||o}))}function te(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ne(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),s(t)&&(r=function(e,n){n[t]=x(e)}),n=0;n<e.length;n++)io[e[n]]=r}function re(e,t){ne(e,function(e,n,r,o){r._w=r._w||{},t(e,r._w,r,o)})}function oe(e,t,n){null!=t&&c(io,e)&&io[e](t,n._a,n,e)}function ie(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function ae(e,t){return e?r(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||yo).test(t)?"format":"standalone"][e.month()]:r(this._months)?this._months:this._months.standalone}function se(e,t){return e?r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[yo.test(t)?"format":"standalone"][e.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function le(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=f([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?(o=vo.call(this._shortMonthsParse,a),o!==-1?o:null):(o=vo.call(this._longMonthsParse,a),o!==-1?o:null):"MMM"===t?(o=vo.call(this._shortMonthsParse,a),o!==-1?o:(o=vo.call(this._longMonthsParse,a),o!==-1?o:null)):(o=vo.call(this._longMonthsParse,a),o!==-1?o:(o=vo.call(this._shortMonthsParse,a),o!==-1?o:null))}function ue(e,t,n){var r,o,i;if(this._monthsParseExact)return le.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=f([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=x(t);else if(t=e.localeData().monthsParse(t),!s(t))return e;return n=Math.min(e.date(),ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function de(e){return null!=e?(ce(this,e),t.updateOffset(this,!0),this):Y(this,"Month")}function fe(){return ie(this.year(),this.month())}function pe(e){return this._monthsParseExact?(c(this,"_monthsRegex")||me.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=bo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function he(e){return this._monthsParseExact?(c(this,"_monthsRegex")||me.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=xo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function me(){function e(e,t){return t.length-e.length}var t,n,r=[],o=[],i=[];for(t=0;t<12;t++)n=f([2e3,t]),r.push(this.monthsShort(n,"")),o.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),o.sort(e),i.sort(e),t=0;t<12;t++)r[t]=te(r[t]),o[t]=te(o[t]);for(t=0;t<24;t++)i[t]=te(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function ve(e){return ye(e)?366:365}function ye(e){return e%4===0&&e%100!==0||e%400===0}function ge(){return ye(this.year())}function _e(e,t,n,r,o,i,a){var s=new Date(e,t,n,r,o,i,a);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function be(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function xe(e,t,n){var r=7+t-n,o=(7+be(e,0,r).getUTCDay()-t)%7;return-o+r-1}function Ce(e,t,n,r,o){var i,a,s=(7+n-r)%7,l=xe(e,r,o),u=1+7*(t-1)+s+l;return u<=0?(i=e-1,a=ve(i)+u):u>ve(e)?(i=e+1,a=u-ve(e)):(i=e,a=u),{year:i,dayOfYear:a}}function Se(e,t,n){var r,o,i=xe(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?(o=e.year()-1,r=a+Ee(o,t,n)):a>Ee(e.year(),t,n)?(r=a-Ee(e.year(),t,n),o=e.year()+1):(o=e.year(),r=a),{week:r,year:o}}function Ee(e,t,n){var r=xe(e,t,n),o=xe(e+1,t,n);return(ve(e)-r+o)/7}function we(e){return Se(e,this._week.dow,this._week.doy).week}function Oe(){return this._week.dow}function Pe(){return this._week.doy}function ke(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Te(e){var t=Se(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Me(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Ne(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Re(e,t){return e?r(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:r(this._weekdays)?this._weekdays:this._weekdays.standalone}function De(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function je(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ie(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=f([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?(o=vo.call(this._weekdaysParse,a),o!==-1?o:null):"ddd"===t?(o=vo.call(this._shortWeekdaysParse,a),o!==-1?o:null):(o=vo.call(this._minWeekdaysParse,a),o!==-1?o:null):"dddd"===t?(o=vo.call(this._weekdaysParse,a),o!==-1?o:(o=vo.call(this._shortWeekdaysParse,a),o!==-1?o:(o=vo.call(this._minWeekdaysParse,a),o!==-1?o:null))):"ddd"===t?(o=vo.call(this._shortWeekdaysParse,a),o!==-1?o:(o=vo.call(this._weekdaysParse,a),o!==-1?o:(o=vo.call(this._minWeekdaysParse,a),o!==-1?o:null))):(o=vo.call(this._minWeekdaysParse,a),o!==-1?o:(o=vo.call(this._weekdaysParse,a),o!==-1?o:(o=vo.call(this._shortWeekdaysParse,a),o!==-1?o:null)))}function Ae(e,t,n){var r,o,i;if(this._weekdaysParseExact)return Ie.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=f([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Le(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Me(e,this.localeData()),this.add(e-t,"d")):t}function Ve(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function We(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Ne(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function He(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Fe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=Po),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Be(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Fe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ko),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ye(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Fe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=To),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fe(){function e(e,t){return t.length-e.length}var t,n,r,o,i,a=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),r=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),i=this.weekdays(n,""),a.push(r),s.push(o),l.push(i),u.push(r),u.push(o),u.push(i);for(a.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=te(s[t]),l[t]=te(l[t]),u[t]=te(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function ze(){return this.hours()%12||12}function Ue(){return this.hours()||24}function Ke(e,t){X(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Xe(e,t){return t._meridiemParse}function Ge(e){return"p"===(e+"").toLowerCase().charAt(0)}function qe(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Ze(e){return e?e.toLowerCase().replace("_","-"):e}function $e(e){for(var t,n,r,o,i=0;i<e.length;){for(o=Ze(e[i]).split("-"),t=o.length,n=Ze(e[i+1]),n=n?n.split("-"):null;t>0;){if(r=Qe(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&C(o,n,!0)>=t-1)break;t--}i++}return null}function Qe(t){var n=null;if(!jo[t]&&"undefined"!=typeof e&&e&&e.exports)try{n=Mo._abbr,require("./locale/"+t),Je(n)}catch(e){}return jo[t]}function Je(e,t){var n;return e&&(n=a(t)?nt(e):et(e,t),n&&(Mo=n)),Mo._abbr}function et(e,t){if(null!==t){var n=Do;if(t.abbr=e,null!=jo[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=jo[e]._config;else if(null!=t.parentLocale){if(null==jo[t.parentLocale])return Io[t.parentLocale]||(Io[t.parentLocale]=[]),Io[t.parentLocale].push({name:e,config:t}),null;n=jo[t.parentLocale]._config}return jo[e]=new T(k(n,t)),Io[e]&&Io[e].forEach(function(e){et(e.name,e.config)}),Je(e),jo[e]}return delete jo[e],null}function tt(e,t){if(null!=t){var n,r=Do;null!=jo[e]&&(r=jo[e]._config),t=k(r,t),n=new T(t),n.parentLocale=jo[e],jo[e]=n,Je(e)}else null!=jo[e]&&(null!=jo[e].parentLocale?jo[e]=jo[e].parentLocale:null!=jo[e]&&delete jo[e]);return jo[e]}function nt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Mo;if(!r(e)){if(t=Qe(e))return t;e=[e]}return $e(e)}function rt(){return kr(jo)}function ot(e){var t,n=e._a;return n&&h(e).overflow===-2&&(t=n[so]<0||n[so]>11?so:n[lo]<1||n[lo]>ie(n[ao],n[so])?lo:n[uo]<0||n[uo]>24||24===n[uo]&&(0!==n[co]||0!==n[fo]||0!==n[po])?uo:n[co]<0||n[co]>59?co:n[fo]<0||n[fo]>59?fo:n[po]<0||n[po]>999?po:-1,h(e)._overflowDayOfYear&&(t<ao||t>lo)&&(t=lo),h(e)._overflowWeeks&&t===-1&&(t=ho),h(e)._overflowWeekday&&t===-1&&(t=mo),h(e).overflow=t),e}function it(e){var t,n,r,o,i,a,s=e._i,l=Ao.exec(s)||Lo.exec(s);if(l){for(h(e).iso=!0,t=0,n=Wo.length;t<n;t++)if(Wo[t][1].exec(l[1])){o=Wo[t][0],r=Wo[t][2]!==!1;break}if(null==o)return void(e._isValid=!1);if(l[3]){for(t=0,n=Ho.length;t<n;t++)if(Ho[t][1].exec(l[3])){i=(l[2]||" ")+Ho[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!Vo.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=o+(i||"")+(a||""),ft(e)}else e._isValid=!1}function at(e){var t,n,r,o,i,a,s,l,u={" GMT":" +0000"," EDT":" -0400"," EST":" -0500"," CDT":" -0500"," CST":" -0600"," MDT":" -0600"," MST":" -0700"," PDT":" -0700"," PST":" -0800"},c="YXWVUTSRQPONZABCDEFGHIKLM";if(t=e._i.replace(/\([^\)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s|\s$/g,""),n=Yo.exec(t)){if(r=n[1]?"ddd"+(5===n[1].length?", ":" "):"",o="D MMM "+(n[2].length>10?"YYYY ":"YY "),i="HH:mm"+(n[4]?":ss":""),n[1]){var d=new Date(n[2]),f=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][d.getDay()];if(n[1].substr(0,3)!==f)return h(e).weekdayMismatch=!0,void(e._isValid=!1)}switch(n[5].length){case 2:0===l?s=" +0000":(l=c.indexOf(n[5][1].toUpperCase())-12,s=(l<0?" -":" +")+(""+l).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:s=u[n[5]];break;default:s=u[" GMT"]}n[5]=s,e._i=n.splice(1).join(""),a=" ZZ",e._f=r+o+i+a,ft(e),h(e).rfc2822=!0}else e._isValid=!1}function st(e){var n=Bo.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(it(e),void(e._isValid===!1&&(delete e._isValid,at(e),e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e)))))}function lt(e,t,n){return null!=e?e:null!=t?t:n}function ut(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function ct(e){var t,n,r,o,i=[];if(!e._d){for(r=ut(e),e._w&&null==e._a[lo]&&null==e._a[so]&&dt(e),null!=e._dayOfYear&&(o=lt(e._a[ao],r[ao]),(e._dayOfYear>ve(o)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=be(o,0,e._dayOfYear),e._a[so]=n.getUTCMonth(),e._a[lo]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=i[t]=r[t];for(;t<7;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[uo]&&0===e._a[co]&&0===e._a[fo]&&0===e._a[po]&&(e._nextDay=!0,e._a[uo]=0),e._d=(e._useUTC?be:_e).apply(null,i),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[uo]=24)}}function dt(e){var t,n,r,o,i,a,s,l;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)i=1,a=4,n=lt(t.GG,e._a[ao],Se(bt(),1,4).year),r=lt(t.W,1),o=lt(t.E,1),(o<1||o>7)&&(l=!0);else{i=e._locale._week.dow,a=e._locale._week.doy;var u=Se(bt(),i,a);n=lt(t.gg,e._a[ao],u.year),r=lt(t.w,u.week),null!=t.d?(o=t.d,(o<0||o>6)&&(l=!0)):null!=t.e?(o=t.e+i,(t.e<0||t.e>6)&&(l=!0)):o=i}r<1||r>Ee(n,i,a)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=Ce(n,r,o,i,a),e._a[ao]=s.year,e._dayOfYear=s.dayOfYear)}function ft(e){if(e._f===t.ISO_8601)return void it(e);if(e._f===t.RFC_2822)return void at(e);e._a=[],h(e).empty=!0;var n,r,o,i,a,s=""+e._i,l=s.length,u=0;for(o=$(e._f,e._locale).match(Lr)||[],n=0;n<o.length;n++)i=o[n],r=(s.match(J(i,e))||[])[0],r&&(a=s.substr(0,s.indexOf(r)),a.length>0&&h(e).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),u+=r.length),Hr[i]?(r?h(e).empty=!1:h(e).unusedTokens.push(i),oe(i,r,e)):e._strict&&!r&&h(e).unusedTokens.push(i);h(e).charsLeftOver=l-u,s.length>0&&h(e).unusedInput.push(s),e._a[uo]<=12&&h(e).bigHour===!0&&e._a[uo]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[uo]=pt(e._locale,e._a[uo],e._meridiem),ct(e),ot(e)}function pt(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function ht(e){var t,n,r,o,i;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;o<e._f.length;o++)i=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],ft(t),m(t)&&(i+=h(t).charsLeftOver,i+=10*h(t).unusedTokens.length,h(t).score=i,(null==r||i<r)&&(r=i,n=t));d(e,n||t)}function mt(e){if(!e._d){var t=V(e._i);e._a=u([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}function vt(e){var t=new g(ot(yt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function yt(e){var t=e._i,n=e._f;return e._locale=e._locale||nt(e._l),null===t||void 0===n&&""===t?v({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t)?new g(ot(t)):(l(t)?e._d=t:r(n)?ht(e):n?ft(e):gt(e),m(e)||(e._d=null),e))}function gt(e){var n=e._i;a(n)?e._d=new Date(t.now()):l(n)?e._d=new Date(n.valueOf()):"string"==typeof n?st(e):r(n)?(e._a=u(n.slice(0),function(e){return parseInt(e,10)}),ct(e)):o(n)?mt(e):s(n)?e._d=new Date(n):t.createFromInputFallback(e)}function _t(e,t,n,a,s){var l={};return n!==!0&&n!==!1||(a=n,n=void 0),(o(e)&&i(e)||r(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=n,l._i=e,l._f=t,l._strict=a,vt(l)}function bt(e,t,n,r){return _t(e,t,n,r,!1)}function xt(e,t){var n,o;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return bt();for(n=t[0],o=1;o<t.length;++o)t[o].isValid()&&!t[o][e](n)||(n=t[o]);return n}function Ct(){var e=[].slice.call(arguments,0);return xt("isBefore",e)}function St(){var e=[].slice.call(arguments,0);return xt("isAfter",e)}function Et(e){for(var t in e)if(Ko.indexOf(t)===-1||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,r=0;r<Ko.length;++r)if(e[Ko[r]]){if(n)return!1;parseFloat(e[Ko[r]])!==x(e[Ko[r]])&&(n=!0)}return!0}function wt(){return this._isValid}function Ot(){return Ut(NaN)}function Pt(e){var t=V(e),n=t.year||0,r=t.quarter||0,o=t.month||0,i=t.week||0,a=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=Et(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+a+7*i,this._months=+o+3*r+12*n,this._data={},this._locale=nt(),this._bubble()}function kt(e){return e instanceof Pt}function Tt(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Mt(e,t){X(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+K(~~(e/60),2)+t+K(~~e%60,2)})}function Nt(e,t){var n=(t||"").match(e);if(null===n)return null;var r=n[n.length-1]||[],o=(r+"").match(Xo)||["-",0,0],i=+(60*o[1])+x(o[2]);return 0===i?0:"+"===o[0]?i:-i}function Rt(e,n){var r,o;return n._isUTC?(r=n.clone(),o=(_(e)||l(e)?e.valueOf():bt(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+o),t.updateOffset(r,!1),r):bt(e).local()}function Dt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function jt(e,n,r){var o,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(e=Nt(to,e),null===e)return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&n&&(o=Dt(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),i!==e&&(!n||this._changeInProgress?Zt(this,Ut(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Dt(this)}function It(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function At(e){return this.utcOffset(0,e)}function Lt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Dt(this),"m")),this}function Vt(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(eo,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Wt(e){return!!this.isValid()&&(e=e?bt(e).utcOffset():0,(this.utcOffset()-e)%60===0)}function Ht(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Bt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=yt(e),e._a){var t=e._isUTC?f(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&C(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Yt(){return!!this.isValid()&&!this._isUTC}function Ft(){return!!this.isValid()&&this._isUTC}function zt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ut(e,t){var n,r,o,i=e,a=null;return kt(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:s(e)?(i={},t?i[t]=e:i.milliseconds=e):(a=Go.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:x(a[lo])*n,h:x(a[uo])*n,m:x(a[co])*n,s:x(a[fo])*n,ms:x(Tt(1e3*a[po]))*n}):(a=qo.exec(e))?(n="-"===a[1]?-1:1,i={y:Kt(a[2],n),M:Kt(a[3],n),w:Kt(a[4],n),d:Kt(a[5],n),h:Kt(a[6],n),m:Kt(a[7],n),s:Kt(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=Gt(bt(i.from),bt(i.to)),i={},i.ms=o.milliseconds,i.M=o.months),r=new Pt(i),kt(e)&&c(e,"_locale")&&(r._locale=e._locale),r}function Kt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Xt(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 Gt(e,t){var n;return e.isValid()&&t.isValid()?(t=Rt(t,e),e.isBefore(t)?n=Xt(e,t):(n=Xt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function qt(e,t){return function(n,r){var o,i;return null===r||isNaN(+r)||(w(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),n="string"==typeof n?+n:n,o=Ut(n,r),Zt(this,o,e),this}}function Zt(e,n,r,o){var i=n._milliseconds,a=Tt(n._days),s=Tt(n._months);e.isValid()&&(o=null==o||o,i&&e._d.setTime(e._d.valueOf()+i*r),a&&F(e,"Date",Y(e,"Date")+a*r),s&&ce(e,Y(e,"Month")+s*r),o&&t.updateOffset(e,a||s))}function $t(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Qt(e,n){var r=e||bt(),o=Rt(r,this).startOf("day"),i=t.calendarFormat(this,o)||"sameElse",a=n&&(O(n[i])?n[i].call(this,r):n[i]);return this.format(a||this.localeData().calendar(i,this,bt(r)))}function Jt(){return new g(this)}function en(e,t){var n=_(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&(t=L(a(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function tn(e,t){var n=_(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&(t=L(a(t)?"millisecond":t),"millisecond"===t?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function nn(e,t,n,r){return r=r||"()",("("===r[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===r[1]?this.isBefore(t,n):!this.isAfter(t,n))}function rn(e,t){var n,r=_(e)?e:bt(e);return!(!this.isValid()||!r.isValid())&&(t=L(t||"millisecond"),"millisecond"===t?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function on(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function an(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function sn(e,t,n){var r,o,i,a;return this.isValid()?(r=Rt(e,this),r.isValid()?(o=6e4*(r.utcOffset()-this.utcOffset()),t=L(t),"year"===t||"month"===t||"quarter"===t?(a=ln(this,r),"quarter"===t?a/=3:"year"===t&&(a/=12)):(i=this-r,a="second"===t?i/1e3:"minute"===t?i/6e4:"hour"===t?i/36e5:"day"===t?(i-o)/864e5:"week"===t?(i-o)/6048e5:i),n?a:b(a)):NaN):NaN}function ln(e,t){var n,r,o=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(o,"months");return t-i<0?(n=e.clone().add(o-1,"months"),r=(t-i)/(i-n)):(n=e.clone().add(o+1,"months"),r=(t-i)/(n-i)),-(o+r)||0}function un(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function cn(){if(!this.isValid())return null;var e=this.clone().utc();return e.year()<0||e.year()>9999?Z(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):O(Date.prototype.toISOString)?this.toDate().toISOString():Z(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function dn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]';return this.format(n+r+o+i)}function fn(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=Z(this,e);return this.localeData().postformat(n)}function pn(e,t){return this.isValid()&&(_(e)&&e.isValid()||bt(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function hn(e){return this.from(bt(),e)}function mn(e,t){return this.isValid()&&(_(e)&&e.isValid()||bt(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function vn(e){return this.to(bt(),e)}function yn(e){var t;return void 0===e?this._locale._abbr:(t=nt(e),null!=t&&(this._locale=t),this)}function gn(){return this._locale}function _n(e){switch(e=L(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function bn(e){return e=L(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function xn(){return this._d.valueOf()-6e4*(this._offset||0)}function Cn(){return Math.floor(this.valueOf()/1e3)}function Sn(){return new Date(this.valueOf())}function En(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function wn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function On(){return this.isValid()?this.toISOString():null}function Pn(){return m(this)}function kn(){return d({},h(this))}function Tn(){return h(this).overflow}function Mn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Nn(e,t){X(0,[e,e.length],0,t)}function Rn(e){return An.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Dn(e){return An.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function jn(){return Ee(this.year(),1,4)}function In(){var e=this.localeData()._week;return Ee(this.year(),e.dow,e.doy)}function An(e,t,n,r,o){var i;return null==e?Se(this,r,o).year:(i=Ee(e,r,o),t>i&&(t=i),Ln.call(this,e,t,n,r,o))}function Ln(e,t,n,r,o){var i=Ce(e,t,n,r,o),a=be(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Vn(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Wn(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 Hn(e,t){t[po]=x(1e3*("0."+e))}function Bn(){return this._isUTC?"UTC":""}function Yn(){return this._isUTC?"Coordinated Universal Time":""}function Fn(e){return bt(1e3*e)}function zn(){return bt.apply(null,arguments).parseZone()}function Un(e){return e}function Kn(e,t,n,r){var o=nt(),i=f().set(r,t);return o[n](i,e)}function Xn(e,t,n){if(s(e)&&(t=e,e=void 0),e=e||"",null!=t)return Kn(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=Kn(e,r,n,"month");return o}function Gn(e,t,n,r){"boolean"==typeof e?(s(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,s(t)&&(n=t,t=void 0),t=t||"");var o=nt(),i=e?o._week.dow:0;if(null!=n)return Kn(t,(n+i)%7,r,"day");var a,l=[];for(a=0;a<7;a++)l[a]=Kn(t,(a+i)%7,r,"day");return l}function qn(e,t){return Xn(e,t,"months")}function Zn(e,t){return Xn(e,t,"monthsShort")}function $n(e,t,n){return Gn(e,t,n,"weekdays")}function Qn(e,t,n){return Gn(e,t,n,"weekdaysShort")}function Jn(e,t,n){return Gn(e,t,n,"weekdaysMin")}function er(){var e=this._data;return this._milliseconds=ai(this._milliseconds),this._days=ai(this._days),this._months=ai(this._months),e.milliseconds=ai(e.milliseconds),e.seconds=ai(e.seconds),e.minutes=ai(e.minutes),e.hours=ai(e.hours),e.months=ai(e.months),e.years=ai(e.years),this}function tr(e,t,n,r){var o=Ut(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function nr(e,t){return tr(this,e,t,1)}function rr(e,t){return tr(this,e,t,-1)}function or(e){return e<0?Math.floor(e):Math.ceil(e)}function ir(){var e,t,n,r,o,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*or(sr(s)+a),a=0,s=0),l.milliseconds=i%1e3,e=b(i/1e3),l.seconds=e%60,t=b(e/60),l.minutes=t%60,n=b(t/60),l.hours=n%24,a+=b(n/24),o=b(ar(a)),s+=o,a-=or(sr(o)),r=b(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function ar(e){return 4800*e/146097}function sr(e){return 146097*e/4800}function lr(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=L(e),"month"===e||"year"===e)return t=this._days+r/864e5,n=this._months+ar(t),"month"===e?n:n/12;switch(t=this._days+Math.round(sr(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function ur(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*x(this._months/12):NaN}function cr(e){return function(){return this.as(e)}}function dr(e){return e=L(e),this.isValid()?this[e+"s"]():NaN}function fr(e){return function(){return this.isValid()?this._data[e]:NaN}}function pr(){return b(this.days()/7)}function hr(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function mr(e,t,n){var r=Ut(e).abs(),o=Ci(r.as("s")),i=Ci(r.as("m")),a=Ci(r.as("h")),s=Ci(r.as("d")),l=Ci(r.as("M")),u=Ci(r.as("y")),c=o<=Si.ss&&["s",o]||o<Si.s&&["ss",o]||i<=1&&["m"]||i<Si.m&&["mm",i]||a<=1&&["h"]||a<Si.h&&["hh",a]||s<=1&&["d"]||s<Si.d&&["dd",s]||l<=1&&["M"]||l<Si.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,hr.apply(null,c)}function vr(e){ return void 0===e?Ci:"function"==typeof e&&(Ci=e,!0)}function yr(e,t){return void 0!==Si[e]&&(void 0===t?Si[e]:(Si[e]=t,"s"===e&&(Si.ss=t-1),!0))}function gr(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=mr(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function _r(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r=Ei(this._milliseconds)/1e3,o=Ei(this._days),i=Ei(this._months);e=b(r/60),t=b(e/60),r%=60,e%=60,n=b(i/12),i%=12;var a=n,s=i,l=o,u=t,c=e,d=r,f=this.asSeconds();return f?(f<0?"-":"")+"P"+(a?a+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var br,xr;xr=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var Cr=xr,Sr=t.momentProperties=[],Er=!1,wr={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Or;Or=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};var Pr,kr=Or,Tr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Mr={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"},Nr="Invalid date",Rr="%d",Dr=/\d{1,2}/,jr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ir={},Ar={},Lr=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Vr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Wr={},Hr={},Br=/\d/,Yr=/\d\d/,Fr=/\d{3}/,zr=/\d{4}/,Ur=/[+-]?\d{6}/,Kr=/\d\d?/,Xr=/\d\d\d\d?/,Gr=/\d\d\d\d\d\d?/,qr=/\d{1,3}/,Zr=/\d{1,4}/,$r=/[+-]?\d{1,6}/,Qr=/\d+/,Jr=/[+-]?\d+/,eo=/Z|[+-]\d\d:?\d\d/gi,to=/Z|[+-]\d\d(?::?\d\d)?/gi,no=/[+-]?\d+(\.\d{1,3})?/,ro=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,oo={},io={},ao=0,so=1,lo=2,uo=3,co=4,fo=5,po=6,ho=7,mo=8;Pr=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};var vo=Pr;X("M",["MM",2],"Mo",function(){return this.month()+1}),X("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),X("MMMM",0,0,function(e){return this.localeData().months(this,e)}),A("month","M"),W("month",8),Q("M",Kr),Q("MM",Kr,Yr),Q("MMM",function(e,t){return t.monthsShortRegex(e)}),Q("MMMM",function(e,t){return t.monthsRegex(e)}),ne(["M","MM"],function(e,t){t[so]=x(e)-1}),ne(["MMM","MMMM"],function(e,t,n,r){var o=n._locale.monthsParse(e,r,n._strict);null!=o?t[so]=o:h(n).invalidMonth=e});var yo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,go="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),_o="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),bo=ro,xo=ro;X("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),X(0,["YY",2],0,function(){return this.year()%100}),X(0,["YYYY",4],0,"year"),X(0,["YYYYY",5],0,"year"),X(0,["YYYYYY",6,!0],0,"year"),A("year","y"),W("year",1),Q("Y",Jr),Q("YY",Kr,Yr),Q("YYYY",Zr,zr),Q("YYYYY",$r,Ur),Q("YYYYYY",$r,Ur),ne(["YYYYY","YYYYYY"],ao),ne("YYYY",function(e,n){n[ao]=2===e.length?t.parseTwoDigitYear(e):x(e)}),ne("YY",function(e,n){n[ao]=t.parseTwoDigitYear(e)}),ne("Y",function(e,t){t[ao]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return x(e)+(x(e)>68?1900:2e3)};var Co=B("FullYear",!0);X("w",["ww",2],"wo","week"),X("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),W("week",5),W("isoWeek",5),Q("w",Kr),Q("ww",Kr,Yr),Q("W",Kr),Q("WW",Kr,Yr),re(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=x(e)});var So={dow:0,doy:6};X("d",0,"do","day"),X("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),X("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),X("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),X("e",0,0,"weekday"),X("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),W("day",11),W("weekday",11),W("isoWeekday",11),Q("d",Kr),Q("e",Kr),Q("E",Kr),Q("dd",function(e,t){return t.weekdaysMinRegex(e)}),Q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Q("dddd",function(e,t){return t.weekdaysRegex(e)}),re(["dd","ddd","dddd"],function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);null!=o?t.d=o:h(n).invalidWeekday=e}),re(["d","e","E"],function(e,t,n,r){t[r]=x(e)});var Eo="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wo="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Oo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Po=ro,ko=ro,To=ro;X("H",["HH",2],0,"hour"),X("h",["hh",2],0,ze),X("k",["kk",2],0,Ue),X("hmm",0,0,function(){return""+ze.apply(this)+K(this.minutes(),2)}),X("hmmss",0,0,function(){return""+ze.apply(this)+K(this.minutes(),2)+K(this.seconds(),2)}),X("Hmm",0,0,function(){return""+this.hours()+K(this.minutes(),2)}),X("Hmmss",0,0,function(){return""+this.hours()+K(this.minutes(),2)+K(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),A("hour","h"),W("hour",13),Q("a",Xe),Q("A",Xe),Q("H",Kr),Q("h",Kr),Q("k",Kr),Q("HH",Kr,Yr),Q("hh",Kr,Yr),Q("kk",Kr,Yr),Q("hmm",Xr),Q("hmmss",Gr),Q("Hmm",Xr),Q("Hmmss",Gr),ne(["H","HH"],uo),ne(["k","kk"],function(e,t,n){var r=x(e);t[uo]=24===r?0:r}),ne(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ne(["h","hh"],function(e,t,n){t[uo]=x(e),h(n).bigHour=!0}),ne("hmm",function(e,t,n){var r=e.length-2;t[uo]=x(e.substr(0,r)),t[co]=x(e.substr(r)),h(n).bigHour=!0}),ne("hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[uo]=x(e.substr(0,r)),t[co]=x(e.substr(r,2)),t[fo]=x(e.substr(o)),h(n).bigHour=!0}),ne("Hmm",function(e,t,n){var r=e.length-2;t[uo]=x(e.substr(0,r)),t[co]=x(e.substr(r))}),ne("Hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[uo]=x(e.substr(0,r)),t[co]=x(e.substr(r,2)),t[fo]=x(e.substr(o))});var Mo,No=/[ap]\.?m?\.?/i,Ro=B("Hours",!0),Do={calendar:Tr,longDateFormat:Mr,invalidDate:Nr,ordinal:Rr,dayOfMonthOrdinalParse:Dr,relativeTime:jr,months:go,monthsShort:_o,week:So,weekdays:Eo,weekdaysMin:Oo,weekdaysShort:wo,meridiemParse:No},jo={},Io={},Ao=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Lo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vo=/Z|[+-]\d\d(?::?\d\d)?/,Wo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ho=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Bo=/^\/?Date\((\-?\d+)/i,Yo=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;t.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Fo=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),zo=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:v()}),Uo=function(){return Date.now?Date.now():+new Date},Ko=["year","quarter","month","week","day","hour","minute","second","millisecond"];Mt("Z",":"),Mt("ZZ",""),Q("Z",to),Q("ZZ",to),ne(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Nt(to,e)});var Xo=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Go=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,qo=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ut.fn=Pt.prototype,Ut.invalid=Ot;var Zo=qt(1,"add"),$o=qt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Qo=E("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)});X(0,["gg",2],0,function(){return this.weekYear()%100}),X(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Nn("gggg","weekYear"),Nn("ggggg","weekYear"),Nn("GGGG","isoWeekYear"),Nn("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),W("weekYear",1),W("isoWeekYear",1),Q("G",Jr),Q("g",Jr),Q("GG",Kr,Yr),Q("gg",Kr,Yr),Q("GGGG",Zr,zr),Q("gggg",Zr,zr),Q("GGGGG",$r,Ur),Q("ggggg",$r,Ur),re(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=x(e)}),re(["gg","GG"],function(e,n,r,o){n[o]=t.parseTwoDigitYear(e)}),X("Q",0,"Qo","quarter"),A("quarter","Q"),W("quarter",7),Q("Q",Br),ne("Q",function(e,t){t[so]=3*(x(e)-1)}),X("D",["DD",2],"Do","date"),A("date","D"),W("date",9),Q("D",Kr),Q("DD",Kr,Yr),Q("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ne(["D","DD"],lo),ne("Do",function(e,t){t[lo]=x(e.match(Kr)[0],10)});var Jo=B("Date",!0);X("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),W("dayOfYear",4),Q("DDD",qr),Q("DDDD",Fr),ne(["DDD","DDDD"],function(e,t,n){n._dayOfYear=x(e)}),X("m",["mm",2],0,"minute"),A("minute","m"),W("minute",14),Q("m",Kr),Q("mm",Kr,Yr),ne(["m","mm"],co);var ei=B("Minutes",!1);X("s",["ss",2],0,"second"),A("second","s"),W("second",15),Q("s",Kr),Q("ss",Kr,Yr),ne(["s","ss"],fo);var ti=B("Seconds",!1);X("S",0,0,function(){return~~(this.millisecond()/100)}),X(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),X(0,["SSS",3],0,"millisecond"),X(0,["SSSS",4],0,function(){return 10*this.millisecond()}),X(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),X(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),X(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),X(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),X(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),W("millisecond",16),Q("S",qr,Br),Q("SS",qr,Yr),Q("SSS",qr,Fr);var ni;for(ni="SSSS";ni.length<=9;ni+="S")Q(ni,Qr);for(ni="S";ni.length<=9;ni+="S")ne(ni,Hn);var ri=B("Milliseconds",!1);X("z",0,0,"zoneAbbr"),X("zz",0,0,"zoneName");var oi=g.prototype;oi.add=Zo,oi.calendar=Qt,oi.clone=Jt,oi.diff=sn,oi.endOf=bn,oi.format=fn,oi.from=pn,oi.fromNow=hn,oi.to=mn,oi.toNow=vn,oi.get=z,oi.invalidAt=Tn,oi.isAfter=en,oi.isBefore=tn,oi.isBetween=nn,oi.isSame=rn,oi.isSameOrAfter=on,oi.isSameOrBefore=an,oi.isValid=Pn,oi.lang=Qo,oi.locale=yn,oi.localeData=gn,oi.max=zo,oi.min=Fo,oi.parsingFlags=kn,oi.set=U,oi.startOf=_n,oi.subtract=$o,oi.toArray=En,oi.toObject=wn,oi.toDate=Sn,oi.toISOString=cn,oi.inspect=dn,oi.toJSON=On,oi.toString=un,oi.unix=Cn,oi.valueOf=xn,oi.creationData=Mn,oi.year=Co,oi.isLeapYear=ge,oi.weekYear=Rn,oi.isoWeekYear=Dn,oi.quarter=oi.quarters=Vn,oi.month=de,oi.daysInMonth=fe,oi.week=oi.weeks=ke,oi.isoWeek=oi.isoWeeks=Te,oi.weeksInYear=In,oi.isoWeeksInYear=jn,oi.date=Jo,oi.day=oi.days=Le,oi.weekday=Ve,oi.isoWeekday=We,oi.dayOfYear=Wn,oi.hour=oi.hours=Ro,oi.minute=oi.minutes=ei,oi.second=oi.seconds=ti,oi.millisecond=oi.milliseconds=ri,oi.utcOffset=jt,oi.utc=At,oi.local=Lt,oi.parseZone=Vt,oi.hasAlignedHourOffset=Wt,oi.isDST=Ht,oi.isLocal=Yt,oi.isUtcOffset=Ft,oi.isUtc=zt,oi.isUTC=zt,oi.zoneAbbr=Bn,oi.zoneName=Yn,oi.dates=E("dates accessor is deprecated. Use date instead.",Jo),oi.months=E("months accessor is deprecated. Use month instead",de),oi.years=E("years accessor is deprecated. Use year instead",Co),oi.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",It),oi.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Bt);var ii=T.prototype;ii.calendar=M,ii.longDateFormat=N,ii.invalidDate=R,ii.ordinal=D,ii.preparse=Un,ii.postformat=Un,ii.relativeTime=j,ii.pastFuture=I,ii.set=P,ii.months=ae,ii.monthsShort=se,ii.monthsParse=ue,ii.monthsRegex=he,ii.monthsShortRegex=pe,ii.week=we,ii.firstDayOfYear=Pe,ii.firstDayOfWeek=Oe,ii.weekdays=Re,ii.weekdaysMin=je,ii.weekdaysShort=De,ii.weekdaysParse=Ae,ii.weekdaysRegex=He,ii.weekdaysShortRegex=Be,ii.weekdaysMinRegex=Ye,ii.isPM=Ge,ii.meridiem=qe,Je("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===x(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),t.lang=E("moment.lang is deprecated. Use moment.locale instead.",Je),t.langData=E("moment.langData is deprecated. Use moment.localeData instead.",nt);var ai=Math.abs,si=cr("ms"),li=cr("s"),ui=cr("m"),ci=cr("h"),di=cr("d"),fi=cr("w"),pi=cr("M"),hi=cr("y"),mi=fr("milliseconds"),vi=fr("seconds"),yi=fr("minutes"),gi=fr("hours"),_i=fr("days"),bi=fr("months"),xi=fr("years"),Ci=Math.round,Si={ss:44,s:45,m:45,h:22,d:26,M:11},Ei=Math.abs,wi=Pt.prototype;return wi.isValid=wt,wi.abs=er,wi.add=nr,wi.subtract=rr,wi.as=lr,wi.asMilliseconds=si,wi.asSeconds=li,wi.asMinutes=ui,wi.asHours=ci,wi.asDays=di,wi.asWeeks=fi,wi.asMonths=pi,wi.asYears=hi,wi.valueOf=ur,wi._bubble=ir,wi.get=dr,wi.milliseconds=mi,wi.seconds=vi,wi.minutes=yi,wi.hours=gi,wi.days=_i,wi.weeks=pr,wi.months=bi,wi.years=xi,wi.humanize=gr,wi.toISOString=_r,wi.toString=_r,wi.toJSON=_r,wi.locale=yn,wi.localeData=gn,wi.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",_r),wi.lang=Qo,X("X",0,0,"unix"),X("x",0,0,"valueOf"),Q("x",Jr),Q("X",no),ne("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ne("x",function(e,t,n){n._d=new Date(x(e))}),t.version="2.18.1",n(bt),t.fn=oi,t.min=Ct,t.max=St,t.now=Uo,t.utc=f,t.unix=Fn,t.months=qn,t.isDate=l,t.locale=Je,t.invalid=v,t.duration=Ut,t.isMoment=_,t.weekdays=$n,t.parseZone=zn,t.localeData=nt,t.isDuration=kt,t.monthsShort=Zn,t.weekdaysMin=Jn,t.defineLocale=et,t.updateLocale=tt,t.locales=rt,t.weekdaysShort=Qn,t.normalizeUnits=L,t.relativeTimeRounding=vr,t.relativeTimeThreshold=yr,t.calendarFormat=$t,t.prototype=oi,t})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={isAppearSupported:function(e){return e.transitionName&&e.transitionAppear||e.animation.appear},isEnterSupported:function(e){return e.transitionName&&e.transitionEnter||e.animation.enter},isLeaveSupported:function(e){return e.transitionName&&e.transitionLeave||e.animation.leave},allowAppearCallback:function(e){return e.transitionAppear||e.animation.appear},allowEnterCallback:function(e){return e.transitionEnter||e.animation.enter},allowLeaveCallback:function(e){return e.transitionLeave||e.animation.leave}};t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(383);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r(o).default}}),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(14),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(9),_=r(g),b=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.vertical,r=e.offset,o=e.style,a=e.disabled,l=e.min,u=e.max,c=e.value,d=(0,s.default)(e,["className","vertical","offset","style","disabled","min","max","value"]),f=n?{bottom:r+"%"}:{left:r+"%"},p=(0,i.default)({},o,f),h={};return void 0!==c&&(h=(0,i.default)({},h,{"aria-valuemin":l,"aria-valuemax":u,"aria-valuenow":c,"aria-disabled":!!a})),y.default.createElement("div",(0,i.default)({role:"slider"},h,d,{className:t,style:p}))}}]),t}(y.default.Component);t.default=b,b.propTypes={className:_.default.string,vertical:_.default.bool,offset:_.default.number,style:_.default.object,disabled:_.default.bool,min:_.default.number,max:_.default.number,value:_.default.number},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(1),s=r(a),l=function(e){var t=e.className,n=e.included,r=e.vertical,o=e.offset,a=e.length,l=e.style,u=r?{bottom:o+"%",height:a+"%"}:{left:o+"%",width:a+"%"},c=(0,i.default)({visibility:n?"visible":"hidden"},l,u);return s.default.createElement("div",{className:t,style:c})};t.default=l,e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(){}function a(e){var t,n;return n=t=function(e){function t(e){(0,h.default)(this,t);var n=(0,g.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onMouseDown=function(e){if(0===e.button){var t=n.props.vertical,r=W.getMousePosition(t,e);if(W.isEventFromHandle(e,n.handlesRefs)){var o=W.getHandleCenterPosition(t,e.target);n.dragOffset=r-o,r=o}else n.dragOffset=0;n.onStart(r),n.addDocumentMouseEvents(),W.pauseEvent(e)}},n.onTouchStart=function(e){if(!W.isNotTouchEvent(e)){var t=n.props.vertical,r=W.getTouchPosition(t,e);if(W.isEventFromHandle(e,n.handlesRefs)){var o=W.getHandleCenterPosition(t,e.target);n.dragOffset=r-o,r=o}else n.dragOffset=0;n.onStart(r),n.addDocumentTouchEvents(),W.pauseEvent(e)}},n.onMouseMove=function(e){if(!n.sliderRef)return void n.onEnd();var t=W.getMousePosition(n.props.vertical,e);n.onMove(e,t-n.dragOffset)},n.onTouchMove=function(e){if(W.isNotTouchEvent(e)||!n.sliderRef)return void n.onEnd();var t=W.getTouchPosition(n.props.vertical,e);n.onMove(e,t-n.dragOffset)},n.saveSlider=function(e){n.sliderRef=e};return n.handlesRefs={},n}return(0,C.default)(t,e),(0,v.default)(t,[{key:"componentWillUnmount",value:function(){(0,b.default)(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this)&&(0,b.default)(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this),this.removeDocumentEvents()}},{key:"addDocumentTouchEvents",value:function(){this.onTouchMoveListener=(0,k.default)(document,"touchmove",this.onTouchMove),this.onTouchUpListener=(0,k.default)(document,"touchend",this.onEnd)}},{key:"addDocumentMouseEvents",value:function(){this.onMouseMoveListener=(0,k.default)(document,"mousemove",this.onMouseMove),this.onMouseUpListener=(0,k.default)(document,"mouseup",this.onEnd)}},{key:"removeDocumentEvents",value:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"getSliderStart",value:function(){var e=this.sliderRef,t=e.getBoundingClientRect();return this.props.vertical?t.top:t.left}},{key:"getSliderLength",value:function(){var e=this.sliderRef;if(!e)return 0;var t=e.getBoundingClientRect();return this.props.vertical?t.height:t.width}},{key:"calcValue",value:function(e){var t=this.props,n=t.vertical,r=t.min,o=t.max,i=Math.abs(Math.max(e,0)/this.getSliderLength()),a=n?(1-i)*(o-r)+r:i*(o-r)+r;return a}},{key:"calcValueByPos",value:function(e){var t=e-this.getSliderStart(),n=this.trimAlignValue(this.calcValue(t));return n}},{key:"calcOffset",value:function(e){var t=this.props,n=t.min,r=t.max,o=(e-n)/(r-n);return 100*o}},{key:"saveHandle",value:function(e,t){this.handlesRefs[e]=t}},{key:"render",value:function(){var e,n=this.props,r=n.prefixCls,o=n.className,a=n.marks,s=n.dots,l=n.step,u=n.included,d=n.disabled,p=n.vertical,h=n.min,m=n.max,v=n.children,y=n.maximumTrackStyle,g=n.style,_=n.railStyle,x=n.dotStyle,C=n.activeDotStyle,S=(0,b.default)(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this),w=S.tracks,O=S.handles,P=(0,M.default)(r,(e={},(0,f.default)(e,r+"-with-marks",Object.keys(a).length),(0,f.default)(e,r+"-disabled",d),(0,f.default)(e,r+"-vertical",p),(0,f.default)(e,o,o),e));return E.default.createElement("div",{ref:this.saveSlider,className:P,onTouchStart:d?i:this.onTouchStart,onMouseDown:d?i:this.onMouseDown,style:g},E.default.createElement("div",{className:r+"-rail",style:(0,c.default)({},y,_)}),w,E.default.createElement(D.default,{prefixCls:r,vertical:p,marks:a,dots:s,step:l,included:u,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:m,min:h,dotStyle:x,activeDotStyle:C}),O,E.default.createElement(I.default,{className:r+"-mark",vertical:p,marks:a,included:u,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:m,min:h}),v)}}]),t}(e),t.displayName="ComponentEnhancer("+e.displayName+")",t.propTypes=(0,c.default)({},e.propTypes,{min:O.default.number,max:O.default.number,step:O.default.number,marks:O.default.object,included:O.default.bool,className:O.default.string,prefixCls:O.default.string,disabled:O.default.bool,children:O.default.any,onBeforeChange:O.default.func,onChange:O.default.func,onAfterChange:O.default.func,handle:O.default.func,dots:O.default.bool,vertical:O.default.bool,style:O.default.object,minimumTrackStyle:O.default.object,maximumTrackStyle:O.default.object,handleStyle:O.default.oneOfType([O.default.object,O.default.arrayOf(O.default.object)]),trackStyle:O.default.oneOfType([O.default.object,O.default.arrayOf(O.default.object)]),railStyle:O.default.object,dotStyle:O.default.object,activeDotStyle:O.default.object}),t.defaultProps=(0,c.default)({},e.defaultProps,{prefixCls:"rc-slider",className:"",min:0,max:100,step:1,marks:{},handle:function(e){var t=e.index,n=(0,l.default)(e,["index"]);return delete n.dragging,E.default.createElement(L.default,(0,c.default)({},n,{key:t}))},onBeforeChange:i,onChange:i,onAfterChange:i,included:!0,disabled:!1,dots:!1,vertical:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),n}Object.defineProperty(t,"__esModule",{value:!0});var s=n(14),l=o(s),u=n(6),c=o(u),d=n(8),f=o(d),p=n(2),h=o(p),m=n(5),v=o(m),y=n(4),g=o(y),_=n(256),b=o(_),x=n(3),C=o(x);t.default=a;var S=n(1),E=o(S),w=n(9),O=o(w),P=n(53),k=o(P),T=n(7),M=o(T),N=n(29),R=(o(N),n(403)),D=o(R),j=n(402),I=o(j),A=n(119),L=o(A),V=n(75),W=r(V);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}function i(e){var t=void 0,n=void 0,r=void 0,i=e.ownerDocument,a=i.body,s=i&&i.documentElement;t=e.getBoundingClientRect(),n=t.left,r=t.top,n-=s.clientLeft||a.clientLeft||0,r-=s.clientTop||a.clientTop||0;var l=i.defaultView||i.parentWindow;return n+=o(l),r+=o(l,!0),{left:n,top:r}}function a(e,t){var n=e.refs,r=e.props.styles,o=n.nav||n.root,a=i(o),s=n.inkBar,l=n.activeTab,c=s.style,d=e.props.tabBarPosition;if(t&&(c.display="none"),l){var f=l,p=i(f),h=(0,u.isTransformSupported)(c);if("top"===d||"bottom"===d){var m=p.left-a.left,v=f.offsetWidth;r.inkBar&&void 0!==r.inkBar.width&&(v=parseFloat(r.inkBar.width,10),v&&(m+=(f.offsetWidth-v)/2)),h?((0,u.setTransform)(c,"translate3d("+m+"px,0,0)"),c.width=v+"px",c.height=""):(c.left=m+"px",c.top="",c.bottom="",c.right=o.offsetWidth-m-v+"px")}else{var y=p.top-a.top,g=f.offsetHeight;r.inkBar&&void 0!==r.inkBar.height&&(g=parseFloat(r.inkBar.height,10),g&&(y+=(f.offsetHeight-g)/2)),h?((0,u.setTransform)(c,"translate3d(0,"+y+"px,0)"),c.height=g+"px",c.width=""):(c.left="",c.right="",c.top=y+"px",c.bottom=o.offsetHeight-y-g+"px")}}c.display=l?"block":"none"}Object.defineProperty(t,"__esModule",{value:!0});var s=n(8),l=r(s);t.getScroll=o;var u=n(52),c=n(1),d=r(c),f=n(7),p=r(f);t.default={getDefaultProps:function(){return{inkBarAnimated:!0}},componentDidUpdate:function(){a(this)},componentDidMount:function(){a(this,!0)},getInkBarNode:function(){var e,t=this.props,n=t.prefixCls,r=t.styles,o=t.inkBarAnimated,i=n+"-ink-bar",a=(0,p.default)((e={},(0,l.default)(e,i,!0),(0,l.default)(e,o?i+"-animated":i+"-no-animated",!0),e));return d.default.createElement("div",{style:r.inkBar,className:a,key:"inkBar",ref:"inkBar"})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(14),u=r(l),c=n(1),d=r(c),f=n(9),p=r(f),h=n(13),m=r(h),v=n(7),y=r(v),g=n(78),_=r(g),b=(0,m.default)({displayName:"TabPane",propTypes:{className:p.default.string,active:p.default.bool,style:p.default.any,destroyInactiveTabPane:p.default.bool,forceRender:p.default.bool,placeholder:p.default.node},getDefaultProps:function(){return{placeholder:null}},render:function(){var e,t=this.props,n=t.className,r=t.destroyInactiveTabPane,o=t.active,a=t.forceRender,l=t.rootPrefixCls,c=t.style,f=t.children,p=t.placeholder,h=(0,u.default)(t,["className","destroyInactiveTabPane","active","forceRender","rootPrefixCls","style","children","placeholder"]);this._isActived=this._isActived||o;var m=l+"-tabpane",v=(0,y.default)((e={},(0,s.default)(e,m,1),(0,s.default)(e,m+"-inactive",!o),(0,s.default)(e,m+"-active",o),(0,s.default)(e,n,n),e)),g=r?o:this._isActived;return d.default.createElement("div",(0,i.default)({style:c,role:"tabpanel","aria-hidden":o?"false":"true",className:v},(0,_.default)(h)),g||a?f:p)}});t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TabContent=t.TabPane=void 0;var o=n(427),i=r(o),a=n(123),s=r(a),l=n(51),u=r(l);t.default=i.default,t.TabPane=s.default,t.TabContent=u.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(428),i=r(o);t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(14),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"shouldComponentUpdate",value:function(e){return e.hiddenClassName||e.visible}},{key:"render",value:function(){var e=this.props,t=e.hiddenClassName,n=e.visible,r=(0,i.default)(e,["hiddenClassName","visible"]);return t||m.default.Children.count(r.children)>1?(!n&&t&&(r.className+=" "+t),m.default.createElement("div",r)):m.default.Children.only(r.children)}}]),t}(h.Component);g.propTypes={children:y.default.any,className:y.default.string,visible:y.default.bool,hiddenClassName:y.default.string},t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return e[0]===t[0]&&e[1]===t[1]}function i(e,t,n){var r=e[t]||{};return(0,u.default)({},r,n)}function a(e,t,n){var r=n.points;for(var i in e)if(e.hasOwnProperty(i)&&o(e[i].points,r))return t+"-placement-"+i;return""}function s(e,t){this[e]=t}Object.defineProperty(t,"__esModule",{value:!0});var l=n(6),u=r(l);t.getAlignFromPlacement=i,t.getPopupClassNameFromAlign=a,t.saveRef=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){var e=document.createElement("div");return document.body.appendChild(e),e}function i(e){function t(e,t,n){if(!c||e._component||c(e)){e._container||(e._container=p(e));var r=void 0;r=e.getComponent?e.getComponent(t):d(e,t),u.default.unstable_renderSubtreeIntoContainer(e,r,e._container,function(){e._component=this,n&&n.call(this)})}}function n(e){if(e._container){var t=e._container;u.default.unmountComponentAtNode(t),t.parentNode.removeChild(t),e._container=null}}var r=e.autoMount,i=void 0===r||r,a=e.autoDestroy,l=void 0===a||a,c=e.isVisible,d=e.getComponent,f=e.getContainer,p=void 0===f?o:f,h=void 0;return i&&(h=(0,s.default)({},h,{componentDidMount:function(){t(this)},componentDidUpdate:function(){t(this)}})),i&&l||(h=(0,s.default)({},h,{renderComponent:function(e,n){t(this,e,n)}})),h=l?(0,s.default)({},h,{componentWillUnmount:function(){n(this)}}):(0,s.default)({},h,{removeContainer:function(){n(this)}})}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a);t.default=i;var l=n(11),u=r(l);e.exports=t.default},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t){n(this,e);var r=[];t=t||{},this.subscribe=function(e){r.push(e)},this.unsubscribe=function(e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)},this.update=function(e){e&&e(t),r.forEach(function(e){return e(t)})}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(82),y=r(v),g=n(446),_=r(g),b=n(448),x=r(b),C=function(e){function t(){(0,s.default)(this,t);var e=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={value:e.getValue(e.props.data,e.props.defaultValue||e.props.value)},e.onValueChange=function(t,n){var r=(0,y.default)(e.props.data,function(e,r){return r<=n&&e.value===t[r]}),o=r[n],i=void 0;for(i=n+1;o&&o.children&&o.children.length&&i<e.props.cols;i++)o=o.children[0],t[i]=o.value;t.length=i,"value"in e.props||e.setState({value:t}),e.props.onChange&&e.props.onChange(t)},e}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){"value"in e&&this.setState({value:this.getValue(e.data,e.value)})}},{key:"getValue",value:function(e,t){var n=e||this.props.data,r=t||this.props.value||this.props.defaultValue;if(!r||!r.length){r=[];for(var o=0;o<this.props.cols;o++)n&&n.length&&(r[o]=n[0].value,n=n[0].children)}return r}},{key:"getCols",value:function(){var e=this.props,t=e.data,n=e.cols,r=e.pickerPrefixCls,o=this.state.value,i=(0,y.default)(t,function(e,t){return e.value===o[t]}).map(function(e){return e.children}),a=n-i.length;if(a>0)for(var s=0;s<a;s++)i.push([]);return i.length=n-1,i.unshift(t),i.map(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];return m.default.createElement(x.default,{key:t,prefixCls:r,style:{flex:1}},e.map(function(e){return m.default.createElement(x.default.Item,{value:e.value,key:e.value},e.label)}))})}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.className,r=e.rootNativeProps,o=e.disabled,a=e.pickerItemStyle,s=e.indicatorStyle,l=e.style,u=this.getCols(),c=(0,i.default)({flexDirection:"row",alignItems:"center"},l);return m.default.createElement(_.default,{ style:c,prefixCls:t,disabled:o,className:n,selectedValue:this.state.value,rootNativeProps:r,indicatorStyle:s,pickerItemStyle:a,onValueChange:this.onValueChange},u)}}]),t}(m.default.Component);C.defaultProps={cols:3,prefixCls:"rmc-cascader",pickerPrefixCls:"rmc-picker",data:[],disabled:!1},t.default=C,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(14),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(9),_=r(g),b=n(11),x=r(b),C=n(457),S=r(C),E=n(461),w=r(E),O=n(460),P=r(O),k=n(462),T=r(k),M=n(444),N=r(M),R=n(440),D=r(R),j=n(138),I=r(j),A=n(442),L=n(458),V=r(L),W=1,H=10,B=1e3,Y=1e3,F=50,z="listviewscroll",U=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r=(0,p.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.state={curRenderedRowsCount:r.props.initialListSize,highlightedRow:{}},r.stickyRefs={},o=n,(0,p.default)(r,o)}return(0,m.default)(t,e),(0,d.default)(t,[{key:"getMetrics",value:function(){return{contentLength:this.scrollProperties.contentLength,totalRows:this.props.dataSource.getRowCount(),renderedRows:this.state.curRenderedRowsCount,visibleRows:Object.keys(this._visibleRows).length}}},{key:"getScrollResponder",value:function(){return this.refs[z]&&this.refs[z].getScrollResponder&&this.refs[z].getScrollResponder()}},{key:"scrollTo",value:function(){var e;this.refs[z]&&this.refs[z].scrollTo&&(e=this.refs[z]).scrollTo.apply(e,arguments)}},{key:"setNativeProps",value:function(e){this.refs[z]&&this.refs[z].setNativeProps&&this.refs[z].setNativeProps(e)}},{key:"getInnerViewNode",value:function(){return this.refs[z].getInnerViewNode()}},{key:"componentWillMount",value:function(){this.scrollProperties={visibleLength:null,contentLength:null,offset:0},this._childFrames=[],this._visibleRows={},this._prevRenderedRowsCount=0,this._sentEndForContentLength=null}},{key:"componentDidMount",value:function(){}},{key:"componentWillReceiveProps",value:function(e){var t=this;this.props.dataSource===e.dataSource&&this.props.initialListSize===e.initialListSize||this.setState(function(e,n){return t._prevRenderedRowsCount=0,{curRenderedRowsCount:Math.min(Math.max(e.curRenderedRowsCount,n.initialListSize),n.dataSource.getRowCount())}},function(){return t._renderMoreRowsIfNeeded()})}},{key:"onRowHighlighted",value:function(e,t){this.setState({highlightedRow:{sectionID:e,rowID:t}})}},{key:"render",value:function(){var e=this,t=[],n=this.props.dataSource,r=n.rowIdentities,o=0,a=[],l=this.props.renderHeader&&this.props.renderHeader(),u=this.props.renderFooter&&this.props.renderFooter(),c=l?1:0,d=function(s){var l=n.sectionIdentities[s],u=r[s];if(0===u.length)return"continue";if(e.props.renderSectionHeader){var d=o>=e._prevRenderedRowsCount&&n.sectionHeaderShouldUpdate(s),f=y.default.createElement(T.default,{key:"s_"+l,shouldUpdate:!!d,render:e.props.renderSectionHeader.bind(null,n.getSectionHeaderData(s),l)});e.props.stickyHeader&&(f=y.default.createElement(A.Sticky,(0,i.default)({},e.props.stickyProps,{key:"s_"+l,ref:function(t){e.stickyRefs[l]=t}}),f)),t.push(f),a.push(c++)}for(var p=[],h=0;h<u.length;h++){var m=u[h],v=l+"_"+m,g=o>=e._prevRenderedRowsCount&&n.rowShouldUpdate(s,h),_=y.default.createElement(T.default,{key:"r_"+v,shouldUpdate:!!g,render:e.props.renderRow.bind(null,n.getRowData(s,h),l,m,e.onRowHighlighted)});if(p.push(_),c++,e.props.renderSeparator&&(h!==u.length-1||s===r.length-1)){var b=e.state.highlightedRow.sectionID===l&&(e.state.highlightedRow.rowID===m||e.state.highlightedRow.rowID===u[h+1]),x=e.props.renderSeparator(l,m,b);x&&(p.push(x),c++)}if(++o===e.state.curRenderedRowsCount)break}return t.push(y.default.cloneElement(e.props.renderSectionBodyWrapper(l),{className:e.props.sectionBodyClassName},p)),o>=e.state.curRenderedRowsCount?"break":void 0};e:for(var f=0;f<r.length;f++){var p=d(f);switch(p){case"continue":continue;case"break":break e}}var h=this.props,m=h.renderScrollComponent,v=(0,s.default)(h,["renderScrollComponent"]);return t=y.default.cloneElement(v.renderBodyComponent(),{},t),v.stickyHeader&&(t=y.default.createElement(A.StickyContainer,v.stickyContainerProps,t)),this._sc=y.default.cloneElement(m((0,i.default)({},v,{onScroll:this._onScroll})),{ref:z,onContentSizeChange:this._onContentSizeChange,onLayout:this._onLayout},l,t,u,v.children),this._sc}},{key:"_measureAndUpdateScrollProps",value:function(){var e=this.getScrollResponder();!e||!e.getInnerViewNode}},{key:"_onContentSizeChange",value:function(e,t){var n=this.props.horizontal?e:t;n!==this.scrollProperties.contentLength&&(this.scrollProperties.contentLength=n,this._updateVisibleRows(),this._renderMoreRowsIfNeeded()),this.props.onContentSizeChange&&this.props.onContentSizeChange(e,t)}},{key:"_onLayout",value:function(e){var t=e.nativeEvent.layout,n=t.width,r=t.height,o=this.props.horizontal?n:r;o!==this.scrollProperties.visibleLength&&(this.scrollProperties.visibleLength=o,this._updateVisibleRows(),this._renderMoreRowsIfNeeded()),this.props.onLayout&&this.props.onLayout(e)}},{key:"_maybeCallOnEndReached",value:function(e){return!!(this.props.onEndReached&&this._getDistanceFromEnd(this.scrollProperties)<this.props.onEndReachedThreshold&&this.state.curRenderedRowsCount===this.props.dataSource.getRowCount())&&(this._sentEndForContentLength=this.scrollProperties.contentLength,this.props.onEndReached(e),!0)}},{key:"_renderMoreRowsIfNeeded",value:function(){if(null===this.scrollProperties.contentLength||null===this.scrollProperties.visibleLength||this.state.curRenderedRowsCount===this.props.dataSource.getRowCount())return void this._maybeCallOnEndReached();var e=this._getDistanceFromEnd(this.scrollProperties);e<this.props.scrollRenderAheadDistance&&this._pageInNewRows()}},{key:"_pageInNewRows",value:function(){var e=this;this.setState(function(t,n){var r=Math.min(t.curRenderedRowsCount+n.pageSize,n.dataSource.getRowCount());return e._prevRenderedRowsCount=t.curRenderedRowsCount,{curRenderedRowsCount:r}},function(){e._measureAndUpdateScrollProps(),e._prevRenderedRowsCount=e.state.curRenderedRowsCount})}},{key:"_getDistanceFromEnd",value:function(e){return e.contentLength-e.visibleLength-e.offset}},{key:"_updateVisibleRows",value:function(){}},{key:"_onScroll",value:function(e){var t=!this.props.horizontal,n=e;if(this.refs[z]){var r=x.default.findDOMNode(this.refs[z]);if(this.props.stickyHeader||this.props.useBodyScroll)this.scrollProperties.visibleLength=window[t?"innerHeight":"innerWidth"],this.scrollProperties.contentLength=r[t?"scrollHeight":"scrollWidth"],this.scrollProperties.offset=window.document.body[t?"scrollTop":"scrollLeft"];else if(this.props.useZscroller){var o=this.refs[z].domScroller;n=o,this.scrollProperties.visibleLength=o.container[t?"clientHeight":"clientWidth"],this.scrollProperties.contentLength=o.content[t?"offsetHeight":"offsetWidth"],this.scrollProperties.offset=o.scroller.getValues()[t?"top":"left"]}else this.scrollProperties.visibleLength=r[t?"offsetHeight":"offsetWidth"],this.scrollProperties.contentLength=r[t?"scrollHeight":"scrollWidth"],this.scrollProperties.offset=r[t?"scrollTop":"scrollLeft"];this._maybeCallOnEndReached(n)||this._renderMoreRowsIfNeeded(),this.props.onEndReached&&this._getDistanceFromEnd(this.scrollProperties)>this.props.onEndReachedThreshold&&(this._sentEndForContentLength=null),this.props.onScroll&&this.props.onScroll(n)}}}]),t}(y.default.Component);U.DataSource=S.default,U.propTypes=(0,i.default)({},w.default.propTypes,{dataSource:_.default.instanceOf(S.default).isRequired,renderSeparator:_.default.func,renderRow:_.default.func.isRequired,initialListSize:_.default.number,onEndReached:_.default.func,onEndReachedThreshold:_.default.number,pageSize:_.default.number,renderFooter:_.default.func,renderHeader:_.default.func,renderSectionHeader:_.default.func,renderScrollComponent:_.default.func,scrollRenderAheadDistance:_.default.number,onChangeVisibleRows:_.default.func,scrollEventThrottle:_.default.number,renderBodyComponent:_.default.func,renderSectionBodyWrapper:_.default.func,sectionBodyClassName:_.default.string,useZscroller:_.default.bool,useBodyScroll:_.default.bool,stickyHeader:_.default.bool,stickyProps:_.default.object,stickyContainerProps:_.default.object}),U.defaultProps={initialListSize:H,pageSize:W,renderScrollComponent:function(e){return y.default.createElement(w.default,e)},renderBodyComponent:function(){return y.default.createElement("div",null)},renderSectionBodyWrapper:function(e){return y.default.createElement("div",{key:e})},sectionBodyClassName:"list-view-section-body",scrollRenderAheadDistance:B,onEndReachedThreshold:Y,scrollEventThrottle:F,stickyProps:{},stickyContainerProps:{}},(0,D.default)(U.prototype,P.default.Mixin),(0,D.default)(U.prototype,N.default),(0,D.default)(U.prototype,V.default),(0,I.default)(U),U.isReactNativeComponent=!0,t.default=U,e.exports=t.default},function(e,t){"use strict";function n(e){var t=0;do isNaN(e.offsetTop)||(t+=e.offsetTop);while(e=e.offsetParent);return t}function r(e){return e.touches&&e.touches.length?e.touches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function o(e,t){var n=!0;return function(r){n&&(n=!1,setTimeout(function(){n=!0},t),e(r))}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOffsetTop=n,t._event=r,t.throttle=o},function(e,t,n){function r(e){return n(o(e))}function o(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./accordion/style/index.web.tsx":141,"./action-sheet/style/index.web.tsx":143,"./activity-indicator/style/index.web.tsx":145,"./badge/style/index.web.tsx":84,"./button/style/index.web.tsx":56,"./card/style/index.web.tsx":150,"./carousel/style/index.web.tsx":86,"./checkbox/style/index.web.tsx":87,"./create-tooltip/style/index.web.tsx":155,"./date-picker/style/index.web.tsx":158,"./drawer/style/index.web.tsx":161,"./flex/style/index.web.tsx":37,"./grid/style/index.web.tsx":165,"./icon/style/index.web.tsx":19,"./image-picker/style/index.web.tsx":167,"./input-item/style/index.web.tsx":174,"./list-view/style/index.web.tsx":177,"./list/style/index.web.tsx":25,"./locale-provider/style/index.web.tsx":180,"./menu/style/index.web.tsx":183,"./modal/style/index.web.tsx":189,"./nav-bar/style/index.web.tsx":191,"./notice-bar/style/index.web.tsx":194,"./pagination/style/index.web.tsx":197,"./picker-view/style/index.web.tsx":89,"./picker/style/index.web.tsx":90,"./popover/style/index.web.tsx":204,"./popup/style/index.web.tsx":206,"./progress/style/index.web.tsx":208,"./radio/style/index.web.tsx":91,"./range/style/index.web.tsx":212,"./refresh-control/style/index.web.tsx":214,"./result/style/index.web.tsx":216,"./search-bar/style/index.web.tsx":219,"./segmented-control/style/index.web.tsx":221,"./slider/style/index.web.tsx":223,"./stepper/style/index.web.tsx":225,"./steps/style/index.web.tsx":227,"./swipe-action/style/index.web.tsx":229,"./switch/style/index.web.tsx":231,"./tab-bar/style/index.web.tsx":234,"./table/style/index.web.tsx":236,"./tabs/style/index.web.tsx":238,"./tag/style/index.web.tsx":240,"./text/style/index.web.tsx":242,"./textarea-item/style/index.web.tsx":244,"./toast/style/index.web.tsx":93,"./view/style/index.web.tsx":245,"./white-space/style/index.web.tsx":247,"./wing-blank/style/index.web.tsx":96};r.keys=function(){return Object.keys(i)},r.resolve=o,e.exports=r,r.id=133},function(e,t,n){function r(e){return n(o(e))}function o(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./check-circle-o.svg":475,"./check-circle.svg":476,"./check.svg":477,"./cross-circle-o.svg":478,"./cross-circle.svg":479,"./cross.svg":480,"./down.svg":481,"./ellipsis-circle.svg":482,"./ellipsis.svg":483,"./exclamation-circle.svg":484,"./info-circle.svg":485,"./koubei-o.svg":486,"./koubei.svg":487,"./left.svg":488,"./loading.svg":489,"./question-circle.svg":490,"./right.svg":491,"./search.svg":492,"./up.svg":493};r.keys=function(){return Object.keys(i)},r.resolve=o,e.exports=r,r.id=134},function(e,t){"use strict";function n(){return!1}function r(){return!0}function o(){this.timeStamp=Date.now(),this.target=void 0,this.currentTarget=void 0}Object.defineProperty(t,"__esModule",{value:!0}),o.prototype={isEventObject:1,constructor:o,isDefaultPrevented:n,isPropagationStopped:n,isImmediatePropagationStopped:n,preventDefault:function(){this.isDefaultPrevented=r},stopPropagation:function(){this.isPropagationStopped=r},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=r,this.stopPropagation()},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}},t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return null===e||void 0===e}function i(){return f}function a(){return p}function s(e){var t=e.type,n="function"==typeof e.stopPropagation||"boolean"==typeof e.cancelBubble;u.default.call(this),this.nativeEvent=e;var r=a;"defaultPrevented"in e?r=e.defaultPrevented?i:a:"getPreventDefault"in e?r=e.getPreventDefault()?i:a:"returnValue"in e&&(r=e.returnValue===p?i:a),this.isDefaultPrevented=r;var o=[],s=void 0,l=void 0,c=void 0,d=h.concat();for(m.forEach(function(e){t.match(e.reg)&&(d=d.concat(e.props),e.fix&&o.push(e.fix))}),l=d.length;l;)c=d[--l],this[c]=e[c];for(!this.target&&n&&(this.target=e.srcElement||document),this.target&&3===this.target.nodeType&&(this.target=this.target.parentNode),l=o.length;l;)(s=o[--l])(this,e);this.timeStamp=e.timeStamp||Date.now()}Object.defineProperty(t,"__esModule",{value:!0});var l=n(135),u=r(l),c=n(28),d=r(c),f=!0,p=!1,h=["altKey","bubbles","cancelable","ctrlKey","currentTarget","eventPhase","metaKey","shiftKey","target","timeStamp","view","type"],m=[{reg:/^key/,props:["char","charCode","key","keyCode","which"],fix:function(e,t){o(e.which)&&(e.which=o(t.charCode)?t.keyCode:t.charCode),void 0===e.metaKey&&(e.metaKey=e.ctrlKey)}},{reg:/^touch/,props:["touches","changedTouches","targetTouches"]},{reg:/^hashchange$/,props:["newURL","oldURL"]},{reg:/^gesturechange$/i,props:["rotation","scale"]},{reg:/^(mousewheel|DOMMouseScroll)$/,props:[],fix:function(e,t){var n=void 0,r=void 0,o=void 0,i=t.wheelDelta,a=t.axis,s=t.wheelDeltaY,l=t.wheelDeltaX,u=t.detail;i&&(o=i/120),u&&(o=0-(u%3===0?u/3:u)),void 0!==a&&(a===e.HORIZONTAL_AXIS?(r=0,n=0-o):a===e.VERTICAL_AXIS&&(n=0,r=o)),void 0!==s&&(r=s/120),void 0!==l&&(n=-1*l/120),n||r||(r=o),void 0!==n&&(e.deltaX=n),void 0!==r&&(e.deltaY=r),void 0!==o&&(e.delta=o)}},{reg:/^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,props:["buttons","clientX","clientY","button","offsetX","relatedTarget","which","fromElement","toElement","offsetY","pageX","pageY","screenX","screenY"],fix:function(e,t){var n=void 0,r=void 0,i=void 0,a=e.target,s=t.button;return a&&o(e.pageX)&&!o(t.clientX)&&(n=a.ownerDocument||document,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===s||(1&s?e.which=1:2&s?e.which=3:4&s?e.which=2:e.which=0),!e.relatedTarget&&e.fromElement&&(e.relatedTarget=e.fromElement===a?e.toElement:e.fromElement),e}}],v=u.default.prototype;(0,d.default)(s.prototype,v,{constructor:s,preventDefault:function(){var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=p,v.preventDefault.call(this)},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=f,v.stopPropagation.call(this)}}),t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){function r(t){var r=new a.default(t);n.call(e,r)}return e.addEventListener?(e.addEventListener(t,r,!1),{remove:function(){e.removeEventListener(t,r,!1)}}):e.attachEvent?(e.attachEvent("on"+t,r),{remove:function(){e.detachEvent("on"+t,r)}}):void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(136),a=r(i);e.exports=t.default},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length?r.apply(void 0,t):o.apply(void 0,t)}function r(e){var t=void 0;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?t=Reflect.ownKeys(e.prototype):(t=Object.getOwnPropertyNames(e.prototype),"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e.prototype)))),t.forEach(function(t){if("constructor"!==t){var n=Object.getOwnPropertyDescriptor(e.prototype,t);"function"==typeof n.value&&Object.defineProperty(e.prototype,t,o(e,t,n))}}),e}function o(e,t,n){var r=n.value;if("function"!=typeof r)throw new Error("@autobind decorator can only be applied to methods not: "+typeof r);var o=!1;return{configurable:!0,get:function(){if(o||this===e.prototype||this.hasOwnProperty(t))return r;var n=r.bind(this);return o=!0,Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),o=!1,n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";var r=n(133);r.keys().forEach(function(e){r(e)}),e.exports=n(168),"undefined"!=typeof console&&console.warn&&console.warn("You are using prebuilt antd-mobile,\nplease use https://github.com/ant-design/babel-plugin-import to reduce app bundle size.")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(387),m=r(h),v=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return p.default.createElement(m.default,this.props)}}]),t}(p.default.Component);t.default=v,v.Panel=h.Panel,v.defaultProps={prefixCls:"am-accordion"},e.exports=t.default},[503,311],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(e,t,n){function r(){if(b){p.default.unmountComponentAtNode(b),b.parentNode.removeChild(b),b=null;var e=O.indexOf(r);e!==-1&&O.splice(e,1)}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=n(e,t);o&&o.then?o.then(function(){r()}):r()}var i,a=(0,u.default)({prefixCls:"am-action-sheet",cancelButtonText:"\u53d6\u6d88"},t),l=a.prefixCls,c=a.className,f=a.transitionName,h=a.maskTransitionName,v=a.maskClosable,g=void 0===v||v,b=document.createElement("div");document.body.appendChild(b),O.push(r);var C=a.title,P=a.message,k=a.options,T=a.destructiveButtonIndex,M=a.cancelButtonIndex,N=a.cancelButtonText,R=[C?d.default.createElement("h3",{key:"0",className:l+"-title"},C):null,P?d.default.createElement("div",{key:"1",className:l+"-message"},P):null],D=null,j="normal";switch(e){case E:j="normal",D=d.default.createElement("div",(0,x.default)(a),R,d.default.createElement("div",{className:l+"-button-list",role:"group"},k.map(function(e,t){var n,r=(n={},(0,s.default)(n,l+"-button-list-item",!0),(0,s.default)(n,l+"-destructive-button",T===t),(0,s.default)(n,l+"-cancel-button",M===t),n),i={className:(0,y.default)(r),onClick:function(){return o(t)},role:"button"},a=d.default.createElement(S.default,{key:t,activeClassName:l+"-button-list-item-active"},d.default.createElement("div",i,e));return M!==t&&T!==t||(a=d.default.createElement(S.default,{key:t,activeClassName:l+"-button-list-item-active"},d.default.createElement("div",i,e,M===t?d.default.createElement("span",{className:l+"-cancel-button-mask"}):null))),a})));break;case w:j="share";var I=k.length&&Array.isArray(k[0])||!1,A=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d.default.createElement("div",{className:l+"-share-list-item",role:"button",key:t,onClick:function(){return o(t,n)}},d.default.createElement("div",{className:l+"-share-list-item-icon"},e.iconName?d.default.createElement(_.default,{type:e.iconName}):e.icon),d.default.createElement("div",{className:l+"-share-list-item-title"},e.title))};D=d.default.createElement("div",(0,x.default)(a),R,d.default.createElement("div",{className:l+"-share"},I?k.map(function(e,t){return d.default.createElement("div",{key:t,className:l+"-share-list"},e.map(function(e,n){return A(e,n,t)}))}):d.default.createElement("div",{className:l+"-share-list"},k.map(function(e,t){return A(e,t)})),d.default.createElement(S.default,{activeClassName:l+"-share-cancel-button-active"},d.default.createElement("div",{className:l+"-share-cancel-button",role:"button",onClick:function(){return o(-1)}},N))))}var L=(0,y.default)((i={},(0,s.default)(i,c,!!c),(0,s.default)(i,l+"-"+j,!0),i));return p.default.render(d.default.createElement(m.default,{visible:!0,title:"",footer:"",prefixCls:l,className:L,transitionName:f||"am-slide-up",maskTransitionName:h||"am-fade",onClose:function(){return o(M||-1)},maskClosable:g,wrapProps:a.wrapProps||{}},D),b),{close:r}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(8),s=r(a),l=n(6),u=r(l),c=n(1),d=r(c),f=n(11),p=r(f),h=n(43),m=r(h),v=n(7),y=r(v),g=n(18),_=r(g),b=n(35),x=r(b),C=n(17),S=r(C),E="NORMAL",w="SHARE",O=[];t.default={showActionSheetWithOptions:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;i(E,e,t)},showShareActionSheetWithOptions:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;i(w,e,t)},close:function(){O.forEach(function(e){return e()})}},e.exports=t.default},[504,312],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(7),y=r(v),g=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t,n=this.props,r=n.prefixCls,o=n.className,a=n.animating,s=n.toast,l=n.size,u=n.text,c=(0,y.default)((e={},(0,i.default)(e,""+r,!0),(0,i.default)(e,r+"-lg","large"===l),(0,i.default)(e,r+"-sm","small"===l),(0,i.default)(e,o,!!o),(0,i.default)(e,r+"-toast",!!s),e)),d=(0,y.default)((t={},(0,i.default)(t,r+"-spinner",!0),(0,i.default)(t,r+"-spinner-lg",!!s||"large"===l),t));return a?s?m.default.createElement("div",{className:c},u?m.default.createElement("div",{className:r+"-content"},m.default.createElement("span",{className:d,"aria-hidden":"true"}),m.default.createElement("span",{className:r+"-toast"},u)):m.default.createElement("div",{className:r+"-content"},m.default.createElement("span",{className:d,"aria-label":"Loading"}))):u?m.default.createElement("div",{className:c},m.default.createElement("span",{className:d,"aria-hidden":"true"}),m.default.createElement("span",{className:r+"-tip"},u)):m.default.createElement("div",{className:c},m.default.createElement("span",{className:d,"aria-label":"loading"})):null}}]),t}(m.default.Component);t.default=g,g.defaultProps={prefixCls:"am-activity-indicator",animating:!0,size:"small",panelColor:"rgba(34,34,34,0.6)",toast:!1},e.exports=t.default},[503,313],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=b(t,["prefixCls","className"]),a=(0,_.default)((e={},(0,s.default)(e,n+"-body",!0),(0,s.default)(e,r,r),e));return y.default.createElement("div",(0,i.default)({className:a},o))}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-card"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.content,o=t.className,a=t.extra,l=b(t,["prefixCls","content","className","extra"]),u=(0,_.default)((e={},(0,s.default)(e,n+"-footer",!0),(0,s.default)(e,o,o),e));return y.default.createElement("div",(0,i.default)({className:u},l),y.default.createElement("div",{className:n+"-footer-content"},r),a&&y.default.createElement("div",{className:n+"-footer-extra"},a))}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-card"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.title,a=t.thumb,l=t.thumbStyle,u=t.extra,c=b(t,["prefixCls","className","title","thumb","thumbStyle","extra"]),d=(0,_.default)((e={},(0,s.default)(e,n+"-header",!0),(0,s.default)(e,r,r),e));return y.default.createElement("div",(0,i.default)({className:d},c),y.default.createElement("div",{className:n+"-header-content"},"string"==typeof a?y.default.createElement("img",{style:l,src:a}):a,o),u?y.default.createElement("div",{className:n+"-header-extra"},u):null)}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-card",thumbStyle:{}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(148),x=r(b),C=n(146),S=r(C),E=n(147),w=r(E),O=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},P=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.full,o=t.className,a=O(t,["prefixCls","full","className"]),l=(0,_.default)((e={},(0,s.default)(e,n,!0),(0,s.default)(e,n+"-full",r),(0,s.default)(e,o,o),e));return y.default.createElement("div",(0,i.default)({className:l},a))}}]),t}(y.default.Component);t.default=P,P.defaultProps={prefixCls:"am-card",full:!1},P.Header=x.default,P.Body=S.default,P.Footer=w.default,e.exports=t.default},[503,316],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(57),x=r(b),C=n(35),S=r(C),E=n(16),w=r(E),O=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.style,o=t.className,a=(0,_.default)((e={},(0,s.default)(e,n+"-agree",!0),(0,s.default)(e,o,o),e));return y.default.createElement("div",(0,i.default)({},(0,S.default)(this.props),{className:a,style:r}),y.default.createElement(x.default,(0,i.default)({},(0,w.default)(this.props,["style"]),{className:n+"-agree-label"})))}}]),t}(y.default.Component);t.default=O,O.defaultProps={prefixCls:"am-checkbox"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i),s=n(8),l=r(s),u=n(2),c=r(u),d=n(5),f=r(d),p=n(4),h=r(p),m=n(3),v=r(m),y=n(1),g=r(y),_=n(7),b=r(_),x=n(30),C=r(x),S=n(57),E=r(S),w=n(16),O=r(w),P=C.default.Item,k=function(e){function t(){return(0,c.default)(this,t),(0,h.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,v.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.prefixCls,i=n.listPrefixCls,s=n.className,u=n.children,c=n.disabled,d=n.checkboxProps,f=void 0===d?{}:d,p=(0,b.default)((e={},(0,l.default)(e,r+"-item",!0),(0,l.default)(e,r+"-item-disabled",c===!0),(0,l.default)(e,s,s),e)),h=(0,O.default)(this.props,["listPrefixCls","onChange","disabled","checkboxProps"]);c?delete h.onClick:h.onClick=h.onClick||o;var m={};return["name","defaultChecked","checked","onChange","disabled"].forEach(function(e){e in t.props&&(m[e]=t.props[e])}),g.default.createElement(P,(0,a.default)({},h,{prefixCls:i,className:p,thumb:g.default.createElement(E.default,(0,a.default)({},f,m))}),u)}}]),t}(g.default.Component);t.default=k,k.defaultProps={prefixCls:"am-checkbox",listPrefixCls:"am-list"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(57),i=r(o),a=n(152),s=r(a),l=n(151),u=r(l);i.default.CheckboxItem=s.default,i.default.AgreeItem=u.default,t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(404),i=r(o);t.default=i.default,e.exports=t.default},[506,319],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){return(0,h.default)({prefixCls:"am-picker",pickerPrefixCls:"am-picker-col",popupPrefixCls:"am-picker-popup",minuteStep:1},(0,S.getProps)())}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),s=n(5),l=r(s),u=n(4),c=r(u),d=n(3),f=r(d),p=n(6),h=r(p),m=n(1),v=r(m),y=n(9),g=r(y),_=n(453),b=r(_),x=n(452),C=r(x),S=n(159),E=n(54),w=function(e){function t(){return(0,a.default)(this,t),(0,c.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,f.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=this.context,r=e.children,o=e.value,i=e.defaultDate,a=e.extra,s=e.popupPrefixCls,l=(0,E.getComponentLocale)(e,t,"DatePicker",function(){return n(157)}),u=(0,E.getLocaleCode)(t),c=l.okText,d=l.dismissText,f=l.DatePickerLocale;u&&(o&&o.locale(u),i&&i.locale(u));var p=v.default.createElement(C.default,{minuteStep:e.minuteStep,locale:f,minDate:e.minDate, maxDate:e.maxDate,mode:e.mode,pickerPrefixCls:e.pickerPrefixCls,prefixCls:e.prefixCls,defaultDate:o||(0,S.getDefaultDate)(this.props)});return v.default.createElement(b.default,(0,h.default)({datePicker:p,WrapComponent:"div",transitionName:"am-slide-up",maskTransitionName:"am-fade"},e,{prefixCls:s,date:o||(0,S.getDefaultDate)(this.props),dismissText:d,okText:c}),r&&v.default.cloneElement(r,{extra:o?(0,S.formatFn)(this,o):a}))}}]),t}(v.default.Component);t.default=w,w.defaultProps=o(),w.contextTypes={antLocale:g.default.object},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(455),i=r(o);t.default={okText:"\u786e\u5b9a",dismissText:"\u53d6\u6d88",DatePickerLocale:i.default},e.exports=t.default},function(e,t,n){"use strict";n(90)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=void 0;return t="time"===e?"HH:mm":"datetime"===e?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"}function i(e,t){var n=e.props.format,r="undefined"==typeof n?"undefined":(0,u.default)(n);return"string"===r?t.format(r):"function"===r?n(t):t.format(o(e.props.mode))}function a(){return{mode:"datetime",extra:"\u8bf7\u9009\u62e9",onChange:function(){},title:""}}function s(e){var t=e.defaultDate,n=e.minDate,r=e.maxDate;if(t)return t;var o=(0,d.default)();return n&&o.isBefore(n)?n:r&&r.isBefore(o)?n:o}Object.defineProperty(t,"__esModule",{value:!0});var l=n(31),u=r(l);t.formatFn=i,t.getProps=a,t.getDefaultDate=s;var c=n(116),d=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(392),m=r(h),v=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return p.default.createElement(m.default,this.props)}}]),t}(p.default.Component);t.default=v,v.defaultProps={prefixCls:"am-drawer",enableDragHandle:!1},e.exports=t.default},[503,320],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.direction,r=t.wrap,o=t.justify,a=t.align,l=t.alignContent,u=t.className,c=t.children,d=t.prefixCls,f=t.style,p=b(t,["direction","wrap","justify","align","alignContent","className","children","prefixCls","style"]),h=(0,_.default)((e={},(0,s.default)(e,d,!0),(0,s.default)(e,d+"-dir-row","row"===n),(0,s.default)(e,d+"-dir-row-reverse","row-reverse"===n),(0,s.default)(e,d+"-dir-column","column"===n),(0,s.default)(e,d+"-dir-column-reverse","column-reverse"===n),(0,s.default)(e,d+"-nowrap","nowrap"===r),(0,s.default)(e,d+"-wrap","wrap"===r),(0,s.default)(e,d+"-wrap-reverse","wrap-reverse"===r),(0,s.default)(e,d+"-justify-start","start"===o),(0,s.default)(e,d+"-justify-end","end"===o),(0,s.default)(e,d+"-justify-center","center"===o),(0,s.default)(e,d+"-justify-between","between"===o),(0,s.default)(e,d+"-justify-around","around"===o),(0,s.default)(e,d+"-align-top","top"===a||"start"===a),(0,s.default)(e,d+"-align-middle","middle"===a||"center"===a),(0,s.default)(e,d+"-align-bottom","bottom"===a||"end"===a),(0,s.default)(e,d+"-align-baseline","baseline"===a),(0,s.default)(e,d+"-align-stretch","stretch"===a),(0,s.default)(e,d+"-align-content-start","start"===l),(0,s.default)(e,d+"-align-content-end","end"===l),(0,s.default)(e,d+"-align-content-center","center"===l),(0,s.default)(e,d+"-align-content-between","between"===l),(0,s.default)(e,d+"-align-content-around","around"===l),(0,s.default)(e,d+"-align-content-stretch","stretch"===l),(0,s.default)(e,u,u),e));return y.default.createElement("div",(0,i.default)({className:h,style:f},p),c)}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-flexbox",align:"center"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.className,o=t.prefixCls,a=t.style,l=b(t,["children","className","prefixCls","style"]),u=(0,_.default)((e={},(0,s.default)(e,o+"-item",!0),(0,s.default)(e,r,r),e));return y.default.createElement("div",(0,i.default)({className:u,style:a},l),n)}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-flexbox"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(6),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(36),x=r(b),C=n(85),S=r(C),E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},w=function(e){function t(){(0,u.default)(this,t);var e=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={initialSlideWidth:0},e.renderCarousel=function(t,n,r){for(var o=e.props.prefixCls,i=e.props.carouselMaxRow,a=[],s=0;s<n;s++){for(var l=[],u=0;u<i;u++){var c=s*i+u;c<r?l.push(t[c]):l.push(y.default.createElement("div",{key:"gridline-"+c}))}a.push(y.default.createElement("div",{key:"pageitem-"+s,className:o+"-carousel-page"},l))}return a},e.renderItem=function(t,n,r,o){var i=e.props.prefixCls,a=null;if(o)a=o(t,n);else if(t){var s=t.icon,l=t.text;a=y.default.createElement("div",{className:i+"-item-inner-content column-num-"+r},y.default.isValidElement(s)?s:y.default.createElement("img",{className:i+"-icon",src:s}),y.default.createElement("div",{className:i+"-text"},l))}return y.default.createElement("div",{className:i+"-item-content"},a)},e.getRows=function(t,n){var r=e.props,o=r.columnNum,i=r.data,a=r.renderItem,s=r.prefixCls,l=r.onClick,u=[];o=o;for(var c=100/o+"%",d={width:c},f=0;f<t;f++){for(var p=[],h=function(t){var r=f*o+t,u=void 0;if(r<n){var c=i&&i[r];u=y.default.createElement(x.default.Item,{key:"griditem-"+r,className:s+"-item",onClick:function(){return l&&l(c,r)},style:d},e.renderItem(c,r,o,a))}else u=y.default.createElement(x.default.Item,{key:"griditem-"+r,className:s+"-item "+s+"-null-item",style:d},y.default.createElement("div",{className:s+"-item-content"},y.default.createElement("div",{className:s+"-item-inner-content"})));p.push(u)},m=0;m<o;m++)h(m);u.push(y.default.createElement(x.default,{justify:"center",align:"stretch",key:"gridline-"+f},p))}return u},e}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentDidMount",value:function(){this.setState({initialSlideWidth:document.documentElement.clientWidth})}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.data,a=t.hasLine,l=t.isCarousel,u=E(t,["prefixCls","className","data","hasLine","isCarousel"]),c=u.columnNum,d=u.carouselMaxRow,f=(u.onClick,u.renderItem,E(u,["columnNum","carouselMaxRow","onClick","renderItem"])),p=this.state.initialSlideWidth;c=c,d=d;var h=o&&o.length||0,m=void 0,v=1,g=void 0,b=void 0;if(l&&p>0){v=Math.ceil(h/(c*d)),m=v*d,g=this.getRows(m,h);var x={};v<=1&&(x={dots:!1,dragging:!1,swiping:!1}),b=y.default.createElement(S.default,(0,s.default)({initialSlideWidth:p},f,x),this.renderCarousel(g,v,m))}else m=Math.ceil(h/c),g=this.getRows(m,h),b=g;return y.default.createElement("div",{className:(0,_.default)((e={},(0,i.default)(e,n,!0),(0,i.default)(e,n+"-line",a),(0,i.default)(e,r,r),e))},b)}}]),t}(y.default.Component);t.default=w,w.defaultProps={data:[],hasLine:!0,isCarousel:!1,columnNum:4,carouselMaxRow:2,prefixCls:"am-grid"},e.exports=t.default},function(e,t,n){"use strict";n(10),n(37),n(86),n(322)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),a=r(i),s=n(2),l=r(s),u=n(5),c=r(u),d=n(4),f=r(d),p=n(3),h=r(p),m=n(1),v=r(m),y=n(7),g=r(y),_=n(95),b=r(_),x=n(36),C=r(x),S=n(92),E=r(S),w=n(17),O=r(w),P=C.default.Item,k=function(e){function t(){(0,l.default)(this,t);var e=(0,f.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.getOrientation=function(e,t){var n=new FileReader;n.onload=function(e){var n=new DataView(e.target.result);if(65496!==n.getUint16(0,!1))return t(-2);for(var r=n.byteLength,o=2;o<r;){var i=n.getUint16(o,!1);if(o+=2,65505===i){var a=n.getUint32(o+=2,!1);if(1165519206!==a)return t(-1);var s=18761===n.getUint16(o+=6,!1);o+=n.getUint32(o+4,s);var l=n.getUint16(o,s);o+=2;for(var u=0;u<l;u++)if(274===n.getUint16(o+12*u,s))return t(n.getUint16(o+12*u+8,s))}else{if(65280!==(65280&i))break;o+=n.getUint16(o,!1)}}return t(-1)},n.readAsArrayBuffer(e.slice(0,65536))},e.getRotation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=0;switch(e){case 3:t=180;break;case 6:t=90;break;case 8:t=270}return t},e.removeImage=function(t){var n=[],r=e.props.files,o=void 0===r?[]:r;o.forEach(function(e,r){t!==r&&n.push(e)}),e.props.onChange&&e.props.onChange(n,"remove",t)},e.addImage=function(t){var n=e.props.files,r=void 0===n?[]:n,o=r.concat(t);e.props.onChange&&e.props.onChange(o,"add")},e.onImageClick=function(t){e.props.onImageClick&&e.props.onImageClick(t,e.props.files)},e.onFileChange=function(){var t=e.refs.fileSelectorInput;if(t.files&&t.files.length){var n=t.files[0],r=new FileReader;r.onload=function(r){var o=r.target.result;if(!o)return void E.default.fail("\u56fe\u7247\u83b7\u53d6\u5931\u8d25");var i=1;e.getOrientation(n,function(r){r>0&&(i=r),e.addImage({url:o,orientation:i,file:n}),t.value=""})},r.readAsDataURL(n)}},e}return(0,h.default)(t,e),(0,c.default)(t,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.prefixCls,o=n.style,i=n.className,s=n.files,l=void 0===s?[]:s,u=n.selectable,c=n.onAddImageClick,d=[],f=(0,g.default)((e={},(0,a.default)(e,""+r,!0),(0,a.default)(e,i,i),e));l.forEach(function(e,n){var o={backgroundImage:"url("+e.url+")",transform:"rotate("+t.getRotation(e.orientation)+"deg)"};d.push(v.default.createElement(P,{key:"item-"+n},v.default.createElement("div",{key:n,className:r+"-item"},v.default.createElement("div",{className:r+"-item-remove",role:"button","aria-label":"Click and Remove this image",onClick:function(){t.removeImage(n)}}),v.default.createElement("div",{className:r+"-item-content",role:"button","aria-label":"Image can be clicked",onClick:function(){t.onImageClick(n)},style:o}))))});var p=v.default.createElement(O.default,{activeClassName:r+"-upload-btn-active",key:"select"},v.default.createElement(P,null,v.default.createElement("div",{className:r+"-item "+r+"-upload-btn",onClick:c,role:"button","aria-label":"Choose and add image"},v.default.createElement("input",{ref:"fileSelectorInput",type:"file",accept:"image/jpg,image/jpeg,image/png,image/gif",onChange:function(){t.onFileChange()}})))),h=u?d.concat([p]):d,m=h.length;if(0!==m&&m%4!==0){for(var y=4-m%4,_=[],x=0;x<y;x++)_.push(v.default.createElement(P,{key:"blank-"+x}));h=h.concat(_)}for(var S=[],E=0;E<h.length/4;E++){var w=h.slice(4*E,4*E+4);S.push(w)}var k=S.map(function(e,t){return v.default.createElement(C.default,{key:"flex-"+t},e)});return v.default.createElement("div",{className:f,style:o},v.default.createElement("div",{className:r+"-list",role:"group"},v.default.createElement(b.default,{size:"md"},k)))}}]),t}(v.default.Component);t.default=k,k.defaultProps={prefixCls:"am-image-picker",files:[],onChange:o,onImageClick:o,onAddImageClick:o,selectable:!0},e.exports=t.default},function(e,t,n){"use strict";n(10),n(96),n(37),n(93),n(324)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(140);Object.defineProperty(t,"Accordion",{enumerable:!0,get:function(){return r(o).default}});var i=n(142);Object.defineProperty(t,"ActionSheet",{enumerable:!0,get:function(){return r(i).default}});var a=n(144);Object.defineProperty(t,"ActivityIndicator",{enumerable:!0,get:function(){return r(a).default}});var s=n(83);Object.defineProperty(t,"Badge",{enumerable:!0,get:function(){return r(s).default}});var l=n(55);Object.defineProperty(t,"Button",{enumerable:!0,get:function(){return r(l).default}});var u=n(149);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return r(u).default}});var c=n(85);Object.defineProperty(t,"Carousel",{enumerable:!0,get:function(){return r(c).default}});var d=n(153);Object.defineProperty(t,"Checkbox",{enumerable:!0,get:function(){return r(d).default}});var f=n(156);Object.defineProperty(t,"DatePicker",{enumerable:!0,get:function(){return r(f).default}});var p=n(160);Object.defineProperty(t,"Drawer",{enumerable:!0,get:function(){return r(p).default}});var h=n(36);Object.defineProperty(t,"Flex",{enumerable:!0,get:function(){return r(h).default}});var m=n(164);Object.defineProperty(t,"Grid",{enumerable:!0,get:function(){return r(m).default}});var v=n(18);Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return r(v).default}});var y=n(166);Object.defineProperty(t,"ImagePicker",{enumerable:!0,get:function(){return r(y).default}});var g=n(172);Object.defineProperty(t,"InputItem",{enumerable:!0,get:function(){return r(g).default}});var _=n(30);Object.defineProperty(t,"List",{enumerable:!0,get:function(){return r(_).default}});var b=n(176);Object.defineProperty(t,"ListView",{enumerable:!0,get:function(){return r(b).default}});var x=n(182);Object.defineProperty(t,"Menu",{enumerable:!0,get:function(){return r(x).default}});var C=n(186);Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return r(C).default}});var S=n(190);Object.defineProperty(t,"NavBar",{enumerable:!0,get:function(){return r(S).default}});var E=n(193);Object.defineProperty(t,"NoticeBar",{enumerable:!0,get:function(){return r(E).default}});var w=n(195);Object.defineProperty(t,"Pagination",{enumerable:!0,get:function(){return r(w).default}});var O=n(200);Object.defineProperty(t,"Picker",{enumerable:!0,get:function(){return r(O).default}});var P=n(198);Object.defineProperty(t,"PickerView",{enumerable:!0,get:function(){return r(P).default}});var k=n(203);Object.defineProperty(t,"Popover",{enumerable:!0,get:function(){return r(k).default}});var T=n(205);Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return r(T).default}});var M=n(207);Object.defineProperty(t,"Progress",{enumerable:!0,get:function(){return r(M).default}});var N=n(210);Object.defineProperty(t,"Radio",{enumerable:!0,get:function(){return r(N).default}});var R=n(213);Object.defineProperty(t,"RefreshControl",{enumerable:!0,get:function(){return r(R).default}});var D=n(215);Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return r(D).default}});var j=n(218);Object.defineProperty(t,"SearchBar",{enumerable:!0,get:function(){return r(j).default}});var I=n(220);Object.defineProperty(t,"SegmentedControl",{enumerable:!0,get:function(){return r(I).default}});var A=n(222);Object.defineProperty(t,"Slider",{enumerable:!0,get:function(){return r(A).default}});var L=n(211);Object.defineProperty(t,"Range",{enumerable:!0,get:function(){return r(L).default}});var V=n(154);Object.defineProperty(t,"createTooltip",{enumerable:!0,get:function(){return r(V).default}});var W=n(224);Object.defineProperty(t,"Stepper",{enumerable:!0,get:function(){return r(W).default}});var H=n(226);Object.defineProperty(t,"Steps",{enumerable:!0,get:function(){return r(H).default}});var B=n(228);Object.defineProperty(t,"SwipeAction",{enumerable:!0,get:function(){return r(B).default}});var Y=n(230);Object.defineProperty(t,"Switch",{enumerable:!0,get:function(){return r(Y).default}});var F=n(233);Object.defineProperty(t,"TabBar",{enumerable:!0,get:function(){return r(F).default}});var z=n(235);Object.defineProperty(t,"Table",{enumerable:!0,get:function(){return r(z).default}});var U=n(237);Object.defineProperty(t,"Tabs",{enumerable:!0,get:function(){return r(U).default}});var K=n(239);Object.defineProperty(t,"Tag",{enumerable:!0,get:function(){return r(K).default}});var X=n(241);Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return r(X).default}});var G=n(243);Object.defineProperty(t,"TextareaItem",{enumerable:!0,get:function(){return r(G).default}});var q=n(92);Object.defineProperty(t,"Toast",{enumerable:!0,get:function(){return r(q).default}});var Z=n(94);Object.defineProperty(t,"View",{enumerable:!0,get:function(){return r(Z).default}});var $=n(246);Object.defineProperty(t,"WhiteSpace",{enumerable:!0,get:function(){return r($).default}});var Q=n(95);Object.defineProperty(t,"WingBlank",{enumerable:!0,get:function(){return r(Q).default}});var J=n(179);Object.defineProperty(t,"LocaleProvider",{enumerable:!0,get:function(){return r(J).default}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(7),y=r(v),g=n(170),_=r(g),b=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._blurEventListener=function(e){var t=n.props.value;e.target!==n.refs["input-container"]&&n.onInputBlur(t)},n.onInputBlur=function(e){var t=n.state.focused;t&&(n.setState({focused:!1}),n.props.onBlur(e))},n.onInputFocus=function(e){n.setState({focused:!0}),n.props.onFocus(e)},n.onKeyboardClick=function(e){var t=n.props,r=t.value,o=t.onChange,i=t.maxLength;"delete"===e?o({target:{value:r.substring(0,r.length-1)}}):"confirm"===e?(o({target:{value:r}}),n.onInputBlur(r)):"hide"===e?n.onInputBlur(r):o(void 0!==i&&+i>=0&&(r+e).length>i?{target:{value:(r+e).substr(0,i)}}:{target:{value:r+e}})},n.onFakeInputClick=function(){var e=n.props.value,t=n.state.focused;t||n.onInputFocus(e)},n.state={focused:!1},n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=this;"focused"in e&&e.focused!==this.state.focused&&(this.debounceFocusTimeout=setTimeout(function(){var n=t.props,r=n.disabled,o=n.editable;e.focused&&!r&&o&&t.onInputFocus(t.props.value)},10))}},{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,n=e.focused,r=e.value,o=e.disabled,i=e.editable;(t||n)&&!o&&i&&this.onInputFocus(r),document.addEventListener("click",this._blurEventListener,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this._blurEventListener,!1),this.debounceFocusTimeout&&(clearTimeout(this.debounceFocusTimeout),this.debounceFocusTimeout=null)}},{key:"render",value:function(){var e,t=this.props,n=t.placeholder,r=t.value,o=t.keyboardPrefixCls,a=t.disabled,s=t.editable,l=t.confirmLabel,u=this.state.focused,c=a||!s,d=(0,y.default)((e={},(0,i.default)(e,"fake-input",!0),(0,i.default)(e,"focus",u),(0,i.default)(e,"fake-input-disabled",a),e));return m.default.createElement("div",{className:"fake-input-container"},""===r&&m.default.createElement("div",{className:"fake-input-placeholder"},n),m.default.createElement("div",{className:d,ref:"input-container",onClick:c?function(){}:this.onFakeInputClick},r),!c&&m.default.createElement(_.default,{onClick:this.onKeyboardClick,hide:!u,confirmDisabled:""===r,preixCls:o,confirmLabel:l}))}}]),t}(m.default.Component);b.defaultProps={onChange:function(){},onFocus:function(){},onBlur:function(){},placeholder:"",value:"",disabled:!1,editable:!0,prefixCls:"am-input",keyboardPrefixCls:"am-number-keyboard"},t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardItem=void 0;var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(17),x=r(b),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},S=t.KeyboardItem=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.onClick,o=t.className,a=t.disabled,l=t.children,u=C(t,["prefixCls","onClick","className","disabled","children"]),c=l;"keyboard-delete"===o?c="delete":"keyboard-hide"===o?c="hide":"keyboard-confirm"===o&&(c="confirm");var d=(e={},(0,s.default)(e,o,o),(0,s.default)(e,n+"-item",!0),(0,s.default)(e,n+"-item-disabled",a),e);return y.default.createElement(x.default,{activeClassName:n+"-item-active"},y.default.createElement("td",(0,i.default)({onClick:function(e){r(e,c)},className:(0,_.default)(d)},u),l))}}]),t}(y.default.Component);S.defaultProps={prefixCls:"am-number-keyboard",onClick:function(){},disabled:!1};var E=function(e){function t(){(0,u.default)(this,t);var e=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onKeyboardClick=function(t,n){t.nativeEvent.stopImmediatePropagation();var r=e.props.confirmDisabled;return"confirm"===n&&r?null:void e.props.onClick(n)},e.renderKetboardItem=function(t,n){return y.default.createElement(S,{onClick:e.onKeyboardClick,key:"item-"+t+"-"+n},t)},e}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.prefixCls,o=n.confirmDisabled,i=n.hide,a=n.confirmLabel,l=(0,_.default)((e={},(0,s.default)(e,r+"-wrapper",!0),(0,s.default)(e,r+"-wrapper-hide",i),e));return y.default.createElement("div",{className:l},y.default.createElement("table",null,y.default.createElement("tbody",null,y.default.createElement("tr",null,["1","2","3"].map(function(e,n){return t.renderKetboardItem(e,n)}),y.default.createElement(S,{className:"keyboard-delete",rowSpan:2,onClick:this.onKeyboardClick})),y.default.createElement("tr",null,["4","5","6"].map(function(e,n){return t.renderKetboardItem(e,n)})),y.default.createElement("tr",null,["7","8","9"].map(function(e,n){return t.renderKetboardItem(e,n)}),y.default.createElement(S,{className:"keyboard-confirm",disabled:o,rowSpan:2,onClick:this.onKeyboardClick},a)),y.default.createElement("tr",null,[".","0"].map(function(e,n){return t.renderKetboardItem(e,n)}),y.default.createElement(S,{className:"keyboard-hide",onClick:this.onKeyboardClick})))))}}]),t}(y.default.Component);E.defaultProps={prefixCls:"am-number-keyboard",onClick:function(){},confirmDisabled:!1},t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(16),y=r(v),g=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onInputBlur=function(e){"focused"in n.props||n.setState({focused:!1});var t=e.target.value;n.props.onBlur&&n.props.onBlur(t)},n.onInputFocus=function(e){"focused"in n.props||n.setState({focused:!0});var t=e.target.value;n.props.onFocus&&n.props.onFocus(t)},n.state={focused:e.focused||!1},n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){"focused"in e&&this.setState({focused:e.focused})}},{key:"componentDidMount",value:function(){(this.props.autoFocus||this.state.focused)&&navigator.userAgent.indexOf("AlipayClient")>0&&this.refs.input.focus()}},{key:"componentDidUpdate",value:function(){this.state.focused&&this.refs.input.focus()}},{key:"render",value:function(){var e=(0,y.default)(this.props,["onBlur","onFocus","focused","autoFocus"]);return m.default.createElement("input",(0,i.default)({ref:"input",onBlur:this.onInputBlur,onFocus:this.onInputFocus},e))}}]),t}(m.default.Component);t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(e){return"undefined"==typeof e||null===e?"":e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a),l=n(8),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(9),x=r(b),C=n(7),S=r(C),E=n(16),w=r(E),O=n(171),P=r(O),k=n(169),T=r(k),M=n(54),N=function(e){function t(e){(0,d.default)(this,t);var n=(0,m.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onInputChange=function(e){var t=e.target.value,r=n.props,o=r.onChange,i=r.type;switch(i){case"text":break;case"bankCard":t=t.replace(/\D/g,"").replace(/(....)(?=.)/g,"$1 ");break;case"phone":t=t.replace(/\D/g,"").substring(0,11);var a=t.length;a>3&&a<8?t=t.substr(0,3)+" "+t.substr(3):a>=8&&(t=t.substr(0,3)+" "+t.substr(3,4)+" "+t.substr(7));break;case"number":t=t.replace(/\D/g,"");break;case"password":}o&&o(t)},n.onInputFocus=function(e){n.debounceTimeout&&(clearTimeout(n.debounceTimeout),n.debounceTimeout=null),n.setState({focus:!0}),"input"===document.activeElement.tagName.toLowerCase()&&(n.scrollIntoViewTimeout=setTimeout(function(){try{document.activeElement.scrollIntoViewIfNeeded()}catch(e){}},100)),n.props.onFocus&&n.props.onFocus(e)},n.onInputBlur=function(e){n.debounceTimeout=setTimeout(function(){n.setState({focus:!1})},200),n.props.onBlur&&n.props.onBlur(e)},n.onExtraClick=function(e){n.props.onExtraClick&&n.props.onExtraClick(e)},n.onErrorClick=function(e){n.props.onErrorClick&&n.props.onErrorClick(e)},n.clearInput=function(){"password"!==n.props.type&&n.props.updatePlaceholder&&n.setState({placeholder:n.props.value}),n.props.onChange&&n.props.onChange("")},n.state={placeholder:e.placeholder},n}return(0,y.default)(t,e),(0,p.default)(t,[{key:"componentWillReceiveProps",value:function(e){"placeholder"in e&&!e.updatePlaceholder&&this.setState({placeholder:e.placeholder})}},{key:"componentWillUnmount",value:function(){this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null),this.scrollIntoViewTimeout&&(clearTimeout(this.scrollIntoViewTimeout),this.scrollIntoViewTimeout=null)}},{key:"render",value:function(){var e,t,r=this.props,o=r.prefixCls,a=r.prefixListCls,l=r.type,c=r.value,d=r.defaultValue,f=r.name,p=r.editable,h=r.disabled,m=r.style,v=r.clear,y=r.children,g=r.error,b=r.className,x=r.extra,C=r.labelNumber,E=r.maxLength,O=(0,w.default)(this.props,["prefixCls","prefixListCls","editable","style","clear","children","error","className","extra","labelNumber","onExtraClick","onErrorClick","updatePlaceholder","placeholderTextColor","type","locale"]),k=(0,M.getComponentLocale)(this.props,this.context,"InputItem",function(){return n(173)}),N=k.confirmLabel,R=this.state,D=R.placeholder,j=R.focus,I=(0,S.default)((e={},(0,u.default)(e,a+"-item",!0),(0,u.default)(e,o+"-item",!0),(0,u.default)(e,o+"-disabled",h),(0,u.default)(e,o+"-error",g),(0,u.default)(e,o+"-focus",j),(0,u.default)(e,o+"-android",j),(0,u.default)(e,b,b),e)),A=(0,S.default)((t={},(0,u.default)(t,o+"-label",!0),(0,u.default)(t,o+"-label-2",2===C),(0,u.default)(t,o+"-label-3",3===C),(0,u.default)(t,o+"-label-4",4===C),(0,u.default)(t,o+"-label-5",5===C),(0,u.default)(t,o+"-label-6",6===C),(0,u.default)(t,o+"-label-7",7===C),t)),L=(0,S.default)((0,u.default)({},o+"-control",!0)),V="text";"bankCard"===l||"phone"===l?V="tel":"password"===l?V="password":"digit"===l?V="number":"text"!==l&&"number"!==l&&(V=l);var W=void 0;W="value"in this.props?{value:i(c)}:{defaultValue:d};var H=void 0;"number"===l&&(H={pattern:"[0-9]*"});var B=void 0;return"digit"===l&&(B={className:"h5numInput"}),_.default.createElement("div",{className:I,style:m},y?_.default.createElement("div",{className:A},y):null,_.default.createElement("div",{className:L},"money"===l?_.default.createElement(T.default,(0,s.default)({type:l,maxLength:E,placeholder:D,onChange:this.onInputChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur,disabled:h,editable:p,value:i(c)},void 0!==this.props.focused?{focused:this.props.focused}:{},void 0!==this.props.autoFocus?{autoFocus:this.props.autoFocus}:{},{prefixCls:o,confirmLabel:N})):_.default.createElement(P.default,(0,s.default)({},H,O,W,B,{type:V,maxLength:E,name:f,placeholder:D,onChange:this.onInputChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur,readOnly:!p,disabled:h}))),v&&p&&!h&&c&&c.length>0?_.default.createElement("div",{className:o+"-clear",onClick:this.clearInput}):null,g?_.default.createElement("div",{className:o+"-error-extra",onClick:this.onErrorClick}):null,""!==x?_.default.createElement("div",{className:o+"-extra",onClick:this.onExtraClick},x):null)}}]),t}(_.default.Component);N.defaultProps={prefixCls:"am-input",prefixListCls:"am-list",type:"text",editable:!0,disabled:!1,placeholder:"",clear:!1,onChange:o,onBlur:o,onFocus:o,extra:"",onExtraClick:o,error:!1,onErrorClick:o,labelNumber:5,updatePlaceholder:!1},N.contextTypes={antLocale:x.default.object},t.default=N,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={confirmLabel:"\u786e\u5b9a"},e.exports=t.default},[505,325],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(79),y=r(v),g=n(88),_=r(g),b=y.default.IndexedList,x=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.listPrefixCls,r=(0,_.default)(this.props,!0),o=r.restProps,a=r.extraProps;return m.default.createElement(b,(0,i.default)({ref:"indexedList",sectionHeaderClassName:t+"-section-header "+n+"-body",sectionBodyClassName:t+"-section-body "+n+"-body"},o,a),this.props.children)}}]),t}(m.default.Component);t.default=x,x.defaultProps={prefixCls:"am-indexed-list",listPrefixCls:"am-list",listViewPrefixCls:"am-list-view"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(79),y=r(v),g=n(88),_=r(g),b=n(175),x=r(b),C=function(e){function t(){(0,s.default)(this,t);var e=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.scrollTo=function(){var t;return(t=e.refs.listview).scrollTo.apply(t,arguments)},e.getInnerViewNode=function(){return e.refs.listview.getInnerViewNode()},e}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render", value:function(){var e=(0,_.default)(this.props,!1),t=e.restProps,n=e.extraProps,r=this.props,o=r.useZscroller,a=r.refreshControl;return a&&(o=!0),m.default.createElement(y.default,(0,i.default)({ref:"listview"},t,n,{useZscroller:o}))}}]),t}(m.default.Component);t.default=C,C.defaultProps={prefixCls:"am-list-view",listPrefixCls:"am-list"},C.DataSource=y.default.DataSource,C.IndexedList=x.default,e.exports=t.default},[505,326],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Brief=void 0;var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(17),x=r(b),C=n(16),S=r(C),E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},w=t.Brief=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return y.default.createElement("div",{className:"am-list-brief",style:this.props.style},this.props.children)}}]),t}(y.default.Component),O=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClick=function(e){var t=n.props,r=t.onClick,o=t.platform,i="android"===o||"cross"===o&&!!navigator.userAgent.match(/Android/i);if(r&&i){n.debounceTimeout&&(clearTimeout(n.debounceTimeout),n.debounceTimeout=null);var a=e.currentTarget,s=Math.max(a.offsetHeight,a.offsetWidth),l=e.currentTarget.getBoundingClientRect(),u=e.clientX-l.left-a.offsetWidth/2,c=e.clientY-l.top-a.offsetWidth/2,d={width:s+"px",height:s+"px",left:u+"px",top:c+"px"};n.setState({coverRippleStyle:d,RippleClicked:!0},function(){n.debounceTimeout=setTimeout(function(){n.setState({coverRippleStyle:{display:"none"},RippleClicked:!1})},1e3)})}r&&r(e)},n.state={coverRippleStyle:{display:"none"},RippleClicked:!1},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentWillUnmount",value:function(){this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null)}},{key:"render",value:function(){var e,t,n,r,o=this,a=this.props,l=a.prefixCls,u=a.className,c=a.activeStyle,d=a.error,f=a.align,p=a.wrap,h=a.disabled,m=a.children,v=a.multipleLine,g=a.thumb,b=a.extra,C=a.arrow,w=a.onClick,O=a.onLongPress,P=E(a,["prefixCls","className","activeStyle","error","align","wrap","disabled","children","multipleLine","thumb","extra","arrow","onClick","onLongPress"]),k=this.state,T=k.coverRippleStyle,M=k.RippleClicked,N=(e={},(0,s.default)(e,u,u),(0,s.default)(e,l+"-item",!0),(0,s.default)(e,l+"-item-disabled",h),(0,s.default)(e,l+"-item-error",d),(0,s.default)(e,l+"-item-top","top"===f),(0,s.default)(e,l+"-item-middle","middle"===f),(0,s.default)(e,l+"-item-bottom","bottom"===f),e),R=(0,_.default)((t={},(0,s.default)(t,l+"-ripple",!0),(0,s.default)(t,l+"-ripple-animate",M),t)),D=(0,_.default)((n={},(0,s.default)(n,l+"-line",!0),(0,s.default)(n,l+"-line-multiple",v),(0,s.default)(n,l+"-line-wrap",p),n)),j=(0,_.default)((r={},(0,s.default)(r,l+"-arrow",!0),(0,s.default)(r,l+"-arrow-horizontal","horizontal"===C),(0,s.default)(r,l+"-arrow-vertical","down"===C||"up"===C),(0,s.default)(r,l+"-arrow-vertical-up","up"===C),r)),I=y.default.createElement("div",(0,i.default)({},(0,S.default)(P,["platform"]),{onClick:function(e){o.onClick(e)},className:(0,_.default)(N)}),g?y.default.createElement("div",{className:l+"-thumb"},"string"==typeof g?y.default.createElement("img",{src:g}):g):null,y.default.createElement("div",{className:D},void 0!==m&&y.default.createElement("div",{className:l+"-content"},m),void 0!==b&&y.default.createElement("div",{className:l+"-extra"},b),C&&y.default.createElement("div",{className:j,"aria-hidden":"true"})),y.default.createElement("div",{style:T,className:R}));return y.default.createElement(x.default,{disabled:h||!w&&!O,activeStyle:c,activeClassName:l+"-item-active",onLongPress:O},I)}}]),t}(y.default.Component);O.defaultProps={prefixCls:"am-list",align:"middle",error:!1,multipleLine:!1,wrap:!1,platform:"cross"},O.Brief=w,t.default=O},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"getChildContext",value:function(){return{antLocale:(0,i.default)({},this.props.locale,{exist:!0})}}},{key:"render",value:function(){return m.default.Children.only(this.props.children)}}]),t}(m.default.Component);t.default=g,g.propTypes={locale:y.default.object},g.childContextTypes={antLocale:y.default.object},e.exports=t.default},[506,328],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=function(t){e.onSel&&e.onSel(t)},n=e.subMenuPrefixCls,r=e.radioPrefixCls,o=e.subMenuData,i=e.showSelect,s=e.selItem,u=function(e){return i&&s.length>0&&s[0].value===e.value};return l.default.createElement(f.default,{style:{paddingTop:0},className:n},o.map(function(e,o){var i;return l.default.createElement(f.default.Item,{className:(0,c.default)((i={},(0,a.default)(i,r+"-item",!0),(0,a.default)(i,n+"-item-selected",u(e)),(0,a.default)(i,n+"-item-disabled",e.disabled),i)),key:o,extra:l.default.createElement(h.default,{checked:u(e),disabled:e.disabled,onChange:function(){return t(e)}})},e.label)}))}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),a=r(i);t.default=o;var s=n(1),l=r(s),u=n(7),c=r(u),d=n(30),f=r(d),p=n(58),h=r(p);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(30),x=r(b),C=n(36),S=r(C),E=n(181),w=r(E),O=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClickFirstLevelItem=function(e){var t=n.props.onChange;n.setState({firstLevelSelectValue:e.value}),e.isLeaf&&t&&t([e.value])},n.onClickSubMenuItem=function(e){var t=n.props,r=t.level,o=t.onChange,i=2===r?[n.state.firstLevelSelectValue,e.value]:[e.value];n.setState({value:i}),setTimeout(function(){o&&o(i)},300)},n.state={firstLevelSelectValue:n.getNewFsv(e),value:e.value},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.props.value&&this.setState({firstLevelSelectValue:this.getNewFsv(e),value:e.value})}},{key:"getNewFsv",value:function(e){var t=e.value,n=e.data,r="";return t&&t.length?r=t[0]:n[0].isLeaf||(r=n[0].value),r}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.className,o=n.style,a=n.height,l=n.data,u=void 0===l?[]:l,c=n.prefixCls,d=n.level,f=this.state,p=f.firstLevelSelectValue,h=f.value,m=u;if(2===d){var v=u;p&&""!==p&&(v=u.filter(function(e){return e.value===p})),m=v[0]&&v[0].children&&v[0].isLeaf!==!0?v[0].children:[]}var g=h&&h.length>0&&h[h.length-1],b=h&&h.length>1?h[0]:null,C=m.filter(function(e){return e.value===g}),E=!0;2===d&&b!==p&&(E=!1);var O={height:Math.round(a||document.documentElement.clientHeight/2)+"px"};return y.default.createElement("div",{className:(0,_.default)((e={},(0,s.default)(e,c,!0),(0,s.default)(e,r,!!r),e)),style:(0,i.default)({},o,O)},y.default.createElement(S.default,{align:"top"},2===d&&y.default.createElement(S.default.Item,{style:O},y.default.createElement(x.default,{role:"tablist"},u.map(function(e,n){return y.default.createElement(x.default.Item,{className:e.value===p?c+"-selected":"",onClick:function(){return t.onClickFirstLevelItem(e)},key:"listitem-1-"+n,role:"tab","aria-selected":e.value===p},e.label)}))),y.default.createElement(S.default.Item,{style:O,role:"tabpanel","aria-hidden":"false"},y.default.createElement(w.default,{subMenuPrefixCls:this.props.subMenuPrefixCls,radioPrefixCls:this.props.radioPrefixCls,subMenuData:m,selItem:C,onSel:this.onClickSubMenuItem,showSelect:E}))))}}]),t}(y.default.Component);t.default=O,O.defaultProps={prefixCls:"am-menu",subMenuPrefixCls:"am-sub-menu",radioPrefixCls:"am-radio",data:[],level:2,onChange:function(){}},e.exports=t.default},function(e,t,n){"use strict";n(10),n(87),n(37),n(25),n(91),n(329)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ModalComponent=void 0;var o=n(2),i=r(o),a=n(4),s=r(a),l=n(3),u=r(l),c=n(1),d=r(c);t.ModalComponent=function(e){function t(){return(0,i.default)(this,t),(0,s.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,u.default)(t,e),t}(d.default.Component)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){function e(){l.default.unmountComponentAtNode(i),i&&i.parentNode&&i.parentNode.removeChild(i)}var t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],r=(arguments.length<=2?void 0:arguments[2])||[{text:"\u786e\u5b9a"}];if(!t&&!n)return{close:function(){}};var o="am-modal",i=document.createElement("div");document.body.appendChild(i);var s=r.map(function(t){var n=t.onPress||function(){};return t.onPress=function(){var t=n();t&&t.then?t.then(function(){e()}):e()},t});return l.default.render(a.default.createElement(c.default,{visible:!0,transparent:!0,prefixCls:o,title:t,transitionName:"am-zoom",closable:!1,maskClosable:!1,footer:s,maskTransitionName:"am-fade"},a.default.createElement("div",{style:{zoom:1,overflow:"hidden"}},n)),i),{close:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(1),a=r(i),s=n(11),l=r(s),u=n(44),c=r(u);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(44),i=r(o),a=n(185),s=r(a),l=n(188),u=r(l),c=n(187),d=r(c);i.default.alert=s.default,i.default.prompt=u.default,i.default.operation=d.default,t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){function e(){l.default.unmountComponentAtNode(r),r&&r.parentNode&&r.parentNode.removeChild(r)}var t=(arguments.length<=0?void 0:arguments[0])||[{text:"\u786e\u5b9a"}],n="am-modal",r=document.createElement("div");document.body.appendChild(r);var o=t.map(function(t){var n=t.onPress||function(){};return t.onPress=function(){var t=n();t&&t.then?t.then(function(){e()}):e()},t});return l.default.render(a.default.createElement(c.default,{visible:!0,operation:!0,transparent:!0,prefixCls:n,transitionName:"am-zoom",closable:!1,maskClosable:!0,onClose:e,footer:o,maskTransitionName:"am-fade",className:"am-modal-operation"}),r),{close:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(1),a=r(i),s=n(11),l=r(s),u=n(44),c=r(u);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){function r(e){var t=e.target,n=t.getAttribute("type");p[n]=t.value}function o(){l.default.unmountComponentAtNode(y),y&&y.parentNode&&y.parentNode.removeChild(y)}function i(e){var t=p.text||"",n=p.password||"";return"login-password"===s?e(t,n):e("secure-text"===s?n:t)}var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"default",u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:["",""];if(!n)return{close:function(){}};var f="am-modal",p={},h=void 0,m=function(e){setTimeout(function(){e&&e.focus()},500)};switch(s){case"login-password":h=a.default.createElement("div",null,a.default.createElement("div",{className:f+"-input"},a.default.createElement("input",{type:"text",defaultValue:u,ref:function(e){return m(e)},onChange:r,placeholder:d[0]})),a.default.createElement("div",{className:f+"-input"},a.default.createElement("input",{type:"password",defaultValue:"",onChange:r,placeholder:d[1]})));break;case"secure-text":h=a.default.createElement("div",null,a.default.createElement("div",{className:f+"-input"},a.default.createElement("input",{type:"password",defaultValue:"",ref:function(e){return m(e)},onChange:r,placeholder:d[0]})));break;case"plain-text":case"default":default:h=a.default.createElement("div",null,a.default.createElement("div",{className:f+"-input"},a.default.createElement("input",{type:"text",defaultValue:u,ref:function(e){return m(e)},onChange:r,placeholder:d[0]})))}var v=a.default.createElement("div",null,a.default.createElement("label",null,t,h)),y=document.createElement("div");document.body.appendChild(y);var g=void 0;g="function"==typeof n?[{text:"\u53d6\u6d88"},{text:"\u786e\u5b9a",onPress:function(){i(n)}}]:n.map(function(e){return{text:e.text,onPress:function(){if(e.onPress)return i(e.onPress)}}});var _=g.map(function(e){var t=e.onPress||function(){};return e.onPress=function(){var e=t();e&&e.then?e.then(function(){o()}):o()},e});return l.default.render(a.default.createElement(c.default,{visible:!0,transparent:!0,prefixCls:f,title:e,closable:!1,maskClosable:!1,transitionName:"am-zoom",footer:_,maskTransitionName:"am-fade"},a.default.createElement("div",{style:{zoom:1,overflow:"hidden"}},v)),y),{close:o}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(1),a=r(i),s=n(11),l=r(s),u=n(44),c=r(u);e.exports=t.default},[503,330],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(18),x=r(b),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},S=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.children,a=t.mode,l=t.iconName,u=t.leftContent,c=t.rightContent,d=t.onLeftClick,f=C(t,["prefixCls","className","children","mode","iconName","leftContent","rightContent","onLeftClick"]),p=(0,_.default)((e={},(0,s.default)(e,r,r),(0,s.default)(e,n,!0),(0,s.default)(e,n+"-"+a,!0),e));return y.default.createElement("div",(0,i.default)({},f,{className:p}),y.default.createElement("div",{className:n+"-left",role:"button",onClick:d},l&&y.default.createElement("span",{className:n+"-left-icon","aria-hidden":"true"},y.default.createElement(x.default,{type:l})),y.default.createElement("span",{className:n+"-left-content"},u)),y.default.createElement("div",{className:n+"-title"},o),y.default.createElement("div",{className:n+"-right"},c))}}]),t}(y.default.Component);t.default=S,S.defaultProps={prefixCls:"am-navbar",mode:"dark",iconName:"left",onLeftClick:function(){}},e.exports=t.default},[504,331],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(1),s=r(a),l=n(13),u=r(l),c=n(11),d=r(c),f=(0,u.default)({displayName:"Marquee",getDefaultProps:function(){return{text:"",loop:!1,leading:500,trailing:800,fps:40,className:""}},getInitialState:function(){return{animatedWidth:0,overflowWidth:0}},componentDidMount:function(){this._measureText(),this._startAnimation()},componentDidUpdate:function(){this._measureText(),this._marqueeTimer||this._startAnimation()},componentWillUnmount:function(){clearTimeout(this._marqueeTimer)},render:function(){var e=this.props,t=e.prefixCls,n=e.className,r=e.text,o=(0,i.default)({position:"relative",right:this.state.animatedWidth,whiteSpace:"nowrap",display:"inline-block"},this.props.style);return s.default.createElement("div",{className:t+"-marquee-wrap "+n,style:{overflow:"hidden"},role:"marquee"},s.default.createElement("div",{ref:"text",className:t+"-marquee",style:o},r," "))},_startAnimation:function(){var e=this;clearTimeout(this._marqueeTimer);var t=1/this.props.fps*1e3,n=0===this.state.animatedWidth,r=n?this.props.leading:t,o=function n(){var r=e.state.overflowWidth,o=e.state.animatedWidth+1,i=o>r;if(i){if(!e.props.loop)return;o=0}i&&e.props.trailing?e._marqueeTimer=setTimeout(function(){e.setState({animatedWidth:o}),e._marqueeTimer=setTimeout(n,t)},e.props.trailing):(e.setState({animatedWidth:o}),e._marqueeTimer=setTimeout(n,t))};0!==this.state.overflowWidth&&(this._marqueeTimer=setTimeout(o,r))},_measureText:function(){var e=d.default.findDOMNode(this),t=d.default.findDOMNode(this.refs.text);if(e&&t){var n=e.offsetWidth,r=t.offsetWidth,o=r-n;o!==this.state.overflowWidth&&this.setState({overflowWidth:o})}}});t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(18),x=r(b),C=n(192),S=r(C),E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},w=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClick=function(){var e=n.props,t=e.mode,r=e.onClick;r&&r(),"closable"===t&&n.setState({show:!1})},n.state={show:!0},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.mode,r=t.icon,o=t.onClick,a=t.children,l=t.className,u=t.prefixCls,c=t.marqueeProps,d=E(t,["mode","icon","onClick","children","className","prefixCls","marqueeProps"]),f={},p=null;"closable"===n?p=y.default.createElement("div",{className:u+"-operation",onClick:this.onClick,role:"button","aria-label":"close"},y.default.createElement(x.default,{type:"cross",size:"md"})):("link"===n&&(p=y.default.createElement("div",{className:u+"-operation",role:"button","aria-label":"go to detail"},y.default.createElement(x.default,{type:"right",size:"md"}))),f.onClick=o);var h=(0,_.default)((e={},(0,s.default)(e,u,!0),(0,s.default)(e,l,!!l),e)),m=(0,i.default)({loop:!1,leading:500,trailing:800,fps:40,style:{}},c);return this.state.show?y.default.createElement("div",(0,i.default)({className:h},d,f,{role:"alert"}),r?y.default.createElement("div",{className:u+"-icon","aria-hidden":"true"}," ",r," "):null,y.default.createElement("div",{className:u+"-content"},y.default.createElement(S.default,(0,i.default)({prefixCls:u,text:a},m))),p):null}}]),t}(y.default.Component);t.default=w,w.defaultProps={prefixCls:"am-notice-bar",mode:"",icon:y.default.createElement(x.default,{type:n(494),size:"xxs"}),onClick:function(){}},e.exports=t.default},[504,332],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=n(7),_=r(g),b=n(55),x=r(b),C=n(36),S=r(C),E=n(54),w=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={current:e.current},n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({current:e.current})}},{key:"onChange",value:function(e){this.setState({current:e}),this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){var e,t=this,r=this.props,o=r.prefixCls,a=r.className,s=r.style,l=r.mode,u=r.total,c=r.simple,d=this.state.current,f=(0,E.getComponentLocale)(this.props,this.context,"Pagination",function(){return n(196)}),p=f.prevText,h=f.nextText,v=m.default.createElement(S.default,null,m.default.createElement(S.default.Item,{className:o+"-wrap-btn "+o+"-wrap-btn-prev"},m.default.createElement(x.default,{inline:!0,disabled:d<=0,onClick:function(){return t.onChange(d-1)}},p)),this.props.children?m.default.createElement(S.default.Item,null,this.props.children):!c&&m.default.createElement(S.default.Item,{className:o+"-wrap","aria-live":"assertive"},m.default.createElement("span",{className:"active"},d+1),"/",m.default.createElement("span",null,u)),m.default.createElement(S.default.Item,{className:o+"-wrap-btn "+o+"-wrap-btn-next"},m.default.createElement(x.default,{inline:!0,disabled:d>=u-1,onClick:function(){return t.onChange(t.state.current+1)}},h)));if("number"===l)v=m.default.createElement("div",{className:o+"-wrap"},m.default.createElement("span",{className:"active"},d+1),"/",m.default.createElement("span",null,u));else if("pointer"===l){for(var y=[],g=0;g<u;g++){var b;y.push(m.default.createElement("div",{key:"dot-"+g,className:(0,_.default)((b={},(0,i.default)(b,o+"-wrap-dot",!0),(0,i.default)(b,o+"-wrap-dot-active",g===d),b))},m.default.createElement("span",null)))}v=m.default.createElement("div",{className:o+"-wrap"},y)}var C=(0,_.default)((e={},(0,i.default)(e,o,!0),(0,i.default)(e,a,!!a),e));return m.default.createElement("div",{className:C,style:s},v)}}]),t}(m.default.Component);t.default=w,w.defaultProps={prefixCls:"am-pagination",mode:"button",current:0,simple:!1,onChange:function(){}},w.contextTypes={antLocale:y.default.object},e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={prevText:"\u4e0a\u4e00\u9875",nextText:"\u4e0b\u4e00\u9875"},e.exports=t.default},function(e,t,n){"use strict";n(10),n(56),n(37),n(333)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){return{prefixCls:"am-picker",pickerPrefixCls:"am-picker-col",cols:3,cascade:!0,value:[],onChange:function(){}}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),s=n(5),l=r(s),u=n(4),c=r(u),d=n(3),f=r(d),p=n(1),h=r(p),m=n(130),v=r(m),y=n(80),g=r(y),_=function(e){function t(){return(0,a.default)(this,t),(0,c.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,f.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=void 0;return t=e.cascade?h.default.createElement(v.default,{prefixCls:e.prefixCls,pickerPrefixCls:e.pickerPrefixCls,data:e.data,value:e.value,onChange:e.onChange,cols:e.cols,indicatorStyle:e.indicatorStyle}):h.default.createElement(g.default,{prefixCls:e.prefixCls,selectedValue:e.value,onValueChange:e.onChange,pickerPrefixCls:e.pickerPrefixCls,indicatorStyle:e.indicatorStyle},e.data.map(function(e){return{props:{children:e}}}))}}]),t}(h.default.Component);t.default=_,_.defaultProps=o(),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){var e=function(e){return e.join(",")};return{triggerType:"onClick",prefixCls:"am-picker",pickerPrefixCls:"am-picker-col",popupPrefixCls:"am-picker-popup",format:e,cols:3,cascade:!0,extra:"\u8bf7\u9009\u62e9",okText:"\u786e\u5b9a",dismissText:"\u53d6\u6d88",title:""}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i),s=n(2),l=r(s),u=n(5),c=r(u),d=n(4),f=r(d),p=n(3),h=r(p);t.getDefaultProps=o;var m=n(1),v=r(m),y=n(445),g=r(y),_=n(130),b=r(_),x=n(80),C=r(x),S=n(82),E=r(S),w=function(e){function t(){(0,l.default)(this,t);var e=(0,f.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.getSel=function(){var t=e.props.value||[],n=void 0;return n=e.props.cascade?(0,E.default)(e.props.data,function(e,n){return e.value===t[n]}):t.map(function(t,n){return e.props.data[n].filter(function(e){return e.value===t})[0]}),e.props.format&&e.props.format(n.map(function(e){return e.label}))},e}return(0,h.default)(t,e),(0,c.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.value,r=void 0===n?[]:n,o=e.extra,i=e.okText,s=e.itemStyle,l=e.dismissText,u=e.popupPrefixCls,c=e.cascade,d=void 0,f={};return c?d=v.default.createElement(b.default,{prefixCls:e.prefixCls,pickerPrefixCls:e.pickerPrefixCls,data:e.data,cols:e.cols,onChange:e.onPickerChange,pickerItemStyle:s}):(d=v.default.createElement(C.default,{prefixCls:e.prefixCls,pickerPrefixCls:e.pickerPrefixCls,pickerItemStyle:s},e.data.map(function(e){return{props:{children:e}}})),f={pickerValueProp:"selectedValue",pickerValueChangeProp:"onValueChange"}),v.default.createElement(g.default,(0,a.default)({cascader:d},this.popupProps,e,{prefixCls:u,value:r,dismissText:l,okText:i},f),v.default.cloneElement(t,{extra:this.getSel()||o}))}}]),t}(v.default.Component);t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(4),s=r(a),l=n(3),u=r(l),c=n(199),d=r(c),f=n(201),p=r(f),h=function(e){function t(){(0,i.default)(this,t);var e=(0,s.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.popupProps=p.default,e}return(0,u.default)(t,e),t}(d.default);t.default=h,h.defaultProps=(0,c.getDefaultProps)(),e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={WrapComponent:"div",transitionName:"am-slide-up",maskTransitionName:"am-fade"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(17),x=r(b),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},S=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.className,o=t.prefixCls,a=t.icon,l=t.disabled,u=t.firstItem,c=t.activeStyle,d=C(t,["children","className","prefixCls","icon","disabled","firstItem","activeStyle"]),f=(e={},(0,s.default)(e,r,!!r),(0,s.default)(e,o+"-item",!0),(0,s.default)(e,o+"-item-disabled",l),e),p=o+"-item-active ";return u&&(p+=o+"-item-fix-active-arrow"),y.default.createElement(x.default,{disabled:l,activeClassName:p,activeStyle:c},y.default.createElement("div",(0,i.default)({className:(0,_.default)(f)},d),y.default.createElement("div",{className:o+"-item-container"},a?y.default.createElement("span",{className:o+"-item-icon","aria-hidden":"true"},a):null,y.default.createElement("span",{className:o+"-item-content"},n))))}}]),t}(y.default.Component);t.default=S,S.defaultProps={prefixCls:"am-popover",disabled:!1},S.myName="PopoverItem",e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return e};return v.default.Children.map(e,function(e,n){var r=t(e,n);return r&&r.props&&r.props.children?v.default.cloneElement(r,{},o(r.props.children,t)):r})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i),s=n(2),l=r(s),u=n(5),c=r(u),d=n(4),f=r(d),p=n(3),h=r(p),m=n(1),v=r(m),y=n(125),g=r(y),_=n(202),b=r(_),x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},C=function(e){function t(){return(0,l.default)(this,t),(0,f.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,c.default)(t,[{key:"render",value:function(){var e=this.props,t=e.overlay,n=e.onSelect,r=void 0===n?function(){}:n,i=x(e,["overlay","onSelect"]),s=o(t,function(e,t){var n={firstItem:!1};return e&&e.type&&"PopoverItem"===e.type.myName&&!e.props.disabled?(n.onClick=function(){return r(e,t)},n.firstItem=0===t,v.default.cloneElement(e,n)):e});return v.default.createElement(g.default,(0,a.default)({},i,{overlay:s}))}}]),t}(v.default.Component);t.default=C,C.defaultProps={prefixCls:"am-popover",placement:"bottomRight",align:{overflow:{adjustY:0,adjustX:0}},trigger:["click"]},C.Item=b.default,e.exports=t.default},[503,336],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){function r(){_&&(f.default.unmountComponentAtNode(_),_.parentNode.removeChild(_),_=null),o(e)}var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(e){},i=(0,l.default)({prefixCls:"am-popup",animationType:"slide-down"},t),a=i.prefixCls,s=i.transitionName,u=i.animationType,d=i.maskTransitionName,p=i.maskClosable,m=void 0===p||p,y=i.onMaskClose,g=i.className,_=document.createElement("div");document.body.appendChild(_);var b="am-slide-down";"slide-up"===u&&(b="am-slide-up");var x={onClick:function(e){if(e.preventDefault(),m)if(y&&"function"==typeof y){var t=y();t&&t.then?t.then(function(){r()}):r()}else r()}},C=g?a+"-"+u+" "+g:a+"-"+u;return f.default.render(c.default.createElement(h.default,(0,l.default)({},i,{className:C,visible:!0,title:"",footer:"",transitionName:s||b,maskTransitionName:d||"am-fade",maskProps:(0,l.default)({},i.maskProps,x)}),n),_),{instanceId:v,close:r}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),s=n(6),l=r(s),u=n(1),c=r(u),d=n(11),f=r(d),p=n(43),h=r(p),m={defaultInstance:null,instances:[]},v=1,y=function e(){(0,a.default)(this,e)};t.default=y,y.newInstance=function(){var e=void 0;return{show:function(t,n){e=o(v++,n,t,function(e){for(var t=0;t<m.instances.length;t++)if(m.instances[t].instanceId===e)return void m.instances.splice(t,1)}),m.instances.push(e)},hide:function(){e.close()}}},y.show=function(e,t){y.hide(),m.defaultInstance=o("0",t,e,function(e){"0"===e&&(m.defaultInstance=null)})},y.hide=function(){m.defaultInstance&&m.defaultInstance.close()},e.exports=t.default},[503,337],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentWillReceiveProps",value:function(){this.noAppearTransition=!0}},{key:"componentDidMount",value:function(){var e=this;this.props.appearTransition&&setTimeout(function(){e.refs.bar.style.width=e.props.percent+"%"},10)}},{key:"render",value:function(){var e,t=this.props,n=t.className,r=t.prefixCls,o=t.position,a=t.unfilled,l=t.style,u=void 0===l?{}:l,c=t.wrapStyle,d=void 0===c?{}:c,f={width:this.noAppearTransition||!this.props.appearTransition?this.props.percent+"%":0,height:0},p=(0,_.default)((e={},(0,s.default)(e,n,n),(0,s.default)(e,r+"-outer",!0),(0,s.default)(e,r+"-fixed-outer","fixed"===o),(0,s.default)(e,r+"-hide-outer","hide"===a),e));return y.default.createElement("div",{style:d,className:p,role:"progressbar","aria-valuenow":this.props.percent,"aria-valuemin":"0","aria-valuemax":"100"},y.default.createElement("div",{ref:"bar",className:r+"-bar",style:(0,i.default)({},u,f)}))}}]),t; }(y.default.Component);t.default=b,b.defaultProps={prefixCls:"am-progress",percent:0,position:"fixed",unfilled:"show",appearTransition:!1},e.exports=t.default},[503,338],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i),s=n(8),l=r(s),u=n(2),c=r(u),d=n(5),f=r(d),p=n(4),h=r(p),m=n(3),v=r(m),y=n(1),g=r(y),_=n(7),b=r(_),x=n(30),C=r(x),S=n(58),E=r(S),w=n(16),O=r(w),P=C.default.Item,k=function(e){function t(){return(0,c.default)(this,t),(0,h.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,v.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.prefixCls,i=n.listPrefixCls,s=n.className,u=n.children,c=n.disabled,d=n.radioProps,f=void 0===d?{}:d,p=(0,b.default)((e={},(0,l.default)(e,r+"-item",!0),(0,l.default)(e,r+"-item-disabled",c===!0),(0,l.default)(e,s,s),e)),h=(0,O.default)(this.props,["listPrefixCls","onChange","disabled","radioProps"]);c?delete h.onClick:h.onClick=h.onClick||o;var m={};return["name","defaultChecked","checked","onChange","disabled"].forEach(function(e){e in t.props&&(m[e]=t.props[e])}),g.default.createElement(P,(0,a.default)({},h,{prefixCls:i,className:p,extra:g.default.createElement(E.default,(0,a.default)({},f,m))}),u)}}]),t}(g.default.Component);t.default=k,k.defaultProps={prefixCls:"am-radio",listPrefixCls:"am-list"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(58),i=r(o),a=n(209),s=r(a);i.default.RadioItem=s.default,t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(400),m=r(h),v=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return p.default.createElement("div",{className:this.props.prefixCls+"-wrapper"},p.default.createElement(m.default,this.props))}}]),t}(p.default.Component);t.default=v,v.defaultProps={prefixCls:"am-slider"},e.exports=t.default},[503,340],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(1),s=r(a),l=n(79),u=r(l),c=n(18),d=r(c),f="undefined"!=typeof window&&window.devicePixelRatio||2;u.default.RefreshControl.defaultProps=(0,i.default)({},u.default.RefreshControl.defaultProps,{prefixCls:"am-refresh-control",icon:[s.default.createElement("div",{key:"0",className:"am-refresh-control-pull"},s.default.createElement("span",null,"\u4e0b\u62c9\u53ef\u4ee5\u5237\u65b0")),s.default.createElement("div",{key:"1",className:"am-refresh-control-release"},s.default.createElement("span",null,"\u677e\u5f00\u7acb\u5373\u5237\u65b0"))],loading:s.default.createElement(d.default,{type:"loading"}),refreshing:!1,distanceToRefresh:25*f}),t.default=u.default.RefreshControl,e.exports=t.default},[504,341],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(55),y=r(v),g=n(7),_=r(g),b=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.img,a=t.imgUrl,s=t.title,l=t.message,u=t.buttonText,c=t.buttonClick,d=t.buttonType,f=t.style,p=(0,_.default)((e={},(0,i.default)(e,""+n,!0),(0,i.default)(e,r,r),e)),h=null;return o?h=m.default.createElement("div",{className:n+"-pic"},o):a&&(h=m.default.createElement("div",{className:n+"-pic",style:{backgroundImage:"url("+a+")"}})),m.default.createElement("div",{className:p,style:f,role:"alert"},h,s?m.default.createElement("div",{className:n+"-title"},s):null,l?m.default.createElement("div",{className:n+"-message"},l):null,u?m.default.createElement("div",{className:n+"-button"},m.default.createElement(y.default,{type:d,onClick:c},u)):null)}}]),t}(m.default.Component);t.default=b,b.defaultProps={prefixCls:"am-result",buttonType:"",buttonClick:function(){}},e.exports=t.default},function(e,t,n){"use strict";n(10),n(56),n(342)},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0});t.defaultProps={prefixCls:"am-search",placeholder:"",onSubmit:n,onChange:n,onFocus:n,onBlur:n,onClear:n,showCancelButton:!1,cancelText:"\u53d6\u6d88",disabled:!1}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(217),x=n(35),C=r(x),S=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onSubmit=function(e){e.preventDefault(),n.props.onSubmit&&n.props.onSubmit(n.state.value),n.refs.searchInput.blur()},n.onChange=function(e){n.state.focus||n.setState({focus:!0});var t=e.target.value;"value"in n.props||n.setState({value:t}),n.props.onChange&&n.props.onChange(t)},n.onFocus=function(){n.setState({focus:!0}),n.firstFocus=!0,"focused"in n.props||n.setState({focused:!0}),n.props.onFocus&&n.props.onFocus(),"input"===document.activeElement.tagName.toLowerCase()&&(n.scrollIntoViewTimeout=setTimeout(function(){try{document.activeElement.scrollIntoViewIfNeeded()}catch(e){}},100))},n.onBlur=function(){setTimeout(function(){n.setState({focus:!1})},0),"focused"in n.props||n.setState({focused:!1}),n.props.onBlur&&n.props.onBlur()},n.onClear=function(){"value"in n.props||n.setState({value:""}),n.props.onClear&&n.props.onClear(""),n.props.onChange&&n.props.onChange("");var e=navigator.userAgent;e.indexOf("AlipayClient")>0&&(e.match(/Android/i)||e.indexOf("AliApp(AM")<0)&&setTimeout(function(){n.refs.searchInput.focus(),n.componentDidUpdate()},300)},n.onCancel=function(){n.props.onCancel?n.props.onCancel(n.state.value):n.onClear()};var r=void 0;return r="value"in e?e.value||"":"defaultValue"in e?e.defaultValue:"",n.state={value:r,focus:!1,focused:e.focused||!1},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentDidMount",value:function(){var e=window.getComputedStyle(this.refs.rightBtn);this.rightBtnInitMarginleft=e["margin-left"],(this.props.autoFocus||this.state.focused)&&navigator.userAgent.indexOf("AlipayClient")>0&&this.refs.searchInput.focus(),this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e=this.refs.syntheticPhContainer.getBoundingClientRect().width;this.refs.searchInputContainer.className.indexOf(this.props.prefixCls+"-start")>-1?(this.refs.syntheticPh.style.width=Math.ceil(e)+"px",this.props.showCancelButton||(this.refs.rightBtn.style.marginRight=0)):(this.refs.syntheticPh.style.width="100%",this.props.showCancelButton||(this.refs.rightBtn.style.marginRight="-"+(this.refs.rightBtn.offsetWidth+parseInt(this.rightBtnInitMarginleft,10))+"px")),this.state.focused&&this.refs.searchInput.focus()}},{key:"componentWillReceiveProps",value:function(e){"value"in e&&this.setState({value:e.value}),"focused"in e&&this.setState({focused:e.focused})}},{key:"componentWillUnmount",value:function(){this.scrollIntoViewTimeout&&(clearTimeout(this.scrollIntoViewTimeout),this.scrollIntoViewTimeout=null)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.prefixCls,a=r.showCancelButton,l=r.disabled,u=r.placeholder,c=r.cancelText,d=r.className,f=r.style,p=this.state,h=p.value,m=p.focus,v=(0,_.default)((e={},(0,s.default)(e,""+o,!0),(0,s.default)(e,o+"-start",m||h&&h.length>0),(0,s.default)(e,d,d),e)),g=(0,_.default)((t={},(0,s.default)(t,o+"-clear",!0),(0,s.default)(t,o+"-clear-show",m&&h&&h.length>0),t)),b=(0,_.default)((n={},(0,s.default)(n,o+"-cancel",!0),(0,s.default)(n,o+"-cancel-show",a||m||h&&h.length>0),(0,s.default)(n,o+"-cancel-anim",this.firstFocus),n));return y.default.createElement("form",{onSubmit:this.onSubmit,className:v,style:f,ref:"searchInputContainer",action:"#"},y.default.createElement("div",{className:o+"-input"},y.default.createElement("div",{className:o+"-synthetic-ph",ref:"syntheticPh"},y.default.createElement("span",{className:o+"-synthetic-ph-container",ref:"syntheticPhContainer"},y.default.createElement("i",{className:o+"-synthetic-ph-icon"}),y.default.createElement("span",{className:o+"-synthetic-ph-placeholder",style:{visibility:u&&!h?"visible":"hidden"}},u))),y.default.createElement("input",(0,i.default)({type:"search",className:o+"-value",value:h,disabled:l,placeholder:u,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,ref:"searchInput"},(0,C.default)(this.props))),y.default.createElement("a",{onClick:this.onClear,className:g})),y.default.createElement("div",{className:b,onClick:this.onCancel,ref:"rightBtn"},c))}}]),t}(y.default.Component);t.default=S,S.defaultProps=b.defaultProps,e.exports=t.default},[503,343],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(7),y=r(v),g=n(17),_=r(g),b=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={selectedIndex:e.selectedIndex},n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.selectedIndex!==this.state.selectedIndex&&this.setState({selectedIndex:e.selectedIndex})}},{key:"onClick",value:function(e,t,n){var r=this.props,o=r.disabled,i=r.onChange,a=r.onValueChange;o||this.state.selectedIndex===t||(e.nativeEvent=e.nativeEvent?e.nativeEvent:{},e.nativeEvent.selectedSegmentIndex=t,e.nativeEvent.value=n,i&&i(e),a&&a(n),this.setState({selectedIndex:t}))}},{key:"renderSegmentItem",value:function(e,t,n){var r,o=this,a=this.props,s=a.prefixCls,l=a.disabled,u=a.tintColor,c=(0,y.default)((r={},(0,i.default)(r,s+"-item",!0),(0,i.default)(r,s+"-item-selected",n),r)),d={color:n?"#fff":u,backgroundColor:n?u:"#fff",borderColor:u};return m.default.createElement(_.default,{key:e,disabled:l,activeClassName:s+"-item-active"},m.default.createElement("div",{className:c,style:d,role:"tab","aria-selected":n&&!l,"aria-disabled":l,onClick:l?void 0:function(n){return o.onClick(n,e,t)}},m.default.createElement("div",{className:s+"-item-inner"}),t))}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.className,o=n.prefixCls,a=n.style,s=n.disabled,l=n.values,u=void 0===l?[]:l,c=(0,y.default)((e={},(0,i.default)(e,r,!!r),(0,i.default)(e,""+o,!0),(0,i.default)(e,o+"-disabled",s),e));return m.default.createElement("div",{className:c,style:a,role:"tablist"},u.map(function(e,n){return t.renderSegmentItem(n,e,n===t.state.selectedIndex)}))}}]),t}(m.default.Component);t.default=b,b.defaultProps={prefixCls:"am-segment",selectedIndex:0,disabled:!1,values:[],onChange:function(){},onValueChange:function(){},style:{},tintColor:""},e.exports=t.default},[503,344],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(401),m=r(h),v=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return p.default.createElement("div",{className:this.props.prefixCls+"-wrapper"},p.default.createElement(m.default,this.props))}}]),t}(p.default.Component);t.default=v,v.defaultProps={prefixCls:"am-slider"},e.exports=t.default},[506,345],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(395),x=r(b),C=n(18),S=r(C),E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},w=function(e){function t(){return(0,u.default)(this,t),(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t=this.props,r=t.className,o=t.showNumber,a=E(t,["className","showNumber"]),l=(0,_.default)((e={},(0,s.default)(e,r,!!r),(0,s.default)(e,"showNumber",!!o),e));return y.default.createElement(x.default,(0,i.default)({upHandler:y.default.createElement(S.default,{type:n(496),size:"xxs"}),downHandler:y.default.createElement(S.default,{type:n(495),size:"xxs"})},a,{ref:"inputNumber",className:l}))}}]),t}(y.default.Component);t.default=w,w.defaultProps={prefixCls:"am-stepper",step:1,readOnly:!1,showNumber:!1,focusOnUpDown:!1,useTouch:!0},e.exports=t.default},[504,346],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(407),y=r(v),g=n(18),_=r(g),b=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){"horizontal"===this.props.direction&&this.stepRefs.forEach(function(e){e.refs.tail&&(e.refs.tail.style.left=e.refs.main.offsetWidth/2+"px")})}},{key:"render",value:function(){var e=this;this.stepRefs=[];var t=this.props,n=t.children,r=t.status,o=this.props.current,a=m.default.Children.map(n,function(e){return e});return a=m.default.Children.map(a,function(t,n){var i=t.props.className;n<a.length-1&&"error"===a[n+1].props.status&&(i=i?i+" error-tail":"error-tail");var s=t.props.icon;return s||(n<o?s="check-circle-o":n>o&&(s="ellipsis",i=i?i+" ellipsis-item":"ellipsis-item"),("error"===r&&n===o||"error"===t.props.status)&&(s="cross-circle-o")),s="string"==typeof s?m.default.createElement(_.default,{type:s}):s,m.default.cloneElement(t,{icon:s,className:i,ref:function(t){return e.stepRefs[n]=t}})}),m.default.createElement(y.default,(0,i.default)({ref:"rcSteps"},this.props),a)}}]),t}(m.default.Component);t.default=b,b.Step=y.default.Step,b.defaultProps={prefixCls:"am-steps",iconPrefix:"ant",labelPlacement:"vertical",direction:"vertical",current:0},e.exports=t.default},[504,347],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(409),y=r(v),g=n(7),_=r(g),b=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.className,r=t.style,o=t.prefixCls,a=t.left,s=void 0===a?[]:a,l=t.right,u=void 0===l?[]:l,c=t.autoClose,d=t.disabled,f=t.onOpen,p=t.onClose,h=t.children,v=(0,_.default)((e={},(0,i.default)(e,""+o,1),(0,i.default)(e,n,!!n),e));return s.length||u.length?m.default.createElement("div",{style:r,className:n},m.default.createElement(y.default,{prefixCls:o,left:s,right:u,autoClose:c,disabled:d,onOpen:f,onClose:p},h)):m.default.createElement("div",{style:r,className:v},h)}}]),t}(m.default.Component);b.defaultProps={prefixCls:"am-swipe",title:"\u8bf7\u786e\u8ba4\u64cd\u4f5c",autoClose:!1,disabled:!1,left:[],right:[],onOpen:function(){},onClose:function(){}},t.default=b,e.exports=t.default},[503,349],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},x=function(e){function t(){(0,u.default)(this,t);var e=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onChange=function(t){var n=t.target.checked;e.props.onChange&&e.props.onChange(n)},e.onClick=function(t){if(e.props.onClick){var n=void 0;n=t&&t.target&&void 0!==t.target.checked?t.target.checked:e.props.checked,e.props.onClick(n)}},e}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e,t,n=this.props,r=n.prefixCls,o=n.style,a=n.name,l=n.checked,u=n.disabled,c=n.className,d=n.platform,f=b(n,["prefixCls","style","name","checked","disabled","className","platform"]),p="android"===d||"cross"===d&&"undefined"!=typeof navigator&&!!navigator.userAgent.match(/Android/i),h=(0,_.default)((e={},(0,s.default)(e,""+r,!0),(0,s.default)(e,c,c),(0,s.default)(e,r+"-android",p),e)),m=(0,_.default)((t={},(0,s.default)(t,"checkbox",!0),(0,s.default)(t,"checkbox-disabled",u),t)),v=Object.keys(f).reduce(function(e,t){return"aria-"!==t.substr(0,5)&&"data-"!==t.substr(0,5)&&"role"!==t||(e[t]=f[t]),e},{});return y.default.createElement("label",{className:h,style:o},y.default.createElement("input",(0,i.default)({type:"checkbox",name:a,className:r+"-checkbox",disabled:u,checked:l,onChange:this.onChange,value:l?"on":"off"},u?{}:{onClick:this.onClick},v)),y.default.createElement("div",(0,i.default)({className:m},u?{onClick:this.onClick}:{})))}}]),t}(y.default.Component);t.default=x,x.defaultProps={prefixCls:"am-switch",name:"",checked:!1,disabled:!1,onChange:function(){},platform:"cross",onClick:function(){}},e.exports=t.default},[503,350],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(83),m=r(h),v=function(e){function t(){(0,i.default)(this,t);var e=(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.renderIcon=function(){var t=e.props,n=t.dot,r=t.badge,o=t.selected,i=t.selectedIcon,a=t.icon,s=t.title,l=t.prefixCls,u=o?i:a,c=p.default.isValidElement(u)?u:p.default.createElement("img",{className:l+"-image",src:u.uri||u,alt:s});return r?p.default.createElement(m.default,{text:r,className:l+"-badge tab-badge"}," ",c," "):n?p.default.createElement(m.default,{dot:!0,className:l+"-badge tab-dot"},c):c},e}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.prefixCls,r=e.selected,o=e.unselectedTintColor,i=e.tintColor,a=r?i:o;return p.default.createElement("div",this.props.dataAttrs,p.default.createElement("div",{className:n+"-icon",style:{color:a}},this.renderIcon()),p.default.createElement("p",{className:n+"-title",style:{color:r?i:o}},t))}}]),t}(p.default.Component);t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Item=void 0;var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(124),m=r(h),v=n(29),y=r(v),g=n(232),_=r(g),b=n(51),x=r(b),C=n(426),S=r(C),E=n(35),w=r(E),O=t.Item=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return null}}]),t}(p.default.Component),P=function(e){function t(){(0,i.default)(this,t);var e=(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onChange=function(t){p.default.Children.forEach(e.props.children,function(e){e.key===t&&e.props.onPress&&e.props.onPress()})},e.renderTabBar=function(){var t=e.props,n=t.barTintColor,r=t.hidden,o=t.prefixCls,i=r?o+"-bar-hidden":"";return p.default.createElement(S.default,{className:i,style:{backgroundColor:n}})},e.renderTabContent=function(){return p.default.createElement(x.default,{animated:!1})},e}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this,t=void 0,n=[],r=[];p.default.Children.forEach(this.props.children,function(e){var o=!!e.key,i=r.indexOf(e.key)===-1;(0,y.default)(o&&i,"TabBar.Item must have a unique key!"),r.push(e.key),e.props.selected&&(t=e.key),n.push(e)});var o=this.props,i=o.tintColor,a=o.unselectedTintColor,s=n.map(function(t){var n=t.props,r=p.default.createElement(_.default,{prefixCls:e.props.prefixCls+"-tab",badge:n.badge,dot:n.dot,selected:n.selected,icon:n.icon,selectedIcon:n.selectedIcon,title:n.title,tintColor:i,unselectedTintColor:a,dataAttrs:(0,w.default)(n)});return p.default.createElement(h.TabPane,{placeholder:e.props.placeholder,tab:r,key:t.key},n.children)});return p.default.createElement(m.default,{renderTabBar:this.renderTabBar,renderTabContent:this.renderTabContent,tabBarPosition:"bottom",prefixCls:this.props.prefixCls,activeKey:t,onChange:this.onChange},s)}}]),t}(p.default.Component);P.defaultProps={prefixCls:"am-tab-bar",barTintColor:"white",tintColor:"#108ee9",hidden:!1,unselectedTintColor:"#888",placeholder:"\u6b63\u5728\u52a0\u8f7d"},P.Item=O,t.default=P},function(e,t,n){"use strict";n(10),n(351),n(84)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(419),y=r(v),g=n(29),_=r(g),b=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){(0,_.default)(!1,"Table is going to be deprecated at [email protected]. see https://goo.gl/xb0YEX");var e=this.props,t=e.prefixCls,n=e.columns,r=e.dataSource,o=e.direction,a=e.scrollX,s=e.titleFixed,l=(0,i.default)({},this.props,{data:r}),u=void 0;return o&&"vertical"!==o?"horizon"===o?(n[0].className=t+"-horizonTitle",u=m.default.createElement(y.default,(0,i.default)({},l,{columns:n,showHeader:!1,scroll:{x:a}}))):"mix"===o&&(n[0].className=t+"-horizonTitle",u=m.default.createElement(y.default,(0,i.default)({},l,{columns:n,scroll:{x:a}}))):u=s?m.default.createElement(y.default,(0,i.default)({},l,{columns:n,scroll:{x:!0},showHeader:!1})):m.default.createElement(y.default,(0,i.default)({},l,{columns:n,scroll:{x:a}})),u}}]),t}(m.default.Component);t.default=b,b.defaultProps={dataSource:[],prefixCls:"am-table"},e.exports=t.default},[503,352],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(124),y=r(v),g=n(425),_=r(g),b=n(51),x=r(b),C=n(421),S=r(C),E=n(423),w=r(E),O=function(e){function t(){(0,s.default)(this,t);var e=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.renderTabBar=function(){var t=e.props,n=t.children,r=t.animated,o=t.speed,i=t.pageSize,a=t.tabBarhammerOptions,s=t.onTabClick;return n.length>i?m.default.createElement(w.default,{onTabClick:s,speed:o,pageSize:i,hammerOptions:a}):m.default.createElement(S.default,{inkBarAnimated:r,onTabClick:s})},e.renderTabContent=function(){var t=e.props,n=t.animated,r=t.swipeable,o=t.hammerOptions;return r?m.default.createElement(_.default,{animated:n,hammerOptions:o}):m.default.createElement(x.default,{animated:n})},e}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){return m.default.createElement(y.default,(0,i.default)({renderTabBar:this.renderTabBar,renderTabContent:this.renderTabContent},this.props))}}]),t}(m.default.Component);t.default=O,O.TabPane=v.TabPane,O.defaultProps={prefixCls:"am-tabs",animated:!0,swipeable:!0,tabBarPosition:"top",hammerOptions:{},tabBarhammerOptions:{},pageSize:5,speed:10,onChange:function(){},onTabClick:function(){}},e.exports=t.default},[503,353],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(7),_=r(g),b=n(18),x=r(b),C=n(35),S=r(C),E=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClick=function(){var e=n.props,t=e.disabled,r=e.onChange;if(!t){var o=n.state.selected;n.setState({selected:!o},function(){r&&r(!o)})}},n.onTagClose=function(){n.props.onClose&&n.props.onClose(),n.setState({closed:!0},n.props.afterClose)},n.state={selected:e.selected,closed:!1},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.props.selected!==e.selected&&this.setState({selected:e.selected})}},{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.className,o=t.prefixCls,a=t.disabled,l=t.closable,u=t.small,c=t.style,d=(0,_.default)((e={},(0,s.default)(e,r,!!r),(0,s.default)(e,""+o,!0),(0,s.default)(e,o+"-normal",!a&&(!this.state.selected||u||l)),(0,s.default)(e,o+"-small",u),(0,s.default)(e,o+"-active",this.state.selected&&!a&&!u&&!l),(0,s.default)(e,o+"-disabled",a),(0,s.default)(e,o+"-closable",l),e)),f=!l||a||u?null:y.default.createElement("div",{className:o+"-close",role:"button",onClick:this.onTagClose,"aria-label":"remove tag"},y.default.createElement(x.default,{type:"cross-circle",size:"xs","aria-hidden":"true"}));return this.state.closed?null:y.default.createElement("div",(0,i.default)({},(0,S.default)(this.props),{className:d,onClick:this.onClick,style:c}),y.default.createElement("div",{className:o+"-text"},n),f)}}]),t}(y.default.Component);t.default=E,E.defaultProps={prefixCls:"am-tag",disabled:!1,selected:!1,closable:!1,small:!1,onChange:function(){},onClose:function(){},afterClose:function(){}},e.exports=t.default},[504,354],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(94),m=r(h),v=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return p.default.createElement(m.default,this.props)}}]),t}(p.default.Component);t.default=v,v.defaultProps={Component:"span"},e.exports=t.default},function(e,t){"use strict"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(e){return"undefined"==typeof e||null===e?"":e}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(w,"_").length}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),l=r(s),u=n(8),c=r(u),d=n(2),f=r(d),p=n(5),h=r(p),m=n(4),v=r(m),y=n(3),g=r(y),_=n(1),b=r(_),x=n(7),C=r(x),S=n(16),E=r(S),w=/[\uD800-\uDBFF][\uDC00-\uDFFF]|\n/g,O=function(e){function t(e){(0,f.default)(this,t);var n=(0,v.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){var t=e.target.value,r=n.props.onChange;r&&r(t),n.componentDidUpdate()},n.onBlur=function(e){n.debounceTimeout=setTimeout(function(){n.setState({focus:!1})},100),"focused"in n.props||n.setState({focused:!1});var t=e.target.value;n.props.onBlur&&n.props.onBlur(t)},n.onFocus=function(e){n.debounceTimeout&&(clearTimeout(n.debounceTimeout),n.debounceTimeout=null),"focused"in n.props||n.setState({focused:!0}),n.setState({focus:!0});var t=e.target.value;n.props.onFocus&&n.props.onFocus(t),"textarea"===document.activeElement.tagName.toLowerCase()&&(n.scrollIntoViewTimeout=setTimeout(function(){try{document.activeElement.scrollIntoViewIfNeeded()}catch(e){}},100))},n.onErrorClick=function(){n.props.onErrorClick&&n.props.onErrorClick()},n.clearInput=function(){n.props.onChange&&n.props.onChange("")},n.state={focus:!1,focused:e.focused||!1},n}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){this.componentDidUpdate(),(this.props.autoFocus||this.state.focused)&&navigator.userAgent.indexOf("AlipayClient")>0&&this.refs.textarea.focus()}},{key:"componentDidUpdate",value:function(){if(this.props.autoHeight){var e=this.refs.textarea;e.style.height="",e.style.height=e.scrollHeight+"px"}this.state.focused&&this.refs.textarea.focus()}},{key:"componentWillReceiveProps",value:function(e){"focused"in e&&this.setState({focused:e.focused})}},{key:"componentWillUnmount",value:function(){this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null),this.scrollIntoViewTimeout&&(clearTimeout(this.scrollIntoViewTimeout),this.scrollIntoViewTimeout=null)}},{key:"render",value:function(){var e,t,n=this.props,r=n.prefixCls,o=n.prefixListCls,s=n.style,u=n.title,d=n.value,f=n.defaultValue,p=n.clear,h=n.editable,m=n.disabled,v=n.error,y=n.className,g=n.labelNumber,_=n.autoHeight,x=this.props.count,S=this.props.rows,w=(0,E.default)(this.props,["prefixCls","prefixListCls","editable","style","clear","children","error","className","count","labelNumber","title","onErrorClick","autoHeight","autoFocus","focused","placeholderTextColor"]),O=void 0;O="value"in this.props?{value:i(d)}:{defaultValue:f};var P=this.state.focus,k=(0,C.default)((e={},(0,c.default)(e,o+"-item",!0),(0,c.default)(e,r+"-item",!0),(0,c.default)(e,r+"-disabled",m),(0,c.default)(e,r+"-item-single-line",1===S&&!_),(0,c.default)(e,r+"-error",v),(0,c.default)(e,r+"-focus",P),(0,c.default)(e,y,y),e)),T=(0,C.default)((t={},(0,c.default)(t,r+"-label",!0),(0,c.default)(t,r+"-label-2",2===g),(0,c.default)(t,r+"-label-3",3===g),(0,c.default)(t,r+"-label-4",4===g),(0,c.default)(t,r+"-label-5",5===g),(0,c.default)(t,r+"-label-6",6===g),(0,c.default)(t,r+"-label-7",7===g),t)),M=a(d),N={};return x>0&&(N.maxLength=x-M+(d?d.length:0)),b.default.createElement("div",{className:k,style:s},u&&b.default.createElement("div",{className:T},u),b.default.createElement("div",{className:r+"-control"},b.default.createElement("textarea",(0,l.default)({ref:"textarea"},N,w,O,{onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,readOnly:!h}))),p&&h&&d&&M>0&&b.default.createElement("div",{className:r+"-clear",onClick:this.clearInput,onTouchStart:this.clearInput}),v&&b.default.createElement("div",{className:r+"-error-extra",onClick:this.onErrorClick}),x>0&&S>1&&b.default.createElement("span",{className:r+"-count"},b.default.createElement("span",null,d?M:0),"/",x))}}]),t}(b.default.Component);t.default=O,O.defaultProps={prefixCls:"am-textarea",prefixListCls:"am-list",autoHeight:!1,editable:!0,disabled:!1,placeholder:"",clear:!1,rows:1,onChange:o,onBlur:o,onFocus:o,onErrorClick:o,error:!1,labelNumber:5},e.exports=t.default},[505,355],242,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(7),y=r(v),g=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.size,o=t.className,a=t.style,s=t.onClick,l=(0,y.default)((e={},(0,i.default)(e,""+n,!0), (0,i.default)(e,n+"-"+r,!0),(0,i.default)(e,o,!!o),e));return m.default.createElement("div",{className:l,style:a,onClick:s})}}]),t}(m.default.Component);t.default=g,g.defaultProps={prefixCls:"am-whitespace",size:"md"},e.exports=t.default},[503,357],function(e,t,n){e.exports={default:n(257),__esModule:!0}},function(e,t,n){e.exports={default:n(258),__esModule:!0}},function(e,t,n){e.exports={default:n(259),__esModule:!0}},function(e,t,n){e.exports={default:n(261),__esModule:!0}},function(e,t,n){e.exports={default:n(262),__esModule:!0}},function(e,t,n){e.exports={default:n(263),__esModule:!0}},function(e,t,n){e.exports={default:n(264),__esModule:!0}},function(e,t,n){e.exports={default:n(265),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(252),i=r(o),a=n(251),s=r(a);t.default=function e(t,n,r){null===t&&(t=Function.prototype);var o=(0,s.default)(t,n);if(void 0===o){var a=(0,i.default)(t);return null===a?void 0:e(a,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)}},function(e,t,n){n(110),n(288),e.exports=n(15).Array.from},function(e,t,n){n(290),e.exports=n(15).Object.assign},function(e,t,n){n(291);var r=n(15).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){n(292);var r=n(15).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){n(293);var r=n(15).Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},function(e,t,n){n(294),e.exports=n(15).Object.getPrototypeOf},function(e,t,n){n(295),e.exports=n(15).Object.setPrototypeOf},function(e,t,n){n(297),n(296),n(298),n(299),e.exports=n(15).Symbol},function(e,t,n){n(110),n(300),e.exports=n(73).f("iterator")},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(24),o=n(109),i=n(286);e.exports=function(e){return function(t,n,a){var s,l=r(t),u=o(l.length),c=i(a,u);if(e&&n!=n){for(;u>c;)if(s=l[c++],s!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(59),o=n(20)("toStringTag"),i="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),o))?n:i?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){"use strict";var r=n(23),o=n(41);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(40),o=n(66),i=n(46);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),l=i.f,u=0;s.length>u;)l.call(e,a=s[u++])&&t.push(a);return t}},function(e,t,n){var r=n(22).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(39),o=n(20)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(59);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(32);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){"use strict";var r=n(64),o=n(41),i=n(67),a={};n(34)(a,n(20)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(20)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(40),o=n(24);e.exports=function(e,t){for(var n,i=o(e),a=r(i),s=a.length,l=0;s>l;)if(i[n=a[l++]]===t)return n}},function(e,t,n){var r=n(48)("meta"),o=n(38),i=n(27),a=n(23).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(33)(function(){return l(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},d=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!i(e,r)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[r].w},p=function(e){return u&&h.NEED&&l(e)&&!i(e,r)&&c(e),e},h=e.exports={KEY:r,NEED:!1,fastKey:d,getWeak:f,onFreeze:p}},function(e,t,n){"use strict";var r=n(40),o=n(66),i=n(46),a=n(47),s=n(102),l=Object.assign;e.exports=!l||n(33)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r})?function(e,t){for(var n=a(e),l=arguments.length,u=1,c=o.f,d=i.f;l>u;)for(var f,p=s(arguments[u++]),h=c?r(p).concat(c(p)):r(p),m=h.length,v=0;m>v;)d.call(p,f=h[v++])&&(n[f]=p[f]);return n}:l},function(e,t,n){var r=n(23),o=n(32),i=n(40);e.exports=n(26)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,l=0;s>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(24),o=n(104).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return o(e)}catch(e){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?s(e):o(r(e))}},function(e,t,n){var r=n(38),o=n(32),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n(60)(Function.call,n(65).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){var r=n(70),o=n(61);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),l=r(n),u=s.length;return l<0||l>=u?e?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):(i-55296<<10)+(a-56320)+65536)}}},function(e,t,n){var r=n(70),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(269),o=n(20)("iterator"),i=n(39);e.exports=n(15).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){"use strict";var r=n(60),o=n(21),i=n(47),a=n(275),s=n(273),l=n(109),u=n(270),c=n(287);o(o.S+o.F*!n(277)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,d,f=i(e),p="function"==typeof this?this:Array,h=arguments.length,m=h>1?arguments[1]:void 0,v=void 0!==m,y=0,g=c(f);if(v&&(m=r(m,h>2?arguments[2]:void 0,2)),void 0==g||p==Array&&s(g))for(t=l(f.length),n=new p(t);t>y;y++)u(n,y,v?m(f[y],y):f[y]);else for(d=g.call(f),n=new p;!(o=d.next()).done;y++)u(n,y,v?a(d,m,[o.value,y],!0):o.value);return n.length=y,n}})},function(e,t,n){"use strict";var r=n(267),o=n(278),i=n(39),a=n(24);e.exports=n(103)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,n):"values"==t?o(0,e[n]):o(0,[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(21);r(r.S+r.F,"Object",{assign:n(281)})},function(e,t,n){var r=n(21);r(r.S,"Object",{create:n(64)})},function(e,t,n){var r=n(21);r(r.S+r.F*!n(26),"Object",{defineProperty:n(23).f})},function(e,t,n){var r=n(24),o=n(65).f;n(107)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){var r=n(47),o=n(105);n(107)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(21);r(r.S,"Object",{setPrototypeOf:n(284).set})},function(e,t){},function(e,t,n){"use strict";var r=n(22),o=n(27),i=n(26),a=n(21),s=n(108),l=n(280).KEY,u=n(33),c=n(69),d=n(67),f=n(48),p=n(20),h=n(73),m=n(72),v=n(279),y=n(271),g=n(274),_=n(32),b=n(24),x=n(71),C=n(41),S=n(64),E=n(283),w=n(65),O=n(23),P=n(40),k=w.f,T=O.f,M=E.f,N=r.Symbol,R=r.JSON,D=R&&R.stringify,j="prototype",I=p("_hidden"),A=p("toPrimitive"),L={}.propertyIsEnumerable,V=c("symbol-registry"),W=c("symbols"),H=c("op-symbols"),B=Object[j],Y="function"==typeof N,F=r.QObject,z=!F||!F[j]||!F[j].findChild,U=i&&u(function(){return 7!=S(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=k(B,t);r&&delete B[t],T(e,t,n),r&&e!==B&&T(B,t,r)}:T,K=function(e){var t=W[e]=S(N[j]);return t._k=e,t},X=Y&&"symbol"==typeof N.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof N},G=function(e,t,n){return e===B&&G(H,t,n),_(e),t=x(t,!0),_(n),o(W,t)?(n.enumerable?(o(e,I)&&e[I][t]&&(e[I][t]=!1),n=S(n,{enumerable:C(0,!1)})):(o(e,I)||T(e,I,C(1,{})),e[I][t]=!0),U(e,t,n)):T(e,t,n)},q=function(e,t){_(e);for(var n,r=y(t=b(t)),o=0,i=r.length;i>o;)G(e,n=r[o++],t[n]);return e},Z=function(e,t){return void 0===t?S(e):q(S(e),t)},$=function(e){var t=L.call(this,e=x(e,!0));return!(this===B&&o(W,e)&&!o(H,e))&&(!(t||!o(this,e)||!o(W,e)||o(this,I)&&this[I][e])||t)},Q=function(e,t){if(e=b(e),t=x(t,!0),e!==B||!o(W,t)||o(H,t)){var n=k(e,t);return!n||!o(W,t)||o(e,I)&&e[I][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=M(b(e)),r=[],i=0;n.length>i;)o(W,t=n[i++])||t==I||t==l||r.push(t);return r},ee=function(e){for(var t,n=e===B,r=M(n?H:b(e)),i=[],a=0;r.length>a;)!o(W,t=r[a++])||n&&!o(B,t)||i.push(W[t]);return i};Y||(N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(H,n),o(this,I)&&o(this[I],e)&&(this[I][e]=!1),U(this,e,C(1,n))};return i&&z&&U(B,e,{configurable:!0,set:t}),K(e)},s(N[j],"toString",function(){return this._k}),w.f=Q,O.f=G,n(104).f=E.f=J,n(46).f=$,n(66).f=ee,i&&!n(63)&&s(B,"propertyIsEnumerable",$,!0),h.f=function(e){return K(p(e))}),a(a.G+a.W+a.F*!Y,{Symbol:N});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)p(te[ne++]);for(var re=P(p.store),oe=0;re.length>oe;)m(re[oe++]);a(a.S+a.F*!Y,"Symbol",{for:function(e){return o(V,e+="")?V[e]:V[e]=N(e)},keyFor:function(e){if(X(e))return v(V,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){z=!0},useSimple:function(){z=!1}}),a(a.S+a.F*!Y,"Object",{create:Z,defineProperty:G,defineProperties:q,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:ee}),R&&a(a.S+a.F*(!Y||u(function(){var e=N();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!X(e)){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);return t=r[1],"function"==typeof t&&(n=t),!n&&g(t)||(t=function(e,t){if(n&&(t=n.call(this,e,t)),!X(t))return t}),r[1]=t,D.apply(R,r)}}}),N[j][A]||n(34)(N[j],A,N[j].valueOf),d(N,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},function(e,t,n){n(72)("asyncIterator")},function(e,t,n){n(72)("observable")},function(e,t,n){n(289);for(var r=n(22),o=n(34),i=n(39),a=n(20)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],c=r[u],d=c&&c.prototype;d&&!d[a]&&o(d,a,u),i[u]=i.Array}},function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=g.hasOwnProperty(t)?g[t]:null;C.hasOwnProperty(t)&&l("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&l("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function i(e,n){if(n){l("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),l(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&_.mixins(e,n.mixins);for(var a in n)if(n.hasOwnProperty(a)&&a!==u){var s=n[a],c=r.hasOwnProperty(a);if(o(c,a),_.hasOwnProperty(a))_[a](e,s);else{var d=g.hasOwnProperty(a),h="function"==typeof s,m=h&&!d&&!c&&n.autobind!==!1;if(m)i.push(a,s),r[a]=s;else if(c){var v=g[a];l(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=f(r[a],s):"DEFINE_MANY"===v&&(r[a]=p(r[a],s))}else r[a]=s}}}else;}function c(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in _;l(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;l(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function d(e,t){l(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(l(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function f(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return d(o,n),d(o,r),o}}function p(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function h(e,t){var n=t.bind(e);return n}function m(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=h(e,o)}}function v(e){var t=r(function(e,r,o){this.__reactAutoBindPairs.length&&m(this),this.props=e,this.context=r,this.refs=s,this.updater=o||n,this.state=null;var i=this.getInitialState?this.getInitialState():null;l("object"==typeof i&&!Array.isArray(i),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=i});t.prototype=new S,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],y.forEach(i.bind(null,t)),i(t,b),i(t,e),i(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),l(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in g)t.prototype[o]||(t.prototype[o]=null);return t}var y=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)i(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=a({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=a({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=f(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=a({},e.propTypes,t)},statics:function(e,t){c(e,t)},autobind:function(){}},b={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},C={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},S=function(){};return a(S.prototype,e.prototype,C),v}var i,a=n(28),s=n(360),l=n(49),u="mixins";i={},e.exports=o},function(e,t){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete i.animationend.animation,"TransitionEvent"in window||delete i.transitionend.transition;for(var n in i)if(i.hasOwnProperty(n)){var r=i[n];for(var o in r)if(o in t){a.push(r[o]);break}}}function r(e,t,n){e.addEventListener(t,n,!1)}function o(e,t,n){e.removeEventListener(t,n,!1)}Object.defineProperty(t,"__esModule",{value:!0});var i={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},a=[];"undefined"!=typeof window&&"undefined"!=typeof document&&n();var s={addEndEventListener:function(e,t){return 0===a.length?void window.setTimeout(t,0):void a.forEach(function(n){r(e,n,t)})},endEvents:a,removeEndEventListener:function(e,t){0!==a.length&&a.forEach(function(n){o(e,n,t)})}};t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r){var o=a.default.clone(e),i={width:t.width,height:t.height};return r.adjustX&&o.left<n.left&&(o.left=n.left),r.resizeWidth&&o.left>=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top<n.top&&(o.top=n.top),r.resizeHeight&&o.top>=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),a.default.mix(o,i)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(42),a=r(i);t.default=o,e.exports=t.default},function(e,t){"use strict";function n(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,s=e.top;return"c"===n?s+=i/2:"b"===n&&(s+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:s}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r,o){var i=(0,a.default)(t,n[1]),s=(0,a.default)(e,n[0]),l=[s.left-i.left,s.top-i.top];return{left:e.left-l[0]+r[0]-o[0],top:e.top-l[1]+r[1]-o[1]}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(304),a=r(i);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=void 0,n=void 0,r=void 0;if(a.default.isWindow(e)||9===e.nodeType){var o=a.default.getWindow(e);t={left:a.default.getWindowScrollLeft(o),top:a.default.getWindowScrollTop(o)},n=a.default.viewportWidth(o),r=a.default.viewportHeight(o)}else t=a.default.offset(e),n=a.default.outerWidth(e),r=a.default.outerHeight(e);return t.width=n,t.height=r,t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(42),a=r(i);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){for(var t={left:0,right:1/0,top:0,bottom:1/0},n=(0,l.default)(e),r=a.default.getDocument(e),o=r.defaultView||r.parentWindow,i=r.body,s=r.documentElement;n;){if(navigator.userAgent.indexOf("MSIE")!==-1&&0===n.clientWidth||n===i||n===s||"visible"===a.default.css(n,"overflow")){if(n===i||n===s)break}else{var u=a.default.offset(n);u.left+=n.clientLeft,u.top+=n.clientTop,t.top=Math.max(t.top,u.top),t.right=Math.min(t.right,u.left+n.clientWidth),t.bottom=Math.min(t.bottom,u.top+n.clientHeight),t.left=Math.max(t.left,u.left)}n=(0,l.default)(n)}var c=a.default.getWindowScrollLeft(o),d=a.default.viewportWidth(o),f=Math.max(s.scrollWidth,c+d);t.right=Math.min(t.right,f);var p=a.default.getWindowScrollTop(o),h=a.default.viewportHeight(o),m=Math.max(s.scrollHeight,p+h);return t.bottom=Math.min(t.bottom,m),t.top>=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}Object.defineProperty(t,"__esModule",{value:!0});var i=n(42),a=r(i),s=n(112),l=r(s);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return e.left<n.left||e.left+t.width>n.right}function i(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function a(e,t,n){return e.left>n.right||e.left+t.width<n.left}function s(e,t,n){return e.top>n.bottom||e.top+t.height<n.top}function l(e){var t=(0,_.default)(e),n=(0,S.default)(e);return!t||n.left+n.width<=t.left||n.top+n.height<=t.top||n.left>=t.right||n.top>=t.bottom}function u(e,t,n){var r=[];return m.default.each(e,function(e){r.push(e.replace(t,function(e){return n[e]}))}),r}function c(e,t){return e[t]=-e[t],e}function d(e,t){var n=void 0;return n=/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10),n||0}function f(e,t){e[0]=d(e[0],t.width),e[1]=d(e[1],t.height)}function p(e,t,n){var r=n.points,d=n.offset||[0,0],p=n.targetOffset||[0,0],h=n.overflow,v=n.target||t,y=n.source||e;d=[].concat(d),p=[].concat(p),h=h||{};var g={},b=0,C=(0,_.default)(y),E=(0,S.default)(y),O=(0,S.default)(v);f(d,E),f(p,O);var P=(0,w.default)(E,O,r,d,p),k=m.default.merge(E,P),T=!l(v);if(C&&(h.adjustX||h.adjustY)&&T){if(h.adjustX&&o(P,E,C)){var M=u(r,/[lr]/gi,{l:"r",r:"l"}),N=c(d,0),R=c(p,0),D=(0,w.default)(E,O,M,N,R);a(D,E,C)||(b=1,r=M,d=N,p=R)}if(h.adjustY&&i(P,E,C)){var j=u(r,/[tb]/gi,{t:"b",b:"t"}),I=c(d,1),A=c(p,1),L=(0,w.default)(E,O,j,I,A);s(L,E,C)||(b=1,r=j,d=I,p=A)}b&&(P=(0,w.default)(E,O,r,d,p),m.default.mix(k,P)),g.adjustX=h.adjustX&&o(P,E,C),g.adjustY=h.adjustY&&i(P,E,C),(g.adjustX||g.adjustY)&&(k=(0,x.default)(P,E,C,g))}return k.width!==E.width&&m.default.css(y,"width",m.default.width(y)+k.width-E.width),k.height!==E.height&&m.default.css(y,"height",m.default.height(y)+k.height-E.height),m.default.offset(y,{left:k.left,top:k.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform}),{points:r,offset:d,targetOffset:p,overflow:g}}Object.defineProperty(t,"__esModule",{value:!0});var h=n(42),m=r(h),v=n(112),y=r(v),g=n(307),_=r(g),b=n(303),x=r(b),C=n(306),S=r(C),E=n(305),w=r(E);p.__getOffsetParent=y.default,p.__getVisibleRectForElement=_.default,t.default=p,e.exports=t.default},function(e,t){"use strict";function n(){if(void 0!==c)return c;c="";var e=document.createElement("p").style,t="Transform";for(var n in d)n+t in e&&(c=n);return c}function r(){return n()?n()+"TransitionProperty":"transitionProperty"}function o(){return n()?n()+"Transform":"transform"}function i(e,t){var n=r();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function a(e,t){var n=o();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}function s(e){return e.style.transitionProperty||e.style[r()]}function l(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(o());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}function u(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue(o());if(r&&"none"!==r){var i=void 0,s=r.match(f);if(s)s=s[1],i=s.split(",").map(function(e){return parseFloat(e,10)}),i[4]=t.x,i[5]=t.y,a(e,"matrix("+i.join(",")+")");else{var l=r.match(p)[1];i=l.split(",").map(function(e){return parseFloat(e,10)}),i[12]=t.x,i[13]=t.y,a(e,"matrix3d("+i.join(",")+")")}}else a(e,"translateX("+t.x+"px) translateY("+t.y+"px) translateZ(0)")}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransformName=o,t.setTransitionProperty=i,t.getTransitionProperty=s,t.getTransformXY=l,t.setTransformXY=u;var c=void 0,d={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"},f=/matrix\((.*)\)/,p=/matrix3d\((.*)\)/},function(e,t,n){var r;/*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. All rights reserved. */ !function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};r=function(){return i}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}()},function(e,t){},311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return 0===e.length;if("object"==typeof e){if(e){o(e)&&void 0!==e.size?i(!1):void 0;for(var t in e)return!1}return!0}return!e}function o(e){return"undefined"!=typeof Symbol&&e[Symbol.iterator]}var i=n(49);e.exports=r},function(e,t){/*! * for-in <https://github.com/jonschlinkert/for-in> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ "use strict";e.exports=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e)===!1)break}},function(e,t,n){/*! * for-own <https://github.com/jonschlinkert/for-own> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ "use strict";var r=n(362),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){r(e,function(r,i){if(o.call(e,i))return t.call(n,e[i],i,e)})}},function(e,t,n){var r;/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ !function(o,i,a,s){"use strict";function l(e,t,n){return setTimeout(p(e,n),t)}function u(e,t,n){return!!Array.isArray(e)&&(c(e,n[t],n),!0)}function c(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function d(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=o.console&&(o.console.warn||o.console.log);return i&&i.call(o.console,r,n),e.apply(this,arguments)}}function f(e,t,n){var r,o=t.prototype;r=e.prototype=Object.create(o),r.constructor=e,r._super=o,n&&me(r,n)}function p(e,t){return function(){return e.apply(t,arguments)}}function h(e,t){return typeof e==ge?e.apply(t?t[0]||s:s,t):e}function m(e,t){return e===s?t:e}function v(e,t,n){c(b(t),function(t){e.addEventListener(t,n,!1)})}function y(e,t,n){c(b(t),function(t){e.removeEventListener(t,n,!1)})}function g(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function _(e,t){return e.indexOf(t)>-1}function b(e){return e.trim().split(/\s+/g)}function x(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function S(e,t,n){for(var r=[],o=[],i=0;i<e.length;){var a=t?e[i][t]:e[i];x(o,a)<0&&r.push(e[i]),o[i]=a,i++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),i=0;i<ve.length;){if(n=ve[i],r=n?n+o:t,r in e)return r;i++}return s}function w(){return Ee++}function O(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||o}function P(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){h(e.options.enable,[e])&&n.handler(t)},this.init()}function k(e){var t,n=e.options.inputClass;return new(t=n?n:Pe?Y:ke?U:Oe?X:B)(e,T)}function T(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,i=t&je&&r-o===0,a=t&(Ae|Le)&&r-o===0;n.isFirst=!!i,n.isFinal=!!a,i&&(e.session={}),n.eventType=t,M(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function M(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=D(t)),o>1&&!n.firstMultiple?n.firstMultiple=D(t):1===o&&(n.firstMultiple=!1);var i=n.firstInput,a=n.firstMultiple,s=a?a.center:i.center,l=t.center=j(r);t.timeStamp=xe(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=V(s,l),t.distance=L(s,l),N(n,t),t.offsetDirection=A(t.deltaX,t.deltaY);var u=I(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=be(u.x)>be(u.y)?u.x:u.y,t.scale=a?H(a.pointers,r):1,t.rotation=a?W(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,R(n,t);var c=e.element;g(t.srcEvent.target,c)&&(c=t.srcEvent.target),t.target=c}function N(e,t){var n=t.center,r=e.offsetDelta||{},o=e.prevDelta||{},i=e.prevInput||{};t.eventType!==je&&i.eventType!==Ae||(o=e.prevDelta={x:i.deltaX||0,y:i.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=o.x+(n.x-r.x),t.deltaY=o.y+(n.y-r.y)}function R(e,t){var n,r,o,i,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=Le&&(l>De||a.velocity===s)){var u=t.deltaX-a.deltaX,c=t.deltaY-a.deltaY,d=I(l,u,c);r=d.x,o=d.y,n=be(d.x)>be(d.y)?d.x:d.y,i=A(u,c),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,i=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=i}function D(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:_e(e.pointers[n].clientX),clientY:_e(e.pointers[n].clientY)},n++;return{timeStamp:xe(),pointers:t,center:j(t),deltaX:e.deltaX,deltaY:e.deltaY}}function j(e){var t=e.length;if(1===t)return{x:_e(e[0].clientX),y:_e(e[0].clientY)};for(var n=0,r=0,o=0;o<t;)n+=e[o].clientX,r+=e[o].clientY,o++;return{x:_e(n/t),y:_e(r/t)}}function I(e,t,n){return{x:t/e||0,y:n/e||0}}function A(e,t){return e===t?Ve:be(e)>=be(t)?e<0?We:He:t<0?Be:Ye}function L(e,t,n){n||(n=Ke);var r=t[n[0]]-e[n[0]],o=t[n[1]]-e[n[1]];return Math.sqrt(r*r+o*o)}function V(e,t,n){n||(n=Ke);var r=t[n[0]]-e[n[0]],o=t[n[1]]-e[n[1]];return 180*Math.atan2(o,r)/Math.PI}function W(e,t){return V(t[1],t[0],Xe)+V(e[1],e[0],Xe)}function H(e,t){return L(t[0],t[1],Xe)/L(e[0],e[1],Xe)}function B(){this.evEl=qe,this.evWin=Ze,this.pressed=!1,P.apply(this,arguments)}function Y(){this.evEl=Je,this.evWin=et,P.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function F(){this.evTarget=nt,this.evWin=rt,this.started=!1,P.apply(this,arguments)}function z(e,t){var n=C(e.touches),r=C(e.changedTouches);return t&(Ae|Le)&&(n=S(n.concat(r),"identifier",!0)),[n,r]}function U(){this.evTarget=it,this.targetIds={},P.apply(this,arguments)}function K(e,t){var n=C(e.touches),r=this.targetIds;if(t&(je|Ie)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var o,i,a=C(e.changedTouches),s=[],l=this.target;if(i=n.filter(function(e){return g(e.target,l)}),t===je)for(o=0;o<i.length;)r[i[o].identifier]=!0,o++;for(o=0;o<a.length;)r[a[o].identifier]&&s.push(a[o]),t&(Ae|Le)&&delete r[a[o].identifier],o++;return s.length?[S(i.concat(s),"identifier",!0),s]:void 0}function X(){P.apply(this,arguments);var e=p(this.handler,this);this.touch=new U(this.manager,e),this.mouse=new B(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function G(e,t){e&je?(this.primaryTouch=t.changedPointers[0].identifier,q.call(this,t)):e&(Ae|Le)&&q.call(this,t)}function q(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches,o=function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)};setTimeout(o,at)}}function Z(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var o=this.lastTouches[r],i=Math.abs(t-o.x),a=Math.abs(n-o.y);if(i<=st&&a<=st)return!0}return!1}function $(e,t){this.manager=e,this.set(t)}function Q(e){if(_(e,pt))return pt;var t=_(e,ht),n=_(e,mt);return t&&n?pt:t||n?t?ht:mt:_(e,ft)?ft:dt}function J(){if(!ut)return!1;var e={},t=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){e[n]=!t||o.CSS.supports("touch-action",n)}),e}function ee(e){this.options=me({},this.defaults,e||{}),this.id=w(),this.manager=null,this.options.enable=m(this.options.enable,!0),this.state=yt,this.simultaneous={},this.requireFail=[]}function te(e){return e&Ct?"cancel":e&bt?"end":e&_t?"move":e&gt?"start":""}function ne(e){return e==Ye?"down":e==Be?"up":e==We?"left":e==He?"right":""}function re(e,t){var n=t.manager;return n?n.get(e):e}function oe(){ee.apply(this,arguments)}function ie(){oe.apply(this,arguments),this.pX=null,this.pY=null}function ae(){oe.apply(this,arguments)}function se(){ee.apply(this,arguments),this._timer=null,this._input=null}function le(){oe.apply(this,arguments)}function ue(){oe.apply(this,arguments)}function ce(){ee.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function de(e,t){return t=t||{},t.recognizers=m(t.recognizers,de.defaults.preset),new fe(e,t)}function fe(e,t){this.options=me({},de.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=k(this),this.touchAction=new $(this,this.options.touchAction),pe(this,!0),c(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function pe(e,t){var n=e.element;if(n.style){var r;c(e.options.cssProps,function(o,i){r=E(n.style,i),t?(e.oldCssProps[r]=n.style[r],n.style[r]=o):n.style[r]=e.oldCssProps[r]||""}),t||(e.oldCssProps={})}}function he(e,t){var n=i.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var me,ve=["","webkit","Moz","MS","ms","o"],ye=i.createElement("div"),ge="function",_e=Math.round,be=Math.abs,xe=Date.now;me="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var Ce=d(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===s)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),Se=d(function(e,t){return Ce(e,t,!0)},"merge","Use `assign`."),Ee=1,we=/mobile|tablet|ip(ad|hone|od)|android/i,Oe="ontouchstart"in o,Pe=E(o,"PointerEvent")!==s,ke=Oe&&we.test(navigator.userAgent),Te="touch",Me="pen",Ne="mouse",Re="kinect",De=25,je=1,Ie=2,Ae=4,Le=8,Ve=1,We=2,He=4,Be=8,Ye=16,Fe=We|He,ze=Be|Ye,Ue=Fe|ze,Ke=["x","y"],Xe=["clientX","clientY"];P.prototype={handler:function(){},init:function(){this.evEl&&v(this.element,this.evEl,this.domHandler),this.evTarget&&v(this.target,this.evTarget,this.domHandler),this.evWin&&v(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(O(this.element),this.evWin,this.domHandler)}};var Ge={mousedown:je,mousemove:Ie,mouseup:Ae},qe="mousedown",Ze="mousemove mouseup";f(B,P,{handler:function(e){var t=Ge[e.type];t&je&&0===e.button&&(this.pressed=!0),t&Ie&&1!==e.which&&(t=Ae),this.pressed&&(t&Ae&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Ne,srcEvent:e}))}});var $e={pointerdown:je,pointermove:Ie,pointerup:Ae,pointercancel:Le,pointerout:Le},Qe={2:Te,3:Me,4:Ne,5:Re},Je="pointerdown",et="pointermove pointerup pointercancel";o.MSPointerEvent&&!o.PointerEvent&&(Je="MSPointerDown",et="MSPointerMove MSPointerUp MSPointerCancel"),f(Y,P,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),o=$e[r],i=Qe[e.pointerType]||e.pointerType,a=i==Te,s=x(t,e.pointerId,"pointerId");o&je&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):o&(Ae|Le)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(s,1))}});var tt={touchstart:je,touchmove:Ie,touchend:Ae,touchcancel:Le},nt="touchstart",rt="touchstart touchmove touchend touchcancel";f(F,P,{handler:function(e){var t=tt[e.type];if(t===je&&(this.started=!0),this.started){var n=z.call(this,e,t);t&(Ae|Le)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Te,srcEvent:e})}}});var ot={touchstart:je,touchmove:Ie,touchend:Ae,touchcancel:Le},it="touchstart touchmove touchend touchcancel";f(U,P,{handler:function(e){var t=ot[e.type],n=K.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Te,srcEvent:e})}});var at=2500,st=25;f(X,P,{handler:function(e,t,n){var r=n.pointerType==Te,o=n.pointerType==Ne;if(!(o&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)G.call(this,t,n);else if(o&&Z.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var lt=E(ye.style,"touchAction"),ut=lt!==s,ct="compute",dt="auto",ft="manipulation",pt="none",ht="pan-x",mt="pan-y",vt=J();$.prototype={set:function(e){e==ct&&(e=this.compute()),ut&&this.manager.element.style&&vt[e]&&(this.manager.element.style[lt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return c(this.manager.recognizers,function(t){h(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Q(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var r=this.actions,o=_(r,pt)&&!vt[pt],i=_(r,mt)&&!vt[mt],a=_(r,ht)&&!vt[ht];if(o){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}return a&&i?void 0:o||i&&n&Fe||a&&n&ze?this.preventSrc(t):void 0},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var yt=1,gt=2,_t=4,bt=8,xt=bt,Ct=16,St=32;ee.prototype={defaults:{},set:function(e){return me(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(u(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=re(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return u(e,"dropRecognizeWith",this)?this:(e=re(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(u(e,"requireFailure",this))return this;var t=this.requireFail;return e=re(e,this),x(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(u(e,"dropRequireFailure",this))return this;e=re(e,this);var t=x(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,r=this.state;r<bt&&t(n.options.event+te(r)),t(n.options.event),e.additionalEvent&&t(e.additionalEvent),r>=bt&&t(n.options.event+te(r))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=St)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(St|yt)))return!1;e++}return!0},recognize:function(e){var t=me({},e);return h(this.options.enable,[this,t])?(this.state&(xt|Ct|St)&&(this.state=yt),this.state=this.process(t),void(this.state&(gt|_t|bt|Ct)&&this.tryEmit(t))):(this.reset(),void(this.state=St))},process:function(e){},getTouchAction:function(){},reset:function(){}},f(oe,ee,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(gt|_t),o=this.attrTest(e);return r&&(n&Le||!o)?t|Ct:r||o?n&Ae?t|bt:t&gt?t|_t:gt:St}}),f(ie,oe,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ue},getTouchAction:function(){var e=this.options.direction,t=[];return e&Fe&&t.push(mt),e&ze&&t.push(ht),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,o=e.direction,i=e.deltaX,a=e.deltaY;return o&t.direction||(t.direction&Fe?(o=0===i?Ve:i<0?We:He,n=i!=this.pX,r=Math.abs(e.deltaX)):(o=0===a?Ve:a<0?Be:Ye,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=o,n&&r>t.threshold&&o&t.direction},attrTest:function(e){return oe.prototype.attrTest.call(this,e)&&(this.state&gt||!(this.state&gt)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ne(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),f(ae,oe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[pt]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&gt)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),f(se,ee,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[dt]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(Ae|Le)&&!o)this.reset();else if(e.eventType&je)this.reset(),this._timer=l(function(){this.state=xt,this.tryEmit()},t.time,this);else if(e.eventType&Ae)return xt;return St},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===xt&&(e&&e.eventType&Ae?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=xe(),this.manager.emit(this.options.event,this._input)))}}),f(le,oe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[pt]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&gt)}}),f(ue,oe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Fe|ze,pointers:1},getTouchAction:function(){return ie.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Fe|ze)?t=e.overallVelocity:n&Fe?t=e.overallVelocityX:n&ze&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&be(t)>this.options.velocity&&e.eventType&Ae},emit:function(e){var t=ne(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),f(ce,ee,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ft]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime<t.time;if(this.reset(),e.eventType&je&&0===this.count)return this.failTimeout();if(r&&o&&n){if(e.eventType!=Ae)return this.failTimeout();var i=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||L(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,a&&i?this.count+=1:this.count=1,this._input=e;var s=this.count%t.taps;if(0===s)return this.hasRequireFailures()?(this._timer=l(function(){this.state=xt,this.tryEmit()},t.interval,this),gt):xt}return St},failTimeout:function(){return this._timer=l(function(){this.state=St},this.options.interval,this),St},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==xt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),de.VERSION="2.0.7",de.defaults={domEvents:!1,touchAction:ct,enable:!0,inputTarget:null,inputClass:null,preset:[[le,{enable:!1}],[ae,{enable:!1},["rotate"]],[ue,{direction:Fe}],[ie,{direction:Fe},["swipe"]],[ce],[ce,{event:"doubletap",taps:2},["tap"]],[se]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Et=1,wt=2;fe.prototype={set:function(e){return me(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?wt:Et},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,o=t.curRecognizer;(!o||o&&o.state&xt)&&(o=t.curRecognizer=null);for(var i=0;i<r.length;)n=r[i],t.stopped===wt||o&&n!=o&&!n.canRecognizeWith(o)?n.reset():n.recognize(e),!o&&n.state&(gt|_t|bt)&&(o=t.curRecognizer=n),i++}},get:function(e){if(e instanceof ee)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(u(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(u(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=x(t,e);n!==-1&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==s&&t!==s){var n=this.handlers;return c(b(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==s){var n=this.handlers;return c(b(e),function(e){t?n[e]&&n[e].splice(x(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&he(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&pe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},me(de,{INPUT_START:je,INPUT_MOVE:Ie,INPUT_END:Ae,INPUT_CANCEL:Le,STATE_POSSIBLE:yt,STATE_BEGAN:gt,STATE_CHANGED:_t,STATE_ENDED:bt,STATE_RECOGNIZED:xt,STATE_CANCELLED:Ct,STATE_FAILED:St,DIRECTION_NONE:Ve,DIRECTION_LEFT:We,DIRECTION_RIGHT:He,DIRECTION_UP:Be,DIRECTION_DOWN:Ye,DIRECTION_HORIZONTAL:Fe,DIRECTION_VERTICAL:ze,DIRECTION_ALL:Ue,Manager:fe,Input:P,TouchAction:$,TouchInput:U,MouseInput:B,PointerEventInput:Y,TouchMouseInput:X,SingleTouchInput:F,Recognizer:ee,AttrRecognizer:oe,Tap:ce,Pan:ie,Swipe:ue,Pinch:ae,Rotate:le,Press:se,on:v,off:y,each:c,merge:Se,extend:Ce,assign:me,inherit:f,bindFn:p,prefixed:E});var Ot="undefined"!=typeof o?o:"undefined"!=typeof self?self:{};Ot.Hammer=de,r=function(){return de}.call(t,n,t,e),!(r!==s&&(e.exports=r))}(window,document,"Hammer")},function(e,t){/*! * is-extendable <https://github.com/jonschlinkert/is-extendable> * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ "use strict";e.exports=function(e){return"undefined"!=typeof e&&null!==e&&("object"==typeof e||"function"==typeof e)}},function(e,t,n){!function(t,n){e.exports=n()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:/*!*****************!*\ !*** multi lib ***! \*****************/ function(e,t,n){e.exports=n(/*! ./index.js */169)},5:/*!******************************!*\ !*** ./~/process/browser.js ***! \******************************/ function(e,t){function n(){u=!1,a.length?l=a.concat(l):c=-1,l.length&&r()}function r(){if(!u){var e=setTimeout(n);u=!0;for(var t=l.length;t;){for(a=l,l=[];++c<t;)a&&a[c].run();c=-1,t=l.length}a=null,u=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var a,s=e.exports={},l=[],u=!1,c=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new o(e,t)),1!==l.length||u||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=i,s.addListener=i,s.once=i,s.off=i,s.removeListener=i,s.removeAllListeners=i,s.emit=i,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},169:/*!******************!*\ !*** ./index.js ***! \******************/ function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! tween-functions */170),i=r(o),a=n(/*! raf */171),s=r(a),l="ADDITIVE",u=o.easeInOutQuad,c=300,d=0,f={ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"},p={_rafID:null,getInitialState:function(){return{tweenQueue:[]}},componentWillUnmount:function(){s.default.cancel(this._rafID),this._rafID=-1},tweenState:function(e,t){var n=this,r=t.easing,o=t.duration,i=t.delay,a=t.beginValue,p=t.endValue,h=t.onEnd,m=t.stackBehavior;this.setState(function(t){var v=t,y=void 0,g=void 0;if("string"==typeof e)y=e,g=e;else{for(var _=0;_<e.length-1;_++)v=v[e[_]];y=e[e.length-1],g=e.join("|")}var b={easing:r||u,duration:null==o?c:o,delay:null==i?d:i,beginValue:null==a?v[y]:a,endValue:p,onEnd:h,stackBehavior:m||l},x=t.tweenQueue;return b.stackBehavior===f.DESTRUCTIVE&&(x=t.tweenQueue.filter(function(e){return e.pathHash!==g})),x.push({pathHash:g,config:b,initTime:Date.now()+b.delay}),v[y]=b.endValue,1===x.length&&(n._rafID=(0,s.default)(n._rafCb)),{tweenQueue:x}})},getTweeningValue:function(e){var t=this.state,n=void 0,r=void 0;if("string"==typeof e)n=t[e],r=e;else{n=t;for(var o=0;o<e.length;o++)n=n[e[o]];r=e.join("|")}for(var i=Date.now(),o=0;o<t.tweenQueue.length;o++){var a=t.tweenQueue[o],s=a.pathHash,l=a.initTime,u=a.config;if(s===r){var c=i-l>u.duration?u.duration:Math.max(0,i-l),d=0===u.duration?u.endValue:u.easing(c,u.beginValue,u.endValue,u.duration),f=d-u.endValue;n+=f}}return n},_rafCb:function(){var e=this.state;if(0!==e.tweenQueue.length){for(var t=Date.now(),n=[],r=0;r<e.tweenQueue.length;r++){var o=e.tweenQueue[r],i=o.initTime,a=o.config;t-i<a.duration?n.push(o):a.onEnd&&a.onEnd()}this._rafID!==-1&&(this.setState({tweenQueue:n}),this._rafID=(0,s.default)(this._rafCb))}}};t.default={Mixin:p,easingTypes:i.default,stackBehavior:f},e.exports=t.default},170:/*!************************************!*\ !*** ./~/tween-functions/index.js ***! \************************************/ function(e,t){"use strict";var n={linear:function(e,t,n,r){var o=n-t;return o*e/r+t},easeInQuad:function(e,t,n,r){var o=n-t;return o*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){var o=n-t;return-o*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){var o=n-t;return o*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){var o=n-t;return o*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){var o=n-t;return o*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){var o=n-t;return-o*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e*e+t:-o/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){var o=n-t;return o*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){var o=n-t;return o*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e*e*e+t:o/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){var o=n-t;return-o*Math.cos(e/r*(Math.PI/2))+o+t},easeOutSine:function(e,t,n,r){var o=n-t;return o*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){var o=n-t;return-o/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){var o=n-t;return 0==e?t:o*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){var o=n-t;return e==r?t+o:o*(-Math.pow(2,-10*e/r)+1)+t},easeInOutExpo:function(e,t,n,r){var o=n-t;return 0===e?t:e===r?t+o:(e/=r/2)<1?o/2*Math.pow(2,10*(e-1))+t:o/2*(-Math.pow(2,-10*--e)+2)+t},easeInCirc:function(e,t,n,r){var o=n-t;return-o*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){var o=n-t;return o*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?-o/2*(Math.sqrt(1-e*e)-1)+t:o/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,n,r){var o,i,a,s=n-t;return a=1.70158,i=0,o=s,0===e?t:1===(e/=r)?t+s:(i||(i=.3*r),o<Math.abs(s)?(o=s,a=i/4):a=i/(2*Math.PI)*Math.asin(s/o),-(o*Math.pow(2,10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i))+t)},easeOutElastic:function(e,t,n,r){var o,i,a,s=n-t;return a=1.70158,i=0,o=s,0===e?t:1===(e/=r)?t+s:(i||(i=.3*r),o<Math.abs(s)?(o=s,a=i/4):a=i/(2*Math.PI)*Math.asin(s/o),o*Math.pow(2,-10*e)*Math.sin((e*r-a)*(2*Math.PI)/i)+s+t)},easeInOutElastic:function(e,t,n,r){var o,i,a,s=n-t;return a=1.70158,i=0,o=s,0===e?t:2===(e/=r/2)?t+s:(i||(i=r*(.3*1.5)),o<Math.abs(s)?(o=s,a=i/4):a=i/(2*Math.PI)*Math.asin(s/o),e<1?-.5*(o*Math.pow(2,10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i))+t:o*Math.pow(2,-10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)*.5+s+t)},easeInBack:function(e,t,n,r,o){var i=n-t;return void 0===o&&(o=1.70158),i*(e/=r)*e*((o+1)*e-o)+t},easeOutBack:function(e,t,n,r,o){var i=n-t;return void 0===o&&(o=1.70158),i*((e=e/r-1)*e*((o+1)*e+o)+1)+t},easeInOutBack:function(e,t,n,r,o){var i=n-t;return void 0===o&&(o=1.70158),(e/=r/2)<1?i/2*(e*e*(((o*=1.525)+1)*e-o))+t:i/2*((e-=2)*e*(((o*=1.525)+1)*e+o)+2)+t},easeInBounce:function(e,t,r,o){var i,a=r-t;return i=n.easeOutBounce(o-e,0,a,o),a-i+t},easeOutBounce:function(e,t,n,r){var o=n-t;return(e/=r)<1/2.75?o*(7.5625*e*e)+t:e<2/2.75?o*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?o*(7.5625*(e-=2.25/2.75)*e+.9375)+t:o*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,t,r,o){var i,a=r-t;return e<o/2?(i=n.easeInBounce(2*e,0,a,o),.5*i+t):(i=n.easeOutBounce(2*e-o,0,a,o),.5*i+.5*a+t)}};e.exports=n},171:/*!************************!*\ !*** ./~/raf/index.js ***! \************************/ function(e,t,n){(function(t){for(var r=n(/*! performance-now */172),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",s=o["request"+a],l=o["cancel"+a]||o["cancelRequest"+a],u=0;!s&&u<i.length;u++)s=o[i[u]+"Request"+a],l=o[i[u]+"Cancel"+a]||o[i[u]+"CancelRequest"+a];if(!s||!l){var c=0,d=0,f=[],p=1e3/60;s=function(e){if(0===f.length){var t=r(),n=Math.max(0,p-(t-c));c=n+t,setTimeout(function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return f.push({handle:++d,callback:e,cancelled:!1}),d},l=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return s.call(o,e)},e.exports.cancel=function(){l.apply(o,arguments)},e.exports.polyfill=function(){o.requestAnimationFrame=s,o.cancelAnimationFrame=l}}).call(t,function(){return this}())},172:/*!**************************************************!*\ !*** ./~/performance-now/lib/performance-now.js ***! \**************************************************/ function(e,t,n){(function(t){(function(){var n,r,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-o)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},o=n()):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,n(/*! ./~/process/browser.js */5))}})})},function(e,t){function n(e){return!!e&&"object"==typeof e}function r(e,t){var n=null==e?void 0:e[t];return a(n)?n:void 0}function o(e){return i(e)&&f.call(e)==s}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(o(e)?p.test(c.call(e)):n(e)&&l.test(e))}var s="[object Function]",l=/^\[object .+?Constructor\]$/,u=Object.prototype,c=Function.prototype.toString,d=u.hasOwnProperty,f=u.toString,p=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t){(function(t){function n(e,t,n){function o(t){var n=m,r=v;return m=v=void 0,E=t,g=e.apply(r,n)}function i(e){return E=e,_=setTimeout(c,t),w?o(e):g}function l(e){var n=e-S,r=e-E,o=t-n;return O?x(o,y-r):o}function u(e){var n=e-S,r=e-E;return void 0===S||n>=t||n<0||O&&r>=y}function c(){var e=C();return u(e)?d(e):void(_=setTimeout(c,l(e)))}function d(e){return _=void 0,P&&m?o(e):(m=v=void 0,g)}function f(){void 0!==_&&clearTimeout(_),E=0,m=S=v=_=void 0}function p(){return void 0===_?g:d(C())}function h(){var e=C(),n=u(e);if(m=arguments,v=this,S=e,n){if(void 0===_)return i(S);if(O)return _=setTimeout(c,t),o(S)}return void 0===_&&(_=setTimeout(c,t)),g}var m,v,y,g,_,S,E=0,w=!1,O=!1,P=!0;if("function"!=typeof e)throw new TypeError(s);return t=a(t)||0,r(n)&&(w=!!n.leading,O="maxWait"in n,y=O?b(a(n.maxWait)||0,t):y,P="trailing"in n?!!n.trailing:P),h.cancel=f,h.flush=p,h}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function o(e){return!!e&&"object"==typeof e}function i(e){return"symbol"==typeof e||o(e)&&_.call(e)==u}function a(e){if("number"==typeof e)return e;if(i(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=f.test(e);return n||p.test(e)?h(e.slice(2),n?2:8):d.test(e)?l:+e}var s="Expected a function",l=NaN,u="[object Symbol]",c=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,p=/^0o[0-7]+$/i,h=parseInt,m="object"==typeof t&&t&&t.Object===Object&&t,v="object"==typeof self&&self&&self.Object===Object&&self,y=m||v||Function("return this")(),g=Object.prototype,_=g.toString,b=Math.max,x=Math.min,C=function(){return y.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){(function(t){function n(e,t){return null==e?void 0:e[t]}function r(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function o(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function i(){this.__data__=ve?ve(null):{}}function a(e){return this.has(e)&&delete this.__data__[e]}function s(e){var t=this.__data__;if(ve){var n=t[e];return n===F?void 0:n}return ce.call(t,e)?t[e]:void 0}function l(e){var t=this.__data__;return ve?void 0!==t[e]:ce.call(t,e)}function u(e,t){var n=this.__data__;return n[e]=ve&&void 0===t?F:t,this}function c(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function d(){this.__data__=[]}function f(e){var t=this.__data__,n=C(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():he.call(t,n,1),!0}function p(e){var t=this.__data__,n=C(t,e);return n<0?void 0:t[n][1]}function h(e){return C(this.__data__,e)>-1}function m(e,t){var n=this.__data__,r=C(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function v(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function y(){this.__data__={hash:new o,map:new(me||c),string:new o}}function g(e){return P(this,e).delete(e)}function _(e){return P(this,e).get(e)}function b(e){return P(this,e).has(e)}function x(e,t){return P(this,e).set(e,t),this}function C(e,t){for(var n=e.length;n--;)if(I(e[n][0],t))return n;return-1}function S(e,t){t=T(t,e)?[t]:O(t);for(var n=0,r=t.length;null!=e&&n<r;)e=e[R(t[n++])];return n&&n==r?e:void 0}function E(e){if(!L(e)||N(e))return!1;var t=A(e)||r(e)?fe:ee;return t.test(D(e))}function w(e){if("string"==typeof e)return e;if(W(e))return ge?ge.call(e):"";var t=e+"";return"0"==t&&1/e==-z?"-0":t}function O(e){return be(e)?e:_e(e)}function P(e,t){var n=e.__data__;return M(t)?n["string"==typeof t?"string":"hash"]:n.map}function k(e,t){var r=n(e,t);return E(r)?r:void 0}function T(e,t){if(be(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!W(e))||(q.test(e)||!G.test(e)||null!=t&&e in Object(t))}function M(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function N(e){return!!le&&le in e}function R(e){if("string"==typeof e||W(e))return e;var t=e+"";return"0"==t&&1/e==-z?"-0":t}function D(e){if(null!=e){try{return ue.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function j(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(Y);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(j.Cache||v),n}function I(e,t){return e===t||e!==e&&t!==t}function A(e){var t=L(e)?de.call(e):"";return t==U||t==K}function L(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function V(e){return!!e&&"object"==typeof e}function W(e){return"symbol"==typeof e||V(e)&&de.call(e)==X}function H(e){return null==e?"":w(e)}function B(e,t,n){var r=null==e?void 0:S(e,t);return void 0===r?n:r}var Y="Expected a function",F="__lodash_hash_undefined__",z=1/0,U="[object Function]",K="[object GeneratorFunction]",X="[object Symbol]",G=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,Z=/^\./,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,J=/\\(\\)?/g,ee=/^\[object .+?Constructor\]$/,te="object"==typeof t&&t&&t.Object===Object&&t,ne="object"==typeof self&&self&&self.Object===Object&&self,re=te||ne||Function("return this")(),oe=Array.prototype,ie=Function.prototype,ae=Object.prototype,se=re["__core-js_shared__"],le=function(){var e=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ue=ie.toString,ce=ae.hasOwnProperty,de=ae.toString,fe=RegExp("^"+ue.call(ce).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=re.Symbol,he=oe.splice,me=k(re,"Map"),ve=k(Object,"create"),ye=pe?pe.prototype:void 0,ge=ye?ye.toString:void 0;o.prototype.clear=i,o.prototype.delete=a,o.prototype.get=s,o.prototype.has=l,o.prototype.set=u,c.prototype.clear=d,c.prototype.delete=f,c.prototype.get=p,c.prototype.has=h,c.prototype.set=m,v.prototype.clear=y,v.prototype.delete=g,v.prototype.get=_,v.prototype.has=b,v.prototype.set=x;var _e=j(function(e){e=H(e);var t=[];return Z.test(e)&&t.push(""),e.replace($,function(e,n,r,o){t.push(r?o.replace(J,"$1"):n||e)}),t});j.Cache=v;var be=Array.isArray;e.exports=B}).call(t,function(){return this}())},function(e,t){function n(e){return o(e)&&h.call(e,"callee")&&(!v.call(e,"callee")||m.call(e)==c)}function r(e){return null!=e&&a(e.length)&&!i(e)}function o(e){return l(e)&&r(e)}function i(e){var t=s(e)?m.call(e):"";return t==d||t==f}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return!!e&&"object"==typeof e}var u=9007199254740991,c="[object Arguments]",d="[object Function]",f="[object GeneratorFunction]",p=Object.prototype,h=p.hasOwnProperty,m=p.toString,v=p.propertyIsEnumerable;e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}function r(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=y}function i(e){return a(e)&&h.call(e)==u}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null!=e&&(i(e)?m.test(f.call(e)):n(e)&&c.test(e))}var l="[object Array]",u="[object Function]",c=/^\[object .+?Constructor\]$/,d=Object.prototype,f=Function.prototype.toString,p=d.hasOwnProperty,h=d.toString,m=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=r(Array,"isArray"),y=9007199254740991,g=v||function(e){return n(e)&&o(e.length)&&h.call(e)==l};e.exports=g},function(e,t,n){/*! * object.omit <https://github.com/jonschlinkert/object.omit> * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ "use strict";var r=n(365),o=n(363);e.exports=function(e,t){if(!r(e))return{};t=[].concat.apply([],[].slice.call(arguments,1));var n,i=t[t.length-1],a={};"function"==typeof i&&(n=t.pop());var s="function"==typeof n;return t.length||s?(o(e,function(r,o){t.indexOf(o)===-1&&(s?n(r,o,e)&&(a[o]=r):a[o]=r)}),a):e}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){m&&p&&(m=!1,p.length?h=p.concat(h):v=-1,h.length&&s())}function s(){if(!m){var e=o(a);m=!0;for(var t=h.length;t;){for(p=h,h=[];++v<t;)p&&p[v].run();v=-1,t=h.length}p=null,m=!1,i(e)}}function l(e,t){this.fun=e,this.array=t}function u(){}var c,d,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var p,h=[],m=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new l(e,t)),1!==h.length||m||o(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(113),o=n(49),i=n(375);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){for(var r=n(377),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",s=o["request"+a],l=o["cancel"+a]||o["cancelRequest"+a],u=0;!s&&u<i.length;u++)s=o[i[u]+"Request"+a],l=o[i[u]+"Cancel"+a]||o[i[u]+"CancelRequest"+a];if(!s||!l){var c=0,d=0,f=[],p=1e3/60;s=function(e){if(0===f.length){var t=r(),n=Math.max(0,p-(t-c));c=n+t,setTimeout(function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return f.push({handle:++d,callback:e,cancelled:!1}),d},l=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return s.call(o,e)},e.exports.cancel=function(){l.apply(o,arguments)},e.exports.polyfill=function(){o.requestAnimationFrame=s,o.cancelAnimationFrame=l}}).call(t,function(){return this}())},function(e,t,n){(function(t){(function(){var n,r,o,i,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},i=n(),s=1e9*t.uptime(),a=i-s):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,n(373))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var o=n[r],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}function l(e,t){function n(){o&&(clearTimeout(o),o=null)}function r(){n(),o=setTimeout(e,t)}var o=void 0;return r.clear=n,r}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),c=r(u),d=n(9),f=r(d),p=n(11),h=r(p),m=n(308),v=r(m),y=n(53),g=r(y),_=n(380),b=r(_),x=function(e){function t(){var n,r,o;i(this,t);for(var s=arguments.length,l=Array(s),u=0;u<s;u++)l[u]=arguments[u];return n=r=a(this,e.call.apply(e,[this].concat(l))),r.forceAlign=function(){var e=r.props;if(!e.disabled){var t=h.default.findDOMNode(r);e.onAlign(t,(0,v.default)(t,e.target(),e.align))}},o=n,a(r,o)}return s(t,e),t.prototype.componentDidMount=function(){var e=this.props;this.forceAlign(),!e.disabled&&e.monitorWindowResize&&this.startMonitorWindowResize()},t.prototype.componentDidUpdate=function(e){var t=!1,n=this.props;if(!n.disabled)if(e.disabled||e.align!==n.align)t=!0;else{var r=e.target(),o=n.target();(0,b.default)(r)&&(0,b.default)(o)?t=!1:r!==o&&(t=!0)}t&&this.forceAlign(),n.monitorWindowResize&&!n.disabled?this.startMonitorWindowResize():this.stopMonitorWindowResize()},t.prototype.componentWillUnmount=function(){this.stopMonitorWindowResize()},t.prototype.startMonitorWindowResize=function(){this.resizeHandler||(this.bufferMonitor=l(this.forceAlign,this.props.monitorBufferTime),this.resizeHandler=(0,g.default)(window,"resize",this.bufferMonitor))},t.prototype.stopMonitorWindowResize=function(){this.resizeHandler&&(this.bufferMonitor.clear(),this.resizeHandler.remove(),this.resizeHandler=null)},t.prototype.render=function(){var e=this.props,t=e.childrenProps,n=e.children,r=c.default.Children.only(n);if(t){var o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=this.props[t[i]]);return c.default.cloneElement(r,o)}return r},t}(u.Component);x.propTypes={childrenProps:f.default.object,align:f.default.object.isRequired,target:f.default.func,onAlign:f.default.func,monitorBufferTime:f.default.number,monitorWindowResize:f.default.bool,disabled:f.default.bool,children:f.default.any},x.defaultProps={target:function(){return window},onAlign:function(){},monitorBufferTime:50,monitorWindowResize:!1,disabled:!1},t.default=x,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(378),i=r(o);t.default=i.default,e.exports=t.default},function(e,t){"use strict";function n(e){return null!=e&&e==e.window}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(31),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(11),y=r(v),g=n(9),_=r(g),b=n(111),x=r(b),C=n(117),S=r(C),E={enter:"transitionEnter",appear:"transitionAppear",leave:"transitionLeave"},w=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillUnmount",value:function(){this.stop()}},{key:"componentWillEnter",value:function(e){S.default.isEnterSupported(this.props)?this.transition("enter",e):e()}},{key:"componentWillAppear",value:function(e){S.default.isAppearSupported(this.props)?this.transition("appear",e):e()}},{key:"componentWillLeave",value:function(e){S.default.isLeaveSupported(this.props)?this.transition("leave",e):e()}},{key:"transition",value:function(e,t){var n=this,r=y.default.findDOMNode(this),o=this.props,a=o.transitionName,s="object"===("undefined"==typeof a?"undefined":(0,i.default)(a));this.stop();var l=function(){n.stopper=null,t()};if((b.isCssAnimationSupported||!o.animation[e])&&a&&o[E[e]]){var u=s?a[e]:a+"-"+e,c=u+"-active";s&&a[e+"Active"]&&(c=a[e+"Active"]),this.stopper=(0,x.default)(r,{name:u,active:c},l)}else this.stopper=o.animation[e](r,l)}},{key:"stop",value:function(){var e=this.stopper;e&&(this.stopper=null,e.stop())}},{key:"render",value:function(){return this.props.children}}]),t}(m.default.Component);w.propTypes={children:_.default.any},t.default=w,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=[];return d.default.Children.forEach(e,function(e){t.push(e)}),t}function i(e,t){var n=null;return e&&e.forEach(function(e){n||e&&e.key===t&&(n=e)}),n}function a(e,t,n){var r=null;return e&&e.forEach(function(e){if(e&&e.key===t&&e.props[n]){if(r)throw new Error("two child with same key for <rc-animate> children");r=e}}),r}function s(e,t,n){var r=0;return e&&e.forEach(function(e){r||(r=e&&e.key===t&&!e.props[n])}),r}function l(e,t,n){var r=e.length===t.length;return r&&e.forEach(function(e,o){var i=t[o];e&&i&&(e&&!i||!e&&i?r=!1:e.key!==i.key?r=!1:n&&e.props[n]!==i.props[n]&&(r=!1))}),r}function u(e,t){var n=[],r={},o=[];return e.forEach(function(e){e&&i(t,e.key)?o.length&&(r[e.key]=o,o=[]):o.push(e)}),t.forEach(function(e){e&&r.hasOwnProperty(e.key)&&(n=n.concat(r[e.key])),n.push(e)}),n=n.concat(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.toArrayChildren=o,t.findChildInChildrenByKey=i,t.findShownChildInChildrenByKey=a,t.findHiddenChildInChildrenByKey=s,t.isSameChildren=l,t.mergeChildren=u;var c=n(1),d=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(14),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(9),x=r(b),C=n(436),S=r(C),E=n(7),w=r(E),O=function(e){function t(e){(0,d.default)(this,t);var n=(0,m.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));P.call(n);var r="checked"in e?e.checked:e.defaultChecked;return n.state={checked:r},n}return(0,y.default)(t,e),(0,p.default)(t,[{key:"componentWillReceiveProps",value:function(e){"checked"in e&&this.setState({checked:e.checked})}},{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return S.default.shouldComponentUpdate.apply(this,t)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.style,a=t.name,l=t.type,c=t.disabled,d=t.readOnly,f=t.tabIndex,p=t.onClick,h=t.onFocus,m=t.onBlur,v=(0,u.default)(t,["prefixCls","className","style","name","type","disabled","readOnly","tabIndex","onClick","onFocus","onBlur"]),y=Object.keys(v).reduce(function(e,t){return"aria-"!==t.substr(0,5)&&"data-"!==t.substr(0,5)&&"role"!==t||(e[t]=v[t]),e},{}),g=this.state.checked,b=(0,w.default)(n,r,(e={},(0,s.default)(e,n+"-checked",g),(0,s.default)(e,n+"-disabled",c),e));return _.default.createElement("span",{className:b,style:o},_.default.createElement("input",(0,i.default)({name:a,type:l,readOnly:d,disabled:c,tabIndex:f,className:n+"-input",checked:!!g,onClick:p,onFocus:h,onBlur:m,onChange:this.handleChange},y)),_.default.createElement("span",{className:n+"-inner"}))}}]),t}(_.default.Component);O.propTypes={prefixCls:x.default.string,className:x.default.string,style:x.default.object,name:x.default.string,type:x.default.string,defaultChecked:x.default.oneOfType([x.default.number,x.default.bool]),checked:x.default.oneOfType([x.default.number,x.default.bool]),disabled:x.default.bool,onFocus:x.default.func,onBlur:x.default.func,onChange:x.default.func,onClick:x.default.func,tabIndex:x.default.string,readOnly:x.default.bool},O.defaultProps={prefixCls:"rc-checkbox",className:"",style:{},type:"checkbox",defaultChecked:!1,onFocus:function(){},onBlur:function(){},onChange:function(){}};var P=function(){var e=this;this.handleChange=function(t){var n=e.props;n.disabled||("checked"in n||e.setState({checked:t.target.checked}),n.onChange({target:(0,i.default)({},n,{checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()}}))}};t.default=O,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){var t=e;return Array.isArray(t)||(t=t?[t]:[]),t}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=n(1),f=r(d),p=n(9),h=r(p),m=n(385),v=r(m),y=n(388),g=r(y),_=n(7),b=r(_),x=function(e){function t(e){a(this,t);var n=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=n.props,o=r.activeKey,i=r.defaultActiveKey,l=i;return"activeKey"in n.props&&(l=o),n.state={openAnimation:n.props.openAnimation||(0,g.default)(n.props.prefixCls),activeKey:u(l)},n}return l(t,e),c(t,[{key:"componentWillReceiveProps",value:function(e){"activeKey"in e&&this.setState({activeKey:u(e.activeKey)}),"openAnimation"in e&&this.setState({openAnimation:e.openAnimation})}},{key:"onClickItem",value:function(e){var t=this.state.activeKey;if(this.props.accordion)t=t[0]===e?[]:[e];else{t=[].concat(i(t));var n=t.indexOf(e),r=n>-1;r?t.splice(n,1):t.push(e)}this.setActiveKey(t)}},{key:"getItems",value:function(){var e=this,t=this.state.activeKey,n=this.props,r=n.prefixCls,o=n.accordion,i=n.destroyInactivePanel,a=[];return d.Children.forEach(this.props.children,function(n,s){if(n){var l=n.key||String(s),u=n.props,c=u.header,d=u.headerClass,p=u.disabled,h=!1;h=o?t[0]===l:t.indexOf(l)>-1;var m={key:l,header:c,headerClass:d,isActive:h,prefixCls:r,destroyInactivePanel:i,openAnimation:e.state.openAnimation,children:n.props.children,onItemClick:p?null:function(){return e.onClickItem(l)}};a.push(f.default.cloneElement(n,m))}}),a}},{key:"setActiveKey",value:function(e){"activeKey"in this.props||this.setState({activeKey:e}),this.props.onChange(this.props.accordion?e[0]:e)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,i=t.style,a=(0,b.default)((e={},o(e,n,!0),o(e,r,!!r),e));return f.default.createElement("div",{className:a,style:i},this.getItems())}}]),t}(d.Component);x.propTypes={children:h.default.any,prefixCls:h.default.string,activeKey:h.default.oneOfType([h.default.string,h.default.arrayOf(h.default.string)]),defaultActiveKey:h.default.oneOfType([h.default.string,h.default.arrayOf(h.default.string)]),openAnimation:h.default.object,onChange:h.default.func,accordion:h.default.bool,className:h.default.string,style:h.default.object,destroyInactivePanel:h.default.bool},x.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},x.Panel=v.default,t.default=x,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),c=r(u),d=n(9),f=r(d),p=n(7),h=r(p),m=n(386),v=r(m),y=n(50),g=r(y),_=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),l(t,[{key:"handleItemClick",value:function(){this.props.onItemClick&&this.props.onItemClick()}},{key:"render",value:function(){var e,t=this.props,n=t.className,r=t.id,i=t.style,a=t.prefixCls,s=t.header,l=t.headerClass,u=t.children,d=t.isActive,f=t.showArrow,p=t.destroyInactivePanel,m=t.disabled,y=(0,h.default)(a+"-header",o({},l,l)),_=(0,h.default)((e={},o(e,a+"-item",!0),o(e,a+"-item-active",d),o(e,a+"-item-disabled",m),e),n);return c.default.createElement("div",{className:_,style:i,id:r},c.default.createElement("div",{className:y,onClick:this.handleItemClick.bind(this),role:"tab","aria-expanded":d},f&&c.default.createElement("i",{className:"arrow"}),s),c.default.createElement(g.default,{showProp:"isActive",exclusive:!0,component:"",animation:this.props.openAnimation},c.default.createElement(v.default,{prefixCls:a,isActive:d,destroyInactivePanel:p},u)))}}]),t}(u.Component);_.propTypes={className:f.default.oneOfType([f.default.string,f.default.object]),id:f.default.string,children:f.default.any,openAnimation:f.default.object,prefixCls:f.default.string,header:f.default.oneOfType([f.default.string,f.default.number,f.default.node]),headerClass:f.default.string,showArrow:f.default.bool,isActive:f.default.bool,onItemClick:f.default.func,style:f.default.object,destroyInactivePanel:f.default.bool,disabled:f.default.bool},_.defaultProps={showArrow:!0,isActive:!1,destroyInactivePanel:!1,onItemClick:function(){},headerClass:""},t.default=_,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),c=r(u),d=n(9),f=r(d),p=n(7),h=r(p),m=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),l(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.isActive||e.isActive}},{key:"render",value:function(){var e;if(this._isActived=this._isActived||this.props.isActive,!this._isActived)return null;var t=this.props,n=t.prefixCls,r=t.isActive,i=t.children,a=t.destroyInactivePanel,s=(0,h.default)((e={},o(e,n+"-content",!0),o(e,n+"-content-active",r),o(e,n+"-content-inactive",!r),e)),l=!r&&a?null:c.default.createElement("div",{className:n+"-content-box"},i);return c.default.createElement("div",{className:s,role:"tabpanel"},l)}}]),t}(u.Component);m.propTypes={prefixCls:f.default.string,isActive:f.default.bool,children:f.default.any,destroyInactivePanel:f.default.bool},t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Panel=void 0;var o=n(384),i=r(o);t.default=i.default;t.Panel=i.default.Panel},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r){var o=void 0;return(0,s.default)(e,n,{start:function(){t?(o=e.offsetHeight,e.style.height=0):e.style.height=e.offsetHeight+"px"},active:function(){e.style.height=(t?o:0)+"px"},end:function(){e.style.height="",r()}})}function i(e){return{enter:function(t,n){return o(t,!0,e+"-anim",n)},leave:function(t,n){return o(t,!1,e+"-anim",n)}}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(111),s=r(a);t.default=i,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}function a(e,t){var n=e.style;["Webkit","Moz","Ms","ms"].forEach(function(e){n[e+"TransformOrigin"]=t}),n.transformOrigin=t}function s(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,o=r.defaultView||r.parentWindow;return n.left+=i(o),n.top+=i(o,!0),n}Object.defineProperty(t,"__esModule",{value:!0});var l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(11),_=r(g),b=n(435),x=r(b),C=n(50),S=r(C),E=n(390),w=r(E),O=n(438),P=r(O),k=n(28),T=r(k),M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},N=0,R=0,D=function(e){function t(){(0,u.default)(this,t);var e=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onAnimateLeave=function(){e.refs.wrap&&(e.refs.wrap.style.display="none"),e.inTransition=!1,e.removeScrollingEffect(),e.props.afterClose()},e.onMaskClick=function(t){Date.now()-e.openTime<300||t.target===t.currentTarget&&e.close(t)},e.onKeyDown=function(t){var n=e.props;if(n.keyboard&&t.keyCode===x.default.ESC&&e.close(t),n.visible&&t.keyCode===x.default.TAB){var r=document.activeElement,o=e.refs.wrap,i=e.refs.sentinel;t.shiftKey?r===o&&i.focus():r===e.refs.sentinel&&o.focus()}},e.getDialogElement=function(){var t=e.props,n=t.closable,r=t.prefixCls,o={};void 0!==t.width&&(o.width=t.width),void 0!==t.height&&(o.height=t.height);var i=void 0;t.footer&&(i=y.default.createElement("div",{className:r+"-footer",ref:"footer"},t.footer));var a=void 0;t.title&&(a=y.default.createElement("div",{className:r+"-header",ref:"header"},y.default.createElement("div",{className:r+"-title",id:e.titleId},t.title)));var s=void 0;n&&(s=y.default.createElement("button",{onClick:e.close,"aria-label":"Close",className:r+"-close"},y.default.createElement("span",{className:r+"-close-x"})));var l=(0,T.default)({},t.style,o),u=e.getTransitionName(),c=y.default.createElement(w.default,{key:"dialog-element",role:"document",ref:"dialog",style:l,className:r+" "+(t.className||""),visible:t.visible},y.default.createElement("div",{className:r+"-content"},s,a,y.default.createElement("div",M({className:r+"-body",style:t.bodyStyle,ref:"body"},t.bodyProps),t.children),i),y.default.createElement("div",{tabIndex:0,ref:"sentinel",style:{width:0,height:0,overflow:"hidden"}},"sentinel"));return y.default.createElement(S.default,{key:"dialog",showProp:"visible",onLeave:e.onAnimateLeave,transitionName:u,component:"",transitionAppear:!0},c)},e.getZIndexStyle=function(){var t={},n=e.props;return void 0!==n.zIndex&&(t.zIndex=n.zIndex),t},e.getWrapStyle=function(){return(0,T.default)({},e.getZIndexStyle(),e.props.wrapStyle)},e.getMaskStyle=function(){return(0,T.default)({},e.getZIndexStyle(),e.props.maskStyle)},e.getMaskElement=function(){var t=e.props,n=void 0;if(t.mask){var r=e.getMaskTransitionName();n=y.default.createElement(w.default,M({style:e.getMaskStyle(),key:"mask",className:t.prefixCls+"-mask",hiddenClassName:t.prefixCls+"-mask-hidden",visible:t.visible},t.maskProps)),r&&(n=y.default.createElement(S.default,{key:"mask",showProp:"visible",transitionAppear:!0,component:"",transitionName:r},n))}return n},e.getMaskTransitionName=function(){var t=e.props,n=t.maskTransitionName,r=t.maskAnimation;return!n&&r&&(n=t.prefixCls+"-"+r),n},e.getTransitionName=function(){var t=e.props,n=t.transitionName,r=t.animation;return!n&&r&&(n=t.prefixCls+"-"+r),n},e.getElement=function(t){return e.refs[t]},e.setScrollbar=function(){e.bodyIsOverflowing&&void 0!==e.scrollbarWidth&&(document.body.style.paddingRight=e.scrollbarWidth+"px")},e.addScrollingEffect=function(){R++,1===R&&(e.checkScrollbar(),e.setScrollbar(),document.body.style.overflow="hidden")},e.removeScrollingEffect=function(){R--,0===R&&(document.body.style.overflow="",e.resetScrollbar())},e.close=function(t){e.props.onClose(t)},e.checkScrollbar=function(){var t=window.innerWidth;if(!t){var n=document.documentElement.getBoundingClientRect();t=n.right-Math.abs(n.left)}e.bodyIsOverflowing=document.body.clientWidth<t,e.bodyIsOverflowing&&(e.scrollbarWidth=(0,P.default)())},e.resetScrollbar=function(){document.body.style.paddingRight=""},e.adjustDialog=function(){if(e.refs.wrap&&void 0!==e.scrollbarWidth){var t=e.refs.wrap.scrollHeight>document.documentElement.clientHeight;e.refs.wrap.style.paddingLeft=(!e.bodyIsOverflowing&&t?e.scrollbarWidth:"")+"px",e.refs.wrap.style.paddingRight=(e.bodyIsOverflowing&&!t?e.scrollbarWidth:"")+"px"}},e.resetAdjustments=function(){e.refs.wrap&&(e.refs.wrap.style.paddingLeft=e.refs.wrap.style.paddingLeft="")},e}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentWillMount",value:function(){this.inTransition=!1,this.titleId="rcDialogTitle"+N++}},{key:"componentDidMount",value:function(){this.componentDidUpdate({})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=this.props.mousePosition;if(t.visible){if(!e.visible){this.openTime=Date.now(),this.lastOutSideFocusNode=document.activeElement,this.addScrollingEffect(),this.refs.wrap.focus();var r=_.default.findDOMNode(this.refs.dialog);if(n){var o=s(r);a(r,n.x-o.left+"px "+(n.y-o.top)+"px")}else a(r,"")}}else if(e.visible&&(this.inTransition=!0,t.mask&&this.lastOutSideFocusNode)){try{this.lastOutSideFocusNode.focus()}catch(e){this.lastOutSideFocusNode=null}this.lastOutSideFocusNode=null}}},{key:"componentWillUnmount",value:function(){(this.props.visible||this.inTransition)&&this.removeScrollingEffect()}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.maskClosable,r=this.getWrapStyle();return e.visible&&(r.display=null),y.default.createElement("div",null,this.getMaskElement(),y.default.createElement("div",M({tabIndex:-1,onKeyDown:this.onKeyDown,className:t+"-wrap "+(e.wrapClassName||""),ref:"wrap",onClick:n?this.onMaskClick:void 0,role:"dialog","aria-labelledby":e.title?this.titleId:null,style:r},e.wrapProps),this.getDialogElement()))}}]),t}(y.default.Component);t.default=D,D.defaultProps={afterClose:o,className:"",mask:!0,visible:!1,keyboard:!0,closable:!0,maskClosable:!0,prefixCls:"rc-dialog",onClose:o},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(28),m=r(h),v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},y=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"shouldComponentUpdate",value:function(e){return!!e.hiddenClassName||!!e.visible}},{key:"render",value:function(){var e=this.props.className;this.props.hiddenClassName&&!this.props.visible&&(e+=" "+this.props.hiddenClassName);var t=(0,m.default)({},this.props);return delete t.hiddenClassName,delete t.visible,t.className=e,p.default.createElement("div",v({},t))}}]),t}(p.default.Component);t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){for(var t=e,n=0,r=0;t&&!isNaN(t.offsetLeft)&&!isNaN(t.offsetTop);)n+=t.offsetLeft-t.scrollLeft,r+=t.offsetTop-t.scrollTop,t=t.offsetParent;return{top:r,left:n}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),a=r(i),s=n(6),l=r(s),u=n(31),c=r(u),d=n(2),f=r(d),p=n(5),h=r(p),m=n(4),v=r(m),y=n(3),g=r(y),_=n(1),b=r(_),x=n(9),C=r(x),S=n(11),E=r(S),w=n(7),O=r(w),P=20,k=function(e){function t(e){(0,f.default)(this,t);var n=(0,v.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onOverlayClicked=function(){n.props.open&&n.props.onOpenChange(!1,{overlayClicked:!0})},n.onTouchStart=function(e){if(!n.isTouching()){var t=e.targetTouches[0];n.setState({touchIdentifier:n.notTouch?null:t.identifier,touchStartX:t.clientX,touchStartY:t.clientY,touchCurrentX:t.clientX,touchCurrentY:t.clientY})}},n.onTouchMove=function(e){if(n.isTouching())for(var t=0;t<e.targetTouches.length;t++)if(e.targetTouches[t].identifier===n.state.touchIdentifier){n.setState({touchCurrentX:e.targetTouches[t].clientX,touchCurrentY:e.targetTouches[t].clientY});break}},n.onTouchEnd=function(){if(n.notTouch=!1,n.isTouching()){var e=n.touchSidebarWidth();(n.props.open&&e<n.state.sidebarWidth-n.props.dragToggleDistance||!n.props.open&&e>n.props.dragToggleDistance)&&n.props.onOpenChange(!n.props.open);var t=n.touchSidebarHeight();(n.props.open&&t<n.state.sidebarHeight-n.props.dragToggleDistance||!n.props.open&&t>n.props.dragToggleDistance)&&n.props.onOpenChange(!n.props.open),n.setState({touchIdentifier:null,touchStartX:null,touchStartY:null,touchCurrentX:null,touchCurrentY:null})}},n.onScroll=function(){n.isTouching()&&n.inCancelDistanceOnScroll()&&n.setState({touchIdentifier:null,touchStartX:null,touchStartY:null,touchCurrentX:null,touchCurrentY:null})},n.inCancelDistanceOnScroll=function(){var e=void 0;switch(n.props.position){case"right":e=Math.abs(n.state.touchCurrentX-n.state.touchStartX)<P;break;case"bottom":e=Math.abs(n.state.touchCurrentY-n.state.touchStartY)<P;break;case"top":e=Math.abs(n.state.touchStartY-n.state.touchCurrentY)<P;break;case"left":default:e=Math.abs(n.state.touchStartX-n.state.touchCurrentX)<P}return e},n.isTouching=function(){return null!==n.state.touchIdentifier},n.saveSidebarSize=function(){var e=E.default.findDOMNode(n.refs.sidebar),t=e.offsetWidth,r=e.offsetHeight,i=o(E.default.findDOMNode(n.refs.sidebar)).top,a=o(E.default.findDOMNode(n.refs.dragHandle)).top;t!==n.state.sidebarWidth&&n.setState({sidebarWidth:t}),r!==n.state.sidebarHeight&&n.setState({sidebarHeight:r}),i!==n.state.sidebarTop&&n.setState({sidebarTop:i}),a!==n.state.dragHandleTop&&n.setState({dragHandleTop:a})},n.touchSidebarWidth=function(){return"right"===n.props.position?n.props.open&&window.innerWidth-n.state.touchStartX<n.state.sidebarWidth?n.state.touchCurrentX>n.state.touchStartX?n.state.sidebarWidth+n.state.touchStartX-n.state.touchCurrentX:n.state.sidebarWidth:Math.min(window.innerWidth-n.state.touchCurrentX,n.state.sidebarWidth):"left"===n.props.position?n.props.open&&n.state.touchStartX<n.state.sidebarWidth?n.state.touchCurrentX>n.state.touchStartX?n.state.sidebarWidth:n.state.sidebarWidth-n.state.touchStartX+n.state.touchCurrentX:Math.min(n.state.touchCurrentX,n.state.sidebarWidth):void 0; },n.touchSidebarHeight=function(){if("bottom"===n.props.position)return n.props.open&&window.innerHeight-n.state.touchStartY<n.state.sidebarHeight?n.state.touchCurrentY>n.state.touchStartY?n.state.sidebarHeight+n.state.touchStartY-n.state.touchCurrentY:n.state.sidebarHeight:Math.min(window.innerHeight-n.state.touchCurrentY,n.state.sidebarHeight);if("top"===n.props.position){var e=n.state.touchStartY-n.state.sidebarTop;return n.props.open&&e<n.state.sidebarHeight?n.state.touchCurrentY>n.state.touchStartY?n.state.sidebarHeight:n.state.sidebarHeight-n.state.touchStartY+n.state.touchCurrentY:Math.min(n.state.touchCurrentY-n.state.dragHandleTop,n.state.sidebarHeight)}},n.renderStyle=function(e){var t=e.sidebarStyle,r=e.isTouching,o=e.overlayStyle,i=e.contentStyle;if("right"===n.props.position||"left"===n.props.position){if(t.transform="translateX(0%)",t.WebkitTransform="translateX(0%)",r){var a=n.touchSidebarWidth()/n.state.sidebarWidth;"right"===n.props.position&&(t.transform="translateX("+100*(1-a)+"%)",t.WebkitTransform="translateX("+100*(1-a)+"%)"),"left"===n.props.position&&(t.transform="translateX(-"+100*(1-a)+"%)",t.WebkitTransform="translateX(-"+100*(1-a)+"%)"),o.opacity=a,o.visibility="visible"}i&&(i[n.props.position]=n.state.sidebarWidth+"px")}if("top"===n.props.position||"bottom"===n.props.position){if(t.transform="translateY(0%)",t.WebkitTransform="translateY(0%)",r){var s=n.touchSidebarHeight()/n.state.sidebarHeight;"bottom"===n.props.position&&(t.transform="translateY("+100*(1-s)+"%)",t.WebkitTransform="translateY("+100*(1-s)+"%)"),"top"===n.props.position&&(t.transform="translateY(-"+100*(1-s)+"%)",t.WebkitTransform="translateY(-"+100*(1-s)+"%)"),o.opacity=s,o.visibility="visible"}i&&(i[n.props.position]=n.state.sidebarHeight+"px")}},n.state={sidebarWidth:0,sidebarHeight:0,sidebarTop:0,dragHandleTop:0,touchIdentifier:null,touchStartX:null,touchStartY:null,touchCurrentX:null,touchCurrentY:null,touchSupported:"object"===("undefined"==typeof window?"undefined":(0,c.default)(window))&&"ontouchstart"in window},n}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){this.saveSidebarSize()}},{key:"componentDidUpdate",value:function(){this.isTouching()||this.saveSidebarSize()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.className,o=n.style,i=n.prefixCls,s=n.position,u=n.transitions,c=n.touch,d=n.enableDragHandle,f=n.sidebar,p=n.children,h=n.docked,m=n.open,v=(0,l.default)({},this.props.sidebarStyle),y=(0,l.default)({},this.props.contentStyle),g=(0,l.default)({},this.props.overlayStyle),_=(e={},(0,a.default)(e,r,!!r),(0,a.default)(e,i,!0),(0,a.default)(e,i+"-"+s,!0),e),x={style:o},C=this.isTouching();C?this.renderStyle({sidebarStyle:v,isTouching:!0,overlayStyle:g}):h?0!==this.state.sidebarWidth&&(_[i+"-docked"]=!0,this.renderStyle({sidebarStyle:v,contentStyle:y})):m&&(_[i+"-open"]=!0,this.renderStyle({sidebarStyle:v}),g.opacity=1,g.visibility="visible"),!C&&u||(v.transition="none",v.WebkitTransition="none",y.transition="none",g.transition="none");var S=null;return this.state.touchSupported&&c&&(m?(x.onTouchStart=function(e){t.notTouch=!0,t.onTouchStart(e)},x.onTouchMove=this.onTouchMove,x.onTouchEnd=this.onTouchEnd,x.onTouchCancel=this.onTouchEnd,x.onScroll=this.onScroll):d&&(S=b.default.createElement("div",{className:i+"-draghandle",style:this.props.dragHandleStyle,onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd,onTouchCancel:this.onTouchEnd,ref:"dragHandle"}))),b.default.createElement("div",(0,l.default)({className:(0,O.default)(_)},x),b.default.createElement("div",{className:i+"-sidebar",style:v,ref:"sidebar"},f),b.default.createElement("div",{className:i+"-overlay",style:g,role:"presentation",ref:"overlay",onClick:this.onOverlayClicked}),b.default.createElement("div",{className:i+"-content",style:y,ref:"content"},S,p))}}]),t}(b.default.Component);k.propTypes={prefixCls:C.default.string,className:C.default.string,children:C.default.node.isRequired,style:C.default.object,sidebarStyle:C.default.object,contentStyle:C.default.object,overlayStyle:C.default.object,dragHandleStyle:C.default.object,sidebar:C.default.node.isRequired,docked:C.default.bool,open:C.default.bool,transitions:C.default.bool,touch:C.default.bool,enableDragHandle:C.default.bool,position:C.default.oneOf(["left","right","top","bottom"]),dragToggleDistance:C.default.number,onOpenChange:C.default.func},k.defaultProps={prefixCls:"rc-drawer",sidebarStyle:{},contentStyle:{},overlayStyle:{},dragHandleStyle:{},docked:!1,open:!1,transitions:!0,touch:!0,enableDragHandle:!0,position:"left",dragToggleDistance:30,onOpenChange:function(){}},t.default=k,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(391),i=r(o);t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=this;t.hasOwnProperty("vertical")&&console.warn("vertical is deprecated, please use `direction` instead");var r=t.direction;if(r||t.hasOwnProperty("vertical")){var o=r?r:t.vertical?"DIRECTION_ALL":"DIRECTION_HORIZONTAL";e.get("pan").set({direction:_[o]}),e.get("swipe").set({direction:_[o]})}t.options&&Object.keys(t.options).forEach(function(r){if("recognizers"===r)Object.keys(t.options.recognizers).forEach(function(n){var r=e.get(n);r.set(t.options.recognizers[n]),t.options.recognizers[n].requireFailure&&r.requireFailure(t.options.recognizers[n].requireFailure)},n);else{var o=r,i={};i[o]=t.options[r],e.set(i)}},this),t.recognizeWith&&Object.keys(t.recognizeWith).forEach(function(n){var r=e.get(n);r.recognizeWith(t.recognizeWith[n])},this),Object.keys(t).forEach(function(n){var r=x[n];r&&(e.off(r),e.on(r,t[n]))})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),s=n(5),l=r(s),u=n(4),c=r(u),d=n(3),f=r(d),p=n(1),h=r(p),m=n(9),v=r(m),y=n(11),g=r(y),_="undefined"!=typeof window?n(364):void 0,b={children:!0,direction:!0,options:!0,recognizeWith:!0,vertical:!0},x={action:"tap press",onDoubleTap:"doubletap",onPan:"pan",onPanCancel:"pancancel",onPanEnd:"panend",onPanStart:"panstart",onPinch:"pinch",onPinchCancel:"pinchcancel",onPinchEnd:"pinchend",onPinchIn:"pinchin",onPinchOut:"pinchout",onPinchStart:"pinchstart",onPress:"press",onPressUp:"pressup",onRotate:"rotate",onRotateCancel:"rotatecancel",onRotateEnd:"rotateend",onRotateMove:"rotatemove",onRotateStart:"rotatestart",onSwipe:"swipe",onSwipeRight:"swiperight",onSwipeLeft:"swipeleft",onSwipeUp:"swipeup",onSwipeDown:"swipedown",onTap:"tap"};Object.keys(x).forEach(function(e){b[e]=!0});var C=function(e){function t(){return(0,a.default)(this,t),(0,c.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,f.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.hammer=new _(g.default.findDOMNode(this)),o(this.hammer,this.props)}},{key:"componentDidUpdate",value:function(){this.hammer&&o(this.hammer,this.props)}},{key:"componentWillUnmount",value:function(){this.hammer&&(this.hammer.stop(),this.hammer.destroy()),this.hammer=null}},{key:"render",value:function(){var e={};return Object.keys(this.props).forEach(function(t){b[t]||(e[t]=this.props[t])},this),h.default.cloneElement(h.default.Children.only(this.props.children),e)}}]),t}(h.default.Component);C.displayName="Hammer",C.propTypes={className:v.default.string},t.default=C,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(14),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=n(17),_=r(g),b=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.disabled,r=(0,i.default)(e,["prefixCls","disabled"]);return m.default.createElement(_.default,{disabled:n,activeClassName:t+"-handler-active"},m.default.createElement("span",r))}}]),t}(h.Component);b.propTypes={prefixCls:y.default.string,disabled:y.default.bool},t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(e){e.preventDefault()}Object.defineProperty(t,"__esModule",{value:!0});var a=n(8),s=r(a),l=n(6),u=r(l),c=n(1),d=r(c),f=n(9),p=r(f),h=n(13),m=r(h),v=n(7),y=r(v),g=n(396),_=r(g),b=n(394),x=r(b),C=(0,m.default)({propTypes:{focusOnUpDown:p.default.bool,onChange:p.default.func,onKeyDown:p.default.func,onKeyUp:p.default.func,prefixCls:p.default.string,tabIndex:p.default.string,disabled:p.default.bool,onFocus:p.default.func,onBlur:p.default.func,readOnly:p.default.bool,max:p.default.number,min:p.default.number,step:p.default.oneOfType([p.default.number,p.default.string]),upHandler:p.default.node,downHandler:p.default.node,useTouch:p.default.bool,formatter:p.default.func,parser:p.default.func,onMouseEnter:p.default.func,onMouseLeave:p.default.func,onMouseOver:p.default.func,onMouseOut:p.default.func,precision:p.default.number},mixins:[_.default],getDefaultProps:function(){return{focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number"}},componentDidMount:function(){this.componentDidUpdate()},componentWillUpdate:function(){try{this.start=this.refs.input.selectionStart,this.end=this.refs.input.selectionEnd}catch(e){}},componentDidUpdate:function(){if(this.props.focusOnUpDown&&this.state.focused){var e=this.refs.input.setSelectionRange;e&&"function"==typeof e&&void 0!==this.start&&void 0!==this.end&&this.start!==this.end?this.refs.input.setSelectionRange(this.start,this.end):this.focus()}},onKeyDown:function e(t){if(38===t.keyCode){var n=this.getRatio(t);this.up(t,n),this.stop()}else if(40===t.keyCode){var r=this.getRatio(t);this.down(t,r),this.stop()}var e=this.props.onKeyDown;if(e){for(var o=arguments.length,i=Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];e.apply(void 0,[t].concat(i))}},onKeyUp:function e(t){this.stop();var e=this.props.onKeyUp;if(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.apply(void 0,[t].concat(r))}},getRatio:function(e){var t=1;return e.metaKey||e.ctrlKey?t=.1:e.shiftKey&&(t=10),t},getValueFromEvent:function(e){return e.target.value},focus:function(){this.refs.input.focus()},formatWrapper:function(e){return this.props.formatter?this.props.formatter(e):e},render:function(){var e,t=(0,u.default)({},this.props),n=t.prefixCls,r=t.disabled,a=t.readOnly,l=t.useTouch,c=(0,y.default)((e={},(0,s.default)(e,n,!0),(0,s.default)(e,t.className,!!t.className),(0,s.default)(e,n+"-disabled",r),(0,s.default)(e,n+"-focused",this.state.focused),e)),f="",p="",h=this.state.value;if(h)if(isNaN(h))f=n+"-handler-up-disabled",p=n+"-handler-down-disabled";else{var m=Number(h);m>=t.max&&(f=n+"-handler-up-disabled"),m<=t.min&&(p=n+"-handler-down-disabled")}var v=!t.readOnly&&!t.disabled,g=void 0;g=this.state.focused?this.state.inputValue:this.toPrecisionAsStep(this.state.value),void 0!==g&&null!==g||(g="");var _=void 0,b=void 0;l?(_={onTouchStart:v&&!f?this.up:o,onTouchEnd:this.stop},b={onTouchStart:v&&!p?this.down:o,onTouchEnd:this.stop}):(_={onMouseDown:v&&!f?this.up:o,onMouseUp:this.stop,onMouseLeave:this.stop},b={onMouseDown:v&&!p?this.down:o,onMouseUp:this.stop,onMouseLeave:this.stop});var C=this.formatWrapper(g),S=!!f||r||a,E=!!p||r||a;return d.default.createElement("div",{className:c,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onMouseOver:t.onMouseOver,onMouseOut:t.onMouseOut},d.default.createElement("div",{className:n+"-handler-wrap"},d.default.createElement(x.default,(0,u.default)({ref:"up",disabled:S,prefixCls:n,unselectable:"unselectable"},_,{role:"button","aria-label":"Increase Value","aria-disabled":!!S,className:n+"-handler "+n+"-handler-up "+f}),this.props.upHandler||d.default.createElement("span",{unselectable:"unselectable",className:n+"-handler-up-inner",onClick:i})),d.default.createElement(x.default,(0,u.default)({ref:"down",disabled:E,prefixCls:n,unselectable:"unselectable"},b,{role:"button","aria-label":"Decrease Value","aria-disabled":!!E,className:n+"-handler "+n+"-handler-down "+p}),this.props.downHandler||d.default.createElement("span",{unselectable:"unselectable",className:n+"-handler-down-inner",onClick:i}))),d.default.createElement("div",{className:n+"-input-wrap",role:"spinbutton","aria-valuemin":t.min,"aria-valuemax":t.max,"aria-valuenow":h},d.default.createElement("input",{type:t.type,placeholder:t.placeholder,onClick:t.onClick,className:n+"-input",tabIndex:t.tabIndex,autoComplete:"off",onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:v?this.onKeyDown:o,onKeyUp:v?this.onKeyUp:o,autoFocus:t.autoFocus,maxLength:t.maxLength,readOnly:t.readOnly,disabled:t.disabled,max:t.max,min:t.min,name:t.name,id:t.id,onChange:this.onChange,ref:"input",value:C})))}});t.default=C,e.exports=t.default},function(e,t){"use strict";function n(){}function r(e){return e.replace(/[^\w\.-]+/g,"")}Object.defineProperty(t,"__esModule",{value:!0});var o=200,i=600,a=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1;t.default={getDefaultProps:function(){return{max:a,min:-a,step:1,style:{},onChange:n,onKeyDown:n,onFocus:n,onBlur:n,parser:r}},getInitialState:function(){var e=void 0,t=this.props;return e="value"in t?t.value:t.defaultValue,e=this.toNumber(e),{inputValue:this.toPrecisionAsStep(e),value:e,focused:t.autoFocus}},componentWillReceiveProps:function(e){"value"in e&&this.setState({inputValue:e.value,value:e.value})},componentWillUnmount:function(){this.stop()},onChange:function(e){var t=this.props.parser(this.getValueFromEvent(e).trim());this.setState({inputValue:t}),this.props.onChange(this.toNumberWhenUserInput(t))},onFocus:function(){var e;this.setState({focused:!0}),(e=this.props).onFocus.apply(e,arguments)},onBlur:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.setState({focused:!1});var i=this.getCurrentValidValue(this.state.inputValue);e.persist(),this.setValue(i,function(){var n;(n=t.props).onBlur.apply(n,[e].concat(r))})},getCurrentValidValue:function(e){var t=e,n=this.props;return""===t?t="":this.isNotCompleteNumber(t)?t=this.state.value:(t=Number(t),t<n.min&&(t=n.min),t>n.max&&(t=n.max)),this.toNumber(t)},setValue:function(e,t){var n=this.isNotCompleteNumber(parseFloat(e,10))?void 0:parseFloat(e,10),r=n!==this.state.value;"value"in this.props?this.setState({inputValue:this.toPrecisionAsStep(this.state.value)},t):this.setState({value:n,inputValue:this.toPrecisionAsStep(e)},t),r&&this.props.onChange(n)},getPrecision:function(e){if("precision"in this.props)return this.props.precision;var t=e.toString();if(t.indexOf("e-")>=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n},getMaxPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if("precision"in this.props)return this.props.precision;var n=this.props.step,r=this.getPrecision(t),o=this.getPrecision(n),i=this.getPrecision(e);return e?Math.max(i,r+o):r+o},getPrecisionFactor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(e,t);return Math.pow(10,n)},toPrecisionAsStep:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)},isNotCompleteNumber:function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},toNumber:function(e){return this.isNotCompleteNumber(e)?e:"precision"in this.props?Number(Number(e).toFixed(this.props.precision)):Number(e)},toNumberWhenUserInput:function(e){return(/\.\d*0$/.test(e)||e.length>16)&&this.state.focused?e:this.toNumber(e)},upStep:function(e,t){var n=this.props,r=n.step,o=n.min,i=this.getPrecisionFactor(e,t),a=Math.abs(this.getMaxPrecision(e,t)),s=void 0;return s="number"==typeof e?((i*e+i*r*t)/i).toFixed(a):o===-(1/0)?r:o,this.toNumber(s)},downStep:function(e,t){var n=this.props,r=n.step,o=n.min,i=this.getPrecisionFactor(e,t),a=Math.abs(this.getMaxPrecision(e,t)),s=void 0;return s="number"==typeof e?((i*e-i*r*t)/i).toFixed(a):o===-(1/0)?-r:o,this.toNumber(s)},step:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t&&t.preventDefault();var r=this.props;if(!r.disabled){var o=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(o)){var i=this[e+"Step"](o,n);i>r.max?i=r.max:i<r.min&&(i=r.min),this.setValue(i),this.setState({focused:!0})}}},stop:function(){this.autoStepTimer&&clearTimeout(this.autoStepTimer)},down:function(e,t,n){var r=this;e.persist&&e.persist(),this.stop(),this.step("down",e,t),this.autoStepTimer=setTimeout(function(){r.down(e,t,!0)},n?o:i)},up:function(e,t,n){var r=this;e.persist&&e.persist(),this.stop(),this.step("up",e,t),this.autoStepTimer=setTimeout(function(){r.up(e,t,!0)},n?o:i)}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(7),y=r(v),g=n(9),_=r(g),b=function(e){function t(){var e,n,r,o;(0,s.default)(this,t);for(var i=arguments.length,a=Array(i),l=0;l<i;l++)a[l]=arguments[l];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.clearCloseTimer=function(){r.closeTimer&&(clearTimeout(r.closeTimer),r.closeTimer=null)},r.close=function(){r.clearCloseTimer(),r.props.onClose()},o=n,(0,d.default)(r,o)}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){var e=this;this.props.duration&&(this.closeTimer=setTimeout(function(){e.close()},1e3*this.props.duration))}},{key:"componentWillUnmount",value:function(){this.clearCloseTimer()}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls+"-notice",r=(e={},(0,i.default)(e,""+n,1),(0,i.default)(e,n+"-closable",t.closable),(0,i.default)(e,t.className,!!t.className),e);return m.default.createElement("div",{className:(0,y.default)(r),style:t.style},m.default.createElement("div",{className:n+"-content"},t.children),t.closable?m.default.createElement("a",{tabIndex:"0",onClick:this.close,className:n+"-close"},m.default.createElement("span",{className:n+"-close-x"})):null)}}]),t}(h.Component);b.propTypes={duration:_.default.number,onClose:_.default.func,children:_.default.any},b.defaultProps={onEnd:function(){},onClose:function(){},duration:1.5,style:{right:"50%"}},t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){return"rcNotification_"+j+"_"+D++}Object.defineProperty(t,"__esModule",{value:!0});var i=n(14),a=r(i),s=n(8),l=r(s),u=n(6),c=r(u),d=n(2),f=r(d),p=n(5),h=r(p),m=n(4),v=r(m),y=n(3),g=r(y),_=n(1),b=r(_),x=n(9),C=r(x),S=n(11),E=r(S),w=n(50),O=r(w),P=n(437),k=r(P),T=n(7),M=r(T),N=n(397),R=r(N),D=0,j=Date.now(),I=function(e){function t(){var e,n,r,i;(0,f.default)(this,t);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return n=r=(0,v.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={notices:[]},r.add=function(e){var t=e.key=e.key||o();r.setState(function(n){var r=n.notices;if(!r.filter(function(e){return e.key===t}).length)return{notices:r.concat(e)}})},r.remove=function(e){r.setState(function(t){return{notices:t.notices.filter(function(t){return t.key!==e})}})},i=n,(0,v.default)(r,i)}return(0,g.default)(t,e),(0,h.default)(t,[{key:"getTransitionName",value:function(){var e=this.props,t=e.transitionName;return!t&&e.animation&&(t=e.prefixCls+"-"+e.animation),t}},{key:"render",value:function(){var e,t=this,n=this.props,r=this.state.notices.map(function(e){var r=(0,k.default)(t.remove.bind(t,e.key),e.onClose);return b.default.createElement(R.default,(0,c.default)({prefixCls:n.prefixCls},e,{onClose:r}),e.content)}),o=(e={},(0,l.default)(e,n.prefixCls,1),(0,l.default)(e,n.className,!!n.className),e);return b.default.createElement("div",{className:(0,M.default)(o),style:n.style},b.default.createElement(O.default,{transitionName:this.getTransitionName()},r))}}]),t}(_.Component);I.propTypes={prefixCls:C.default.string,transitionName:C.default.string,animation:C.default.oneOfType([C.default.string,C.default.object]),style:C.default.object},I.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}},I.newInstance=function(e){var t=e||{},n=t.getContainer,r=(0,a.default)(t,["getContainer"]),o=void 0;n?o=n():(o=document.createElement("div"),document.body.appendChild(o));var i=E.default.render(b.default.createElement(I,r),o);return{notice:function(e){i.add(e)},removeNotice:function(e){i.remove(e)},component:i,destroy:function(){E.default.unmountComponentAtNode(o),n||document.body.removeChild(o)}}},t.default=I,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(398),i=r(o);t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),a=o(i),s=n(45),l=o(s),u=n(6),c=o(u),d=n(2),f=o(d),p=n(5),h=o(p),m=n(4),v=o(m),y=n(3),g=o(y),_=n(1),b=o(_),x=n(9),C=o(x),S=n(7),E=o(S),w=n(472),O=o(w),P=n(120),k=o(P),T=n(121),M=o(T),N=n(75),R=r(N),D=function(e){function t(e){(0,f.default)(this,t);var n=(0,v.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onEnd=function(){n.setState({handle:null}),n.removeDocumentEvents(),n.props.onAfterChange(n.getValue())};var r=e.count,o=e.min,i=e.max,a=Array.apply(null,Array(r+1)).map(function(){return o}),s="defaultValue"in e?e.defaultValue:a,l=void 0!==e.value?e.value:s,u=l.map(function(e){return n.trimAlignValue(e)}),c=u[0]===i?0:u.length-1;return n.state={handle:null,recent:c,bounds:u},n}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=this;if(("value"in e||"min"in e||"max"in e)&&(this.props.min!==e.min||this.props.max!==e.max||!(0,O.default)(this.props.value,e.value))){var n=this.state.bounds,r=e.value||n,o=r.map(function(n){return t.trimAlignValue(n,e)});o.length===n.length&&o.every(function(e,t){return e===n[t]})||(this.setState({bounds:o}),n.some(function(t){return R.isValueOutOfRange(t,e)})&&this.props.onChange(o))}}},{key:"onChange",value:function(e){var t=this.props,n=!("value"in t);n?this.setState(e):void 0!==e.handle&&this.setState({handle:e.handle});var r=(0,c.default)({},this.state,e),o=r.bounds;t.onChange(o)}},{key:"onStart",value:function(e){var t=this.props,n=this.state,r=this.getValue();t.onBeforeChange(r);var o=this.calcValueByPos(e);this.startValue=o,this.startPosition=e;var i=this.getClosestBound(o),a=this.getBoundNeedMoving(o,i);this.setState({handle:a,recent:a});var s=r[a];if(o!==s){var u=[].concat((0,l.default)(n.bounds));u[a]=o,this.onChange({bounds:u})}}},{key:"onMove",value:function(e,t){R.pauseEvent(e);var n=this.props,r=this.state,o=this.calcValueByPos(t),i=r.bounds[r.handle];if(o!==i){var a=[].concat((0,l.default)(r.bounds));a[r.handle]=o;var s=r.handle;if(n.pushable!==!1){var u=r.bounds[s];this.pushSurroundingHandles(a,s,u)}else n.allowCross&&(a.sort(function(e,t){return e-t}),s=a.indexOf(o));this.onChange({handle:s,bounds:a})}}},{key:"getValue",value:function(){return this.state.bounds}},{key:"getClosestBound",value:function(e){for(var t=this.state.bounds,n=0,r=1;r<t.length-1;++r)e>t[r]&&(n=r);return Math.abs(t[n+1]-e)<Math.abs(t[n]-e)&&(n+=1),n}},{key:"getBoundNeedMoving",value:function(e,t){var n=this.state,r=n.bounds,o=n.recent,i=t,a=r[t+1]===r[t];return a&&(i=o),a&&e!==r[t+1]&&(i=e<r[t+1]?t:t+1),i}},{key:"getLowerBound",value:function(){return this.state.bounds[0]}},{key:"getUpperBound",value:function(){var e=this.state.bounds;return e[e.length-1]}},{key:"getPoints",value:function(){var e=this.props,t=e.marks,n=e.step,r=e.min,o=e.max,i=this._getPointsCache;if(!i||i.marks!==t||i.step!==n){var a=(0,c.default)({},t);if(null!==n)for(var s=r;s<=o;s+=n)a[s]=s;var l=Object.keys(a).map(parseFloat);l.sort(function(e,t){return e-t}),this._getPointsCache={marks:t,step:n,points:l}}return this._getPointsCache.points}},{key:"pushSurroundingHandles",value:function(e,t,n){var r=this.props.pushable,o=e[t],i=0;if(e[t+1]-o<r&&(i=1),o-e[t-1]<r&&(i=-1),0!==i){var a=t+i,s=i*(e[a]-o);this.pushHandle(e,a,i,r-s)||(e[t]=n)}}},{key:"pushHandle",value:function(e,t,n,r){for(var o=e[t],i=e[t];n*(i-o)<r;){if(!this.pushHandleOnePoint(e,t,n))return e[t]=o,!1;i=e[t]}return!0}},{key:"pushHandleOnePoint",value:function(e,t,n){var r=this.getPoints(),o=r.indexOf(e[t]),i=o+n;if(i>=r.length||i<0)return!1;var a=t+n,s=r[i],l=this.props.pushable,u=n*(e[a]-s);return!!this.pushHandle(e,a,n,l-u)&&(e[t]=s,!0)}},{key:"trimAlignValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,c.default)({},this.props,t),r=R.ensureValueInRange(e,n),o=this.ensureValueNotConflict(r,n);return R.ensureValuePrecision(o,n)}},{key:"ensureValueNotConflict",value:function(e,t){var n=t.allowCross,r=this.state||{},o=r.handle,i=r.bounds;if(!n&&null!=o){if(o>0&&e<=i[o-1])return i[o-1];if(o<i.length-1&&e>=i[o+1])return i[o+1]}return e}},{key:"render",value:function(){var e=this,t=this.state,n=t.handle,r=t.bounds,o=this.props,i=o.prefixCls,s=o.vertical,l=o.included,u=o.disabled,c=o.min,d=o.max,f=o.handle,p=o.trackStyle,h=o.handleStyle,m=r.map(function(t){return e.calcOffset(t)}),v=i+"-handle",y=r.map(function(t,r){var o;return f({className:(0,E.default)((o={},(0,a.default)(o,v,!0),(0,a.default)(o,v+"-"+(r+1),!0),o)),vertical:s,offset:m[r],value:t,dragging:n===r,index:r,min:c,max:d,disabled:u,style:h[r],ref:function(t){return e.saveHandle(r,t)}})}),g=r.slice(0,-1).map(function(e,t){var n,r=t+1,o=(0,E.default)((n={},(0,a.default)(n,i+"-track",!0),(0,a.default)(n,i+"-track-"+r,!0),n));return b.default.createElement(k.default,{className:o,vertical:s,included:l,offset:m[r-1],length:m[r]-m[r-1],style:p[t],key:r})});return{tracks:g,handles:y}}}]),t}(b.default.Component);D.displayName="Range",D.propTypes={defaultValue:C.default.arrayOf(C.default.number),value:C.default.arrayOf(C.default.number),count:C.default.number,pushable:C.default.oneOfType([C.default.bool,C.default.number]),allowCross:C.default.bool,disabled:C.default.bool},D.defaultProps={count:1,allowCross:!0,pushable:!1},t.default=(0,M.default)(D),e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=o(i),s=n(2),l=o(s),u=n(5),c=o(u),d=n(4),f=o(d),p=n(3),h=o(p),m=n(1),v=o(m),y=n(9),g=o(y),_=n(29),b=(o(_),n(120)),x=o(b),C=n(121),S=o(C),E=n(75),w=r(E),O=function(e){function t(e){(0,l.default)(this,t);var n=(0,f.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onEnd=function(){n.setState({dragging:!1}),n.removeDocumentEvents(),n.props.onAfterChange(n.getValue())};var r=void 0!==e.defaultValue?e.defaultValue:e.min,o=void 0!==e.value?e.value:r;return n.state={value:n.trimAlignValue(o),dragging:!1},n}return(0,h.default)(t,e),(0,c.default)(t,[{key:"componentWillReceiveProps",value:function(e){if("value"in e||"min"in e||"max"in e){var t=this.state.value,n=void 0!==e.value?e.value:t,r=this.trimAlignValue(n,e);r!==t&&(this.setState({value:r}),w.isValueOutOfRange(n,e)&&this.props.onChange(r))}}},{key:"onChange",value:function(e){var t=this.props,n=!("value"in t);n&&this.setState(e);var r=e.value;t.onChange(r)}},{key:"onStart",value:function(e){this.setState({dragging:!0});var t=this.props,n=this.getValue();t.onBeforeChange(n);var r=this.calcValueByPos(e);this.startValue=r,this.startPosition=e,r!==n&&this.onChange({value:r})}},{key:"onMove",value:function(e,t){w.pauseEvent(e);var n=this.state,r=this.calcValueByPos(t),o=n.value;r!==o&&this.onChange({value:r})}},{key:"getValue",value:function(){return this.state.value}},{key:"getLowerBound",value:function(){return this.props.min}},{key:"getUpperBound",value:function(){return this.state.value}},{key:"trimAlignValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,a.default)({},this.props,t),r=w.ensureValueInRange(e,n);return w.ensureValuePrecision(r,n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.vertical,o=t.included,i=t.disabled,s=t.minimumTrackStyle,l=t.trackStyle,u=t.handleStyle,c=t.min,d=t.max,f=t.handle,p=this.state,h=p.value,m=p.dragging,y=this.calcOffset(h),g=f({className:n+"-handle",vertical:r,offset:y,value:h,dragging:m,disabled:i,min:c,max:d,style:u[0]||u,ref:function(t){return e.saveHandle(0,t)}}),_=l[0]||l,b=v.default.createElement(x.default,{className:n+"-track",vertical:r,included:o,offset:0,length:y,style:(0,a.default)({},s,_)});return{tracks:b,handles:g}}}]),t}(v.default.Component);O.propTypes={defaultValue:g.default.number,value:g.default.number,disabled:g.default.bool},t.default=(0,S.default)(O),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(31),s=r(a),l=n(8),u=r(l),c=n(1),d=r(c),f=n(7),p=r(f),h=function(e){var t=e.className,n=e.vertical,r=e.marks,o=e.included,a=e.upperBound,l=e.lowerBound,c=e.max,f=e.min,h=Object.keys(r),m=h.length,v=m>1?100/(m-1):100,y=.9*v,g=c-f,_=h.map(parseFloat).sort(function(e,t){return e-t}).map(function(e){var c,h=!o&&e===a||o&&e<=a&&e>=l,m=(0,p.default)((c={},(0,u.default)(c,t+"-text",!0),(0,u.default)(c,t+"-text-active",h),c)),v={marginBottom:"-50%",bottom:(e-f)/g*100+"%"},_={width:y+"%",marginLeft:-y/2+"%",left:(e-f)/g*100+"%"},b=n?v:_,x=r[e],C="object"===("undefined"==typeof x?"undefined":(0,s.default)(x))&&!d.default.isValidElement(x),S=C?x.label:x,E=C?(0,i.default)({},b,x.style):b;return d.default.createElement("span",{className:m,style:E,key:e},S)});return d.default.createElement("div",{className:t},_)};t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(6),s=r(a),l=n(1),u=r(l),c=n(7),d=r(c),f=n(29),p=r(f),h=function(e,t,n,r,o,i){(0,p.default)(!n||r>0,"`Slider[step]` should be a positive number in order to make Slider[dots] work.");var a=Object.keys(t).map(parseFloat);if(n)for(var s=o;s<=i;s+=r)a.indexOf(s)>=0||a.push(s);return a},m=function(e){var t=e.prefixCls,n=e.vertical,r=e.marks,o=e.dots,a=e.step,l=e.included,c=e.lowerBound,f=e.upperBound,p=e.max,m=e.min,v=e.dotStyle,y=e.activeDotStyle,g=p-m,_=h(n,r,o,a,m,p).map(function(e){var r,o=Math.abs(e-m)/g*100+"%",a=!l&&e===f||l&&e<=f&&e>=c,p=n?(0,s.default)({bottom:o},v):(0,s.default)({left:o},v);a&&(p=(0,s.default)({},p,y));var h=(0,d.default)((r={},(0,i.default)(r,t+"-dot",!0),(0,i.default)(r,t+"-dot-active",a),r));return u.default.createElement("span",{className:h,style:p,key:e})});return u.default.createElement("div",{className:t+"-step"},_)};t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t,n;return n=t=function(t){function n(e){(0,f.default)(this,n);var t=(0,v.default)(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.handleTooltipVisibleChange=function(e,n){t.setState(function(t){return{visibles:(0,c.default)({},t.visibles,(0,l.default)({},e,n))}})},t.handleWithTooltip=function(e){var n=e.value,r=e.dragging,o=e.index,i=e.disabled,s=(0, a.default)(e,["value","dragging","index","disabled"]),l=t.props,u=l.tipFormatter,d=l.tipProps,f=l.handleStyle,p=d.prefixCls,h=void 0===p?"rc-slider-tooltip":p,m=d.overlay,v=void 0===m?u(n):m,y=d.placement,g=void 0===y?"top":y,_=(0,a.default)(d,["prefixCls","overlay","placement"]);return b.default.createElement(E.default,(0,c.default)({},_,{prefixCls:h,overlay:v,placement:g,visible:!i&&(t.state.visibles[o]||r),key:o}),b.default.createElement(O.default,(0,c.default)({},s,{style:(0,c.default)({},f[0]),value:n,onMouseEnter:function(){return t.handleTooltipVisibleChange(o,!0)},onMouseLeave:function(){return t.handleTooltipVisibleChange(o,!1)}})))},t.state={visibles:{}},t}return(0,g.default)(n,t),(0,h.default)(n,[{key:"render",value:function(){return b.default.createElement(e,(0,c.default)({},this.props,{handle:this.handleWithTooltip}))}}]),n}(b.default.Component),t.propTypes={tipFormatter:C.default.func,handleStyle:C.default.arrayOf(C.default.object),tipProps:C.default.object},t.defaultProps={tipFormatter:function(e){return e},handleStyle:[{}],tipProps:{}},n}Object.defineProperty(t,"__esModule",{value:!0});var i=n(14),a=r(i),s=n(8),l=r(s),u=n(6),c=r(u),d=n(2),f=r(d),p=n(5),h=r(p),m=n(4),v=r(m),y=n(3),g=r(y);t.default=o;var _=n(1),b=r(_),x=n(9),C=r(x),S=n(125),E=r(S),w=n(119),O=r(w);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var o=n[r],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}function c(e){return"string"==typeof e}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=n(1),p=r(f),h=n(9),m=r(h),v=n(7),y=r(v),g=function(e){function t(){return s(this,t),l(this,e.apply(this,arguments))}return u(t,e),t.prototype.render=function(){var e,t,n=this.props,r=n.className,o=n.prefixCls,s=n.style,l=n.itemWidth,u=n.status,f=void 0===u?"wait":u,h=n.iconPrefix,m=n.icon,v=n.wrapperStyle,g=n.adjustMarginRight,_=n.stepNumber,b=n.description,x=n.title,C=n.progressDot,S=a(n,["className","prefixCls","style","itemWidth","status","iconPrefix","icon","wrapperStyle","adjustMarginRight","stepNumber","description","title","progressDot"]),E=(0,y.default)((e={},i(e,o+"-icon",!0),i(e,h+"icon",!0),i(e,h+"icon-"+m,m&&c(m)),i(e,h+"icon-check",!m&&"finish"===f),i(e,h+"icon-cross",!m&&"error"===f),e)),w=void 0,O=p.default.createElement("span",{className:o+"-icon-dot"});w=C?"function"==typeof C?p.default.createElement("span",{className:o+"-icon"},C(O,{index:_-1,status:f,title:x,description:b})):p.default.createElement("span",{className:o+"-icon"},O):m&&!c(m)?p.default.createElement("span",{className:o+"-icon"},m):m||"finish"===f||"error"===f?p.default.createElement("span",{className:E}):p.default.createElement("span",{className:o+"-icon"},_);var P=(0,y.default)((t={},i(t,o+"-item",!0),i(t,o+"-status-"+f,!0),i(t,o+"-custom",m),i(t,r,!!r),t));return p.default.createElement("div",d({},S,{className:P,style:d({width:l,marginRight:g},s)}),p.default.createElement("div",{ref:"tail",className:o+"-tail",style:{paddingRight:-g}},p.default.createElement("i",null)),p.default.createElement("div",{className:o+"-step"},p.default.createElement("div",{className:o+"-head",style:{background:v.background||v.backgroundColor}},p.default.createElement("div",{className:o+"-head-inner"},w)),p.default.createElement("div",{ref:"main",className:o+"-main"},p.default.createElement("div",{className:o+"-title",style:{background:v.background||v.backgroundColor}},x),b?p.default.createElement("div",{className:o+"-description"},b):"")))},t}(p.default.Component);t.default=g,g.propTypes={className:m.default.string,prefixCls:m.default.string,style:m.default.object,wrapperStyle:m.default.object,itemWidth:m.default.oneOfType([m.default.number,m.default.string]),status:m.default.string,iconPrefix:m.default.string,icon:m.default.node,adjustMarginRight:m.default.oneOfType([m.default.number,m.default.string]),stepNumber:m.default.string,description:m.default.any,title:m.default.any,progressDot:m.default.oneOfType([m.default.bool,m.default.func])},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var o=n[r],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d=n(1),f=r(d),p=n(9),h=r(p),m=n(11),v=r(m),y=n(7),g=r(y),_=n(368),b=r(_),x=function(e){function t(n){s(this,t);var r=l(this,e.call(this,n));return r.calcStepOffsetWidth=function(){var e=v.default.findDOMNode(r);e.children.length>0&&(r.calcTimeout&&clearTimeout(r.calcTimeout),r.calcTimeout=setTimeout(function(){var t=(e.lastChild.offsetWidth||0)+1;r.state.lastStepOffsetWidth===t||Math.abs(r.state.lastStepOffsetWidth-t)<=3||r.setState({lastStepOffsetWidth:t})}))},r.state={lastStepOffsetWidth:0},r.calcStepOffsetWidth=(0,b.default)(r.calcStepOffsetWidth,150),r}return u(t,e),t.prototype.componentDidMount=function(){this.calcStepOffsetWidth()},t.prototype.componentDidUpdate=function(){this.calcStepOffsetWidth()},t.prototype.componentWillUnmount=function(){this.calcTimeout&&clearTimeout(this.calcTimeout),this.calcStepOffsetWidth.cancel&&this.calcStepOffsetWidth.cancel()},t.prototype.render=function(){var e,t=this,n=this.props,r=n.prefixCls,o=n.style,s=void 0===o?{}:o,l=n.className,u=n.children,d=n.direction,p=n.labelPlacement,h=n.iconPrefix,m=n.status,v=n.size,y=n.current,_=n.progressDot,b=a(n,["prefixCls","style","className","children","direction","labelPlacement","iconPrefix","status","size","current","progressDot"]),x=u.length-1,C=this.state.lastStepOffsetWidth>0,S=_?"vertical":p,E=(0,g.default)((e={},i(e,r,!0),i(e,r+"-"+v,v),i(e,r+"-"+d,!0),i(e,r+"-label-"+S,"horizontal"===d),i(e,r+"-hidden",!C),i(e,r+"-dot",!!_),i(e,l,l),e));return f.default.createElement("div",c({className:E,style:s},b),f.default.Children.map(u,function(e,o){var i="vertical"!==d&&o!==x&&C?100/x+"%":null,a="vertical"===d||o===x?null:-Math.round(t.state.lastStepOffsetWidth/x+1),l={stepNumber:(o+1).toString(),itemWidth:i,adjustMarginRight:a,prefixCls:r,iconPrefix:h,wrapperStyle:s,progressDot:_};return"error"===m&&o===y-1&&(l.className=n.prefixCls+"-next-error"),e.props.status||(o===y?l.status=m:o<y?l.status="finish":l.status="wait"),f.default.cloneElement(e,l)},this))},t}(f.default.Component);t.default=x,x.propTypes={prefixCls:h.default.string,iconPrefix:h.default.string,direction:h.default.string,labelPlacement:h.default.string,children:h.default.any,status:h.default.string,size:h.default.string,progressDot:h.default.oneOfType([h.default.bool,h.default.func])},x.defaultProps={prefixCls:"rc-steps",iconPrefix:"rc",direction:"horizontal",labelPlacement:"horizontal",current:0,status:"process",size:"",progressDot:!1},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(406),i=r(o),a=n(405),s=r(a);i.default.Step=s.default,t.default=i.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(11),y=r(v),g=n(74),_=r(g),b=n(372),x=r(b),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n},S=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onPanStart=n.onPanStart.bind(n),n.onPan=n.onPan.bind(n),n.onPanEnd=n.onPanEnd.bind(n),n.onCloseSwipe=n.onCloseSwipe.bind(n),n.openedLeft=!1,n.openedRight=!1,n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){this.btnsLeftWidth=this.left?this.left.offsetWidth:0,this.btnsRightWidth=this.right?this.right.offsetWidth:0,document.body.addEventListener("touchstart",this.onCloseSwipe,!0)}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("touchstart",this.onCloseSwipe,!0)}},{key:"onCloseSwipe",value:function(e){var t=this;if(this.openedLeft||this.openedRight){var n=function(e){for(;e.parentNode&&e.parentNode!==document.body;){if(e.className.indexOf(t.props.prefixCls+"-actions")>-1)return e;e=e.parentNode}}(e.target);n||(e.preventDefault(),this.close())}}},{key:"onPanStart",value:function(e){this.panStartX=e.deltaX,this.panStartY=e.deltaY}},{key:"onPan",value:function(e){var t=e.deltaX-this.panStartX,n=e.deltaY-this.panStartY;if(!(Math.abs(t)<=Math.abs(n))){var r=this.props,o=r.left,i=void 0===o?[]:o,a=r.right,s=void 0===a?[]:a;t<0&&s.length?this._setStyle(Math.min(t,0)):t>0&&i.length&&this._setStyle(Math.max(t,0))}}},{key:"onPanEnd",value:function(e){var t=e.deltaX-this.panStartX,n=e.deltaY-this.panStartY;if(!(Math.abs(t)<=Math.abs(n))){var r=this.props,o=r.left,i=void 0===o?[]:o,a=r.right,s=void 0===a?[]:a,l=this.btnsLeftWidth,u=this.btnsRightWidth,c=t>l/2,d=t<-u/2;d&&t<0&&s.length?this.open(-u,!1,!0):c&&t>0&&i.length?this.open(l,!0,!1):this.close()}}},{key:"onBtnClick",value:function(e,t){var n=t.onPress;n&&n(e),this.props.autoClose&&this.close()}},{key:"_getContentEasing",value:function(e,t){return e<0&&e<t?t-Math.pow(t-e,.85):e>0&&e>t?t+Math.pow(e-t,.85):e}},{key:"_setStyle",value:function(e){var t=e>0?this.btnsLeftWidth:-this.btnsRightWidth,n=this._getContentEasing(e,t);this.content.style.left=n+"px",this.cover&&(this.cover.style.display=Math.abs(e)>0?"block":"none",this.cover.style.left=n+"px")}},{key:"open",value:function(e,t,n){this.openedLeft||this.openedRight||!this.props.onOpen||this.props.onOpen(),this.openedLeft=t,this.openedRight=n,this._setStyle(e)}},{key:"close",value:function(){(this.openedLeft||this.openedRight)&&this.props.onClose&&this.props.onClose(),this._setStyle(0),this.openedLeft=!1,this.openedRight=!1}},{key:"renderButtons",value:function(e,t){var n=this,r=this.props.prefixCls;return e&&e.length?m.default.createElement("div",{className:r+"-actions "+r+"-actions-"+t,ref:function(e){return n[t]=y.default.findDOMNode(e)}},e.map(function(e,t){return m.default.createElement("div",{key:t,className:r+"-btn "+(e.hasOwnProperty("className")?e.className:""),style:e.style,role:"button",onClick:function(t){return n.onBtnClick(t,e)}},m.default.createElement("div",{className:r+"-btn-text"},e.text||"Click"))})):null}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.left,o=t.right,a=t.disabled,s=t.children,l=C(t,["prefixCls","left","right","disabled","children"]),u=(0,x.default)(l,["autoClose","onOpen","onClose"]),c={ref:function(t){return e.content=y.default.findDOMNode(t)}};return!r.length&&!o.length||a?m.default.createElement("div",(0,i.default)({},c,u),s):m.default.createElement("div",(0,i.default)({className:""+n},u),m.default.createElement("div",{className:n+"-cover",ref:function(t){return e.cover=y.default.findDOMNode(t)}}),this.renderButtons(r,"left"),this.renderButtons(o,"right"),m.default.createElement(_.default,(0,i.default)({direction:"DIRECTION_HORIZONTAL",onPanStart:this.onPanStart,onPan:this.onPan,onPanEnd:this.onPanEnd},c),m.default.createElement("div",{className:n+"-content"},s)))}}]),t}(m.default.Component);S.defaultProps={prefixCls:"rc-swipeout",autoClose:!1,disabled:!1,left:[],right:[],onOpen:function(){},onClose:function(){}},t.default=S,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(408);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r(o).default}}),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(4),s=r(a),l=n(3),u=r(l),c=n(1),d=n(9),f=r(d),p=function(e){function t(){return(0,i.default)(this,t),(0,s.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,u.default)(t,e),t}(c.Component);p.propTypes={className:f.default.string,colSpan:f.default.number,title:f.default.node,dataIndex:f.default.string,width:f.default.oneOfType([f.default.number,f.default.string]),fixed:f.default.oneOf([!0,"left","right"]),render:f.default.func,onCellClick:f.default.func},t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(4),s=r(a),l=n(3),u=r(l),c=n(1),d=n(9),f=r(d),p=function(e){function t(){return(0,i.default)(this,t),(0,s.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,u.default)(t,e),t}(c.Component);p.propTypes={title:f.default.node},p.isTableColumnGroup=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(45),i=r(o),a=n(6),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(1),p=r(f),h=function(){function e(t,n){(0,u.default)(this,e),this._cached={},this.columns=t||this.normalize(n)}return(0,d.default)(e,[{key:"isAnyColumnsFixed",value:function(){var e=this;return this._cache("isAnyColumnsFixed",function(){return e.columns.some(function(e){return!!e.fixed})})}},{key:"isAnyColumnsLeftFixed",value:function(){var e=this;return this._cache("isAnyColumnsLeftFixed",function(){return e.columns.some(function(e){return"left"===e.fixed||e.fixed===!0})})}},{key:"isAnyColumnsRightFixed",value:function(){var e=this;return this._cache("isAnyColumnsRightFixed",function(){return e.columns.some(function(e){return"right"===e.fixed})})}},{key:"leftColumns",value:function(){var e=this;return this._cache("leftColumns",function(){return e.groupedColumns().filter(function(e){return"left"===e.fixed||e.fixed===!0})})}},{key:"rightColumns",value:function(){var e=this;return this._cache("rightColumns",function(){return e.groupedColumns().filter(function(e){return"right"===e.fixed})})}},{key:"leafColumns",value:function(){var e=this;return this._cache("leafColumns",function(){return e._leafColumns(e.columns)})}},{key:"leftLeafColumns",value:function(){var e=this;return this._cache("leftLeafColumns",function(){return e._leafColumns(e.leftColumns())})}},{key:"rightLeafColumns",value:function(){var e=this;return this._cache("rightLeafColumns",function(){return e._leafColumns(e.rightColumns())})}},{key:"groupedColumns",value:function(){var e=this;return this._cache("groupedColumns",function(){var t=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];o[n]=o[n]||[];var i=[],a=function(e){var t=o.length-n;e&&!e.children&&t>1&&(!e.rowSpan||e.rowSpan<t)&&(e.rowSpan=t)};return t.forEach(function(l,u){var c=(0,s.default)({},l);o[n].push(c),r.colSpan=r.colSpan||0,c.children&&c.children.length>0?(c.children=e(c.children,n+1,c,o),r.colSpan=r.colSpan+c.colSpan):r.colSpan++;for(var d=0;d<o[n].length-1;++d)a(o[n][d]);u+1===t.length&&a(c),i.push(c)}),i};return t(e.columns)})}},{key:"normalize",value:function(e){var t=this,n=[];return p.default.Children.forEach(e,function(e){if(p.default.isValidElement(e)){var r=(0,s.default)({},e.props);e.key&&(r.key=e.key),e.type.isTableColumnGroup&&(r.children=t.normalize(r.children)),n.push(r)}}),n}},{key:"reset",value:function(e,t){this.columns=e||this.normalize(t),this._cached={}}},{key:"_cache",value:function(e,t){return e in this._cached?this._cached[e]:(this._cached[e]=t(),this._cached[e])}},{key:"_leafColumns",value:function(e){var t=this,n=[];return e.forEach(function(e){e.children?n.push.apply(n,(0,i.default)(t._leafColumns(e.children))):n.push(e)}),n}}]),e}();t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(9),m=r(h),v=n(76),y=r(v),g=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"shouldComponentUpdate",value:function(e){return!(0,y.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.expandable,n=e.prefixCls,r=e.onExpand,o=e.needIndentSpaced,i=e.expanded,a=e.record;if(t){var s=i?"expanded":"collapsed";return p.default.createElement("span",{className:n+"-expand-icon "+n+"-"+s,onClick:function(e){return r(!i,a,e)}})}return o?p.default.createElement("span",{className:n+"-expand-icon "+n+"-spaced"}):null}}]),t}(p.default.Component);g.propTypes={record:m.default.object,prefixCls:m.default.string,expandable:m.default.any,expanded:m.default.bool,needIndentSpaced:m.default.bool,onExpand:m.default.func},t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(45),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(9),_=r(g),b=n(417),x=r(b),C=n(416),S=r(C),E=n(420),w=n(76),O=r(w),P=n(53),k=r(P),T=n(412),M=r(T),N=n(418),R=r(N),D=n(98),j=r(D),I=function(e){function t(e){(0,u.default)(this,t);var n=(0,p.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onExpanded=function(e,t,r,o){r&&(r.preventDefault(),r.stopPropagation());var i=n.findExpandedRow(t);if("undefined"==typeof i||e){if(!i&&e){var a=n.getExpandedRows().concat();a.push(n.getRowKey(t,o)),n.onExpandedRowsChange(a)}}else n.onRowDestroy(t,o);n.props.onExpand(e,t)},n.onRowDestroy=function(e,t){var r=n.getExpandedRows().concat(),o=n.getRowKey(e,t),i=-1;r.forEach(function(e,t){e===o&&(i=t)}),i!==-1&&r.splice(i,1),n.onExpandedRowsChange(r)},n.handleWindowResize=function(){n.syncFixedTableRowHeight(),n.setScrollPositionClassName()},n.syncFixedTableRowHeight=function(){var e=n.tableNode.getBoundingClientRect();if(!(void 0!==e.height&&e.height<=0)){var t=n.props.prefixCls,r=n.refs.headTable?n.refs.headTable.querySelectorAll("thead"):n.refs.bodyTable.querySelectorAll("thead"),o=n.refs.bodyTable.querySelectorAll("."+t+"-row")||[],i=[].map.call(r,function(e){return e.getBoundingClientRect().height||"auto"}),a=[].map.call(o,function(e){return e.getBoundingClientRect().height||"auto"});(0,O.default)(n.state.fixedColumnsHeadRowsHeight,i)&&(0,O.default)(n.state.fixedColumnsBodyRowsHeight,a)||n.setState({fixedColumnsHeadRowsHeight:i,fixedColumnsBodyRowsHeight:a})}},n.handleBodyScrollLeft=function(e){var t=e.target,r=n.props.scroll,o=void 0===r?{}:r,i=n.refs,a=i.headTable,s=i.bodyTable;t.scrollLeft!==n.lastScrollLeft&&o.x&&(t===s&&a?a.scrollLeft=t.scrollLeft:t===a&&s&&(s.scrollLeft=t.scrollLeft),n.setScrollPositionClassName(t)),n.lastScrollLeft=t.scrollLeft},n.handleBodyScrollTop=function(e){var t=e.target,r=n.props.scroll,o=void 0===r?{}:r,i=n.refs,a=i.headTable,s=i.bodyTable,l=i.fixedColumnsBodyLeft,u=i.fixedColumnsBodyRight;if(t.scrollTop!==n.lastScrollTop&&o.y&&t!==a){var c=t.scrollTop;l&&t!==l&&(l.scrollTop=c),u&&t!==u&&(u.scrollTop=c),s&&t!==s&&(s.scrollTop=c)}n.lastScrollTop=t.scrollTop},n.handleBodyScroll=function(e){n.handleBodyScrollLeft(e),n.handleBodyScrollTop(e)},n.handleRowHover=function(e,t){n.store.setState({currentHoverKey:e?t:null})};var r=[],o=[].concat((0,s.default)(e.data));if(n.columnManager=new M.default(e.columns,e.children),n.store=(0,R.default)({currentHoverKey:null,expandedRowsHeight:{}}),n.setScrollPosition("left"),e.defaultExpandAllRows)for(var i=0;i<o.length;i++){var a=o[i];r.push(n.getRowKey(a,i)),o=o.concat(a[e.childrenColumnName]||[])}else r=e.expandedRowKeys||e.defaultExpandedRowKeys;return n.state={expandedRowKeys:r,currentHoverKey:null,fixedColumnsHeadRowsHeight:[],fixedColumnsBodyRowsHeight:[]},n}return(0,m.default)(t,e),(0,d.default)(t,[{key:"componentDidMount",value:function(){this.columnManager.isAnyColumnsFixed()&&(this.handleWindowResize(),this.debouncedWindowResize=(0,E.debounce)(this.handleWindowResize,150),this.resizeEvent=(0,k.default)(window,"resize",this.debouncedWindowResize))}},{key:"componentWillReceiveProps",value:function(e){"expandedRowKeys"in e&&this.setState({expandedRowKeys:e.expandedRowKeys}),e.columns&&e.columns!==this.props.columns?this.columnManager.reset(e.columns):e.children!==this.props.children&&this.columnManager.reset(null,e.children)}},{key:"componentDidUpdate",value:function(e){this.columnManager.isAnyColumnsFixed()&&this.handleWindowResize(),e.data.length>0&&0===this.props.data.length&&this.hasScrollX()&&this.resetScrollX()}},{key:"componentWillUnmount",value:function(){this.resizeEvent&&this.resizeEvent.remove(),this.debouncedWindowResize&&this.debouncedWindowResize.cancel()}},{key:"onExpandedRowsChange",value:function(e){this.props.expandedRowKeys||this.setState({expandedRowKeys:e}),this.props.onExpandedRowsChange(e)}},{key:"getRowKey",value:function(e,t){var n=this.props.rowKey,r="function"==typeof n?n(e,t):e[n];return(0,E.warningOnce)(void 0!==r,"Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key."),void 0===r?t:r}},{key:"getExpandedRows",value:function(){return this.props.expandedRowKeys||this.state.expandedRowKeys}},{key:"getHeader",value:function(e,t){var n=this.props,r=n.showHeader,o=n.expandIconAsCell,i=n.prefixCls,a=this.getHeaderRows(e);o&&"right"!==t&&a[0].unshift({key:"rc-table-expandIconAsCell",className:i+"-expand-icon-th",title:"",rowSpan:a.length});var s=t?this.getHeaderRowStyle(e,a):null;return r?y.default.createElement(S.default,{prefixCls:i,rows:a,rowStyle:s}):null}},{key:"getHeaderRows",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2];return r=r||[],r[n]=r[n]||[],e.forEach(function(e){if(e.rowSpan&&r.length<e.rowSpan)for(;r.length<e.rowSpan;)r.push([]);var o={key:e.key,className:e.className||"",children:e.title};e.children&&t.getHeaderRows(e.children,n+1,r),"colSpan"in e&&(o.colSpan=e.colSpan),"rowSpan"in e&&(o.rowSpan=e.rowSpan),0!==o.colSpan&&r[n].push(o)}),r.filter(function(e){return e.length>0})}},{key:"getExpandedRow",value:function(e,t,n,r,o){var i=this.props,a=i.prefixCls,s=i.expandIconAsCell,l=void 0;l="left"===o?this.columnManager.leftLeafColumns().length:"right"===o?this.columnManager.rightLeafColumns().length:this.columnManager.leafColumns().length;var u=[{key:"extra-row",render:function(){return{props:{colSpan:l},children:"right"!==o?t:"&nbsp;"}}}];return s&&"right"!==o&&u.unshift({key:"expand-icon-placeholder",render:function(){return null}}),y.default.createElement(x.default,{columns:u,visible:n,className:r,key:e+"-extra-row",rowKey:e+"-extra-row",prefixCls:a+"-expanded-row",indent:1,expandable:!1,store:this.store,expandedRow:!0,fixed:!!o})}},{key:"getRowsByData",value:function(e,t,n,r,o){for(var a=this.props,s=a.childrenColumnName,l=a.expandedRowRender,u=a.expandRowByClick,c=a.rowClassName,d=a.rowRef,f=a.expandedRowClassName,p=a.onRowClick,h=a.onRowDoubleClick,m=a.onRowMouseEnter,v=a.onRowMouseLeave,g=this.state.fixedColumnsBodyRowsHeight,_=[],b=a.data.some(function(e){return e[s]}),C="right"!==o&&a.expandIconAsCell,S="right"!==o?a.expandIconColumnIndex:-1,E=0;E<e.length;E++){var w=e[E],O=this.getRowKey(w,E),P=w[s],k=this.isRowExpanded(w,E),T=void 0;l&&k&&(T=l(w,E,n));var M=c(w,E,n),N={};this.columnManager.isAnyColumnsFixed()&&(N.onHover=this.handleRowHover);var R=o&&g[E]?g[E]:null,D=void 0;D="left"===o?this.columnManager.leftLeafColumns():"right"===o?this.columnManager.rightLeafColumns():this.columnManager.leafColumns(),_.push(y.default.createElement(x.default,(0,i.default)({indent:n,indentSize:a.indentSize,needIndentSpaced:b,className:M,record:w,expandIconAsCell:C,onDestroy:this.onRowDestroy,index:E,visible:t,expandRowByClick:u,onExpand:this.onExpanded,expandable:P||l,expanded:k,prefixCls:a.prefixCls+"-row",childrenColumnName:s,columns:D,expandIconColumnIndex:S,onRowClick:p,onRowDoubleClick:h,onRowMouseEnter:m,onRowMouseLeave:v,height:R},N,{key:O,hoverKey:O,ref:d(w,E,n),store:this.store})));var j=t&&k;T&&k&&_.push(this.getExpandedRow(O,T,j,f(w,E,n),o)),P&&(_=_.concat(this.getRowsByData(P,j,n+1,r,o)))}return _}},{key:"getRows",value:function(e,t){return this.getRowsByData(this.props.data,!0,0,e,t)}},{key:"getColGroup",value:function(e,t){var n=[];this.props.expandIconAsCell&&"right"!==t&&n.push(y.default.createElement("col",{className:this.props.prefixCls+"-expand-icon-col",key:"rc-table-expand-icon-col"}));var r=void 0;return r="left"===t?this.columnManager.leftLeafColumns():"right"===t?this.columnManager.rightLeafColumns():this.columnManager.leafColumns(),n=n.concat(r.map(function(e){return y.default.createElement("col",{key:e.key,style:{width:e.width,minWidth:e.width}})})),y.default.createElement("colgroup",null,n)}},{key:"getLeftFixedTable",value:function(){return this.getTable({columns:this.columnManager.leftColumns(),fixed:"left"})}},{key:"getRightFixedTable",value:function(){return this.getTable({columns:this.columnManager.rightColumns(),fixed:"right"})}},{key:"getTable",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.columns,r=t.fixed,o=this.props,a=o.prefixCls,s=o.scroll,l=void 0===s?{}:s,u=o.getBodyWrapper,c=o.showHeader,d=this.props.useFixedHeader,f=(0,i.default)({},this.props.bodyStyle),p={},h="";(l.x||r)&&(h=a+"-fixed",f.overflowX=f.overflowX||"auto");var m={};if(l.y){r?(m.maxHeight=f.maxHeight||l.y,m.overflowY=f.overflowY||"scroll"):f.maxHeight=f.maxHeight||l.y,f.overflowY=f.overflowY||"scroll",d=!0;var v=(0,E.measureScrollbar)();v>0&&((r?f:p).marginBottom="-"+v+"px",(r?f:p).paddingBottom="0px")}var g=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i={};!r&&l.x&&(l.x===!0?i.tableLayout="fixed":i.width=l.x);var s=o?u(y.default.createElement("tbody",{className:a+"-tbody"},e.getRows(n,r))):null;return y.default.createElement("table",{className:h,style:i,key:"table"},e.getColGroup(n,r),t?e.getHeader(n,r):null,s)},_=void 0;d&&c&&(_=y.default.createElement("div",{key:"headTable",className:a+"-header",ref:r?null:"headTable",style:p,onScroll:this.handleBodyScrollLeft},g(!0,!1)));var b=y.default.createElement("div",{key:"bodyTable",className:a+"-body",style:f,ref:"bodyTable",onScroll:this.handleBodyScroll},g(!d));if(r&&n.length){var x=void 0;"left"===n[0].fixed||n[0].fixed===!0?x="fixedColumnsBodyLeft":"right"===n[0].fixed&&(x="fixedColumnsBodyRight"),delete f.overflowX,delete f.overflowY,b=y.default.createElement("div",{key:"bodyTable",className:a+"-body-outer",style:(0,i.default)({},f)},y.default.createElement("div",{className:a+"-body-inner",style:m,ref:x,onScroll:this.handleBodyScroll},g(!d)))}return[_,b]}},{key:"getTitle",value:function(){var e=this.props,t=e.title,n=e.prefixCls;return t?y.default.createElement("div",{className:n+"-title",key:"title"},t(this.props.data)):null}},{key:"getFooter",value:function(){var e=this.props,t=e.footer,n=e.prefixCls;return t?y.default.createElement("div",{className:n+"-footer",key:"footer"},t(this.props.data)):null}},{key:"getEmptyText",value:function(){var e=this.props,t=e.emptyText,n=e.prefixCls,r=e.data;return r.length?null:y.default.createElement("div",{className:n+"-placeholder",key:"emptyText"},"function"==typeof t?t():t)}},{key:"getHeaderRowStyle",value:function(e,t){var n=this.state.fixedColumnsHeadRowsHeight,r=n[0];return r&&e?"auto"===r?{height:"auto"}:{height:r/t.length}:null}},{key:"setScrollPosition",value:function(e){if(this.scrollPosition=e,this.tableNode){var t=this.props.prefixCls;"both"===e?(0,j.default)(this.tableNode).remove(new RegExp("^"+t+"-scroll-position-.+$")).add(t+"-scroll-position-left").add(t+"-scroll-position-right"):(0,j.default)(this.tableNode).remove(new RegExp("^"+t+"-scroll-position-.+$")).add(t+"-scroll-position-"+e)}}},{key:"setScrollPositionClassName",value:function(e){var t=e||this.refs.bodyTable,n=0===t.scrollLeft,r=t.scrollLeft+1>=t.children[0].getBoundingClientRect().width-t.getBoundingClientRect().width;n&&r?this.setScrollPosition("both"):n?this.setScrollPosition("left"):r?this.setScrollPosition("right"):"middle"!==this.scrollPosition&&this.setScrollPosition("middle")}},{key:"resetScrollX",value:function(){this.refs.headTable&&(this.refs.headTable.scrollLeft=0),this.refs.bodyTable&&(this.refs.bodyTable.scrollLeft=0)}},{key:"findExpandedRow",value:function(e,t){var n=this,r=this.getExpandedRows().filter(function(r){return r===n.getRowKey(e,t)});return r[0]}},{key:"isRowExpanded",value:function(e,t){return"undefined"!=typeof this.findExpandedRow(e,t)}},{key:"hasScrollX",value:function(){var e=this.props.scroll,t=void 0===e?{}:e;return"x"in t}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.prefixCls;t.className&&(r+=" "+t.className),(t.useFixedHeader||t.scroll&&t.scroll.y)&&(r+=" "+n+"-fixed-header"),r+="both"===this.scrollPosition?" "+n+"-scroll-position-left "+n+"-scroll-position-right":" "+n+"-scroll-position-"+this.scrollPosition;var o=this.columnManager.isAnyColumnsFixed()||t.scroll.x||t.scroll.y,i=[this.getTable({columns:this.columnManager.groupedColumns()}),this.getEmptyText(),this.getFooter()],a=o?y.default.createElement("div",{className:n+"-scroll"},i):i;return y.default.createElement("div",{ref:function(t){return e.tableNode=t},className:r,style:t.style},this.getTitle(),y.default.createElement("div",{className:n+"-content"},a,this.columnManager.isAnyColumnsLeftFixed()&&y.default.createElement("div",{className:n+"-fixed-left"},this.getLeftFixedTable()),this.columnManager.isAnyColumnsRightFixed()&&y.default.createElement("div",{className:n+"-fixed-right"},this.getRightFixedTable())))}}]),t}(y.default.Component); I.propTypes={data:_.default.array,expandIconAsCell:_.default.bool,defaultExpandAllRows:_.default.bool,expandedRowKeys:_.default.array,defaultExpandedRowKeys:_.default.array,useFixedHeader:_.default.bool,columns:_.default.array,prefixCls:_.default.string,bodyStyle:_.default.object,style:_.default.object,rowKey:_.default.oneOfType([_.default.string,_.default.func]),rowClassName:_.default.func,expandedRowClassName:_.default.func,childrenColumnName:_.default.string,onExpand:_.default.func,onExpandedRowsChange:_.default.func,indentSize:_.default.number,onRowClick:_.default.func,onRowDoubleClick:_.default.func,expandIconColumnIndex:_.default.number,showHeader:_.default.bool,title:_.default.func,footer:_.default.func,emptyText:_.default.oneOfType([_.default.node,_.default.func]),scroll:_.default.object,rowRef:_.default.func,getBodyWrapper:_.default.func,children:_.default.node},I.defaultProps={data:[],useFixedHeader:!1,expandIconAsCell:!1,defaultExpandAllRows:!1,defaultExpandedRowKeys:[],rowKey:"key",rowClassName:function(){return""},expandedRowClassName:function(){return""},onExpand:function(){},onExpandedRowsChange:function(){},onRowClick:function(){},onRowDoubleClick:function(){},onRowMouseEnter:function(){},onRowMouseLeave:function(){},prefixCls:"rc-table",bodyStyle:{},style:{},childrenColumnName:"children",indentSize:15,expandIconColumnIndex:0,showHeader:!0,scroll:{},rowRef:function(){return null},getBodyWrapper:function(e){return e},emptyText:function(){return"No Data"}},t.default=I,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=n(369),_=r(g),b=function(e){function t(){var e,n,r,o;(0,s.default)(this,t);for(var i=arguments.length,a=Array(i),l=0;l<i;l++)a[l]=arguments[l];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleClick=function(e){var t=r.props,n=t.record,o=t.column.onCellClick;o&&o(n,e)},o=n,(0,d.default)(r,o)}return(0,p.default)(t,e),(0,u.default)(t,[{key:"isInvalidRenderCellText",value:function(e){return e&&!m.default.isValidElement(e)&&"[object Object]"===Object.prototype.toString.call(e)}},{key:"render",value:function e(){var t=this.props,n=t.record,r=t.indentSize,o=t.prefixCls,a=t.indent,s=t.index,l=t.expandIcon,u=t.column,c=u.dataIndex,e=u.render,d=u.className,f=void 0===d?"":d,p=void 0;p="number"==typeof c?(0,_.default)(n,c):c&&0!==c.length?(0,_.default)(n,c):n;var h=void 0,v=void 0,y=void 0;e&&(p=e(p,n,s),this.isInvalidRenderCellText(p)&&(h=p.props||{},v=h.colSpan,y=h.rowSpan,p=p.children)),this.isInvalidRenderCellText(p)&&(p=null);var g=l?m.default.createElement("span",{style:{paddingLeft:r*a+"px"},className:o+"-indent indent-level-"+a}):null;return 0===y||0===v?null:m.default.createElement("td",(0,i.default)({className:f},h,{onClick:this.handleClick}),g,l,p)}}]),t}(m.default.Component);b.propTypes={record:y.default.object,prefixCls:y.default.string,index:y.default.number,indent:y.default.number,indentSize:y.default.number,column:y.default.object,expandIcon:y.default.node},t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=n(76),_=r(g),b=function(e){function t(){return(0,s.default)(this,t),(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,p.default)(t,e),(0,u.default)(t,[{key:"shouldComponentUpdate",value:function(e){return!(0,_.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.rowStyle,r=e.rows;return m.default.createElement("thead",{className:t+"-thead"},r.map(function(e,t){return m.default.createElement("tr",{key:t,style:n},e.map(function(e,t){return m.default.createElement("th",(0,i.default)({},e,{key:t}))}))}))}}]),t}(m.default.Component);b.propTypes={prefixCls:y.default.string,rowStyle:y.default.object,rows:y.default.array},t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(9),m=r(h),v=n(415),y=r(v),g=n(413),_=r(g),b=function(e){function t(){var e,n,r,o;(0,i.default)(this,t);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return n=r=(0,u.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={hovered:!1,height:null},r.onRowClick=function(e){var t=r.props,n=t.record,o=t.index,i=t.onRowClick,a=t.expandable,s=t.expandRowByClick,l=t.expanded,u=t.onExpand;a&&s&&u(!l,n,e,o),i(n,o,e)},r.onRowDoubleClick=function(e){var t=r.props,n=t.record,o=t.index,i=t.onRowDoubleClick;i(n,o,e)},r.onMouseEnter=function(e){var t=r.props,n=t.record,o=t.index,i=t.onRowMouseEnter,a=t.onHover,s=t.hoverKey;a(!0,s),i(n,o,e)},r.onMouseLeave=function(e){var t=r.props,n=t.record,o=t.index,i=t.onRowMouseLeave,a=t.onHover,s=t.hoverKey;a(!1,s),i(n,o,e)},o=n,(0,u.default)(r,o)}return(0,d.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.store;this.pushHeight(),this.pullHeight(),this.unsubscribe=t.subscribe(function(){e.setHover(),e.pullHeight()})}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.record,n=e.onDestroy,r=e.index;n(t,r),this.unsubscribe&&this.unsubscribe()}},{key:"setHover",value:function(){var e=this.props,t=e.store,n=e.hoverKey,r=t.getState(),o=r.currentHoverKey;o===n?this.setState({hovered:!0}):this.state.hovered===!0&&this.setState({hovered:!1})}},{key:"pullHeight",value:function(){var e=this.props,t=e.store,n=e.expandedRow,r=e.fixed,o=e.rowKey,i=t.getState(),a=i.expandedRowsHeight;n&&r&&a[o]&&this.setState({height:a[o]})}},{key:"pushHeight",value:function(){var e=this.props,t=e.store,n=e.expandedRow,r=e.fixed,o=e.rowKey;if(n&&!r){var i=t.getState(),a=i.expandedRowsHeight,s=this.trRef.getBoundingClientRect().height;a[o]=s,t.setState({expandedRowsHeight:a})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.columns,o=t.record,i=t.visible,a=t.index,s=t.expandIconColumnIndex,l=t.expandIconAsCell,u=t.expanded,c=t.expandRowByClick,d=t.expandable,f=t.onExpand,h=t.needIndentSpaced,m=t.indent,v=t.indentSize,g=this.props.className;this.state.hovered&&(g+=" "+n+"-hover");for(var b=[],x=p.default.createElement(_.default,{expandable:d,prefixCls:n,onExpand:f,needIndentSpaced:h,expanded:u,record:o}),C=0;C<r.length;C++){l&&0===C&&b.push(p.default.createElement("td",{className:n+"-expand-icon-cell",key:"rc-table-expand-icon-cell"},x));var S=!l&&!c&&C===s;b.push(p.default.createElement(y.default,{prefixCls:n,record:o,indentSize:v,indent:m,index:a,column:r[C],key:r[C].key,expandIcon:S?x:null}))}var E=this.props.height||this.state.height,w={height:E};return i||(w.display="none"),p.default.createElement("tr",{ref:function(t){return e.trRef=t},onClick:this.onRowClick,onDoubleClick:this.onRowDoubleClick,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,className:n+" "+g+" "+n+"-level-"+m,style:w},b)}}]),t}(p.default.Component);b.propTypes={onDestroy:m.default.func,onRowClick:m.default.func,onRowDoubleClick:m.default.func,onRowMouseEnter:m.default.func,onRowMouseLeave:m.default.func,record:m.default.object,prefixCls:m.default.string,expandIconColumnIndex:m.default.number,onHover:m.default.func,columns:m.default.array,height:m.default.oneOfType([m.default.string,m.default.number]),visible:m.default.bool,index:m.default.number,hoverKey:m.default.any,expanded:m.default.bool,expandable:m.default.any,onExpand:m.default.func,needIndentSpaced:m.default.bool,className:m.default.string,indent:m.default.number,indentSize:m.default.number,expandIconAsCell:m.default.bool,expandRowByClick:m.default.bool,store:m.default.object.isRequired,expandedRow:m.default.bool,fixed:m.default.bool,rowKey:m.default.string},b.defaultProps={onRowClick:function(){},onRowDoubleClick:function(){},onRowMouseEnter:function(){},onRowMouseLeave:function(){},onDestroy:function(){},expandIconColumnIndex:0,expandRowByClick:!1,onHover:function(){}},t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){function t(e){o=(0,a.default)({},o,e);for(var t=0;t<i.length;t++)i[t]()}function n(){return o}function r(e){return i.push(e),function(){var t=i.indexOf(e);i.splice(t,1)}}var o=e,i=[];return{setState:t,getState:n,subscribe:r}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=r(i);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnGroup=t.Column=void 0;var o=n(414),i=r(o),a=n(410),s=r(a),l=n(411),u=r(l);i.default.Column=s.default,i.default.ColumnGroup=u.default,t.default=i.default,t.Column=s.default,t.ColumnGroup=u.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){if("undefined"==typeof document||"undefined"==typeof window)return 0;if(u)return u;var e=document.createElement("div");for(var t in c)c.hasOwnProperty(t)&&(e.style[t]=c[t]);document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),u=n}function i(e,t,n){function r(){var r=this,i=arguments;i[0]&&i[0].persist&&i[0].persist();var a=function(){o=null,n||e.apply(r,i)},s=n&&!o;clearTimeout(o),o=setTimeout(a,t),s&&e.apply(r,i)}var o=void 0;return r.cancel=function(){o&&(clearTimeout(o),o=null)},r}function a(e,t,n){d[t]||((0,l.default)(e,t,n),d[t]=!e)}Object.defineProperty(t,"__esModule",{value:!0}),t.measureScrollbar=o,t.debounce=i,t.warningOnce=a;var s=n(29),l=r(s),u=void 0,c={position:"absolute",top:"-9999px",width:"50px",height:"50px",overflow:"scroll"},d={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),i=r(o),a=n(122),s=r(a),l=n(77),u=r(l),c=(0,i.default)({displayName:"InkTabBar",mixins:[u.default,s.default],render:function(){var e=this.getInkBarNode(),t=this.getTabs();return this.getRootNode([e,t])}});t.default=c,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={LEFT:37,UP:38,RIGHT:39,DOWN:40},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(1),u=r(l),c=n(13),d=r(c),f=n(7),p=r(f),h=n(122),m=r(h),v=n(424),y=r(v),g=n(77),_=r(g),b=(0,d.default)({displayName:"SwipeableInkTabBar",mixins:[_.default,m.default,y.default],getSwipeableTabs:function(){var e=this,t=this.props,n=t.panels,r=t.activeKey,o=[],a=t.prefixCls,l=1/t.pageSize*100+"%",c={WebkitFlexBasis:l,flexBasis:l};return u.default.Children.forEach(n,function(t){var n;if(t){var l=t.key,d=(0,p.default)(a+"-tab",(n={},(0,s.default)(n,a+"-tab-active",r===l),(0,s.default)(n,a+"-tab-disabled",t.props.disabled),n)),f={};t.props.disabled||(f={onClick:e.onTabClick.bind(e,l)});var h={};r===l&&(h.ref="activeTab"),o.push(u.default.createElement("div",(0,i.default)({role:"tab",style:c,"aria-disabled":t.props.disabled?"true":"false","aria-selected":r===l?"true":"false"},f,{className:d,key:l},h),t.props.tab))}}),o},render:function(){var e=this.getInkBarNode(),t=this.getSwipeableTabs(),n=this.getSwipeBarNode([e,t]);return this.getRootNode(n)}});t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(1),u=r(l),c=n(7),d=r(c),f=n(74),p=r(f),h=n(11),m=r(h),v=n(52);t.default={getInitialState:function(){var e=this.checkPaginationByKey(this.props.activeKey),t=e.hasPrevPage,n=e.hasNextPage;return{hasPrevPage:t,hasNextPage:n}},getDefaultProps:function(){return{hammerOptions:{},pageSize:5,speed:7}},checkPaginationByKey:function(e){var t=this.props,n=t.panels,r=t.pageSize,o=this.getIndexByKey(e),i=Math.floor(r/2);return{hasPrevPage:o-i>0,hasNextPage:o+i<n.length}},getDeltaByKey:function(e){var t=this.props.pageSize,n=this.getIndexByKey(e),r=Math.floor(t/2),o=this.cache.tabWidth,i=(n-r)*o*-1;return i},getIndexByKey:function(e){for(var t=this.props.panels,n=t.length,r=0;r<n;r++)if(t[r].key===e)return r;return-1},checkPaginationByDelta:function(e){var t=this.cache.totalAvaliableDelta;return{hasPrevPage:e<0,hasNextPage:-e<t}},setSwipePositionByKey:function(e){var t=this.checkPaginationByKey(e),n=t.hasPrevPage,r=t.hasNextPage,o=this.cache.totalAvaliableDelta;this.setState({hasPrevPage:n,hasNextPage:r});var i=void 0;n?r?r&&(i=this.getDeltaByKey(e)):i=-o:i=0,this.cache.totalDelta=i,this.setSwipePosition()},setSwipePosition:function(){var e=this.cache,t=e.totalDelta,n=e.vertical;(0,v.setPxStyle)(this.swipeNode,t,n)},componentDidMount:function(){var e=this.refs,t=e.swipe,n=e.nav,r=this.props,o=r.tabBarPosition,i=r.pageSize,a=r.panels,s=r.activeKey;this.swipeNode=m.default.findDOMNode(t),this.realNode=m.default.findDOMNode(n);var l=(0,v.isVertical)(o),u=(0,v.getStyle)(this.realNode,l?"height":"width"),c=u/i;this.cache={vertical:l,totalAvaliableDelta:c*a.length-u,tabWidth:c},this.setSwipePositionByKey(s)},componentWillReceiveProps:function(e){e.activeKey&&e.activeKey!==this.props.activeKey&&this.setSwipePositionByKey(e.activeKey)},onPan:function(e){var t=this.cache,n=t.vertical,r=t.totalAvaliableDelta,o=t.totalDelta,i=this.props.speed,a=n?e.deltaY:e.deltaX;a*=i/10;var s=a+o;s>=0?s=0:s<=-r&&(s=-r),this.cache.totalDelta=s,this.setSwipePosition();var l=this.checkPaginationByDelta(this.cache.totalDelta),u=l.hasPrevPage,c=l.hasNextPage;u===this.state.hasPrevPage&&c===this.state.hasNextPage||this.setState({hasPrevPage:u,hasNextPage:c})},getSwipeBarNode:function(e){var t,n=this.props,r=n.prefixCls,o=n.hammerOptions,a=n.tabBarPosition,l=this.state,c=l.hasPrevPage,f=l.hasNextPage,h=r+"-nav",m=(0,d.default)((0,s.default)({},h,!0)),y={onPan:this.onPan};return u.default.createElement("div",{className:(0,d.default)((t={},(0,s.default)(t,r+"-nav-container",1),(0,s.default)(t,r+"-nav-swipe-container",1),(0,s.default)(t,r+"-prevpage",c),(0,s.default)(t,r+"-nextpage",f),t)),key:"container",ref:"container"},u.default.createElement("div",{className:r+"-nav-wrap",ref:"navWrap"},u.default.createElement(p.default,(0,i.default)({},y,{direction:(0,v.isVertical)(a)?"DIRECTION_ALL":"DIRECTION_HORIZONTAL",options:o}),u.default.createElement("div",{className:r+"-nav-swipe",ref:"swipe"},u.default.createElement("div",{className:m,ref:"nav"},e)))))}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.maxIndex,n=e.startIndex,r=e.delta,o=e.viewSize,i=n+-r/o;return i<0?i=Math.exp(i*x)-1:i>t&&(i=t+1-Math.exp((t-i)*x)),i}function i(e){var t=(0,b.isVertical)(this.props.tabBarPosition)?e.deltaY:e.deltaX,n=(0,b.isVertical)(this.props.tabBarPosition)?e.deltaX:e.deltaY;if(!(Math.abs(t)<Math.abs(n))){var r=o({maxIndex:this.maxIndex,viewSize:this.viewSize,startIndex:this.startIndex,delta:t}),i=t<0?Math.floor(r+1):Math.floor(r);if(i<0?i=0:i>this.maxIndex&&(i=this.maxIndex),!this.children[i].props.disabled)return r}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a),l=n(51),u=r(l),c=n(1),d=r(c),f=n(9),p=r(f),h=n(13),m=r(h),v=n(74),y=r(v),g=n(11),_=r(g),b=n(52),x=.6,C=(0,m.default)({displayName:"SwipeableTabContent",propTypes:{tabBarPosition:p.default.string,onChange:p.default.func,children:p.default.any,hammerOptions:p.default.any,animated:p.default.bool,activeKey:p.default.string},getDefaultProps:function(){return{animated:!0}},componentDidMount:function(){this.rootNode=_.default.findDOMNode(this)},onPanStart:function(){var e=this.props,t=e.tabBarPosition,n=e.children,r=e.activeKey,o=e.animated,i=this.startIndex=(0,b.getActiveIndex)(n,r);i!==-1&&(o&&(0,b.setTransition)(this.rootNode.style,"none"),this.startDrag=!0,this.children=(0,b.toArray)(n),this.maxIndex=this.children.length-1,this.viewSize=(0,b.isVertical)(t)?this.rootNode.offsetHeight:this.rootNode.offsetWidth)},onPan:function(e){if(this.startDrag){var t=this.props.tabBarPosition,n=i.call(this,e);void 0!==n&&(0,b.setTransform)(this.rootNode.style,(0,b.getTransformByIndex)(n,t))}},onPanEnd:function(e){this.startDrag&&this.end(e)},onSwipe:function(e){this.end(e,!0)},end:function(e,t){var n=this.props,r=n.tabBarPosition,o=n.animated;this.startDrag=!1,o&&(0,b.setTransition)(this.rootNode.style,"");var a=i.call(this,e),s=this.startIndex;if(void 0!==a)if(a<0)s=0;else if(a>this.maxIndex)s=this.maxIndex;else if(t){var l=(0,b.isVertical)(r)?e.deltaY:e.deltaX;s=l<0?Math.ceil(a):Math.floor(a)}else{var u=Math.floor(a);s=a-u>.6?u+1:u}this.children[s].props.disabled||(this.startIndex===s?o&&(0,b.setTransform)(this.rootNode.style,(0,b.getTransformByIndex)(s,this.props.tabBarPosition)):this.props.onChange((0,b.getActiveKey)(this.props.children,s)))},render:function(){var e=this.props,t=e.tabBarPosition,n=e.hammerOptions,r=e.animated,o={onSwipe:this.onSwipe,onPanStart:this.onPanStart};return r!==!1&&(o=(0,s.default)({},o,{onPan:this.onPan,onPanEnd:this.onPanEnd})),d.default.createElement(y.default,(0,s.default)({},o,{direction:(0,b.isVertical)(t)?"DIRECTION_ALL":"DIRECTION_HORIZONTAL",options:n}),d.default.createElement(u.default,this.props))}});t.default=C,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),i=r(o),a=n(77),s=r(a),l=(0,i.default)({displayName:"TabBar",mixins:[s.default],render:function(){var e=this.getTabs();return this.getRootNode(e)}});t.default=l,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(e){var t=void 0;return C.default.Children.forEach(e.children,function(e){!e||t||e.props.disabled||(t=e.key)}),t}function a(e,t){var n=C.default.Children.map(e.children,function(e){return e.key});return n.indexOf(t)>=0}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),l=r(s),u=n(8),c=r(u),d=n(14),f=r(d),p=n(2),h=r(p),m=n(5),v=r(m),y=n(4),g=r(y),_=n(3),b=r(_),x=n(1),C=r(x),S=n(9),E=r(S),w=n(78),O=r(w),P=n(422),k=r(P),T=n(123),M=r(T),N=n(7),R=r(N),D=function(e){function t(e){(0,h.default)(this,t);var n=(0,g.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));j.call(n);var r=void 0;return r="activeKey"in e?e.activeKey:"defaultActiveKey"in e?e.defaultActiveKey:i(e),n.state={activeKey:r},n}return(0,b.default)(t,e),(0,v.default)(t,[{key:"componentWillReceiveProps",value:function(e){"activeKey"in e?this.setState({activeKey:e.activeKey}):a(e,this.state.activeKey)||this.setState({activeKey:i(e)})}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.tabBarPosition,o=t.className,i=t.renderTabContent,a=t.renderTabBar,s=t.destroyInactiveTabPane,u=(0,f.default)(t,["prefixCls","tabBarPosition","className","renderTabContent","renderTabBar","destroyInactiveTabPane"]),d=(0,R.default)((e={},(0,c.default)(e,n,1),(0,c.default)(e,n+"-"+r,1),(0,c.default)(e,o,!!o),e));this.tabBar=a();var p=[C.default.cloneElement(this.tabBar,{prefixCls:n,key:"tabBar",onKeyDown:this.onNavKeyDown,tabBarPosition:r,onTabClick:this.onTabClick,panels:t.children,activeKey:this.state.activeKey}),C.default.cloneElement(i(),{prefixCls:n,tabBarPosition:r,activeKey:this.state.activeKey,destroyInactiveTabPane:s,children:t.children,onChange:this.setActiveKey,key:"tabContent"})];return"bottom"===r&&p.reverse(),C.default.createElement("div",(0,l.default)({className:d,style:t.style},(0,O.default)(u)),p)}}]),t}(C.default.Component),j=function(){var e=this;this.onTabClick=function(t){e.tabBar.props.onTabClick&&e.tabBar.props.onTabClick(t),e.setActiveKey(t)},this.onNavKeyDown=function(t){var n=t.keyCode;if(n===k.default.RIGHT||n===k.default.DOWN){t.preventDefault();var r=e.getNextActiveKey(!0);e.onTabClick(r)}else if(n===k.default.LEFT||n===k.default.UP){t.preventDefault();var o=e.getNextActiveKey(!1);e.onTabClick(o)}},this.setActiveKey=function(t){e.state.activeKey!==t&&("activeKey"in e.props||e.setState({activeKey:t}),e.props.onChange(t))},this.getNextActiveKey=function(t){var n=e.state.activeKey,r=[];C.default.Children.forEach(e.props.children,function(e){e&&!e.props.disabled&&(t?r.push(e):r.unshift(e))});var o=r.length,i=o&&r[0].key;return r.forEach(function(e,t){e.key===n&&(i=t===o-1?r[0].key:r[t+1].key)}),i}};t.default=D,D.propTypes={destroyInactiveTabPane:E.default.bool,renderTabBar:E.default.func.isRequired,renderTabContent:E.default.func.isRequired,onChange:E.default.func,children:E.default.any,prefixCls:E.default.string,className:E.default.string,tabBarPosition:E.default.string,style:E.default.object,activeKey:E.default.string,defaultActiveKey:E.default.string},D.defaultProps={prefixCls:"rc-tabs",destroyInactiveTabPane:!1,onChange:o,tabBarPosition:"top",style:{}},D.TabPane=M.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(14),s=r(a),l=n(2),u=r(l),c=n(5),d=r(c),f=n(4),p=r(f),h=n(3),m=r(h),v=n(1),y=r(v),g=n(9),_=r(g),b=n(433),x=r(b),C=n(429),S=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r=(0,p.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.getPopupElement=function(){var e=r.props,t=e.arrowContent,n=e.overlay,o=e.prefixCls;return[y.default.createElement("div",{className:o+"-arrow",key:"arrow"},t),y.default.createElement("div",{className:o+"-inner",key:"content"},"function"==typeof n?n():n)]},o=n,(0,p.default)(r,o)}return(0,m.default)(t,e),(0,d.default)(t,[{key:"getPopupDomNode",value:function(){return this.refs.trigger.getPopupDomNode()}},{key:"render",value:function(){var e=this.props,t=e.overlayClassName,n=e.trigger,r=e.mouseEnterDelay,o=e.mouseLeaveDelay,a=e.overlayStyle,l=e.prefixCls,u=e.children,c=e.onVisibleChange,d=e.afterVisibleChange,f=e.transitionName,p=e.animation,h=e.placement,m=e.align,v=e.destroyTooltipOnHide,g=e.defaultVisible,_=e.getTooltipContainer,b=(0,s.default)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer"]),S=(0,i.default)({},b);return"visible"in this.props&&(S.popupVisible=this.props.visible),y.default.createElement(x.default,(0,i.default)({popupClassName:t,ref:"trigger",prefixCls:l,popup:this.getPopupElement,action:n,builtinPlacements:C.placements,popupPlacement:h,popupAlign:m,getPopupContainer:_,onPopupVisibleChange:c,afterPopupVisibleChange:d,popupTransitionName:f,popupAnimation:p,defaultPopupVisible:g,destroyPopupOnHide:v,mouseLeaveDelay:o,popupStyle:a,mouseEnterDelay:r},S),u)}}]),t}(v.Component);S.propTypes={trigger:_.default.any,children:_.default.any,defaultVisible:_.default.bool,visible:_.default.bool,placement:_.default.string,transitionName:_.default.string,animation:_.default.any,onVisibleChange:_.default.func,afterVisibleChange:_.default.func,overlay:_.default.oneOfType([_.default.node,_.default.func]).isRequired,overlayStyle:_.default.object,overlayClassName:_.default.string,prefixCls:_.default.string,mouseEnterDelay:_.default.number,mouseLeaveDelay:_.default.number,getTooltipContainer:_.default.func,destroyTooltipOnHide:_.default.bool,align:_.default.object,arrowContent:_.default.any},S.defaultProps={prefixCls:"rc-tooltip",mouseEnterDelay:0,destroyTooltipOnHide:!1,mouseLeaveDelay:.1,align:{},placement:"right",trigger:["hover"],arrowContent:null},t.default=S,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={adjustX:1,adjustY:1},r=[0,0],o=t.placements={left:{points:["cr","cl"],overflow:n,offset:[-4,0],targetOffset:r},right:{points:["cl","cr"],overflow:n,offset:[4,0],targetOffset:r},top:{points:["bc","tc"],overflow:n,offset:[0,-4],targetOffset:r},bottom:{points:["tc","bc"],overflow:n,offset:[0,4],targetOffset:r},topLeft:{points:["bl","tl"],overflow:n,offset:[0,-4],targetOffset:r},leftTop:{points:["tr","tl"],overflow:n,offset:[-4,0],targetOffset:r},topRight:{points:["br","tr"],overflow:n,offset:[0,-4],targetOffset:r},rightTop:{points:["tl","tr"],overflow:n,offset:[4,0],targetOffset:r},bottomRight:{points:["tr","br"],overflow:n,offset:[0,4],targetOffset:r},rightBottom:{points:["bl","br"],overflow:n,offset:[4,0],targetOffset:r},bottomLeft:{points:["tl","bl"],overflow:n,offset:[0,4],targetOffset:r},leftBottom:{points:["br","bl"],overflow:n,offset:[-4,0],targetOffset:r}};t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=this;this.nativeEvent=e,["type","currentTarget","target","touches","changedTouches"].forEach(function(n){t[n]=e[n]}),e.$pressSeq?e.$pressSeq+=1:e.$pressSeq=1,this.$pressSeq=e.$pressSeq}function i(e){var t=e.nativeEvent,n=e.$pressSeq;return!t.$stopPressSeq||t.$stopPressSeq>=n}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),s=r(a);t.shouldFirePress=i,o.prototype=(0,s.default)({},o.prototype,{preventDefault:function(){this.nativeEvent.preventDefault()},stopPropagation:function(){var e=this.nativeEvent,t=this.$pressSeq;e.$stopPressSeq||(e.$stopPressSeq=t)}}),t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=n(11),_=r(g),b=n(379),x=r(b),C=n(50),S=r(C),E=n(432),w=r(E),O=n(126),P=r(O),k=n(127),T=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return M.call(n),n.savePopupRef=k.saveRef.bind(n,"popupInstance"),n.saveAlignRef=k.saveRef.bind(n,"alignInstance"),n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){this.rootNode=this.getPopupDomNode()}},{key:"getPopupDomNode",value:function(){return _.default.findDOMNode(this.popupInstance)}},{key:"getMaskTransitionName",value:function(){var e=this.props,t=e.maskTransitionName,n=e.maskAnimation;return!t&&n&&(t=e.prefixCls+"-"+n),t}},{key:"getTransitionName",value:function(){var e=this.props,t=e.transitionName;return!t&&e.animation&&(t=e.prefixCls+"-"+e.animation),t}},{key:"getClassName",value:function(e){return this.props.prefixCls+" "+this.props.className+" "+e}},{key:"getPopupElement",value:function(){var e=this.savePopupRef,t=this.props,n=t.align,r=t.style,o=t.visible,a=t.prefixCls,s=t.destroyPopupOnHide,l=this.getClassName(this.currentAlignClassName||t.getClassNameFromAlign(n)),u=a+"-hidden";o||(this.currentAlignClassName=null);var c=(0,i.default)({},r,this.getZIndexStyle()),d={className:l,prefixCls:a,ref:e,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,style:c};return s?m.default.createElement(S.default,{component:"",exclusive:!0,transitionAppear:!0,transitionName:this.getTransitionName()},o?m.default.createElement(x.default,{target:this.getTarget,key:"popup",ref:this.saveAlignRef,monitorWindowResize:!0,align:n,onAlign:this.onAlign},m.default.createElement(w.default,(0,i.default)({visible:!0},d),t.children)):null):m.default.createElement(S.default,{component:"",exclusive:!0,transitionAppear:!0,transitionName:this.getTransitionName(),showProp:"xVisible"},m.default.createElement(x.default,{target:this.getTarget,key:"popup",ref:this.saveAlignRef,monitorWindowResize:!0,xVisible:o,childrenProps:{visible:"xVisible"},disabled:!o,align:n,onAlign:this.onAlign},m.default.createElement(w.default,(0,i.default)({hiddenClassName:u},d),t.children)))}},{key:"getZIndexStyle",value:function(){var e={},t=this.props;return void 0!==t.zIndex&&(e.zIndex=t.zIndex),e}},{key:"getMaskElement",value:function(){var e=this.props,t=void 0;if(e.mask){var n=this.getMaskTransitionName();t=m.default.createElement(P.default,{style:this.getZIndexStyle(),key:"mask",className:e.prefixCls+"-mask",hiddenClassName:e.prefixCls+"-mask-hidden",visible:e.visible}),n&&(t=m.default.createElement(S.default,{key:"mask",showProp:"visible",transitionAppear:!0,component:"",transitionName:n},t))}return t}},{key:"render",value:function(){return m.default.createElement("div",null,this.getMaskElement(),this.getPopupElement())}}]),t}(h.Component);T.propTypes={visible:y.default.bool,style:y.default.object,getClassNameFromAlign:y.default.func,onAlign:y.default.func,getRootDomNode:y.default.func,onMouseEnter:y.default.func,align:y.default.any,destroyPopupOnHide:y.default.bool,className:y.default.string,prefixCls:y.default.string,onMouseLeave:y.default.func};var M=function(){var e=this;this.onAlign=function(t,n){var r=e.props,o=r.getClassNameFromAlign(n);e.currentAlignClassName!==o&&(e.currentAlignClassName=o,t.className=e.getClassName(o)),r.onAlign(t,n)},this.getTarget=function(){return e.props.getRootDomNode()}};t.default=T,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(9),m=r(h),v=n(126),y=r(v),g=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this.props,t=e.className;return e.visible||(t+=" "+e.hiddenClassName),p.default.createElement("div",{className:t,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,style:e.style},p.default.createElement(y.default,{className:e.prefixCls+"-content",visible:e.visible},e.children))}}]),t}(f.Component);g.propTypes={hiddenClassName:m.default.string,className:m.default.string,prefixCls:m.default.string,onMouseEnter:m.default.func,onMouseLeave:m.default.func,children:m.default.any},t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}function i(){return""}function a(){return window.document}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),l=r(s),u=n(1),c=r(u),d=n(9),f=r(d),p=n(11),h=n(13),m=r(h),v=n(434),y=r(v),g=n(53),_=r(g),b=n(431),x=r(b),C=n(127),S=n(128),E=r(S),w=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"],O=(0,m.default)({displayName:"Trigger",propTypes:{children:f.default.any,action:f.default.oneOfType([f.default.string,f.default.arrayOf(f.default.string)]),showAction:f.default.any,hideAction:f.default.any,getPopupClassNameFromAlign:f.default.any,onPopupVisibleChange:f.default.func,afterPopupVisibleChange:f.default.func,popup:f.default.oneOfType([f.default.node,f.default.func]).isRequired,popupStyle:f.default.object,prefixCls:f.default.string,popupClassName:f.default.string,popupPlacement:f.default.string,builtinPlacements:f.default.object,popupTransitionName:f.default.oneOfType([f.default.string,f.default.object]),popupAnimation:f.default.any,mouseEnterDelay:f.default.number,mouseLeaveDelay:f.default.number,zIndex:f.default.number,focusDelay:f.default.number,blurDelay:f.default.number,getPopupContainer:f.default.func,getDocument:f.default.func,destroyPopupOnHide:f.default.bool,mask:f.default.bool,maskClosable:f.default.bool,onPopupAlign:f.default.func,popupAlign:f.default.object,popupVisible:f.default.bool,maskTransitionName:f.default.oneOfType([f.default.string,f.default.object]),maskAnimation:f.default.string},mixins:[(0,E.default)({autoMount:!1,isVisible:function(e){return e.state.popupVisible},getContainer:function(e){var t=e.props,n=document.createElement("div"); n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%";var r=t.getPopupContainer?t.getPopupContainer((0,p.findDOMNode)(e)):t.getDocument().body;return r.appendChild(n),n}})],getDefaultProps:function(){return{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:i,getDocument:a,onPopupVisibleChange:o,afterPopupVisibleChange:o,onPopupAlign:o,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[]}},getInitialState:function(){var e=this.props,t=void 0;return t="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,{popupVisible:t}},componentWillMount:function(){var e=this;w.forEach(function(t){e["fire"+t]=function(n){e.fireEvents(t,n)}})},componentDidMount:function(){this.componentDidUpdate({},{popupVisible:this.state.popupVisible})},componentWillReceiveProps:function(e){var t=e.popupVisible;void 0!==t&&this.setState({popupVisible:t})},componentDidUpdate:function(e,t){var n=this.props,r=this.state;if(this.renderComponent(null,function(){t.popupVisible!==r.popupVisible&&n.afterPopupVisibleChange(r.popupVisible)}),r.popupVisible){var o=void 0;return!this.clickOutsideHandler&&this.isClickToHide()&&(o=n.getDocument(),this.clickOutsideHandler=(0,_.default)(o,"mousedown",this.onDocumentClick)),void(this.touchOutsideHandler||(o=o||n.getDocument(),this.touchOutsideHandler=(0,_.default)(o,"touchstart",this.onDocumentClick)))}this.clearOutsideHandler()},componentWillUnmount:function(){this.clearDelayTimer(),this.clearOutsideHandler()},onMouseEnter:function(e){this.fireEvents("onMouseEnter",e),this.delaySetPopupVisible(!0,this.props.mouseEnterDelay)},onMouseLeave:function(e){this.fireEvents("onMouseLeave",e),this.delaySetPopupVisible(!1,this.props.mouseLeaveDelay)},onPopupMouseEnter:function(){this.clearDelayTimer()},onPopupMouseLeave:function(e){e.relatedTarget&&!e.relatedTarget.setTimeout&&this._component&&(0,y.default)(this._component.getPopupDomNode(),e.relatedTarget)||this.delaySetPopupVisible(!1,this.props.mouseLeaveDelay)},onFocus:function(e){this.fireEvents("onFocus",e),this.clearDelayTimer(),this.isFocusToShow()&&(this.focusTime=Date.now(),this.delaySetPopupVisible(!0,this.props.focusDelay))},onMouseDown:function(e){this.fireEvents("onMouseDown",e),this.preClickTime=Date.now()},onTouchStart:function(e){this.fireEvents("onTouchStart",e),this.preTouchTime=Date.now()},onBlur:function(e){this.fireEvents("onBlur",e),this.clearDelayTimer(),this.isBlurToHide()&&this.delaySetPopupVisible(!1,this.props.blurDelay)},onClick:function(e){if(this.fireEvents("onClick",e),this.focusTime){var t=void 0;if(this.preClickTime&&this.preTouchTime?t=Math.min(this.preClickTime,this.preTouchTime):this.preClickTime?t=this.preClickTime:this.preTouchTime&&(t=this.preTouchTime),Math.abs(t-this.focusTime)<20)return;this.focusTime=0}this.preClickTime=0,this.preTouchTime=0,e.preventDefault();var n=!this.state.popupVisible;(this.isClickToHide()&&!n||n&&this.isClickToShow())&&this.setPopupVisible(!this.state.popupVisible)},onDocumentClick:function(e){if(!this.props.mask||this.props.maskClosable){var t=e.target,n=(0,p.findDOMNode)(this),r=this.getPopupDomNode();(0,y.default)(n,t)||(0,y.default)(r,t)||this.close()}},getPopupDomNode:function(){return this._component&&this._component.getPopupDomNode?this._component.getPopupDomNode():null},getRootDomNode:function(){return(0,p.findDOMNode)(this)},getPopupClassNameFromAlign:function(e){var t=[],n=this.props,r=n.popupPlacement,o=n.builtinPlacements,i=n.prefixCls;return r&&o&&t.push((0,C.getPopupClassNameFromAlign)(o,i,e)),n.getPopupClassNameFromAlign&&t.push(n.getPopupClassNameFromAlign(e)),t.join(" ")},getPopupAlign:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?(0,C.getAlignFromPlacement)(r,t,n):n},getComponent:function(){var e=this.props,t=this.state,n={};return this.isMouseEnterToShow()&&(n.onMouseEnter=this.onPopupMouseEnter),this.isMouseLeaveToHide()&&(n.onMouseLeave=this.onPopupMouseLeave),c.default.createElement(x.default,(0,l.default)({prefixCls:e.prefixCls,destroyPopupOnHide:e.destroyPopupOnHide,visible:t.popupVisible,className:e.popupClassName,action:e.action,align:this.getPopupAlign(),onAlign:e.onPopupAlign,animation:e.popupAnimation,getClassNameFromAlign:this.getPopupClassNameFromAlign},n,{getRootDomNode:this.getRootDomNode,style:e.popupStyle,mask:e.mask,zIndex:e.zIndex,transitionName:e.popupTransitionName,maskAnimation:e.maskAnimation,maskTransitionName:e.maskTransitionName}),"function"==typeof e.popup?e.popup():e.popup)},setPopupVisible:function(e){this.clearDelayTimer(),this.state.popupVisible!==e&&("popupVisible"in this.props||this.setState({popupVisible:e}),this.props.onPopupVisibleChange(e))},delaySetPopupVisible:function(e,t){var n=this,r=1e3*t;this.clearDelayTimer(),r?this.delayTimer=setTimeout(function(){n.setPopupVisible(e),n.clearDelayTimer()},r):this.setPopupVisible(e)},clearDelayTimer:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)},clearOutsideHandler:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)},createTwoChains:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire"+e]:t[e]||n[e]},isClickToShow:function(){var e=this.props,t=e.action,n=e.showAction;return t.indexOf("click")!==-1||n.indexOf("click")!==-1},isClickToHide:function(){var e=this.props,t=e.action,n=e.hideAction;return t.indexOf("click")!==-1||n.indexOf("click")!==-1},isMouseEnterToShow:function(){var e=this.props,t=e.action,n=e.showAction;return t.indexOf("hover")!==-1||n.indexOf("mouseEnter")!==-1},isMouseLeaveToHide:function(){var e=this.props,t=e.action,n=e.hideAction;return t.indexOf("hover")!==-1||n.indexOf("mouseLeave")!==-1},isFocusToShow:function(){var e=this.props,t=e.action,n=e.showAction;return t.indexOf("focus")!==-1||n.indexOf("focus")!==-1},isBlurToHide:function(){var e=this.props,t=e.action,n=e.hideAction;return t.indexOf("focus")!==-1||n.indexOf("blur")!==-1},forcePopupAlign:function(){this.state.popupVisible&&this._component&&this._component.alignInstance&&this._component.alignInstance.forceAlign()},fireEvents:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)},close:function(){this.setPopupVisible(!1)},render:function(){var e=this.props,t=e.children,n=c.default.Children.only(t),r={};return this.isClickToHide()||this.isClickToShow()?(r.onClick=this.onClick,r.onMouseDown=this.onMouseDown,r.onTouchStart=this.onTouchStart):(r.onClick=this.createTwoChains("onClick"),r.onMouseDown=this.createTwoChains("onMouseDown"),r.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?r.onMouseEnter=this.onMouseEnter:r.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?r.onMouseLeave=this.onMouseLeave:r.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(r.onFocus=this.onFocus,r.onBlur=this.onBlur):(r.onFocus=this.createTwoChains("onFocus"),r.onBlur=this.createTwoChains("onBlur")),c.default.cloneElement(n,r)}});t.default=O,e.exports=t.default},function(e,t){"use strict";function n(e,t){for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229};n.isTextModifyingKeyEvent=function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=n.F1&&t<=n.F12)return!1;switch(t){case n.ALT:case n.CAPS_LOCK:case n.CONTEXT_MENU:case n.CTRL:case n.DOWN:case n.END:case n.ESC:case n.HOME:case n.INSERT:case n.LEFT:case n.MAC_FF_META:case n.META:case n.NUMLOCK:case n.NUM_CENTER:case n.PAGE_DOWN:case n.PAGE_UP:case n.PAUSE:case n.PRINT_SCREEN:case n.RIGHT:case n.SHIFT:case n.UP:case n.WIN_KEY:case n.WIN_KEY_RIGHT:return!1;default:return!0}},n.isCharacterKey=function(e){if(e>=n.ZERO&&e<=n.NINE)return!0;if(e>=n.NUM_ZERO&&e<=n.NUM_MULTIPLY)return!0;if(e>=n.A&&e<=n.Z)return!0;if(window.navigation.userAgent.indexOf("WebKit")!==-1&&0===e)return!0;switch(e){case n.SPACE:case n.QUESTION_MARK:case n.NUM_PLUS:case n.NUM_MINUS:case n.NUM_PERIOD:case n.NUM_DIVISION:case n.SEMICOLON:case n.DASH:case n.EQUALS:case n.COMMA:case n.PERIOD:case n.SLASH:case n.APOSTROPHE:case n.SINGLE_QUOTE:case n.OPEN_SQUARE_BRACKET:case n.BACKSLASH:case n.CLOSE_SQUARE_BRACKET:return!0;default:return!1}},t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){return!o(e.props,t)||!o(e.state,n)}var o=n(439),i={shouldComponentUpdate:function(e,t){return r(this,e,t)}};e.exports=i},function(e,t){"use strict";function n(){var e=[].slice.call(arguments,0);return 1===e.length?e[0]:function(){for(var t=0;t<e.length;t++)e[t]&&e[t].apply&&e[t].apply(this,arguments)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t){"use strict";function n(e){if(e||void 0===r){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),o=n.style;o.position="absolute",o.top=0,o.left=0,o.pointerEvents="none",o.visibility="hidden",o.width="200px",o.height="150px",o.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var i=t.offsetWidth;n.style.overflow="scroll";var a=t.offsetWidth;i===a&&(a=n.clientWidth),document.body.removeChild(n),r=i-a}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var r=void 0;e.exports=t.default},76,function(e,t,n){function r(e){var t=e.getDefaultProps;t&&(e.defaultProps=t(),delete e.getDefaultProps)}function o(e){function t(e){var t=e.state||{};s(t,n.call(e)),e.setState(t)}var n=e.getInitialState,r=e.componentWillMount;n&&(r?e.componentWillMount=function(){t(this),r.call(this)}:e.componentWillMount=function(){t(this)},delete e.getInitialState)}function i(e,t){r(t),o(t);var n={},s={};Object.keys(t).forEach(function(e){"mixins"!==e&&"statics"!==e&&("function"==typeof t[e]?n[e]=t[e]:s[e]=t[e])}),l(e.prototype,n);var u=function(e,t,n){if(!e)return t;if(!t)return e;var r={};return Object.keys(e).forEach(function(n){t[n]||(r[n]=e[n])}),Object.keys(t).forEach(function(n){e[n]?r[n]=function(){return t[n].apply(this,arguments)&&e[n].apply(this,arguments)}:r[n]=t[n]}),r};return a({childContextTypes:u,contextTypes:u,propTypes:a.MANY_MERGED_LOOSE,defaultProps:a.MANY_MERGED_LOOSE})(e,s),t.statics&&Object.getOwnPropertyNames(t.statics).forEach(function(n){var r=e[n],o=t.statics[n];if(void 0!==r&&void 0!==o)throw new TypeError("Cannot mixin statics because statics."+n+" and Component."+n+" are defined.");e[n]=void 0!==r?r:o}),t.mixins&&t.mixins.reverse().forEach(i.bind(null,e)),e}var a=n(473),s=n(28),l=a({componentDidMount:a.MANY,componentWillMount:a.MANY,componentWillReceiveProps:a.MANY,shouldComponentUpdate:a.ONCE,componentWillUpdate:a.MANY,componentDidUpdate:a.MANY,componentWillUnmount:a.MANY,getChildContext:a.MANY_MERGED});e.exports=function(){var e=l;return e.onClass=function(e,t){return t=s({},t),i(e,t)},e.decorate=function(t){return function(n){return e.onClass(n,t)}},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(1),u=r(l),c=n(9),d=r(c),f=n(11),p=r(f),h=n(129),m=r(h),v=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.updateOffset=function(e){var t=e.inherited,r=e.offset;n.channel.update(function(e){e.inherited=t+r})},n.channel=new m.default({inherited:0,offset:0,node:null}),n}return a(t,e),s(t,[{key:"getChildContext",value:function(){return{"sticky-channel":this.channel}}},{key:"componentWillMount",value:function(){var e=this.context["sticky-channel"];e&&e.subscribe(this.updateOffset)}},{key:"componentDidMount",value:function(){var e=p.default.findDOMNode(this);this.channel.update(function(t){t.node=e})}},{key:"componentWillUnmount",value:function(){this.channel.update(function(e){e.node=null});var e=this.context["sticky-channel"];e&&e.unsubscribe(this.updateOffset)}},{key:"render",value:function(){return u.default.createElement("div",this.props,this.props.children)}}]),t}(u.default.Component);v.contextTypes={"sticky-channel":d.default.any},v.childContextTypes={"sticky-channel":d.default.any},t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Channel=t.StickyContainer=t.Sticky=void 0;var o=n(443),i=r(o),a=n(441),s=r(a),l=n(129),u=r(l);t.Sticky=i.default,t.StickyContainer=s.default,t.Channel=u.default,t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(1),d=r(c),f=n(9),p=r(f),h=n(11),m=r(h),v=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.updateContext=function(e){var t=e.inherited,r=e.node;n.containerNode=r,n.setState({containerOffset:t,distanceFromBottom:n.getDistanceFromBottom()})},n.recomputeState=function(){var e=n.isSticky(),t=n.getHeight(),r=n.getWidth(),o=n.getXOffset(),i=n.getDistanceFromBottom(),a=n.state.isSticky!==e;n.setState({isSticky:e,height:t,width:r,xOffset:o,distanceFromBottom:i}),a&&(n.channel&&n.channel.update(function(t){t.offset=e?n.state.height:0}),n.props.onStickyStateChange(e))},n.state={},n}return s(t,e),u(t,[{key:"componentWillMount",value:function(){this.channel=this.context["sticky-channel"],this.channel.subscribe(this.updateContext)}},{key:"componentDidMount",value:function(){this.on(["resize","scroll","touchstart","touchmove","touchend","pageshow","load"],this.recomputeState),this.recomputeState()}},{key:"componentWillReceiveProps",value:function(){this.recomputeState()}},{key:"componentWillUnmount",value:function(){this.off(["resize","scroll","touchstart","touchmove","touchend","pageshow","load"],this.recomputeState),this.channel.unsubscribe(this.updateContext)}},{key:"getXOffset",value:function(){return this.refs.placeholder.getBoundingClientRect().left}},{key:"getWidth",value:function(){return this.refs.placeholder.getBoundingClientRect().width}},{key:"getHeight",value:function(){return m.default.findDOMNode(this.refs.children).getBoundingClientRect().height}},{key:"getDistanceFromTop",value:function(){return this.refs.placeholder.getBoundingClientRect().top}},{key:"getDistanceFromBottom",value:function(){return this.containerNode?this.containerNode.getBoundingClientRect().bottom:0}},{key:"isSticky",value:function(){if(!this.props.isActive)return!1;var e=this.getDistanceFromTop(),t=this.getDistanceFromBottom(),n=this.state.containerOffset-this.props.topOffset,r=this.state.containerOffset+this.props.bottomOffset;return e<=n&&t>=r}},{key:"on",value:function(e,t){e.forEach(function(e){window.addEventListener(e,t)})}},{key:"off",value:function(e,t){e.forEach(function(e){window.removeEventListener(e,t)})}},{key:"shouldComponentUpdate",value:function(e,t){var n=this,r=Object.keys(this.props);if(Object.keys(e).length!=r.length)return!0;var o=r.every(function(t){return e.hasOwnProperty(t)&&e[t]===n.props[t]});if(!o)return!0;var i=this.state;if(t.isSticky!==i.isSticky)return!0;if(i.isSticky){if(t.height!==i.height)return!0;if(t.width!==i.width)return!0;if(t.xOffset!==i.xOffset)return!0;if(t.containerOffset!==i.containerOffset)return!0;if(t.distanceFromBottom!==i.distanceFromBottom)return!0}return!1}},{key:"render",value:function(){var e={paddingBottom:0},t=this.props.className,n=l({},{transform:"translateZ(0)"},this.props.style);if(this.state.isSticky){var r={position:"fixed",top:this.state.containerOffset,left:this.state.xOffset,width:this.state.width},i=this.state.distanceFromBottom-this.state.height-this.props.bottomOffset;this.state.containerOffset>i&&(r.top=i),e.paddingBottom=this.state.height,t+=" "+this.props.stickyClassName,n=l({},n,r,this.props.stickyStyle)}var a=this.props,s=(a.topOffset,a.isActive,a.stickyClassName,a.stickyStyle,a.bottomOffset,a.onStickyStateChange,o(a,["topOffset","isActive","stickyClassName","stickyStyle","bottomOffset","onStickyStateChange"]));return d.default.createElement("div",null,d.default.createElement("div",{ref:"placeholder",style:e}),d.default.createElement("div",l({},s,{ref:"children",className:t,style:n}),this.props.children))}}]),t}(d.default.Component);v.propTypes={isActive:p.default.bool,className:p.default.string,style:p.default.object,stickyClassName:p.default.string,stickyStyle:p.default.object,topOffset:p.default.number,bottomOffset:p.default.number,onStickyStateChange:p.default.func},v.defaultProps={isActive:!0,className:"",style:{},stickyClassName:"sticky",stickyStyle:{},topOffset:0,bottomOffset:0,onStickyStateChange:function(){}},v.contextTypes={"sticky-channel":p.default.any},t.default=v,e.exports=t.default},function(e,t){(function(t){"use strict";var n="undefined"==typeof window?t:window,r=function(e,t,n){return function(r,o){var i=e(function(){t.call(this,i),r.apply(this,arguments)}.bind(this),o);return this[n]?this[n].push(i):this[n]=[i],i}},o=function(e,t){return function(n){if(this[t]){var r=this[t].indexOf(n);r!==-1&&this[t].splice(r,1)}e(n)}},i="TimerMixin_timeouts",a=o(n.clearTimeout,i),s=r(n.setTimeout,a,i),l="TimerMixin_intervals",u=o(n.clearInterval,l),c=r(n.setInterval,function(){},l),d="TimerMixin_immediates",f=o(n.clearImmediate,d),p=r(n.setImmediate,f,d),h="TimerMixin_rafs",m=o(n.cancelAnimationFrame,h),v=r(n.requestAnimationFrame,m,h),y={componentWillUnmount:function(){this[i]&&this[i].forEach(function(e){n.clearTimeout(e)}),this[i]=null,this[l]&&this[l].forEach(function(e){n.clearInterval(e)}),this[l]=null,this[d]&&this[d].forEach(function(e){n.clearImmediate(e)}),this[d]=null,this[h]&&this[h].forEach(function(e){n.cancelAnimationFrame(e)}),this[h]=null},setTimeout:s,clearTimeout:a,setInterval:c,clearInterval:u,setImmediate:p,clearImmediate:f,requestAnimationFrame:v,cancelAnimationFrame:m};e.exports=y}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(450),y=r(v),g=function(e){function t(){(0,s.default)(this,t);var e=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onOk=function(t){var n=e.props,r=n.onChange,o=n.onOk;r&&r(t),o&&o(t)},e}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){return m.default.createElement(y.default,(0,i.default)({picker:this.props.cascader},this.props,{onOk:this.onOk}))}}]),t}(m.default.Component);g.defaultProps={pickerValueProp:"value",pickerValueChangeProp:"onChange"},t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(1),s=r(a),l=n(7),u=r(l),c=n(13),d=r(c),f=n(447),p=r(f),h=(0,d.default)({mixins:[p.default],render:function(){var e=this,t=this.props,n=t.prefixCls,r=t.className,o=t.rootNativeProps,a=t.children,l=this.getValue(),c=s.default.Children.map(a,function(t,n){return s.default.cloneElement(t,{selectedValue:l[n],onValueChange:function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.onValueChange.apply(e,[n].concat(r))}})});return s.default.createElement("div",(0,i.default)({},o,{style:this.props.style,className:(0,u.default)(r,n)}),c)}});t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o);t.default={getDefaultProps:function(){return{prefixCls:"rmc-multi-picker",onValueChange:function(){}}},getValue:function(){var e=this.props,t=e.children,n=e.selectedValue;return n&&n.length?n:t?i.default.Children.map(t,function(e){var t=i.default.Children.toArray(e.props.children);return t&&t[0]&&t[0].props.value}):[]},onValueChange:function(e,t){var n=this.getValue().concat();n[e]=t,this.props.onValueChange(n,e)}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(6),s=r(a),l=n(1),u=r(l),c=n(13),d=r(c),f=n(7),p=r(f),h=n(81),m=r(h),v=n(449),y=r(v),g=(0,d.default)({mixins:[y.default],statics:{Item:function(){}},getDefaultProps:function(){return{prefixCls:"rmc-picker"}},getInitialState:function(){var e=void 0,t=this.props,n=t.selectedValue,r=t.defaultSelectedValue;if(void 0!==n)e=n;else if(void 0!==r)e=r;else{var o=u.default.Children.toArray(this.props.children);e=o&&o[0]&&o[0].props.value}return{selectedValue:e}},componentDidMount:function(){var e=this.refs,t=e.content,n=e.indicator,r=e.mask,o=e.root,i=o.getBoundingClientRect().height,a=this.itemHeight=n.getBoundingClientRect().height,s=Math.floor(i/a);s%2===0&&s--,s--,s/=2,t.style.padding=a*s+"px 0",n.style.top=a*s+"px",r.style.backgroundSize="100% "+a*s+"px",this.zscroller=new m.default(t,{scrollingX:!1,snapping:!0,locking:!1,penetrationDeceleration:.1,minVelocityToKeepDecelerating:.5,scrollingComplete:this.scrollingComplete}),this.zscroller.setDisabled(this.props.disabled),this.zscroller.scroller.setSnapSize(0,a),this.select(this.state.selectedValue)},componentWillReceiveProps:function(e){"selectedValue"in e&&this.setState({selectedValue:e.selectedValue}),this.zscroller.setDisabled(e.disabled)},shouldComponentUpdate:function(e,t){return this.state.selectedValue!==t.selectedValue||this.props.children!==e.children},componentDidUpdate:function(){this.zscroller.reflow(),this.select(this.state.selectedValue)},componentWillUnmount:function(){this.zscroller.destroy()},scrollTo:function(e){this.zscroller.scroller.scrollTo(0,e)},fireValueChange:function(e){e!==this.state.selectedValue&&("selectedValue"in this.props||this.setState({selectedValue:e}),this.props.onValueChange&&this.props.onValueChange(e))},scrollingComplete:function(){var e=this.zscroller.scroller.getValues(),t=e.top;t>=0&&this.doScrollingComplete(t)},getValue:function(){if("selectedValue"in this.props)return this.props.selectedValue;var e=u.default.Children.toArray(this.props.children);return e&&e[0]&&e[0].props.value},render:function(){var e,t=this.props,n=t.prefixCls,r=t.itemStyle,o=t.indicatorStyle,a=t.indicatorClassName,l=void 0===a?"":a,c=this.state.selectedValue,d=n+"-item",f=d+" "+n+"-item-selected",h=u.default.Children.map(t.children,function(e){var t=e.props,n=t.className,o=void 0===n?"":n,i=t.style,a=t.value,l=t.children;return u.default.createElement("div",{style:(0,s.default)({},r,i),className:(c===a?f:d)+" "+o,key:a},l)}),m=(e={},(0,i.default)(e,t.className,!!t.className),(0,i.default)(e,n,!0),e);return u.default.createElement("div",{className:(0,p.default)(m),ref:"root",style:this.props.style},u.default.createElement("div",{className:n+"-mask",ref:"mask"}),u.default.createElement("div",{className:n+"-indicator "+l,ref:"indicator",style:o}),u.default.createElement("div",{className:n+"-content",ref:"content"},h))}});t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o);t.default={select:function(e){for(var t=i.default.Children.toArray(this.props.children),n=0,r=t.length;n<r;n++)if(t[n].props.value===e)return void this.selectByIndex(n);this.selectByIndex(0)},selectByIndex:function(e){e<0||e>=i.default.Children.count(this.props.children)||!this.itemHeight||this.scrollTo(e*this.itemHeight)},doScrollingComplete:function(e){var t=e/this.itemHeight,n=Math.floor(t);t=t-n>.5?n+1:n;var r=i.default.Children.toArray(this.props.children);t=Math.min(t,r.length-1);var o=r[t];o?this.fireValueChange(o.props.value):console.warn&&console.warn("child not found",r,t)}},e.exports=t.default},[507,451],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),a=r(i),s=n(1),l=r(s);t.default={getDefaultProps:function(){return{onVisibleChange:o,okText:"Ok",pickerValueProp:"selectedValue",pickerValueChangeProp:"onValueChange",dismissText:"Dismiss",title:"",onOk:o,onDismiss:o}},getInitialState:function(){return{pickerValue:"value"in this.props?this.props.value:null,visible:this.props.visible||!1}},componentWillReceiveProps:function(e){"value"in e&&this.setState({pickerValue:e.value}),"visible"in e&&this.setVisibleState(e.visible)},onPickerChange:function(e){if(this.state.pickerValue!==e){this.setState({pickerValue:e});var t=this.props,n=t.picker,r=t.pickerValueChangeProp;n&&n.props[r]&&n.props[r](e)}},saveRef:function(e){this.picker=e},setVisibleState:function(e){this.setState({visible:e}),e||this.setState({pickerValue:null})},fireVisibleChange:function(e){this.state.visible!==e&&("visible"in this.props||this.setVisibleState(e),this.props.onVisibleChange(e))},getRender:function(){var e=this.props,t=e.children;if(!t)return this.getModal();var n=this.props,r=n.WrapComponent,o=n.disabled,i=t,a={};return o||(a[e.triggerType]=this.onTriggerClick),l.default.createElement(r,{style:e.wrapStyle},l.default.cloneElement(i,a),this.getModal())},onTriggerClick:function(e){var t=this.props.children,n=t.props||{};n[this.props.triggerType]&&n[this.props.triggerType](e),this.fireVisibleChange(!this.state.visible)},onOk:function(){this.props.onOk(this.picker&&this.picker.getValue()),this.fireVisibleChange(!1)},getContent:function(){if(this.props.picker){var e,t=this.state.pickerValue;return null===t&&(t=this.props.value),l.default.cloneElement(this.props.picker,(e={},(0,a.default)(e,this.props.pickerValueProp,t),(0,a.default)(e,this.props.pickerValueChangeProp,this.onPickerChange),(0,a.default)(e,"ref",this.saveRef),e))}return this.props.content},onDismiss:function(){this.props.onDismiss(),this.fireVisibleChange(!1)},hide:function(){this.fireVisibleChange(!1)}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return e.clone().endOf("month").date()}function i(e){return e<10?"0"+e:e+""}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(80),y=r(v),g=n(116),_=r(g),b=n(454),x=r(b),C={fontSize:20},S="datetime",E="date",w="time",O="month",P="year",k=function(e){function t(){(0,s.default)(this,t);var e=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={date:e.props.date||e.props.defaultDate},e.onValueChange=function(t,n){var r=parseInt(t[n],10),o=e.props,i=o.mode,a=e.getDate().clone();if(i===S||i===E||i===P||i===O)switch(n){case 0:a.year(r);break;case 1:a.month(r);break;case 2:a.date(r);break;case 3:a.hour(r);break;case 4:a.minute(r)}else switch(n){case 0:a.hour(r);break;case 1:a.minute(r)}a=e.clipDate(a),"date"in o||e.setState({date:a}),o.onDateChange&&o.onDateChange(a)},e}return(0,p.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){"date"in e&&this.setState({date:e.date||e.defaultDate})}},{key:"getDefaultMinDate",value:function(){return this.defaultMinDate||(this.defaultMinDate=this.getGregorianCalendar([2e3,1,1,0,0,0])),this.defaultMinDate}},{key:"getDefaultMaxDate",value:function(){return this.defaultMaxDate||(this.defaultMaxDate=this.getGregorianCalendar([2030,1,1,23,59,59])),this.defaultMaxDate}},{key:"getDate",value:function(){return this.state.date||this.getDefaultMinDate()}},{key:"getValue",value:function(){return this.getDate()}},{key:"getMinYear",value:function(){return this.getMinDate().year()}},{key:"getMaxYear",value:function(){return this.getMaxDate().year()}},{key:"getMinMonth",value:function(){return this.getMinDate().month()}},{key:"getMaxMonth",value:function(){return this.getMaxDate().month()}},{key:"getMinDay",value:function(){return this.getMinDate().date()}},{key:"getMaxDay",value:function(){return this.getMaxDate().date()}},{key:"getMinHour",value:function(){return this.getMinDate().hour()}},{key:"getMaxHour",value:function(){return this.getMaxDate().hour()}},{key:"getMinMinute",value:function(){return this.getMinDate().minute()}},{key:"getMaxMinute",value:function(){return this.getMaxDate().minute()}},{key:"getMinDate",value:function(){return this.props.minDate||this.getDefaultMinDate()}},{key:"getMaxDate",value:function(){return this.props.maxDate||this.getDefaultMaxDate()}},{key:"getDateData",value:function(){for(var e=this.props,t=e.locale,n=e.formatMonth,r=e.formatDay,i=e.mode,a=this.getDate(),s=a.year(),l=a.month(),u=this.getMinYear(),c=this.getMaxYear(),d=this.getMinMonth(),f=this.getMaxMonth(),p=this.getMinDay(),h=this.getMaxDay(),m=[],v=u;v<=c;v++)m.push({value:v+"",label:v+t.year+""});var y={key:"year",props:{children:m}};if(i===P)return[y];var g=[],_=0,b=11;u===s&&(_=d), c===s&&(b=f);for(var x=_;x<=b;x++){var C=n?n(x,a):x+1+t.month+"";g.push({value:x+"",label:C})}var S={key:"month",props:{children:g}};if(i===O)return[y,S];var E=[],w=1,k=o(a);u===s&&d===l&&(w=p),c===s&&f===l&&(k=h);for(var T=w;T<=k;T++){var M=r?r(T,a):T+t.day+"";E.push({value:T+"",label:M})}return[y,S,{key:"day",props:{children:E}}]}},{key:"getTimeData",value:function(){var e=0,t=23,n=0,r=59,o=this.props,a=o.mode,s=o.locale,l=o.minuteStep,u=this.getDate(),c=this.getMinMinute(),d=this.getMaxMinute(),f=this.getMinHour(),p=this.getMaxHour(),h=u.hour();if(a===S){var m=u.year(),v=u.month(),y=u.date(),g=this.getMinYear(),_=this.getMaxYear(),b=this.getMinMonth(),x=this.getMaxMonth(),C=this.getMinDay(),E=this.getMaxDay();g===m&&b===v&&C===y&&(e=f,f===h&&(n=c)),_===m&&x===v&&E===y&&(t=p,p===h&&(r=d))}else e=f,f===h&&(n=c),t=p,p===h&&(r=d);for(var w=[],O=e;O<=t;O++)w.push({value:O+"",label:s.hour?O+s.hour+"":i(O)});for(var P=[],k=n;k<=r;k+=l)P.push({value:k+"",label:s.minute?k+s.minute+"":i(k)});return[{key:"hours",props:{children:w}},{key:"minutes",props:{children:P}}]}},{key:"getGregorianCalendar",value:function(e){return(0,_.default)(e)}},{key:"clipDate",value:function(e){var t=this.props.mode,n=this.getMinDate(),r=this.getMaxDate();if(t===S){if(e.isBefore(n))return n.clone();if(e.isAfter(r))return r.clone()}else if(t===E){if(e.isBefore(n,"day"))return n.clone();if(e.isAfter(r,"day"))return r.clone()}else{var o=r.hour(),i=r.minute(),a=n.hour(),s=n.minute(),l=e.hour(),u=e.minute();if(l<a||l===a&&u<s)return n.clone();if(l>o||l===o&&u>i)return r.clone()}return e}},{key:"getValueCols",value:function(){var e=this.props.mode,t=this.getDate(),n=[],r=[];return e===P?{cols:this.getDateData(),value:[t.year()+""]}:e===O?{cols:this.getDateData(),value:[t.year()+"",t.month()+""]}:(e!==S&&e!==E||(n=this.getDateData(),r=[t.year()+"",t.month()+"",t.date()+""]),e!==S&&e!==w||(n=n.concat(this.getTimeData()),r=r.concat([t.hour()+"",t.minute()+""])),{value:r,cols:n})}},{key:"render",value:function(){var e=this.getValueCols(),t=e.value,n=e.cols,r=this.props,o=r.mode,i=r.prefixCls,a=r.pickerPrefixCls,s=r.rootNativeProps,l=r.className;return m.default.createElement(y.default,{rootNativeProps:s,className:l,prefixCls:i,pickerPrefixCls:a,pickerItemStyle:"undefined"==typeof window&&"datetime"===o?C:void 0,selectedValue:t,onValueChange:this.onValueChange},n)}}]),t}(m.default.Component);k.defaultProps={prefixCls:"rmc-date-picker",pickerPrefixCls:"rmc-picker",locale:x.default,mode:E,minuteStep:1,onDateChange:function(){}},t.default=k,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(469),y=r(v),g=function(e){function t(){(0,s.default)(this,t);var e=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onOk=function(t){var n=e.props,r=n.onChange,o=n.onOk;r&&r(t),o&&o(t)},e}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){return m.default.createElement(y.default,(0,i.default)({picker:this.props.datePicker,value:this.props.date},this.props,{onOk:this.onOk}))}}]),t}(m.default.Component);g.defaultProps={pickerValueProp:"date",pickerValueChangeProp:"onDateChange"},t.default=g,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={year:"",month:"",day:"",hour:"",minute:""},e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={year:"\u5e74",month:"\u6708",day:"\u65e5",hour:"\u65f6",minute:"\u5206"},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),i=r(o),a=n(8),s=r(a),l=n(14),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(9),x=r(b),C=n(11),S=r(C),E=n(7),w=r(E),O=n(131),P=r(O),k=n(132),T=function(e){function t(e){(0,d.default)(this,t);var n=(0,m.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return M.call(n),n.state={pageSize:e.pageSize,_delay:!1},n}return(0,y.default)(t,e),(0,p.default)(t,[{key:"componentDidMount",value:function(){this.dataChange(this.props),this.getQsInfo()}},{key:"componentWillReceiveProps",value:function(e){this.props.dataSource!==e.dataSource&&this.dataChange(e)}},{key:"componentDidUpdate",value:function(){this.getQsInfo()}},{key:"componentWillUnmount",value:function(){this._timer&&clearTimeout(this._timer),this._hCache=null}},{key:"renderQuickSearchBar",value:function(e,t){var n=this,r=this.props,o=r.dataSource,i=r.prefixCls,a=o.sectionIdentities.map(function(e){return{value:e,label:o._getSectionHeaderData(o._dataBlob,e)}});return _.default.createElement("ul",{ref:"quickSearchBar",className:i+"-quick-search-bar",style:t,onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd,onTouchCancel:this.onTouchEnd},_.default.createElement("li",{"data-qf-target":e.value,onClick:function(){return n.onQuickSearchTop(void 0,e.value)}},e.label),a.map(function(e){return _.default.createElement("li",{key:e.value,"data-qf-target":e.value,onClick:function(){return n.onQuickSearch(e.value)}},e.label)}))}},{key:"render",value:function(){var e,t,n=this,r=this.state,o=r._delay,a=r.pageSize,l=this.props,c=l.className,d=l.prefixCls,f=l.children,p=l.quickSearchBarTop,h=l.quickSearchBarStyle,m=l.initialListSize,v=void 0===m?Math.min(20,this.props.dataSource.getRowCount()):m,y=l.showQuickSearchIndicator,g=l.renderSectionHeader,b=l.sectionHeaderClassName,x=(0,u.default)(l,["className","prefixCls","children","quickSearchBarTop","quickSearchBarStyle","initialListSize","showQuickSearchIndicator","renderSectionHeader","sectionHeaderClassName"]);return _.default.createElement("div",{className:d+"-container"},o&&this.props.delayActivityIndicator,_.default.createElement(P.default,(0,i.default)({},x,{ref:"indexedListView",className:(0,w.default)((e={},(0,s.default)(e,c,c),(0,s.default)(e,d,!0),e)),initialListSize:v,pageSize:a,renderSectionHeader:function(e,t){return _.default.cloneElement(g(e,t),{ref:function(e){return n.sectionComponents[t]=e},className:b||d+"-section-header"})}}),f),this.renderQuickSearchBar(p,h),y?_.default.createElement("div",{className:(0,w.default)((t={},(0,s.default)(t,d+"-qsindicator",!0),(0,s.default)(t,d+"-qsindicator-hide",!y||!this.state.showQuickSearchIndicator),t)),ref:"qsIndicator"}):null)}}]),t}(_.default.Component);T.propTypes=(0,i.default)({},P.default.propTypes,{children:x.default.any,prefixCls:x.default.string,className:x.default.string,sectionHeaderClassName:x.default.string,quickSearchBarTop:x.default.object,quickSearchBarStyle:x.default.object,onQuickSearch:x.default.func,showQuickSearchIndicator:x.default.bool}),T.defaultProps={prefixCls:"rmc-indexed-list",quickSearchBarTop:{value:"#",label:"#"},onQuickSearch:function(){},showQuickSearchIndicator:!1,delayTime:100,delayActivityIndicator:""};var M=function(){var e=this;this.onQuickSearchTop=function(t,n){e.props.stickyHeader?window.document.body.scrollTop=0:S.default.findDOMNode(e.refs.indexedListView.refs.listviewscroll).scrollTop=0,e.props.onQuickSearch(t,n)},this.onQuickSearch=function(t){var n=S.default.findDOMNode(e.refs.indexedListView.refs.listviewscroll),r=S.default.findDOMNode(e.sectionComponents[t]);if(e.props.stickyHeader){var o=e.refs.indexedListView.stickyRefs[t];o&&o.refs.placeholder&&(r=S.default.findDOMNode(o.refs.placeholder)),window.document.body.scrollTop=r.getBoundingClientRect().top-n.getBoundingClientRect().top+(0,k.getOffsetTop)(n)}else n.scrollTop+=r.getBoundingClientRect().top-n.getBoundingClientRect().top;e.props.onQuickSearch(t)},this.onTouchStart=function(t){e._target=t.target,e._basePos=e.refs.quickSearchBar.getBoundingClientRect(),document.addEventListener("touchmove",e._disableParent,!1),document.body.className=document.body.className+" "+e.props.prefixCls+"-qsb-moving",e.updateIndicator(e._target)},this.onTouchMove=function(t){if(t.preventDefault(),e._target){var n=(0,k._event)(t),r=e._basePos,o=void 0;if(n.clientY>=r.top&&n.clientY<=r.top+e._qsHeight){o=Math.floor((n.clientY-r.top)/e._avgH);var i=void 0;if(o in e._hCache&&(i=e._hCache[o][0]),i){var a=i.getAttribute("data-qf-target");e._target!==i&&(e.props.quickSearchBarTop.value===a?e.onQuickSearchTop(void 0,a):e.onQuickSearch(a),e.updateIndicator(i)),e._target=i}}}},this.onTouchEnd=function(){e._target&&(document.removeEventListener("touchmove",e._disableParent,!1),document.body.className=document.body.className.replace(new RegExp("\\s*"+e.props.prefixCls+"-qsb-moving","g"),""),e.updateIndicator(e._target,!0),e._target=null)},this.getQsInfo=function(){var t=e.refs.quickSearchBar,n=t.offsetHeight,r=[];[].slice.call(t.querySelectorAll("[data-qf-target]")).forEach(function(e){r.push([e])});for(var o=n/r.length,i=0,a=0,s=r.length;a<s;a++)i=a*o,r[a][1]=[i,i+o];e._qsHeight=n,e._avgH=o,e._hCache=r},this.sectionComponents={},this.dataChange=function(t){var n=t.dataSource.getRowCount();n&&(e.setState({_delay:!0}),e._timer&&clearTimeout(e._timer),e._timer=setTimeout(function(){e.setState({pageSize:n,_delay:!1},function(){return e.refs.indexedListView._pageInNewRows()})},t.delayTime))},this.updateIndicator=function(t,n){var r=t;r.getAttribute("data-qf-target")||(r=r.parentNode),e.props.showQuickSearchIndicator&&(e.refs.qsIndicator.innerText=r.innerText.trim(),e.setState({showQuickSearchIndicator:!0}),e._indicatorTimer&&clearTimeout(e._indicatorTimer),e._indicatorTimer=setTimeout(function(){e.setState({showQuickSearchIndicator:!1})},1e3));var o=e.props.prefixCls+"-quick-search-bar-over";e._hCache.forEach(function(e){e[0].className=e[0].className.replace(o,"")}),n||(r.className=r.className+" "+o)},this._disableParent=function(e){e.preventDefault(),e.stopPropagation()}};t.default=T,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return e[t][n]}function i(e,t){return e[t]}function a(e){for(var t=0,n=0;n<e.length;n++){var r=e[n];t+=r.length}return t}function s(e){if((0,m.default)(e))return{};for(var t={},n=0;n<e.length;n++){var r=e[n];(0,y.default)(!t[r],"Value appears more than once in array: "+r),t[r]=!0}return t}Object.defineProperty(t,"__esModule",{value:!0});var l=n(2),u=r(l),c=n(5),d=r(c),f=n(49),p=r(f),h=n(361),m=r(h),v=n(114),y=r(v),g=function(){function e(t){(0,u.default)(this,e),(0,p.default)(t&&"function"==typeof t.rowHasChanged,"Must provide a rowHasChanged function."),this._rowHasChanged=t.rowHasChanged,this._getRowData=t.getRowData||o,this._sectionHeaderHasChanged=t.sectionHeaderHasChanged,this._getSectionHeaderData=t.getSectionHeaderData||i,this._dataBlob=null,this._dirtyRows=[],this._dirtySections=[],this._cachedRowCount=0,this.rowIdentities=[],this.sectionIdentities=[]}return(0,d.default)(e,[{key:"cloneWithRows",value:function(e,t){var n=t?[t]:null;return this._sectionHeaderHasChanged||(this._sectionHeaderHasChanged=function(){return!1}),this.cloneWithRowsAndSections({s1:e},["s1"],n)}},{key:"cloneWithRowsAndSections",value:function(t,n,r){(0,p.default)("function"==typeof this._sectionHeaderHasChanged,"Must provide a sectionHeaderHasChanged function with section data."),(0,p.default)(!n||!r||n.length===r.length,"row and section ids lengths must be the same");var o=new e({getRowData:this._getRowData,getSectionHeaderData:this._getSectionHeaderData,rowHasChanged:this._rowHasChanged,sectionHeaderHasChanged:this._sectionHeaderHasChanged});return o._dataBlob=t,n?o.sectionIdentities=n:o.sectionIdentities=Object.keys(t),r?o.rowIdentities=r:(o.rowIdentities=[],o.sectionIdentities.forEach(function(e){o.rowIdentities.push(Object.keys(t[e]))})),o._cachedRowCount=a(o.rowIdentities),o._calculateDirtyArrays(this._dataBlob,this.sectionIdentities,this.rowIdentities),o}},{key:"getRowCount",value:function(){return this._cachedRowCount}},{key:"getRowAndSectionCount",value:function(){return this._cachedRowCount+this.sectionIdentities.length}},{key:"rowShouldUpdate",value:function(e,t){var n=this._dirtyRows[e][t];return(0,y.default)(void 0!==n,"missing dirtyBit for section, row: "+e+", "+t),n}},{key:"getRowData",value:function(e,t){var n=this.sectionIdentities[e],r=this.rowIdentities[e][t];return(0,y.default)(void 0!==n&&void 0!==r,"rendering invalid section, row: "+e+", "+t),this._getRowData(this._dataBlob,n,r)}},{key:"getRowIDForFlatIndex",value:function(e){for(var t=e,n=0;n<this.sectionIdentities.length;n++){if(!(t>=this.rowIdentities[n].length))return this.rowIdentities[n][t];t-=this.rowIdentities[n].length}return null}},{key:"getSectionIDForFlatIndex",value:function(e){for(var t=e,n=0;n<this.sectionIdentities.length;n++){if(!(t>=this.rowIdentities[n].length))return this.sectionIdentities[n];t-=this.rowIdentities[n].length}return null}},{key:"getSectionLengths",value:function(){for(var e=[],t=0;t<this.sectionIdentities.length;t++)e.push(this.rowIdentities[t].length);return e}},{key:"sectionHeaderShouldUpdate",value:function(e){var t=this._dirtySections[e];return(0,y.default)(void 0!==t,"missing dirtyBit for section: "+e),t}},{key:"getSectionHeaderData",value:function(e){if(!this._getSectionHeaderData)return null;var t=this.sectionIdentities[e];return(0,y.default)(void 0!==t,"renderSection called on invalid section: "+e),this._getSectionHeaderData(this._dataBlob,t)}},{key:"_calculateDirtyArrays",value:function(e,t,n){for(var r=s(t),o={},i=0;i<n.length;i++){var a=t[i];(0,y.default)(!o[a],"SectionID appears more than once: "+a),o[a]=s(n[i])}this._dirtySections=[],this._dirtyRows=[];for(var l,u=0;u<this.sectionIdentities.length;u++){var a=this.sectionIdentities[u];l=!r[a];var c=this._sectionHeaderHasChanged;!l&&c&&(l=c(this._getSectionHeaderData(e,a),this._getSectionHeaderData(this._dataBlob,a))),this._dirtySections.push(!!l),this._dirtyRows[u]=[];for(var d=0;d<this.rowIdentities[u].length;d++){var f=this.rowIdentities[u][d];l=!r[a]||!o[a][f]||this._rowHasChanged(this._getRowData(e,a,f),this._getRowData(this._dataBlob,a,f)),this._dirtyRows[u].push(!!l)}}}}]),e}();t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=(r(o),n(11)),a=r(i);t.default={bindEvt:function(){var e=this.getEle();e.addEventListener("touchstart",this.onPullUpStart),e.addEventListener("touchmove",this.onPullUpMove),e.addEventListener("touchend",this.onPullUpEnd),e.addEventListener("touchcancel",this.onPullUpEnd)},unBindEvt:function(){var e=this.getEle();e.removeEventListener("touchstart",this.onPullUpStart),e.removeEventListener("touchmove",this.onPullUpMove),e.removeEventListener("touchend",this.onPullUpEnd),e.removeEventListener("touchcancel",this.onPullUpEnd)},getEle:function(){var e=this.props,t=e.stickyHeader,n=e.useBodyScroll,r=void 0;return r=t||n?document.body:a.default.findDOMNode(this.refs.listviewscroll.refs.ScrollView)},componentDidMount:function(){this.bindEvt()},componentWillUnmount:function(){this.unBindEvt()},onPullUpStart:function(e){this._pullUpStartPageY=e.touches[0].screenY,this._isPullUp=!1,this._pullUpEle=this.getEle()},onPullUpMove:function(e){e.touches[0].screenY<this._pullUpStartPageY&&this._reachBottom()&&(this._isPullUp=!0)},onPullUpEnd:function(e){this._isPullUp&&this.props.onEndReached&&this.props.onEndReached(e),this._isPullUp=!1},_reachBottom:function(){var e=this._pullUpEle;return e===document.body?e.scrollHeight-e.scrollTop===window.innerHeight:e.scrollHeight-e.scrollTop===e.clientHeight}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(2),s=r(a),l=n(5),u=r(l),c=n(4),d=r(c),f=n(3),p=r(f),h=n(1),m=r(h),v=n(9),y=r(v),g=n(7),_=r(g),b={prefixCls:y.default.string,className:y.default.string,style:y.default.object,icon:y.default.any,loading:y.default.any,distanceToRefresh:y.default.number,refreshing:y.default.bool,onRefresh:y.default.func.isRequired},x=function(e){function t(e){(0,s.default)(this,t);var n=(0,d.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={active:!1,deactive:!1,loadingState:!1},n}return(0,p.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=void 0===r?"":r,a=t.style,s=t.icon,l=t.loading,u=t.refreshing,c=this.state,d=c.active,f=c.deactive,p=c.loadingState,h=(0,_.default)((e={},(0,i.default)(e,o,o),(0,i.default)(e,n+"-ptr",!0),(0,i.default)(e,n+"-active",d),(0,i.default)(e,n+"-deactive",f),(0,i.default)(e,n+"-loading",p||u),e));return m.default.createElement("div",{ref:"ptr",className:h,style:a},m.default.createElement("div",{className:n+"-ptr-icon"},s),m.default.createElement("div",{className:n+"-ptr-loading"},l))}}]),t}(m.default.Component);x.propTypes=b,x.defaultProps={prefixCls:"list-view-refresh-control",distanceToRefresh:50,refreshing:!1,icon:[m.default.createElement("div",{key:"0",className:"list-view-refresh-control-pull"},"\u2193 \u4e0b\u62c9"),m.default.createElement("div",{key:"1",className:"list-view-refresh-control-release"},"\u2191 \u91ca\u653e")],loading:m.default.createElement("div",null,"loading...")},t.default=x,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=(r(o),n(11)),a=r(i),s=n(114),l=r(s),u=16,c={scrollResponderMixinGetInitialState:function(){return{isTouching:!1,lastMomentumScrollBeginTime:0,lastMomentumScrollEndTime:0,observedScrollSinceBecomingResponder:!1,becameResponderWhileAnimating:!1}},scrollResponderHandleScrollShouldSetResponder:function(){return this.state.isTouching},scrollResponderHandleStartShouldSetResponder:function(){return!1},scrollResponderHandleStartShouldSetResponderCapture:function(e){return this.scrollResponderIsAnimating()},scrollResponderHandleMoveShouldSetResponderCapture:function(e){return!0},scrollResponderHandleResponderReject:function(){(0,l.default)(!1,"ScrollView doesn't take rejection well - scrolls anyway")},scrollResponderHandleTerminationRequest:function(){return!this.state.observedScrollSinceBecomingResponder},scrollResponderHandleTouchEnd:function(e){var t=e.nativeEvent;this.state.isTouching=0!==t.touches.length,this.props.onTouchEnd&&this.props.onTouchEnd(e)},scrollResponderHandleResponderRelease:function(e){this.props.onResponderRelease&&this.props.onResponderRelease(e),this.props.keyboardShouldPersistTaps||this.state.observedScrollSinceBecomingResponder||this.state.becameResponderWhileAnimating||this.props.onScrollResponderKeyboardDismissed&&this.props.onScrollResponderKeyboardDismissed(e)},scrollResponderHandleScroll:function(e){this.state.observedScrollSinceBecomingResponder=!0,this.props.onScroll&&this.props.onScroll(e)},scrollResponderHandleResponderGrant:function(e){this.state.observedScrollSinceBecomingResponder=!1,this.props.onResponderGrant&&this.props.onResponderGrant(e),this.state.becameResponderWhileAnimating=this.scrollResponderIsAnimating()},scrollResponderHandleScrollBeginDrag:function(e){this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},scrollResponderHandleScrollEndDrag:function(e){this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},scrollResponderHandleMomentumScrollBegin:function(e){this.state.lastMomentumScrollBeginTime=Date.now(),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},scrollResponderHandleMomentumScrollEnd:function(e){this.state.lastMomentumScrollEndTime=Date.now(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},scrollResponderHandleTouchStart:function(e){this.state.isTouching=!0,this.props.onTouchStart&&this.props.onTouchStart(e)},scrollResponderHandleTouchMove:function(e){this.props.onTouchMove&&this.props.onTouchMove(e)},scrollResponderIsAnimating:function(){var e=Date.now(),t=e-this.state.lastMomentumScrollEndTime,n=t<u||this.state.lastMomentumScrollEndTime<this.state.lastMomentumScrollBeginTime;return n},scrollResponderScrollTo:function(e,t){this.scrollResponderScrollWithouthAnimationTo(e,t)},scrollResponderScrollWithouthAnimationTo:function(e,t){var n=a.default.findDOMNode(this);n.offsetX=e,n.offsetY=t},scrollResponderZoomTo:function(e){},scrollResponderScrollNativeHandleToKeyboard:function(e,t,n){this.additionalScrollOffset=t||0,this.preventNegativeScrollOffset=!!n},scrollResponderInputMeasureAndScrollToKeyboard:function(e,t,n,r){if(this.keyboardWillOpenTo){var o=t-this.keyboardWillOpenTo.endCoordinates.screenY+r+this.additionalScrollOffset;this.preventNegativeScrollOffset&&(o=Math.max(0,o)),this.scrollResponderScrollTo(0,o)}this.additionalOffset=0,this.preventNegativeScrollOffset=!1},scrollResponderTextInputFocusError:function(e){console.error("Error measuring text field: ",e)},componentWillMount:function(){},scrollResponderKeyboardWillShow:function(e){this.keyboardWillOpenTo=e,this.props.onKeyboardWillShow&&this.props.onKeyboardWillShow(e)},scrollResponderKeyboardWillHide:function(e){this.keyboardWillOpenTo=null,this.props.onKeyboardWillHide&&this.props.onKeyboardWillHide(e)},scrollResponderKeyboardDidShow:function(e){e&&(this.keyboardWillOpenTo=e),this.props.onKeyboardDidShow&&this.props.onKeyboardDidShow(e)},scrollResponderKeyboardDidHide:function(){this.keyboardWillOpenTo=null,this.props.onKeyboardDidHide&&this.props.onKeyboardDidHide()}},d={Mixin:c};t.default=d,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(6),s=r(a),l=n(14),u=r(l),c=n(2),d=r(c),f=n(5),p=r(f),h=n(4),m=r(h),v=n(3),y=r(v),g=n(1),_=r(g),b=n(9),x=r(b),C=n(11),S=r(C),E=n(81),w=r(E),O=n(28),P=r(O),k=n(7),T=r(k),M=n(132),N="ScrollView",R="InnerScrollView",D={children:x.default.any,className:x.default.string,prefixCls:x.default.string,listPrefixCls:x.default.string,listViewPrefixCls:x.default.string,style:x.default.object,contentContainerStyle:x.default.object,onScroll:x.default.func,scrollEventThrottle:x.default.number,removeClippedSubviews:x.default.bool,refreshControl:x.default.element},j={base:{position:"relative",overflow:"auto",WebkitOverflowScrolling:"touch",flex:1},zScroller:{position:"relative",overflow:"hidden",flex:1}},I=function(e){function t(){var e,n,r,o;(0,d.default)(this,t);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r=(0,m.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.throttleScroll=function(){var e=function(){};return r.props.scrollEventThrottle&&r.props.onScroll&&(e=(0,M.throttle)(function(e){r.props.onScroll&&r.props.onScroll(e)},r.props.scrollEventThrottle)),e},r.scrollingComplete=function(){r.props.refreshControl&&r.refs.refreshControl&&r.refs.refreshControl.state.deactive&&r.refs.refreshControl.setState({deactive:!1})},o=n,(0,m.default)(r,o)}return(0,y.default)(t,e),(0,p.default)(t,[{key:"getInnerViewNode",value:function(){return S.default.findDOMNode(this.refs[R])}},{key:"componentWillUpdate",value:function(e){this.props.dataSource===e.dataSource&&this.props.initialListSize===e.initialListSize||!this.tsExec||(this.props.stickyHeader||this.props.useBodyScroll?window.removeEventListener("scroll",this.tsExec):this.props.useZscroller||S.default.findDOMNode(this.refs[N]).removeEventListener("scroll",this.tsExec))}},{key:"componentDidUpdate",value:function(e){var t=this;if(e.refreshControl&&this.props.refreshControl){var n=e.refreshControl.props.refreshing,r=this.props.refreshControl.props.refreshing;n&&!r&&this.refreshControlRefresh?this.refreshControlRefresh():this.manuallyRefresh||n||!r||this.domScroller.scroller.triggerPullToRefresh()}this.props.dataSource===e.dataSource&&this.props.initialListSize===e.initialListSize||!this.tsExec||setTimeout(function(){t.props.stickyHeader||t.props.useBodyScroll?window.addEventListener("scroll",t.tsExec):t.props.useZscroller||S.default.findDOMNode(t.refs[N]).addEventListener("scroll",t.tsExec)},0)}},{key:"componentDidMount",value:function(){var e=this;this.tsExec=this.throttleScroll(),this.onLayout=function(){return e.props.onLayout({nativeEvent:{layout:{width:window.innerWidth,height:window.innerHeight}}})};var t=S.default.findDOMNode(this.refs[N]);this.props.stickyHeader||this.props.useBodyScroll?(window.addEventListener("scroll",this.tsExec),window.addEventListener("resize",this.onLayout)):this.props.useZscroller?this.renderZscroller():t.addEventListener("scroll",this.tsExec)}},{key:"componentWillUnmount",value:function(){this.props.stickyHeader||this.props.useBodyScroll?(window.removeEventListener("scroll",this.tsExec),window.removeEventListener("resize",this.onLayout)):this.props.useZscroller?this.domScroller.destroy():S.default.findDOMNode(this.refs[N]).removeEventListener("scroll",this.tsExec)}},{key:"scrollTo",value:function(){if(this.props.stickyHeader||this.props.useBodyScroll){var e;(e=window).scrollTo.apply(e,arguments)}else if(this.props.useZscroller){var t;this.domScroller.reflow(),(t=this.domScroller.scroller).scrollTo.apply(t,arguments)}else{var n=S.default.findDOMNode(this.refs[N]);n.scrollLeft=arguments.length<=0?void 0:arguments[0],n.scrollTop=arguments.length<=1?void 0:arguments[1]}}},{key:"renderZscroller",value:function(){var e=this,t=this.props,n=t.scrollerOptions,r=t.refreshControl,o=n.scrollingComplete,i=n.onScroll,a=(0,u.default)(n,["scrollingComplete","onScroll"]);if(this.domScroller=new w.default(this.getInnerViewNode(),(0,P.default)({},(0,s.default)({scrollingX:!1,onScroll:function(){e.tsExec(),i&&i()},scrollingComplete:function(){e.scrollingComplete(),o&&o()}},a))),r){var l=this.domScroller.scroller,c=r.props,d=c.distanceToRefresh,f=c.onRefresh;l.activatePullToRefresh(d,function(){e.manuallyRefresh=!0,e.overDistanceThenRelease=!1,e.refs.refreshControl&&e.refs.refreshControl.setState({active:!0})},function(){e.manuallyRefresh=!1,e.refs.refreshControl&&e.refs.refreshControl.setState({deactive:e.overDistanceThenRelease,active:!1,loadingState:!1})},function(){e.overDistanceThenRelease=!0,e.refs.refreshControl&&e.refs.refreshControl.setState({deactive:!1,loadingState:!0});var t=function(){l.finishPullToRefresh(),e.refreshControlRefresh=null};Promise.all([new Promise(function(t){f(),e.refreshControlRefresh=t}),new Promise(function(e){return setTimeout(e,1e3)})]).then(t,t)}),r.props.refreshing&&l.triggerPullToRefresh()}}},{key:"render",value:function(){var e,t,n=this.props,r=n.children,o=n.className,a=n.prefixCls,s=void 0===a?"":a,l=n.listPrefixCls,u=void 0===l?"":l,c=n.listViewPrefixCls,d=void 0===c?"rmc-list-view":c,f=n.style,p=void 0===f?{}:f,h=n.contentContainerStyle,m=n.useZscroller,v=n.refreshControl,y=n.stickyHeader,g=n.useBodyScroll,b=j.base;y||g?b=null:m&&(b=j.zScroller);var x=s||d||"",C={ref:N,style:(0,P.default)({},b,p),className:(0,T.default)((e={},(0,i.default)(e,o,!!o),(0,i.default)(e,x+"-scrollview",!0),e))},S={ref:R,style:(0,P.default)({},{position:"absolute",minWidth:"100%"},h),className:(0,T.default)((t={},(0,i.default)(t,x+"-scrollview-content",!0),(0,i.default)(t,u,!!u),t))};return v?_.default.createElement("div",C,_.default.createElement("div",S,_.default.cloneElement(v,{ref:"refreshControl"}),r)):y||g?_.default.createElement("div",C,r):_.default.createElement("div",C,_.default.createElement("div",S,r))}}]),t}(_.default.Component);I.propTypes=D,t.default=I,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(5),s=r(a),l=n(4),u=r(l),c=n(3),d=r(c),f=n(1),p=r(f),h=n(9),m=r(h),v=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,s.default)(t,[{key:"shouldComponentUpdate",value:function(e){return e.shouldUpdate}},{key:"render",value:function(){return this.props.render()}}]),t}(p.default.Component);v.propTypes={shouldUpdate:m.default.bool.isRequired,render:m.default.func.isRequired},t.default=v,e.exports=t.default},function(e,t,n){"use strict";var r=n(464);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(11),l=(r(s),n(13)),u=r(l),c=n(9),d=r(c),f=n(366),p=r(f),h=n(465),m=r(h),v=n(28),y=r(v),g=n(310),_=r(g),b=function(e,t,n){null!==e&&"undefined"!=typeof e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},x=function(e,t,n){null!==e&&"undefined"!=typeof e&&(e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null)},C=(0,u.default)({displayName:"Carousel",mixins:[p.default.Mixin],propTypes:{afterSlide:d.default.func,autoplay:d.default.bool,resetAutoplay:d.default.bool,swipeSpeed:d.default.number,autoplayInterval:d.default.number,beforeSlide:d.default.func,cellAlign:d.default.oneOf(["left","center","right"]),cellSpacing:d.default.number,data:d.default.func,decorators:d.default.arrayOf(d.default.shape({component:d.default.func,position:d.default.oneOf(["TopLeft","TopCenter","TopRight","CenterLeft","CenterCenter","CenterRight","BottomLeft","BottomCenter","BottomRight"]),style:d.default.object})),dragging:d.default.bool,easing:d.default.string,edgeEasing:d.default.string,framePadding:d.default.string,frameOverflow:d.default.string,initialSlideHeight:d.default.number,initialSlideWidth:d.default.number,slideIndex:d.default.number,slidesToShow:d.default.number,slidesToScroll:d.default.oneOfType([d.default.number,d.default.oneOf(["auto"])]),slideWidth:d.default.oneOfType([d.default.string,d.default.number]),speed:d.default.number,swiping:d.default.bool,vertical:d.default.bool,width:d.default.string,wrapAround:d.default.bool},getDefaultProps:function(){return{afterSlide:function(){},autoplay:!1,resetAutoplay:!0,swipeSpeed:5,autoplayInterval:3e3,beforeSlide:function(){},cellAlign:"left",cellSpacing:0,data:function(){},decorators:m.default,dragging:!0,easing:"easeOutCirc",edgeEasing:"easeOutElastic",framePadding:"0px",frameOverflow:"hidden",slideIndex:0,slidesToScroll:1,slidesToShow:1,slideWidth:1,speed:500,swiping:!0,vertical:!1,width:"100%",wrapAround:!1}},getInitialState:function(){return{currentSlide:this.props.slideIndex,dragging:!1,frameWidth:0,left:0,slideCount:0,slidesToScroll:this.props.slidesToScroll,slideWidth:0,top:0}},componentWillMount:function(){this.setInitialDimensions()},componentDidMount:function(){this.setDimensions(),this.bindEvents(),this.setExternalData(),this.props.autoplay&&this.startAutoplay()},componentWillReceiveProps:function(e){this.setState({slideCount:e.children.length}),this.setDimensions(e),this.props.slideIndex!==e.slideIndex&&e.slideIndex!==this.state.currentSlide&&this.goToSlide(e.slideIndex),this.props.autoplay!==e.autoplay&&(e.autoplay?this.startAutoplay():this.stopAutoplay())},componentWillUnmount:function(){this.unbindEvents(),this.stopAutoplay()},render:function(){var e=this,t=a.default.Children.count(this.props.children)>1?this.formatChildren(this.props.children):this.props.children;return a.default.createElement("div",{className:["slider",this.props.className||""].join(" "),ref:"slider",style:(0,y.default)(this.getSliderStyles(),this.props.style||{})},a.default.createElement("div",o({className:"slider-frame",ref:"frame",style:this.getFrameStyles()},this.getTouchEvents(),this.getMouseEvents(),{onClick:this.handleClick}),a.default.createElement("ul",{className:"slider-list",ref:"list",style:this.getListStyles()},t)),this.props.decorators?this.props.decorators.map(function(t,n){return a.default.createElement("div",{style:(0,y.default)(e.getDecoratorStyles(t.position),t.style||{}), className:"slider-decorator-"+n,key:n},a.default.createElement(t.component,{currentSlide:e.state.currentSlide,slideCount:e.state.slideCount,frameWidth:e.state.frameWidth,slideWidth:e.state.slideWidth,slidesToScroll:e.state.slidesToScroll,cellSpacing:e.props.cellSpacing,slidesToShow:e.props.slidesToShow,wrapAround:e.props.wrapAround,nextSlide:e.nextSlide,previousSlide:e.previousSlide,goToSlide:e.goToSlide}))}):null,a.default.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:e.getStyleTagStyles()}}))},touchObject:{},getTouchEvents:function(){var e=this;return e.props.swiping===!1?null:{onTouchStart:function(t){e.touchObject={startX:t.touches[0].pageX,startY:t.touches[0].pageY},e.handleMouseOver()},onTouchMove:function(t){var n=e.swipeDirection(e.touchObject.startX,t.touches[0].pageX,e.touchObject.startY,t.touches[0].pageY);0!==n&&t.preventDefault();var r=e.props.vertical?Math.round(Math.sqrt(Math.pow(t.touches[0].pageY-e.touchObject.startY,2))):Math.round(Math.sqrt(Math.pow(t.touches[0].pageX-e.touchObject.startX,2)));e.touchObject={startX:e.touchObject.startX,startY:e.touchObject.startY,endX:t.touches[0].pageX,endY:t.touches[0].pageY,length:r,direction:n},e.setState({left:e.props.vertical?0:e.getTargetLeft(e.touchObject.length*e.touchObject.direction),top:e.props.vertical?e.getTargetLeft(e.touchObject.length*e.touchObject.direction):0})},onTouchEnd:function(t){e.handleSwipe(t),e.handleMouseOut()},onTouchCancel:function(t){e.handleSwipe(t)}}},clickSafe:!0,getMouseEvents:function(){var e=this;return this.props.dragging===!1?null:{onMouseOver:function(){e.handleMouseOver()},onMouseOut:function(){e.handleMouseOut()},onMouseDown:function(t){e.touchObject={startX:t.clientX,startY:t.clientY},e.setState({dragging:!0})},onMouseMove:function(t){if(e.state.dragging){var n=e.swipeDirection(e.touchObject.startX,t.clientX,e.touchObject.startY,t.clientY);0!==n&&t.preventDefault();var r=e.props.vertical?Math.round(Math.sqrt(Math.pow(t.clientY-e.touchObject.startY,2))):Math.round(Math.sqrt(Math.pow(t.clientX-e.touchObject.startX,2)));e.touchObject={startX:e.touchObject.startX,startY:e.touchObject.startY,endX:t.clientX,endY:t.clientY,length:r,direction:n},e.setState({left:e.props.vertical?0:e.getTargetLeft(e.touchObject.length*e.touchObject.direction),top:e.props.vertical?e.getTargetLeft(e.touchObject.length*e.touchObject.direction):0})}},onMouseUp:function(t){e.state.dragging&&e.handleSwipe(t)},onMouseLeave:function(t){e.state.dragging&&e.handleSwipe(t)}}},handleMouseOver:function(){this.props.autoplay&&(this.autoplayPaused=!0,this.stopAutoplay())},handleMouseOut:function(){this.props.autoplay&&this.autoplayPaused&&(this.startAutoplay(),this.autoplayPaused=null)},handleClick:function(e){this.clickSafe===!0&&(e.preventDefault(),e.stopPropagation(),e.nativeEvent&&e.nativeEvent.stopPropagation())},handleSwipe:function(e){"undefined"!=typeof this.touchObject.length&&this.touchObject.length>44?this.clickSafe=!0:this.clickSafe=!1;var t=this.props.slidesToShow;"auto"===this.props.slidesToScroll&&(t=this.state.slidesToScroll),this.touchObject.length>this.state.slideWidth/t/this.props.swipeSpeed?1===this.touchObject.direction?this.state.currentSlide>=a.default.Children.count(this.props.children)-t&&!this.props.wrapAround?this.animateSlide(p.default.easingTypes[this.props.edgeEasing]):this.nextSlide():this.touchObject.direction===-1&&(this.state.currentSlide<=0&&!this.props.wrapAround?this.animateSlide(p.default.easingTypes[this.props.edgeEasing]):this.previousSlide()):this.goToSlide(this.state.currentSlide),this.touchObject={},this.setState({dragging:!1})},swipeDirection:function(e,t,n,r){var o,i,a,s;return o=e-t,i=n-r,a=Math.atan2(i,o),s=Math.round(180*a/Math.PI),s<0&&(s=360-Math.abs(s)),s<=45&&s>=0?1:s<=360&&s>=315?1:s>=135&&s<=225?-1:this.props.vertical===!0?s>=35&&s<=135?1:-1:0},autoplayIterator:function(){return this.props.wrapAround?this.nextSlide():void(this.state.currentSlide!==this.state.slideCount-this.state.slidesToShow?this.nextSlide():this.stopAutoplay())},startAutoplay:function(){this.autoplayID=setInterval(this.autoplayIterator,this.props.autoplayInterval)},resetAutoplay:function(){this.props.resetAutoplay&&this.props.autoplay&&!this.autoplayPaused&&(this.stopAutoplay(),this.startAutoplay())},stopAutoplay:function(){this.autoplayID&&clearInterval(this.autoplayID)},goToSlide:function(e){var t=this;if(e>=a.default.Children.count(this.props.children)||e<0){if(!this.props.wrapAround)return;if(e>=a.default.Children.count(this.props.children))return this.props.beforeSlide(this.state.currentSlide,0),this.setState({currentSlide:0},function(){t.animateSlide(null,null,t.getTargetLeft(null,e),function(){t.animateSlide(null,.01),t.props.afterSlide(0),t.resetAutoplay(),t.setExternalData()})});var n=a.default.Children.count(this.props.children)-this.state.slidesToScroll;return this.props.beforeSlide(this.state.currentSlide,n),this.setState({currentSlide:n},function(){t.animateSlide(null,null,t.getTargetLeft(null,e),function(){t.animateSlide(null,.01),t.props.afterSlide(n),t.resetAutoplay(),t.setExternalData()})})}this.props.beforeSlide(this.state.currentSlide,e),this.setState({currentSlide:e},function(){t.animateSlide(),this.props.afterSlide(e),t.resetAutoplay(),t.setExternalData()})},nextSlide:function(){var e=a.default.Children.count(this.props.children),t=this.props.slidesToShow;if("auto"===this.props.slidesToScroll&&(t=this.state.slidesToScroll),!(this.state.currentSlide>=e-t)||this.props.wrapAround)if(this.props.wrapAround)this.goToSlide(this.state.currentSlide+this.state.slidesToScroll);else{if(1!==this.props.slideWidth)return this.goToSlide(this.state.currentSlide+this.state.slidesToScroll);this.goToSlide(Math.min(this.state.currentSlide+this.state.slidesToScroll,e-t))}},previousSlide:function(){this.state.currentSlide<=0&&!this.props.wrapAround||(this.props.wrapAround?this.goToSlide(this.state.currentSlide-this.state.slidesToScroll):this.goToSlide(Math.max(0,this.state.currentSlide-this.state.slidesToScroll)))},animateSlide:function(e,t,n,r){this.tweenState(this.props.vertical?"top":"left",{easing:e||p.default.easingTypes[this.props.easing],duration:t||this.props.speed,endValue:n||this.getTargetLeft(),onEnd:r||null})},getTargetLeft:function(e,t){var n,r=t||this.state.currentSlide;switch(this.props.cellAlign){case"left":n=0,n-=this.props.cellSpacing*r;break;case"center":n=(this.state.frameWidth-this.state.slideWidth)/2,n-=this.props.cellSpacing*r;break;case"right":n=this.state.frameWidth-this.state.slideWidth,n-=this.props.cellSpacing*r}var o=this.state.slideWidth*r,i=this.state.currentSlide>0&&r+this.state.slidesToScroll>=this.state.slideCount;return i&&1!==this.props.slideWidth&&!this.props.wrapAround&&"auto"===this.props.slidesToScroll&&(o=this.state.slideWidth*this.state.slideCount-this.state.frameWidth,n=0,n-=this.props.cellSpacing*(this.state.slideCount-1)),n-=e||0,(o-n)*-1},bindEvents:function(){var e=this;_.default.canUseDOM&&(b(window,"resize",e.onResize),b(document,"readystatechange",e.onReadyStateChange))},onResize:function(){this.setDimensions()},onReadyStateChange:function(){this.setDimensions()},unbindEvents:function(){var e=this;_.default.canUseDOM&&(x(window,"resize",e.onResize),x(document,"readystatechange",e.onReadyStateChange))},formatChildren:function(e){var t=this,n=this.props.vertical?this.getTweeningValue("top"):this.getTweeningValue("left");return a.default.Children.map(e,function(e,r){return a.default.createElement("li",{className:"slider-slide",style:t.getSlideStyles(r,n),key:r},e)})},setInitialDimensions:function(){var e,t,n,r=this;e=this.props.vertical?this.props.initialSlideHeight||0:this.props.initialSlideWidth||0,n=this.props.initialSlideHeight?this.props.initialSlideHeight*this.props.slidesToShow:0,t=n+this.props.cellSpacing*(this.props.slidesToShow-1),this.setState({slideHeight:n,frameWidth:this.props.vertical?t:"100%",slideCount:a.default.Children.count(this.props.children),slideWidth:e},function(){r.setLeft(),r.setExternalData()})},setDimensions:function(e){e=e||this.props;var t,n,r,o,i,a,s,l=this;n=e.slidesToScroll,o=this.refs.frame,r=o.childNodes[0].childNodes[0],r?(r.style.height="auto",s=this.props.vertical?r.offsetHeight*e.slidesToShow:r.offsetHeight):s=100,t="number"!=typeof e.slideWidth?parseInt(e.slideWidth):e.vertical?s/e.slidesToShow*e.slideWidth:o.offsetWidth/e.slidesToShow*e.slideWidth,e.vertical||(t-=e.cellSpacing*((100-100/e.slidesToShow)/100)),a=s+e.cellSpacing*(e.slidesToShow-1),i=e.vertical?a:o.offsetWidth,"auto"===e.slidesToScroll&&(n=Math.floor(i/(t+e.cellSpacing))),this.setState({slideHeight:s,frameWidth:i,slideWidth:t,slidesToScroll:n,left:e.vertical?0:this.getTargetLeft(),top:e.vertical?this.getTargetLeft():0},function(){l.setLeft()})},setLeft:function(){this.setState({left:this.props.vertical?0:this.getTargetLeft(),top:this.props.vertical?this.getTargetLeft():0})},setExternalData:function(){this.props.data&&this.props.data()},getListStyles:function(){var e=this.state.slideWidth*a.default.Children.count(this.props.children),t=this.props.cellSpacing*a.default.Children.count(this.props.children),n="translate3d("+this.getTweeningValue("left")+"px, "+this.getTweeningValue("top")+"px, 0)";return{transform:n,WebkitTransform:n,msTransform:"translate("+this.getTweeningValue("left")+"px, "+this.getTweeningValue("top")+"px)",position:"relative",display:"block",margin:this.props.vertical?this.props.cellSpacing/2*-1+"px 0px":"0px "+this.props.cellSpacing/2*-1+"px",padding:0,height:this.props.vertical?e+t:this.state.slideHeight,width:this.props.vertical?"auto":e+t,cursor:this.state.dragging===!0?"pointer":"inherit",boxSizing:"border-box",MozBoxSizing:"border-box"}},getFrameStyles:function(){return{position:"relative",display:"block",overflow:this.props.frameOverflow,height:this.props.vertical?this.state.frameWidth||"initial":"auto",margin:this.props.framePadding,padding:0,transform:"translate3d(0, 0, 0)",WebkitTransform:"translate3d(0, 0, 0)",msTransform:"translate(0, 0)",boxSizing:"border-box",MozBoxSizing:"border-box"}},getSlideStyles:function(e,t){var n=this.getSlideTargetPosition(e,t);return{position:"absolute",left:this.props.vertical?0:n,top:this.props.vertical?n:0,display:this.props.vertical?"block":"inline-block",listStyleType:"none",verticalAlign:"top",width:this.props.vertical?"100%":this.state.slideWidth,height:"auto",boxSizing:"border-box",MozBoxSizing:"border-box",marginLeft:this.props.vertical?"auto":this.props.cellSpacing/2,marginRight:this.props.vertical?"auto":this.props.cellSpacing/2,marginTop:this.props.vertical?this.props.cellSpacing/2:"auto",marginBottom:this.props.vertical?this.props.cellSpacing/2:"auto"}},getSlideTargetPosition:function(e,t){var n=this.state.frameWidth/this.state.slideWidth,r=(this.state.slideWidth+this.props.cellSpacing)*e,o=(this.state.slideWidth+this.props.cellSpacing)*n*-1;if(this.props.wrapAround){var i=Math.ceil(t/this.state.slideWidth);if(this.state.slideCount-i<=e)return(this.state.slideWidth+this.props.cellSpacing)*(this.state.slideCount-e)*-1;var a=Math.ceil((Math.abs(t)-Math.abs(o))/this.state.slideWidth);if(1!==this.state.slideWidth&&(a=Math.ceil((Math.abs(t)-this.state.slideWidth)/this.state.slideWidth)),e<=a-1)return(this.state.slideWidth+this.props.cellSpacing)*(this.state.slideCount+e)}return r},getSliderStyles:function(){return{position:"relative",display:"block",width:this.props.width,height:"auto",boxSizing:"border-box",MozBoxSizing:"border-box",visibility:this.state.slideWidth?"visible":"hidden"}},getStyleTagStyles:function(){return".slider-slide > img {width: 100%; display: block;}"},getDecoratorStyles:function(e){switch(e){case"TopLeft":return{position:"absolute",top:0,left:0};case"TopCenter":return{position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",WebkitTransform:"translateX(-50%)",msTransform:"translateX(-50%)"};case"TopRight":return{position:"absolute",top:0,right:0};case"CenterLeft":return{position:"absolute",top:"50%",left:0,transform:"translateY(-50%)",WebkitTransform:"translateY(-50%)",msTransform:"translateY(-50%)"};case"CenterCenter":return{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"};case"CenterRight":return{position:"absolute",top:"50%",right:0,transform:"translateY(-50%)",WebkitTransform:"translateY(-50%)",msTransform:"translateY(-50%)"};case"BottomLeft":return{position:"absolute",bottom:0,left:0};case"BottomCenter":return{position:"absolute",bottom:0,width:"100%",textAlign:"center"};case"BottomRight":return{position:"absolute",bottom:0,right:0};default:return{position:"absolute",top:0,left:0}}}});C.ControllerMixin={getInitialState:function(){return{carousels:{}}},setCarouselData:function(e){var t=this.state.carousels;t[e]=this.refs[e],this.setState({carousels:t})}},t.default=C,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(13),s=r(a),l=[{component:(0,s.default)({render:function(){return i.default.createElement("button",{style:this.getButtonStyles(0===this.props.currentSlide&&!this.props.wrapAround),onClick:this.handleClick},"PREV")},handleClick:function(e){e.preventDefault(),this.props.previousSlide()},getButtonStyles:function(e){return{border:0,background:"rgba(0,0,0,0.4)",color:"white",padding:10,outline:0,opacity:e?.3:1,cursor:"pointer"}}}),position:"CenterLeft"},{component:(0,s.default)({render:function(){return i.default.createElement("button",{style:this.getButtonStyles(this.props.currentSlide+this.props.slidesToScroll>=this.props.slideCount&&!this.props.wrapAround),onClick:this.handleClick},"NEXT")},handleClick:function(e){e.preventDefault(),this.props.nextSlide()},getButtonStyles:function(e){return{border:0,background:"rgba(0,0,0,0.4)",color:"white",padding:10,outline:0,opacity:e?.3:1,cursor:"pointer"}}}),position:"CenterRight"},{component:(0,s.default)({render:function(){var e=this,t=this.getIndexes(e.props.slideCount,e.props.slidesToScroll);return i.default.createElement("ul",{style:e.getListStyles()},t.map(function(t){return i.default.createElement("li",{style:e.getListItemStyles(),key:t},i.default.createElement("button",{style:e.getButtonStyles(e.props.currentSlide===t),onClick:e.props.goToSlide.bind(null,t)},"\u2022"))}))},getIndexes:function(e,t){for(var n=[],r=0;r<e;r+=t)n.push(r);return n},getListStyles:function(){return{position:"relative",margin:0,top:-10,padding:0}},getListItemStyles:function(){return{listStyleType:"none",display:"inline-block"}},getButtonStyles:function(e){return{border:0,background:"transparent",color:"black",cursor:"pointer",padding:10,outline:0,fontSize:24,opacity:e?1:.5}}}),position:"BottomCenter"}];t.default=l,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={getDefaultProps:function(){return{prefixCls:"rmc-multi-picker",pickerPrefixCls:"rmc-picker",onValueChange:function(){},disabled:!1}},getValue:function(){var e=this.props,t=e.children,n=e.selectedValue;return n&&n.length?n:t?t.map(function(e){var t=e.props.children;return t&&t[0]&&t[0].value}):[]},onValueChange:function(e,t){var n=this.getValue().concat();n[e]=t,this.props.onValueChange(n,e)}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),a=n(1),s=r(a),l=n(13),u=r(l),c=n(7),d=r(c),f=n(81),p=r(f),h=n(468),m=r(h),v=n(471),y=r(v),g=(0,u.default)({mixins:[m.default],getDefaultProps:function(){return{prefixCls:"rmc-picker",pure:!0}},getInitialState:function(){var e=void 0,t=this.props,n=t.selectedValue,r=t.defaultSelectedValue,o=t.children;return void 0!==n?e=n:void 0!==r?e=r:o&&o.length&&(e=o[0].value),{selectedValue:e}},componentDidMount:function(){this.itemHeight=this.refs.indicator.getBoundingClientRect().height,this.refs.content.style.padding=3*this.itemHeight+"px 0",this.zscroller=new p.default(this.refs.content,{scrollingX:!1,snapping:!0,locking:!1,penetrationDeceleration:.1,minVelocityToKeepDecelerating:.5,scrollingComplete:this.scrollingComplete}),this.zscroller.setDisabled(this.props.disabled),this.zscroller.scroller.setSnapSize(0,this.itemHeight),this.select(this.state.selectedValue)},componentWillReceiveProps:function(e){"selectedValue"in e&&this.setState({selectedValue:e.selectedValue}),this.zscroller.setDisabled(e.disabled)},shouldComponentUpdate:function(e,t){return this.state.selectedValue!==t.selectedValue||!(0,y.default)(this.props.children,e.children,this.props.pure)},componentDidUpdate:function(){this.zscroller.reflow(),this.select(this.state.selectedValue)},componentWillUnmount:function(){this.zscroller.destroy()},scrollTo:function(e){this.zscroller.scroller.scrollTo(0,e)},fireValueChange:function(e){e!==this.state.selectedValue&&("selectedValue"in this.props||this.setState({selectedValue:e}),this.props.onValueChange&&this.props.onValueChange(e))},scrollingComplete:function(){var e=this.zscroller.scroller.getValues(),t=e.top;t>=0&&this.doScrollingComplete(t)},getChildMember:function(e,t){return e[t]},getValue:function(){return this.props.selectedValue||this.props.children&&this.props.children[0]&&this.props.children[0].value},toChildrenArray:function(e){return e||[]},render:function(){var e,t=this.props,n=t.children,r=t.prefixCls,o=t.className,a=t.itemStyle,l=t.indicatorStyle,u=this.state.selectedValue,c=r+"-item",f=c+" "+r+"-item-selected",p=this.toChildrenArray(n).map(function(e){return s.default.createElement("div",{style:a,className:u===e.value?f:c,key:e.value},e.label)}),h=(e={},(0,i.default)(e,o,!!o),(0,i.default)(e,r,!0),e);return s.default.createElement("div",{className:(0,d.default)(h)},s.default.createElement("div",{className:r+"-mask"}),s.default.createElement("div",{className:r+"-indicator",ref:"indicator",style:l}),s.default.createElement("div",{className:r+"-content",ref:"content"},p))}});t.default=g,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={select:function(e){for(var t=this.toChildrenArray(this.props.children),n=0,r=t.length;n<r;n++)if(this.getChildMember(t[n],"value")===e)return void this.selectByIndex(n);this.selectByIndex(0)},selectByIndex:function(e){e<0||e>=this.toChildrenArray(this.props.children).length||!this.itemHeight||this.scrollTo(e*this.itemHeight)},doScrollingComplete:function(e){var t=e/this.itemHeight,n=Math.floor(t);t=t-n>.5?n+1:n;var r=this.toChildrenArray(this.props.children);t=Math.min(t,r.length-1);var o=r[t];o?this.fireValueChange(this.getChildMember(o,"value")):console.warn&&console.warn("child not found",r,t)}},e.exports=t.default},[507,470],451,function(e,t){"use strict";function n(e){return!e||!e.length}function r(e,t,r){if(n(e)&&n(t))return!0;if(r)return e===t;if(e.length!==t.length)return!1;for(var o=e.length,i=0;i<o;i++)if(e[i].value!==t[i].value||e[i].label!==t[i].label)return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyArray=n,t.default=r},function(e,t){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var u=i[l];if(!s(u))return!1;var c=e[u],d=t[u];if(o=n?n.call(r,c,d,u):void 0,o===!1||void 0===o&&c!==d)return!1}return!0}},function(e,t){function n(e){return Object.prototype.toString.call(e)}function r(e){return e}function o(e){return"function"!=typeof e?e:function(){return e.apply(this,arguments)}}function i(e,t,n){t in e?e[t]=n:Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function a(e,t,r){if(void 0!==e&&void 0!==t){var o=function(e){return e&&e.constructor&&e.constructor.name?e.constructor.name:n(e).slice(8,-1)};throw new TypeError("Cannot mixin key "+r+" because it is provided by multiple sources, and the types are "+o(e)+" and "+o(t))}return void 0===e?t:e}function s(e,t){var r=n(e);if("[object Object]"!==r){var o=e.constructor?e.constructor.name:"Unknown",i=t.constructor?t.constructor.name:"Unknown";throw new Error("cannot merge returned value of type "+o+" with an "+i)}}var l=e.exports=function(e,t){var n=t||{};return n.unknownFunction||(n.unknownFunction=l.ONCE),n.nonFunctionProperty||(n.nonFunctionProperty=a),function(t,r){Object.keys(r).forEach(function(a){var s=t[a],l=r[a],u=e[a];if(void 0!==s||void 0!==l){if(u){var c=u(s,l,a);return void i(t,a,o(c))}var d="function"==typeof s,f="function"==typeof l;return d&&void 0===l||f&&void 0===s||d&&f?void i(t,a,o(n.unknownFunction(s,l,a))):void(t[a]=n.nonFunctionProperty(s,l,a))}})}};l._mergeObjects=function(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.concat(t);s(e,t),s(t,e);var n={};return Object.keys(e).forEach(function(r){if(Object.prototype.hasOwnProperty.call(t,r))throw new Error("cannot merge returns because both have the "+JSON.stringify(r)+" key");n[r]=e[r]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n},l.ONCE=function(e,t,n){if(e&&t)throw new TypeError("Cannot mixin "+n+" because it has a unique constraint.");return e||t},l.MANY=function(e,t,n){return function(){return t&&t.apply(this,arguments),e?e.apply(this,arguments):void 0}},l.MANY_MERGED_LOOSE=function(e,t,n){return e&&t?l._mergeObjects(e,t):e||t},l.MANY_MERGED=function(e,t,n){return function(){var n=t&&t.apply(this,arguments),r=e&&e.apply(this,arguments);return n&&r?l._mergeObjects(n,r):r||n}},l.REDUCE_LEFT=function(e,t,n){var o=e||r,i=t||r;return function(){return i.call(this,o.apply(this,arguments))}},l.REDUCE_RIGHT=function(e,t,n){var o=e||r,i=t||r;return function(){return o.call(this,i.apply(this,arguments))}}},function(e,t){!function(t){function n(){var e=this;s.forEach(function(t){e[t]={name:a,version:[],versionString:a}})}function r(e,t,n){i[t].forEach(function(r){var i=r[0],s=r[1],l=n.match(i);l&&(e[t].name=s,l[2]?(e[t].versionString=l[2],e[t].version=[]):l[1]?(e[t].versionString=l[1].replace(/_/g,"."),e[t].version=o(l[1])):(e[t].versionString=a,e[t].version=[]))})}function o(e){return e.split(/[\._]/).map(function(e){return parseInt(e)})}var i={browser:[[/msie ([\.\_\d]+)/,"ie"],[/trident\/.*?rv:([\.\_\d]+)/,"ie"],[/firefox\/([\.\_\d]+)/,"firefox"],[/chrome\/([\.\_\d]+)/,"chrome"],[/version\/([\.\_\d]+).*?safari/,"safari"],[/mobile safari ([\.\_\d]+)/,"safari"],[/android.*?version\/([\.\_\d]+).*?safari/,"com.android.browser"],[/crios\/([\.\_\d]+).*?safari/,"chrome"],[/opera/,"opera"],[/opera\/([\.\_\d]+)/,"opera"],[/opera ([\.\_\d]+)/,"opera"],[/opera mini.*?version\/([\.\_\d]+)/,"opera.mini"],[/opios\/([a-z\.\_\d]+)/,"opera"],[/blackberry/,"blackberry"],[/blackberry.*?version\/([\.\_\d]+)/,"blackberry"],[/bb\d+.*?version\/([\.\_\d]+)/,"blackberry"],[/rim.*?version\/([\.\_\d]+)/,"blackberry"],[/iceweasel\/([\.\_\d]+)/,"iceweasel"],[/edge\/([\.\d]+)/,"edge"]],os:[[/linux ()([a-z\.\_\d]+)/,"linux"],[/mac os x/,"macos"],[/mac os x.*?([\.\_\d]+)/,"macos"],[/os ([\.\_\d]+) like mac os/,"ios"],[/openbsd ()([a-z\.\_\d]+)/,"openbsd"],[/android/,"android"],[/android ([a-z\.\_\d]+);/,"android"],[/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/,"firefoxos"],[/windows\s*(?:nt)?\s*([\.\_\d]+)/,"windows"],[/windows phone.*?([\.\_\d]+)/,"windows.phone"],[/windows mobile/,"windows.mobile"],[/blackberry/,"blackberryos"],[/bb\d+/,"blackberryos"],[/rim.*?os\s*([\.\_\d]+)/,"blackberryos"]],device:[[/ipad/,"ipad"],[/iphone/,"iphone"],[/lumia/,"lumia"],[/htc/,"htc"],[/nexus/,"nexus"],[/galaxy nexus/,"galaxy.nexus"],[/nokia/,"nokia"],[/ gt\-/,"galaxy"],[/ sm\-/,"galaxy"],[/xbox/,"xbox"],[/(?:bb\d+)|(?:blackberry)|(?: rim )/,"blackberry"]]},a="Unknown",s=Object.keys(i);n.prototype.sniff=function(e){var t=this,n=(e||navigator.userAgent||"").toLowerCase();s.forEach(function(e){r(t,e,n)})},"undefined"!=typeof e&&e.exports?e.exports=n:(t.Sniffr=new n,t.Sniffr.sniff(navigator.userAgent))}(this)},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 48 48" id="check-circle-o" ><g fill-rule="evenodd"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm0-3c11.598 0 21-9.402 21-21S35.598 3 24 3 3 12.402 3 24s9.402 21 21 21z"/><path d="M12.2 23.2L10 25.3l10 9.9L37.2 15 35 13 19.8 30.8z"/></g></symbol>';e.exports=r.add(o,"check-circle-o")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 48 48" id="check-circle" ><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zM13.1 23.2l-2.2 2.1 10 9.9L38.1 15l-2.2-2-15.2 17.8-7.6-7.6z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"check-circle")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="check" ><title>Operation Icons Copy 6</title><path d="M34.538 8L38 11.518 17.808 32 8 22.033l3.462-3.518 6.346 6.45z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"check")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 48 48" id="cross-circle-o" ><title>step-48-&#x9519;&#x8BEF;-&#x5B9E;&#x5FC3;</title><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm.353-25.77l-7.593-7.593c-.797-.799-1.538-.822-2.263-.207-.724.614-.56 1.617-.124 2.067l7.852 7.847-7.721 7.723c-.726.728-.558 1.646-.065 2.177.494.532 1.554.683 2.312-.174l7.587-7.584 7.644 7.623c.796.799 1.608.725 2.211.146.604-.579.72-1.442-.075-2.24l-7.657-7.669 7.544-7.521c.811-.697.9-1.76.297-2.34-.92-.885-1.849-.338-2.264.078l-7.685 7.667z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"cross-circle-o")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 48 48" id="cross-circle" ><g fill-rule="evenodd"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm0-3c11.598 0 21-9.402 21-21S35.598 3 24 3 3 12.402 3 24s9.402 21 21 21z"/><path d="M24.34 22.219l-7.775-7.774a1.499 1.499 0 1 0-2.121 2.121l7.774 7.774-7.774 7.775a1.499 1.499 0 1 0 2.12 2.12l7.775-7.773 7.775 7.774a1.499 1.499 0 1 0 2.121-2.121L26.46 24.34l7.774-7.774a1.499 1.499 0 1 0-2.121-2.121l-7.775 7.774z"/></g></symbol>';e.exports=r.add(o,"cross-circle")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="cross" ><path d="M24.008 21.852l8.969-8.968L31.093 11l-8.969 8.968L13.156 11l-1.884 1.884 8.968 8.968-9.24 9.24 1.884 1.885 9.24-9.24 9.24 9.24 1.885-1.884-9.24-9.24z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"cross")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="down" ><title>Operation Icons Copy 4</title><path d="M22.355 28.237l-11.483-10.9c-.607-.576-1.714-.396-2.48.41l.674-.71c-.763.802-.73 2.071-.282 2.496l11.37 10.793-.04.039 2.088 2.196 1.098-1.043 12.308-11.682c.447-.425.48-1.694-.282-2.496l.674.71c-.766-.806-1.873-.986-2.48-.41L22.355 28.237z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"down")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="ellipsis-circle" ><title>ellipsis-circle-cp</title><g fill-rule="evenodd"><path d="M22.13.109C10.049.109.255 9.903.255 21.984s9.794 21.875 21.875 21.875 21.875-9.794 21.875-21.875S34.211.109 22.13.109zm0 40.7c-10.396 0-18.825-8.429-18.825-18.825 0-10.396 8.429-18.825 18.825-18.825 10.396 0 18.825 8.429 18.825 18.825 0 10.396-8.429 18.825-18.825 18.825z"/><circle cx="21.888" cy="22.701" r="2.445"/><circle cx="12.23" cy="22.701" r="2.445"/><circle cx="31.546" cy="22.701" r="2.445"/></g></symbol>';e.exports=r.add(o,"ellipsis-circle")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="ellipsis" ><circle cx="21.888" cy="22" r="4.045"/><circle cx="5.913" cy="22" r="4.045"/><circle cx="37.863" cy="22" r="4.045"/></symbol>';e.exports=r.add(o,"ellipsis")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 64 64" id="exclamation-circle" ><title>Share Icons Copy 3</title><path d="M59.58 40.889L41.193 9.11C39.135 5.382 35.723 3 31.387 3c-3.11 0-6.521 2.382-8.58 6.111L4.42 40.89c-2.788 4.635-3.126 8.81-1.225 12.22C5.015 56.208 7.572 58 13 58h36.773c5.428 0 9.21-1.792 11.031-4.889 1.9-3.41 1.564-7.584-1.225-12.222zm-2.452 11c-.635 1.695-3.802 2.444-7.354 2.444H13c-3.591 0-5.493-.75-6.129-2.444-1.712-2.41-1.375-5.262 0-8.556l18.386-31.777c2.116-3.168 4.394-4.89 6.13-4.89 2.96 0 5.238 1.722 7.354 4.89l18.386 31.777c1.374 3.294 1.713 6.146 0 8.556zm-25.74-33c-.405 0-1.227.836-1.227 2.444v15.89c0 1.608.822 2.444 1.226 2.444 1.628 0 2.452-.836 2.452-2.445V21.333c0-1.608-.824-2.444-2.452-2.444zm0 23.222c-.405 0-1.227.788-1.227 1.222v2.445c0 .434.822 1.222 1.226 1.222 1.628 0 2.452-.788 2.452-1.222v-2.445c0-.434-.824-1.222-2.452-1.222z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"exclamation-circle")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="info-circle" ><circle cx="13.828" cy="19.63" r="1.938"/><circle cx="21.767" cy="19.63" r="1.938"/><circle cx="29.767" cy="19.63" r="1.938"/><path d="M22.102 4.161c-9.918 0-17.958 7.146-17.958 15.961 0 4.935 2.522 9.345 6.481 12.273v5.667l.038.012a2.627 2.627 0 1 0 4.501 1.455l.002.001 5.026-3.539c.628.059 1.265.093 1.911.093 9.918 0 17.958-7.146 17.958-15.961-.001-8.816-8.041-15.962-17.959-15.962zm-.04 29.901c-.902 0-1.781-.081-2.642-.207l-5.882 4.234c-.024.025-.055.04-.083.06l-.008.006a.511.511 0 0 1-.284.095.525.525 0 0 1-.525-.525l.005-6.375c-3.91-2.516-6.456-6.544-6.456-11.1 0-7.628 7.107-13.812 15.875-13.812s15.875 6.184 15.875 13.812-7.107 13.812-15.875 13.812z"/></symbol>';e.exports=r.add(o,"info-circle")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 43 38" id="koubei-o" ><path d="M37.75.227H5.25C2.125.227.66 2.652.66 4.542v8.03c0 9.346 5.751 17.213 13.64 20.35a.732.732 0 0 1 .325.246c.145.207.128.409.128.409l.001 2.033s.241.743.667 1.167c.254.254.899.545 1.201.577.929.099 2.059.226 4.716-.125a25.097 25.097 0 0 0 13.111-5.918c6.157-5.345 8.549-12.549 8.549-18.738V4.625c0-1.89-1.206-4.398-5.248-4.398zm3.287 13.045c0 5.58-2.277 11.784-7.87 16.603-3.366 2.896-7.511 4.831-11.917 5.417-2.413.317-3.347.186-4.191.096-.275-.029-.496-.076-.392-1.013.104-1.958-.194-2.156-.325-2.342-.076-.1-.261-.287-.378-.332C8.797 28.874 2.577 21.698 2.577 13.272V5.203c0-1.703.335-3.06 3.173-3.06h31.292c3.671 0 3.995 1.174 3.995 2.878v8.251z"/><path d="M32.531 19.444c-.336 0-.62.171-.809.42l-.01-.007-.002-.001a11.61 11.61 0 0 1-9.682 5.196c-6.419 0-11.623-5.204-11.623-11.623h-.038a1.027 1.027 0 0 0-1.023-.995c-.556 0-1.003.443-1.023.995h-.007l.001.029-.001.007.002.012c.026 7.552 6.154 13.667 13.713 13.667 4.757 0 8.945-2.423 11.406-6.101 0 0 .127-.368.127-.57a1.031 1.031 0 0 0-1.031-1.029z"/><ellipse cx="35.456" cy="12.506" rx="1.95" ry="1.918"/></symbol>';e.exports=r.add(o,"koubei-o")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 43 38" id="koubei" ><title>&#x53E3;&#x7891;</title><g fill-rule="evenodd"><path d="M4.921 1.227c-1.814 0-3.284 1.452-3.284 3.243v8.459c0 8.86 6.073 16.517 13.589 19.49a.701.701 0 0 1 .31.233c.138.196.122.388.122.388v2.148s-.012.463.393.865c.242.241.506.338.794.368.885.094 1.962.214 4.493-.119a23.972 23.972 0 0 0 12.492-5.61c5.866-5.067 8.145-11.896 8.145-17.763V4.563c0-1.792-1.47-3.336-3.285-3.336H4.92z"/><path d="M33.506 12.506c0-1.06.873-1.918 1.95-1.918 1.078 0 1.95.858 1.95 1.918 0 1.059-.872 1.918-1.95 1.918-1.077 0-1.95-.86-1.95-1.918z" fill="#FFF"/><path d="M9.127 13.465c0 6.087 5.564 12.847 12.626 12.784 3.336-.03 8.006-1.522 10.778-5.784" stroke="#FFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g></symbol>';e.exports=r.add(o,"koubei")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="left" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Operation Icons Copy 4</title><defs><path id="left_a" d="M-129-845h24v24h-24z"/></defs><clipPath id="left_b"><use xlink:href="#left_a" overflow="visible"/></clipPath><g clip-path="url(#left_b)"><defs><path id="left_c" d="M-903-949H947V996H-903z"/></defs><clipPath id="left_d"><use xlink:href="#left_c" overflow="visible"/></clipPath></g><path d="M16.247 21.399L28.48 9.166l2.121 2.121-10.118 10.119 10.118 10.118-2.121 2.121-12.233-12.233.007-.006z"/></symbol>'; e.exports=r.add(o,"left")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 -2 59.75 60.25" id="loading" ><path fill="#ccc" d="M29.691-.527c-15.648 0-28.333 12.685-28.333 28.333s12.685 28.333 28.333 28.333c15.648 0 28.333-12.685 28.333-28.333S45.339-.527 29.691-.527zm.184 53.75c-14.037 0-25.417-11.379-25.417-25.417S15.838 2.39 29.875 2.39s25.417 11.379 25.417 25.417-11.38 25.416-25.417 25.416z"/><path fill="none" stroke="#108ee9" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" d="M56.587 29.766c.369-7.438-1.658-14.699-6.393-19.552"/></symbol>';e.exports=r.add(o,"loading")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="question-circle" ><title>Operation Icons Copy 12</title><g fill-rule="evenodd"><path d="M21.186 3C10.333 3 1.827 11.506 1.827 22.358 1.827 32.494 10.333 41 21.186 41c10.133 0 18.641-8.506 18.641-18.642C39.827 11.506 31.32 3 21.186 3m15.641 19c0 8.823-7.179 16-16 16-8.823 0-16-7.177-16-16s7.177-16 16-16c8.821 0 16 7.177 16 16z"/><path d="M22.827 31.5a1.5 1.5 0 1 1-2.999.001 1.5 1.5 0 0 1 3-.001M26.827 16.02c0 .957-.203 1.822-.61 2.593-.427.792-1.117 1.612-2.073 2.457-.867.734-1.453 1.435-1.754 2.096-.302.7-.453 1.693-.453 2.979a.828.828 0 0 1-.823.855.828.828 0 0 1-.584-.22.877.877 0 0 1-.24-.635c0-1.305.168-2.38.506-3.227.336-.883.93-1.682 1.779-2.4 1.01-.883 1.71-1.692 2.1-2.428.337-.645.504-1.38.504-2.209-.018-.936-.3-1.7-.85-2.289-.654-.717-1.62-1.075-2.896-1.075-1.506 0-2.596.535-3.269 1.6-.46.754-.689 1.645-.689 2.677a.92.92 0 0 1-.266.66.747.747 0 0 1-.558.25.73.73 0 0 1-.585-.194c-.16-.164-.239-.393-.239-.69 0-1.819.584-3.272 1.754-4.357C18.644 11.486 19.927 11 21.433 11h.293c1.452 0 2.638.414 3.561 1.241 1.027.902 1.54 2.162 1.54 3.78z"/></g></symbol>';e.exports=r.add(o,"question-circle")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="right" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Operation Icons Copy 4</title><defs><path id="right_a" d="M-129-845h24v24h-24z"/></defs><clipPath id="right_b"><use xlink:href="#right_a" overflow="visible"/></clipPath><g clip-path="url(#right_b)"><defs><path id="right_c" d="M-903-949H947V996H-903z"/></defs><clipPath id="right_d"><use xlink:href="#right_c" overflow="visible"/></clipPath></g><path d="M30.601 21.399L18.368 9.166l-2.121 2.121 10.118 10.119-10.118 10.118 2.121 2.121 12.233-12.233-.006-.006z"/></symbol>';e.exports=r.add(o,"right")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="search" ><title>System Icons Copy 8</title><path d="M32.981 29.255l8.914 8.293L39.603 40l-8.859-8.242a15.952 15.952 0 0 1-10.754 4.147C11.16 35.905 4 28.763 4 19.952 4 11.142 11.16 4 19.99 4s15.99 7.142 15.99 15.952c0 3.472-1.112 6.685-2.999 9.303zm.05-9.21c0 7.123-5.701 12.918-12.88 12.918-7.177 0-13.016-5.795-13.016-12.918 0-7.12 5.839-12.917 13.017-12.917 7.178 0 12.879 5.797 12.879 12.917z" fill-rule="evenodd"/></symbol>';e.exports=r.add(o,"search")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 44 44" id="up" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Operation Icons Copy 4</title><title>background</title><path fill="none" d="M-1-1h46v46H-1z"/><g><title>Layer 1</title><defs><path id="up_a" d="M-129-845h24v24h-24z"/></defs><clipPath id="up_b"><use xlink:href="#up_a"/></clipPath><g clip-path="url(#up_b)"><defs><path id="up_c" d="M-903-949H947V996H-903z"/></defs><clipPath id="up_d"><use xlink:href="#up_c"/></clipPath></g><path d="M23.417 14.229L11.184 26.462l2.121 2.12 10.12-10.117 10.117 10.118 2.121-2.121L23.43 14.229l-.006.006z"/></g></symbol>';e.exports=r.add(o,"up")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 38 33" id="trips" ><title>trips</title><g fill-rule="evenodd"><path d="M17.838 28.8c-.564-.468-1.192-.983-1.836-1.496-4.244-3.385-5.294-3.67-6.006-3.67-.014 0-.027.005-.04.005-.015 0-.028-.005-.042-.005H3.562c-.734 0-.903-.203-.903-.928V10.085c0-.49.058-.8.66-.8h5.782c.693 0 1.758-.28 6.4-3.628.828-.597 1.637-1.197 2.336-1.723V28.8zM19.682.19c-.463-.22-1.014-.158-1.417.157-.02.016-1.983 1.552-4.152 3.125C10.34 6.21 9.243 6.664 9.02 6.737H3.676c-.027 0-.053.003-.08.004H1.183c-.608 0-1.1.486-1.1 1.085V25.14c0 .598.492 1.084 1.1 1.084h8.71c.22.08 1.257.55 4.605 3.24 1.947 1.562 3.694 3.088 3.712 3.103.25.22.568.333.89.333.186 0 .373-.038.55-.116.48-.213.79-.684.79-1.204V1.38c0-.506-.294-.968-.758-1.19z" mask="url(#mask-2)"/><path d="M31.42 16.475c0-3.363-1.854-6.297-4.606-7.876-.125-.066-.42-.192-.625-.192-.612 0-1.108.488-1.108 1.09 0 .404.22.764.55.952 2.128 1.19 3.565 3.442 3.565 6.025 0 2.627-1.486 4.913-3.677 6.087-.318.19-.53.54-.53.934 0 .602.496 1.09 1.107 1.09.26.002.568-.15.568-.15 2.835-1.556 4.754-4.538 4.754-7.96" mask="url(#mask-4)"/><g><path d="M30.14 3.057c-.205-.122-.41-.22-.658-.22-.608 0-1.1.485-1.1 1.084 0 .433.26.78.627.977 4.043 2.323 6.762 6.636 6.762 11.578 0 4.938-2.716 9.248-6.755 11.572-.354.19-.66.55-.66.993 0 .6.494 1.084 1.102 1.084.243 0 .438-.092.65-.213 4.692-2.695 7.848-7.7 7.848-13.435 0-5.723-3.142-10.718-7.817-13.418" mask="url(#mask-6)"/></g></g></symbol>';e.exports=r.add(o,"trips")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 30 2" id="minus" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch --> <title>Rectangle</title> <desc>Created with Sketch.</desc> <defs/> <g id="minus_Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <rect id="minus_Rectangle" fill="#000000" x="0" y="0" width="30" height="2"/> </g> </symbol>';e.exports=r.add(o,"minus")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 30 30" id="plus" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch --> <title>Combined Shape</title> <desc>Created with Sketch.</desc> <defs/> <g id="plus_Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <path d="M14,14 L0,14 L0,16 L14,16 L14,30 L16,30 L16,16 L30,16 L30,14 L16,14 L16,-1.77635684e-15 L14,-2.14375088e-15 L14,14 Z" id="plus_Combined-Shape" fill="#000000"/> </g> </symbol>';e.exports=r.add(o,"plus")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 72 72" id="dislike" ><title>&#x54ED;&#x8138;</title><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path fill="#FFF" d="M47 22h2v6h-2zM23 22h2v6h-2z"/><path d="M21 51s4.6-7 15-7 15 7 15 7" stroke="#FFF" stroke-width="2"/></g></symbol>';e.exports=r.add(o,"dislike")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 72 72" id="fail" ><title>&#x5931;&#x8D25;</title><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path d="M22 22l28.304 28.304M22 50.304L50.304 22" stroke="#FFF" stroke-width="2"/></g></symbol>';e.exports=r.add(o,"fail")},function(e,t,n){var r=n(12),o='<symbol viewBox="0 0 72 72" id="success" ><title>&#x6210;&#x529F;</title><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path stroke="#FFF" stroke-width="2" d="M19 34.54l11.545 11.923L52.815 24"/></g></symbol>';e.exports=r.add(o,"success")},function(e,t,n){function r(e){return Array.prototype.slice.call(e,0)}function o(e){return e.replace(/\(|\)/g,"\\$&")}function i(e,t,n){var i=e.querySelectorAll(c);i&&r(i).forEach(function(e){e.attributes&&r(e.attributes).forEach(function(r){var i=r.localName.toLowerCase();if(u.indexOf(i)!==-1){var a=d.exec(e.getAttribute(i));if(a&&0===a[1].indexOf(t)){var s=o(n+a[1].split(t)[1]);e.setAttribute(i,"url("+s+")")}}})})}function a(e){try{if(document.importNode)return document.importNode(e,!0)}catch(e){}return e}function s(){var e=document.getElementsByTagName("base")[0],t=window.location.href.split("#")[0],n=e&&e.href;this.urlPrefix=n&&n!==t?t+p:p;var o=new l;o.sniff(),this.browser=o.browser,this.content=[],"ie"!==this.browser.name&&n&&window.addEventListener("spriteLoaderLocationUpdated",function(e){var t=this.urlPrefix,n=e.detail.newUrl.split(p)[0]+p;if(i(this.svg,t,n),this.urlPrefix=n,"chrome"!==this.browser.name||this.browser.version[0]>=49){var o=r(document.querySelectorAll("use[*|href]"));o.forEach(function(e){var r=e.getAttribute(h);r&&0===r.indexOf(t)&&e.setAttributeNS(m,h,n+r.split(p)[1])})}}.bind(this))}var l=n(474),u=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke"],c="["+u.join("],[")+"]",d=/^url\((.*)\)$/,f=function(e){for(var t=e.querySelector("defs"),n=e.querySelectorAll("symbol linearGradient, symbol radialGradient, symbol pattern"),r=0,o=n.length;r<o;r++)t.appendChild(n[r])},p="#",h="xlink:href",m="http://www.w3.org/1999/xlink",v='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="'+m+'"',y="</svg>",g="{content}";s.styles=["position:absolute","width:0","height:0"],s.spriteTemplate=function(){return v+' style="'+s.styles.join(";")+'"><defs>'+g+"</defs>"+y},s.symbolTemplate=function(){return v+">"+g+y},s.prototype.content=null,s.prototype.add=function(e,t){return this.svg&&this.appendSymbol(e),this.content.push(e),p+t},s.prototype.wrapSVG=function(e,t){var n=t.replace(g,e),r=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement,o=a(r);return"ie"!==this.browser.name&&this.urlPrefix&&i(o,p,this.urlPrefix),o},s.prototype.appendSymbol=function(e){var t=this.wrapSVG(e,s.symbolTemplate()).childNodes[0];this.svg.querySelector("defs").appendChild(t),"firefox"===this.browser.name&&f(this.svg)},s.prototype.toString=function(){var e=document.createElement("div");return e.appendChild(this.render()),e.innerHTML},s.prototype.render=function(e,t){e=e||null,t="boolean"!=typeof t||t;var n=this.wrapSVG(this.content.join(""),s.spriteTemplate());return"firefox"===this.browser.name&&f(n),e&&(t&&e.childNodes[0]?e.insertBefore(n,e.childNodes[0]):e.appendChild(n)),this.svg=n,n},e.exports=s},function(e,t,n){(function(r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(376),a=o(i),s=60,l=1e3,u={},c=1,d="undefined"!=typeof window?window:void 0;d||(d="undefined"!=typeof r?r:{});var f={stop:function(e){var t=null!=u[e];return t&&(u[e]=null),t},isRunning:function(e){return null!=u[e]},start:function e(t,n,r,o,i){var e=+new Date,d=e,f=0,p=0,h=c++;if(h%20===0){var m={};for(var v in u)m[v]=!0;u=m}var y=function c(m){var v=m!==!0,y=+new Date;if(!u[h]||n&&!n(h))return u[h]=null,void(r&&r(s-p/((y-e)/l),h,!1));if(v)for(var g=Math.round((y-d)/(l/s))-1,_=0;_<Math.min(g,4);_++)c(!0),p++;o&&(f=(y-e)/o,f>1&&(f=1));var b=i?i(f):f;t(b,y,v)!==!1&&1!==f||!v?v&&(d=y,(0,a.default)(c)):(u[h]=null,r&&r(s-p/((y-e)/l),h,1===f||null==o))};return u[h]=!0,(0,a.default)(y),h}};t.default=f,e.exports=t.default}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(501),a=r(i),s=function(){};o=function(e,t){this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:s,penetrationDeceleration:.03,penetrationAcceleration:.08};for(var n in t)this.options[n]=t[n]};var l=function(e){return Math.pow(e-1,3)+1},u=function(e){return(e/=.5)<1?.5*Math.pow(e,3):.5*(Math.pow(e-2,3)+2)},c={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,n,r){var o=this;e===+e&&(o.__clientWidth=e),t===+t&&(o.__clientHeight=t),n===+n&&(o.__contentWidth=n),r===+r&&(o.__contentHeight=r),o.__computeScrollMax(),o.scrollTo(o.__scrollLeft,o.__scrollTop,!0)},setPosition:function(e,t){var n=this;n.__clientLeft=e||0,n.__clientTop=t||0},setSnapSize:function(e,t){var n=this;n.__snapWidth=e,n.__snapHeight=t},activatePullToRefresh:function(e,t,n,r){var o=this;o.__refreshHeight=e,o.__refreshActivate=t,o.__refreshDeactivate=n,o.__refreshStart=r},triggerPullToRefresh:function(){this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()},finishPullToRefresh:function(){var e=this;e.__refreshActive=!1,e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)},getValues:function(){var e=this;return{left:e.__scrollLeft,top:e.__scrollTop,zoom:e.__zoomLevel}},getScrollMax:function(){var e=this;return{left:e.__maxScrollLeft,top:e.__maxScrollTop}},zoomTo:function(e,t,n,r,o){var i=this;if(!i.options.zooming)throw new Error("Zooming is not enabled!");o&&(i.__zoomComplete=o),i.__isDecelerating&&(a.default.stop(i.__isDecelerating),i.__isDecelerating=!1);var s=i.__zoomLevel;null==n&&(n=i.__clientWidth/2),null==r&&(r=i.__clientHeight/2),e=Math.max(Math.min(e,i.options.maxZoom),i.options.minZoom),i.__computeScrollMax(e);var l=(n+i.__scrollLeft)*e/s-n,u=(r+i.__scrollTop)*e/s-r;l>i.__maxScrollLeft?l=i.__maxScrollLeft:l<0&&(l=0),u>i.__maxScrollTop?u=i.__maxScrollTop:u<0&&(u=0),i.__publish(l,u,e,t)},zoomBy:function(e,t,n,r,o){var i=this;i.zoomTo(i.__zoomLevel*e,t,n,r,o)},scrollTo:function(e,t,n,r,o){var i=this;if(i.__isDecelerating&&(a.default.stop(i.__isDecelerating),i.__isDecelerating=!1),null!=r&&r!==i.__zoomLevel){if(!i.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,i.__computeScrollMax(r)}else r=i.__zoomLevel;i.options.scrollingX?i.options.paging?e=Math.round(e/i.__clientWidth)*i.__clientWidth:i.options.snapping&&(e=Math.round(e/i.__snapWidth)*i.__snapWidth):e=i.__scrollLeft,i.options.scrollingY?i.options.paging?t=Math.round(t/i.__clientHeight)*i.__clientHeight:i.options.snapping&&(t=Math.round(t/i.__snapHeight)*i.__snapHeight):t=i.__scrollTop,e=Math.max(Math.min(i.__maxScrollLeft,e),0),t=Math.max(Math.min(i.__maxScrollTop,t),0),e===i.__scrollLeft&&t===i.__scrollTop&&(n=!1,o&&o()),i.__isTracking||i.__publish(e,t,r,n)},scrollBy:function(e,t,n){var r=this,o=r.__isAnimating?r.__scheduledLeft:r.__scrollLeft,i=r.__isAnimating?r.__scheduledTop:r.__scrollTop;r.scrollTo(o+(e||0),i+(t||0),n)},doMouseZoom:function(e,t,n,r){var o=this,i=e>0?.97:1.03;return o.zoomTo(o.__zoomLevel*i,!1,n-o.__clientLeft,r-o.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var n=this;n.__interruptedAnimation=!0,n.__isDecelerating&&(a.default.stop(n.__isDecelerating),n.__isDecelerating=!1,n.__interruptedAnimation=!0),n.__isAnimating&&(a.default.stop(n.__isAnimating),n.__isAnimating=!1,n.__interruptedAnimation=!0);var r,o,i=1===e.length;i?(r=e[0].pageX,o=e[0].pageY):(r=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),n.__initialTouchLeft=r,n.__initialTouchTop=o,n.__zoomLevelStart=n.__zoomLevel,n.__lastTouchLeft=r,n.__lastTouchTop=o,n.__lastTouchMove=t,n.__lastScale=1,n.__enableScrollX=!i&&n.options.scrollingX,n.__enableScrollY=!i&&n.options.scrollingY,n.__isTracking=!0,n.__didDecelerationComplete=!1,n.__isDragging=!i,n.__isSingleTouch=i,n.__positions=[]},doTouchMove:function(e,t,n){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var r=this;if(r.__isTracking){var o,i;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,i=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,i=e[0].pageY);var a=r.__positions;if(r.__isDragging){var s=o-r.__lastTouchLeft,l=i-r.__lastTouchTop,u=r.__scrollLeft,c=r.__scrollTop,d=r.__zoomLevel;if(null!=n&&r.options.zooming){var f=d;if(d=d/r.__lastScale*n,d=Math.max(Math.min(d,r.options.maxZoom),r.options.minZoom),f!==d){var p=o-r.__clientLeft,h=i-r.__clientTop;u=(p+u)*d/f-p,c=(h+c)*d/f-h,r.__computeScrollMax(d)}}if(r.__enableScrollX){u-=s*this.options.speedMultiplier;var m=r.__maxScrollLeft;(u>m||u<0)&&(r.options.bouncing?u+=s/2*this.options.speedMultiplier:u=u>m?m:0)}if(r.__enableScrollY){c-=l*this.options.speedMultiplier;var v=r.__maxScrollTop;(c>v||c<0)&&(r.options.bouncing?(c+=l/2*this.options.speedMultiplier,r.__enableScrollX||null==r.__refreshHeight||(!r.__refreshActive&&c<=-r.__refreshHeight?(r.__refreshActive=!0,r.__refreshActivate&&r.__refreshActivate()):r.__refreshActive&&c>-r.__refreshHeight&&(r.__refreshActive=!1,r.__refreshDeactivate&&r.__refreshDeactivate()))):c=c>v?v:0)}a.length>60&&a.splice(0,30),a.push(u,c,t),r.__publish(u,c,d)}else{var y=3,g=5,_=Math.abs(o-r.__initialTouchLeft),b=Math.abs(i-r.__initialTouchTop);r.__enableScrollX=r.options.scrollingX&&_>=y,r.__enableScrollY=r.options.scrollingY&&b>=y;var x=void 0;r.options.locking&&r.__enableScrollY&&(x=x||Math.atan2(b,_),x<Math.PI/4&&(r.__enableScrollY=!1)),r.options.locking&&r.__enableScrollX&&(x=x||Math.atan2(b,_),x>Math.PI/4&&(r.__enableScrollX=!1)),a.push(r.__scrollLeft,r.__scrollTop,t),r.__isDragging=(r.__enableScrollX||r.__enableScrollY)&&(_>=g||b>=g),r.__isDragging&&(r.__interruptedAnimation=!1)}r.__lastTouchLeft=o,r.__lastTouchTop=i,r.__lastTouchMove=t,r.__lastScale=n}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);var t=this;if(t.__isTracking){if(t.__isTracking=!1,t.__isDragging)if(t.__isDragging=!1,t.__isSingleTouch&&t.options.animating&&e-t.__lastTouchMove<=100){for(var n=t.__positions,r=n.length-1,o=r,i=r;i>0&&n[i]>t.__lastTouchMove-100;i-=3)o=i;if(o!==r){var a=n[r]-n[o],s=t.__scrollLeft-n[o-2],l=t.__scrollTop-n[o-1];t.__decelerationVelocityX=s/a*(1e3/60),t.__decelerationVelocityY=l/a*(1e3/60);var u=t.options.paging||t.options.snapping?4:1;Math.abs(t.__decelerationVelocityX)>u||Math.abs(t.__decelerationVelocityY)>u?t.__refreshActive||t.__startDeceleration(e):t.options.scrollingComplete()}else t.options.scrollingComplete()}else e-t.__lastTouchMove>100&&t.options.scrollingComplete();t.__isDecelerating||(t.__refreshActive&&t.__refreshStart?(t.__publish(t.__scrollLeft,-t.__refreshHeight,t.__zoomLevel,!0),t.__refreshStart&&t.__refreshStart()):((t.__interruptedAnimation||t.__isDragging)&&t.options.scrollingComplete(),t.scrollTo(t.__scrollLeft,t.__scrollTop,!0,t.__zoomLevel),t.__refreshActive&&(t.__refreshActive=!1,t.__refreshDeactivate&&t.__refreshDeactivate()))),t.__positions.length=0}},__publish:function(e,t,n,r){var o=this,i=o.__isAnimating;if(i&&(a.default.stop(i),o.__isAnimating=!1),r&&o.options.animating){o.__scheduledLeft=e,o.__scheduledTop=t,o.__scheduledZoom=n;var s=o.__scrollLeft,c=o.__scrollTop,d=o.__zoomLevel,f=e-s,p=t-c,h=n-d,m=function(e,t,n){n&&(o.__scrollLeft=s+f*e,o.__scrollTop=c+p*e,o.__zoomLevel=d+h*e,o.__callback&&o.__callback(o.__scrollLeft,o.__scrollTop,o.__zoomLevel))},v=function(e){return o.__isAnimating===e},y=function(e,t,n){t===o.__isAnimating&&(o.__isAnimating=!1),(o.__didDecelerationComplete||n)&&o.options.scrollingComplete(),o.options.zooming&&(o.__computeScrollMax(),o.__zoomComplete&&(o.__zoomComplete(),o.__zoomComplete=null))};o.__isAnimating=a.default.start(m,v,y,o.options.animationDuration,i?l:u)}else o.__scheduledLeft=o.__scrollLeft=e,o.__scheduledTop=o.__scrollTop=t,o.__scheduledZoom=o.__zoomLevel=n,o.__callback&&o.__callback(e,t,n),o.options.zooming&&(o.__computeScrollMax(),o.__zoomComplete&&(o.__zoomComplete(),o.__zoomComplete=null))},__computeScrollMax:function(e){var t=this;null==e&&(e=t.__zoomLevel),t.__maxScrollLeft=Math.max(t.__contentWidth*e-t.__clientWidth,0),t.__maxScrollTop=Math.max(t.__contentHeight*e-t.__clientHeight,0)},__startDeceleration:function(e){var t=this;if(t.options.paging){var n=Math.max(Math.min(t.__scrollLeft,t.__maxScrollLeft),0),r=Math.max(Math.min(t.__scrollTop,t.__maxScrollTop),0),o=t.__clientWidth,i=t.__clientHeight;t.__minDecelerationScrollLeft=Math.floor(n/o)*o,t.__minDecelerationScrollTop=Math.floor(r/i)*i,t.__maxDecelerationScrollLeft=Math.ceil(n/o)*o,t.__maxDecelerationScrollTop=Math.ceil(r/i)*i}else t.__minDecelerationScrollLeft=0,t.__minDecelerationScrollTop=0,t.__maxDecelerationScrollLeft=t.__maxScrollLeft,t.__maxDecelerationScrollTop=t.__maxScrollTop;var s=function(e,n,r){t.__stepThroughDeceleration(r)},l=t.options.minVelocityToKeepDecelerating;l||(l=t.options.snapping?4:.001);var u=function(){var e=Math.abs(t.__decelerationVelocityX)>=l||Math.abs(t.__decelerationVelocityY)>=l;return e||(t.__didDecelerationComplete=!0),e},c=function(e,n,r){t.__isDecelerating=!1,t.scrollTo(t.__scrollLeft,t.__scrollTop,t.options.snapping,null,t.__didDecelerationComplete&&t.options.scrollingComplete)};t.__isDecelerating=a.default.start(s,u,c)},__stepThroughDeceleration:function(e){var t=this,n=t.__scrollLeft+t.__decelerationVelocityX,r=t.__scrollTop+t.__decelerationVelocityY;if(!t.options.bouncing){var o=Math.max(Math.min(t.__maxDecelerationScrollLeft,n),t.__minDecelerationScrollLeft);o!==n&&(n=o,t.__decelerationVelocityX=0);var i=Math.max(Math.min(t.__maxDecelerationScrollTop,r),t.__minDecelerationScrollTop);i!==r&&(r=i,t.__decelerationVelocityY=0)}if(e?t.__publish(n,r,t.__zoomLevel):(t.__scrollLeft=n,t.__scrollTop=r),!t.options.paging){var a=.95;t.__decelerationVelocityX*=a,t.__decelerationVelocityY*=a}if(t.options.bouncing){var s=0,l=0,u=t.options.penetrationDeceleration,c=t.options.penetrationAcceleration;n<t.__minDecelerationScrollLeft?s=t.__minDecelerationScrollLeft-n:n>t.__maxDecelerationScrollLeft&&(s=t.__maxDecelerationScrollLeft-n),r<t.__minDecelerationScrollTop?l=t.__minDecelerationScrollTop-r:r>t.__maxDecelerationScrollTop&&(l=t.__maxDecelerationScrollTop-r),0!==s&&(s*t.__decelerationVelocityX<=0?t.__decelerationVelocityX+=s*u:t.__decelerationVelocityX=s*c),0!==l&&(l*t.__decelerationVelocityY<=0?t.__decelerationVelocityY+=l*u:t.__decelerationVelocityY=l*c)}}};for(var d in c)o.prototype[d]=c[d];t.default=o,e.exports=t.default},function(e,t,n,r){"use strict";n(10),n(r)},function(e,t,n,r){"use strict";n(10),n(19),n(r)},function(e,t,n,r){"use strict";n(10),n(25),n(r)},function(e,t,n,r){"use strict";n(r)},function(e,t,n,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i),s=n(43),l=o(s),u=n(13),c=o(u),d=n(r),f=o(d),p=n(17),h=o(p),m=(0,c.default)({mixins:[f.default],getDefaultProps:function(){return{prefixCls:"rmc-picker-popup",triggerType:"onClick",WrapComponent:"span"}},getModal:function(){var e=this.props;if(!this.state.visible)return null;var t=e.prefixCls;return a.default.createElement(l.default,{prefixCls:""+t,className:e.className||"",visible:!0,closable:!1,transitionName:e.transitionName||e.popupTransitionName,maskTransitionName:e.maskTransitionName,onClose:this.hide,style:e.style},a.default.createElement("div",null,a.default.createElement("div",{className:t+"-header"},a.default.createElement(h.default,{activeClassName:t+"-item-active"},a.default.createElement("div",{className:t+"-item "+t+"-header-left",onClick:this.onDismiss},e.dismissText)),a.default.createElement("div",{className:t+"-item "+t+"-title"},e.title),a.default.createElement(h.default,{activeClassName:t+"-item-active"},a.default.createElement("div",{className:t+"-item "+t+"-header-right",onClick:this.onOk},e.okText))),this.getContent()))},render:function(){return this.getRender()}});t.default=m,e.exports=t.default}]))}); //# sourceMappingURL=antd-mobile.min.js.map
app/components/Counter.js
alexdibattista/no-noise
// @flow import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import styles from './Counter.css'; class Counter extends Component { props: { increment: () => void, incrementIfOdd: () => void, incrementAsync: () => void, decrement: () => void, counter: number }; render() { const { increment, incrementIfOdd, incrementAsync, decrement, counter } = this.props; return ( <div> <div className={styles.backButton} data-tid="backButton"> <Link to="/"> <i className="fa fa-arrow-left fa-3x" /> </Link> </div> <div className={`counter ${styles.counter}`} data-tid="counter"> {counter} </div> <div className={styles.btnGroup}> <button className={styles.btn} onClick={increment} data-tclass="btn"> <i className="fa fa-plus" /> </button> <button className={styles.btn} onClick={decrement} data-tclass="btn"> <i className="fa fa-minus" /> </button> <button className={styles.btn} onClick={incrementIfOdd} data-tclass="btn">odd</button> <button className={styles.btn} onClick={() => incrementAsync()} data-tclass="btn">async</button> </div> </div> ); } } export default Counter;
react/redux-start/product/src/containers/VisibleProducts.js
kobeCan/practices
import { connect } from 'react-redux'; import React from 'react'; import ProductTable from '../components/ProductTable'; import CategoryRow from '../components/CategoryRow'; import ItemRow from '../components/ItemRow'; const filter = (products, stockOnly, filterText) => { const rows = []; let id = 0, lastCategory; products.forEach(product => { if ((stockOnly && !product.stocked) || product.name.indexOf(filterText) === -1) { return false; } if (lastCategory !== product.category) { lastCategory = product.category; rows.push(<CategoryRow key={id} category={lastCategory} />) id++; } rows.push(<ItemRow key={id} {...product} />); id++; }); return rows; } const mapStateToProps = (state, props) => ({ rows: filter(props.products, state.stockOnly, state.filterText) }) const VisibleProducts = connect(mapStateToProps)(ProductTable); export default VisibleProducts
src/icons/IosFootball.js
fbfeix/react-icons
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class IosFootball extends React.Component { render() { if(this.props.bare) { return <g> <path d="M256,48C141.137,48,48,141.136,48,256c0,114.864,93.137,208,208,208c114.872,0,208-93.138,208-208 C464,141.138,370.87,48,256,48z M297.151,442.179c-13.514,2.657-30.327,4.187-44,4.45c-13.198-0.195-26.074-1.735-38.5-4.493 c-2.144-0.549-4.383-1.138-6.805-1.777l-24.417-65.435L203.074,336h105.854l0.57,1.076l19.34,38.852L305.22,440.21 C302.553,440.924,299.862,441.579,297.151,442.179z M189.578,77.28L247,116.576v58.147l-70.997,60.067L126.6,212.28l-4.167-1.899 l-22.332-64.019C122.11,115.158,153.239,90.83,189.578,77.28z M411.564,146.067l-22.432,64.483l-53.992,24.388L264,174.723v-58.147 l57.596-39.415C357.958,90.644,389.501,114.913,411.564,146.067z M66.144,273.414l53.756-46.518l49.539,22.599l0.559,0.255 l19.718,77.287l-20.433,38.529l-69.86-0.915C81.075,338.291,69.209,307.105,66.144,273.414z M342.719,365.565l-20.434-38.529 l19.752-77.416l49.997-22.781l53.822,46.575c-3.065,33.691-14.932,64.877-33.277,91.236L342.719,365.565z"></path> </g>; } return <IconBase> <path d="M256,48C141.137,48,48,141.136,48,256c0,114.864,93.137,208,208,208c114.872,0,208-93.138,208-208 C464,141.138,370.87,48,256,48z M297.151,442.179c-13.514,2.657-30.327,4.187-44,4.45c-13.198-0.195-26.074-1.735-38.5-4.493 c-2.144-0.549-4.383-1.138-6.805-1.777l-24.417-65.435L203.074,336h105.854l0.57,1.076l19.34,38.852L305.22,440.21 C302.553,440.924,299.862,441.579,297.151,442.179z M189.578,77.28L247,116.576v58.147l-70.997,60.067L126.6,212.28l-4.167-1.899 l-22.332-64.019C122.11,115.158,153.239,90.83,189.578,77.28z M411.564,146.067l-22.432,64.483l-53.992,24.388L264,174.723v-58.147 l57.596-39.415C357.958,90.644,389.501,114.913,411.564,146.067z M66.144,273.414l53.756-46.518l49.539,22.599l0.559,0.255 l19.718,77.287l-20.433,38.529l-69.86-0.915C81.075,338.291,69.209,307.105,66.144,273.414z M342.719,365.565l-20.434-38.529 l19.752-77.416l49.997-22.781l53.822,46.575c-3.065,33.691-14.932,64.877-33.277,91.236L342.719,365.565z"></path> </IconBase>; } };IosFootball.defaultProps = {bare: false}
packages/core/src/shared/apollo/createApolloClient.js
strues/boldr
// @flow /* eslint-disable no-unused-vars, eqeqeq */ /** * @module boldr-core/apollo/createApolloClient */ import { ApolloClient } from 'react-apollo'; import { createNetworkInterface } from './networkInterface'; import { createBatchingNetworkInterface } from './batchNetworkInterface'; export type ApolloClientConfig = { headers?: Object, initialState?: Object, batchRequests?: boolean, trustNetwork?: boolean, queryDeduplication?: boolean, uri?: string, connectToDevTools?: boolean, ssrForceFetchDelay?: number, }; /** * Bootstrap an ApolloClient * @param {Object} [config={}] configuration values for the ApolloClient * @return {function} function to create the client. */ export default function createApolloClient(config: ApolloClientConfig = {}) { const { headers, initialState = {}, batchRequests = false, trustNetwork = true, queryDeduplication = true, uri, connectToDevTools = true, ssrForceFetchDelay = 100, } = config; const hasApollo = uri !== null; // $FlowIssue const ssrMode = !process.browser; let client; if (hasApollo) { const opts = { /* istanbul ignore next */ dataIdFromObject: ({ __typename, id, slug, safeName }) => `${__typename}:${slug || id || safeName}`, credentials: trustNetwork ? 'include' : 'same-origin', headers, }; if (!ssrMode) { /* $FlowIssue istanbul ignore next */ opts.ssrForceFetchDelay = 100; /* $FlowIssue istanbul ignore next */ opts.connectToDevTools = true; } let networkInterface; if (batchRequests) { /* istanbul ignore next */ networkInterface = createBatchingNetworkInterface({ uri, batchInterval: 10, opts, }); } else { networkInterface = createNetworkInterface({ uri, opts, }); } client = new ApolloClient({ ssrMode, queryDeduplication, networkInterface, }); } else { /* istanbul ignore next */ client = new ApolloClient({ ssrMode, queryDeduplication, }); } return client; }
client/routes.js
sdougbrown/react-streaming-store-boilerplate
// Client Routes // // ideally here you would split resources on a per-page level. // also, there's no need to use `react-router`, you could easily // drop-in any other client-side router of your choice. import React from 'react'; import { Router, Route } from 'react-router'; import RoutesMap from '../common/routes'; import { appHistory } from './config'; import index from './pages/index'; import account from './pages/account'; import login from './pages/login'; import register from './pages/register'; import reset from './pages/reset-password'; import view from './pages/view'; const pages = { index, account, view, login, register, reset, }; export function mapRoutes() { const routeMap = RoutesMap.map(); return Object.keys(routeMap).map((route) => { const key = routeMap[route]; return ( <Route key={route} path={route} component={pages[key]} onEnter={pages[key].onEnter} onChange={pages[key].onChange} /> ); }); } const Routes = () => { return ( <Router history={appHistory}> {mapRoutes()} </Router> ); }; export const routes = RoutesMap.routes; export const setRoute = (url, ops, change = appHistory.push) => { change({ pathname: url, query: ops }); }; export default Routes;
src/App.js
yiooxir/react-image-load
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import Lib from './Lib'; import './App.scss'; export default class App extends Component { render() { return ( <div className="App"> <Lib width="100" height="200" rotate={90} src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQQtPiYYqfwdb4-JHHtYjT8mnO42yIpQ1d2o8rz2zE3-ZQOi9y3" onLoading={() => console.log('on loading')} onLoad={() => console.log('on load')} onFail={(err) => console.log('on fail', err)} /> </div> ); } } ReactDOM.render(<App />, document.getElementById('root'));
src/scenes/Layout/components/Representation/components/Week/components/DayOfWeek/DayOfWeek.js
czonios/schedule-maker-app
import React from 'react'; import { Header } from 'semantic-ui-react'; import './dayOfWeek.css'; import EditEvent from '../../../../services/EditEvent'; class DayOfWeek extends React.Component { constructor() { super(); this.state = { showModal: false }; this.setModal = this.setModal.bind(this); } setModal(event) { if (this.state.showModal) { this.setState({ showModal: false }); } else { this.setState({ showModal: true }); } } render() { return ( <div className="clickable" onClick={this.setModal.bind(this)}> <Header size="tiny">title for {this.props.time} {this.props.day}</Header> <p>description</p> { this.state.showModal ? <EditEvent setModal={this.setModal} event={this.props} /> : null } </div> ) } } export default DayOfWeek;
docs/src/pages/components/checkboxes/Checkboxes.js
allanalexandre/material-ui
import React from 'react'; import Checkbox from '@material-ui/core/Checkbox'; function Checkboxes() { const [state, setState] = React.useState({ checkedA: true, checkedB: true, checkedF: true, }); const handleChange = name => event => { setState({ ...state, [name]: event.target.checked }); }; return ( <div> <Checkbox checked={state.checkedA} onChange={handleChange('checkedA')} value="checkedA" inputProps={{ 'aria-label': 'primary checkbox', }} /> <Checkbox checked={state.checkedB} onChange={handleChange('checkedB')} value="checkedB" color="primary" inputProps={{ 'aria-label': 'secondary checkbox', }} /> <Checkbox value="checkedC" inputProps={{ 'aria-label': 'uncontrolled-checkbox', }} /> <Checkbox disabled value="checkedD" inputProps={{ 'aria-label': 'disabled checkbox', }} /> <Checkbox disabled checked value="checkedE" inputProps={{ 'aria-label': 'disabled checked checkbox', }} /> <Checkbox checked={state.checkedF} onChange={handleChange('checkedF')} value="checkedF" indeterminate inputProps={{ 'aria-label': 'indeterminate checkbox', }} /> <Checkbox defaultChecked color="default" value="checkedG" inputProps={{ 'aria-label': 'checkbox with default color', }} /> </div> ); } export default Checkboxes;
app/jsx/new_user_tutorial/initializeNewUserTutorials.js
venturehive/canvas-lms
/* * Copyright (C) 2017 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import React from 'react' import ReactDOM from 'react-dom' import axios from 'axios' import NewUserTutorialToggleButton from './NewUserTutorialToggleButton' import TutorialTray from './trays/TutorialTray' import getProperTray from './utils/getProperTray' import createTutorialStore from './utils/createTutorialStore' import splitAssetString from 'compiled/str/splitAssetString' const initializeNewUserTutorials = () => { if (window.ENV.NEW_USER_TUTORIALS && window.ENV.NEW_USER_TUTORIALS.is_enabled && (window.ENV.context_asset_string && (splitAssetString(window.ENV.context_asset_string)[0] === 'courses'))) { const API_URL = '/api/v1/users/self/new_user_tutorial_statuses'; axios.get(API_URL) .then((response) => { let onPageToggleButton; const trayObj = getProperTray(); const collapsedStatus = response.data.new_user_tutorial_statuses.collapsed[trayObj.pageName]; const store = createTutorialStore({ isCollapsed: collapsedStatus }); store.addChangeListener(() => { axios.put(`${API_URL}/${trayObj.pageName}`, { collapsed: store.getState().isCollapsed }); }); const getReturnFocus = () => onPageToggleButton; const renderTray = () => { const Tray = trayObj.component; ReactDOM.render( <TutorialTray store={store} returnFocusToFunc={getReturnFocus} label={trayObj.label} > <Tray /> </TutorialTray> , document.querySelector('.NewUserTutorialTray__Container') ); } ReactDOM.render( <NewUserTutorialToggleButton ref={(c) => { onPageToggleButton = c; }} store={store} /> , document.querySelector('.TutorialToggleHolder'), () => renderTray() ); }); } }; export default initializeNewUserTutorials
modules/Route.js
flocks/react-router
import React from 'react'; import invariant from 'invariant'; import { createRouteFromReactElement } from './RouteUtils'; import { component, components } from './PropTypes'; import warning from 'warning'; var { string, bool, func } = React.PropTypes; /** * A <Route> is used to declare which components are rendered to the page when * the URL matches a given pattern. * * Routes are arranged in a nested tree structure. When a new URL is requested, * the tree is searched depth-first to find a route whose path matches the URL. * When one is found, all routes in the tree that lead to it are considered * "active" and their components are rendered into the DOM, nested in the same * order as they are in the tree. */ export var Route = React.createClass({ statics: { createRouteFromReactElement(element) { var route = createRouteFromReactElement(element); if (route.handler) { warning(false, '<Route handler> is deprecated, use <Route component> instead'); route.component = route.handler; delete route.handler; } return route; } }, propTypes: { path: string, ignoreScrollBehavior: bool, handler: component, component, components, getComponents: func }, render() { invariant( false, '<Route> elements are for router configuration only and should not be rendered' ); } }); export default Route;
Components/Core.PeoplePicker/Core.PeoplePickerWeb/Scripts/jquery-1.9.1.js
baldswede/PnP
/* NUGET: BEGIN LICENSE TEXT jQuery v1.9.1 Microsoft grants you the right to use these script files for the sole purpose of either: (i) interacting through your browser with the Microsoft website, subject to the website's terms of use; or (ii) using the files as included with a Microsoft product subject to that product's license terms. Microsoft reserves all other rights to the files not expressly granted by Microsoft, whether by implication, estoppel or otherwise. The notices and licenses below are for informational purposes only. *************************************************** * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors ******************************** * Includes Sizzle CSS Selector Engine * http://sizzlejs.com/ * Copyright 2012 jQuery Foundation and other contributors ******************************************************** Provided for Informational Purposes Only MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The 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. * NUGET: END LICENSE TEXT */ /*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<9 // For `typeof node.method` instead of `node.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) document = window.document, location = window.location, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.9.1", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( list && ( !fired || stack ) ) { if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function() { var support, all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Support tests won't run in some limited or non-browser environments all = div.getElementsByTagName("*"); a = div.getElementsByTagName("a")[ 0 ]; if ( !all || !a || !all.length ) { return {}; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; support = { // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) getSetAttribute: div.className !== "t", // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType === 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText instead) style: /top/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.5/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) checkOn: !!input.value, // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Tests for enctype support on a form (#6743) enctype: !!document.createElement("form").enctype, // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode boxModel: document.compatMode === "CSS1Compat", // Will be defined later deleteExpando: true, noCloneEvent: true, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, boxSizingReliable: true, pixelPosition: false }; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; support.boxSizing = ( div.offsetWidth === 4 ); support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })(); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { cache[ id ] = {}; // Avoids exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var i, l, thisCache, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } for ( i = 0, l = name.length; i < l; i++ ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) } else if ( jQuery.support.deleteExpando || cache != cache.window ) { delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, elem = this[0], i = 0, data = null; // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( !name.indexOf( "data-" ) ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return jQuery.access( this, function( value ) { if ( value === undefined ) { // Try to fetch any internally stored data first return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; } this.each(function() { jQuery.data( this, key, value ); }); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } hooks.cur = fn; if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val, self = jQuery(this); if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, self.val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var values = jQuery.makeArray( value ); jQuery(elem).find("option").each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, notxml, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { // In IE9+, Flash objects don't have .getAttribute (#12945) // Support: IE9+ if ( typeof elem.getAttribute !== core_strundefined ) { ret = elem.getAttribute( name ); } // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( rboolean.test( name ) ) { // Set corresponding property to false for boolean attributes // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 if ( !getSetAttribute && ruseDefault.test( name ) ) { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } else { elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { return ( elem[ name ] = value ); } } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { return elem[ name ]; } } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt( attributeNode.value, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } } } }); // Hook for boolean attributes boolHook = { get: function( elem, name ) { var // Use .prop to determine if this attribute is understood as boolean prop = jQuery.prop( elem, name ), // Fetch it accordingly attr = typeof prop === "boolean" && elem.getAttribute( name ), detail = typeof prop === "boolean" ? getSetInput && getSetAttribute ? attr != null : // oldIE fabricates an empty string for missing boolean attributes // and conflates checked/selected into attroperties ruseDefault.test( name ) ? elem[ jQuery.camelCase( "default-" + name ) ] : !!attr : // fetch an attribute node for properties not recognized as boolean elem.getAttributeNode( name ); return detail && detail.value !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; // fix oldIE value attroperty if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return jQuery.nodeName( elem, "input" ) ? // Ignore the value *property* by using defaultValue elem.defaultValue : ret && ret.specified ? ret.value : undefined; }, set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? ret.value : undefined; }, set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }); }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { get: function( elem ) { var ret = elem.getAttribute( name, 2 ); return ret == null ? undefined : ret; } }); }); // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }); } // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter if ( !jQuery.support.checkOn ) { jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { get: function( elem ) { // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); event.isTrigger = true; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { for ( ; cur != this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } } }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== document.activeElement && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === document.activeElement && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ (function( window, undefined ) { var i, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, // Local document vars setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches, contains, sortOrder, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, support = {}, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Array methods arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors operators = "([*^$|!~]?=)", attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rsibling = /[\x20\t\r\n\f]*[+~]/, rnative = /^[^{]+\{\s*\[native code/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, funescape = function( _, escaped ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint return high !== high ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Use a stripped-down slice if we can't use a native one try { slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; } catch ( e ) { slice = function( i ) { var elem, results = []; while ( (elem = this[i++]) ) { results.push( elem ); } return results; }; } /** * For feature detection * @param {Function} fn The function to test for native support */ function isNative( fn ) { return rnative.test( fn + "" ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var cache, keys = []; return (cache = function( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); }); } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return fn( div ); } catch (e) { return false; } finally { // release memory in IE div = null; } } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( !documentIsXML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); return results; } } // QSA path if ( support.qsa && !rbuggyQSA.test(selector) ) { old = true; nid = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, slice.call( newContext.querySelectorAll( newSelector ), 0 ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsXML = isXML( doc ); // Check if getElementsByTagName("*") returns only elements support.tagNameNoComments = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if attributes should be retrieved by attribute nodes support.attributes = assert(function( div ) { div.innerHTML = "<select></select>"; var type = typeof div.lastChild.getAttribute("multiple"); // IE8 returns a string for some attributes even when not present return type !== "boolean" && type !== "string"; }); // Check if getElementsByClassName can be trusted support.getByClassName = assert(function( div ) { // Opera can't find a second classname (in 9.6) div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { return false; } // Safari 3.2 caches class attributes and doesn't catch changes div.lastChild.className = "e"; return div.getElementsByClassName("e").length === 2; }); // Check if getElementById returns elements by name // Check if getElementsByName privileges form controls or returns elements by ID support.getByName = assert(function( div ) { // Inject content div.id = expando + 0; div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; docElem.insertBefore( div, docElem.firstChild ); // Test var pass = doc.getElementsByName && // buggy browsers will return fewer than the correct 2 doc.getElementsByName( expando ).length === 2 + // buggy browsers will return more than the correct 0 doc.getElementsByName( expando + 0 ).length; support.getIdNotName = !doc.getElementById( expando ); // Cleanup docElem.removeChild( div ); return pass; }); // IE6/7 return modified attributes Expr.attrHandle = assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && div.firstChild.getAttribute("href") === "#"; }) ? {} : { "href": function( elem ) { return elem.getAttribute( "href", 2 ); }, "type": function( elem ) { return elem.getAttribute("type"); } }; // ID find and filter if ( support.getIdNotName ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? [m] : undefined : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.tagNameNoComments ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Name Expr.find["NAME"] = support.getByName && function( tag, context ) { if ( typeof context.getElementsByName !== strundefined ) { return context.getElementsByName( name ); } }; // Class Expr.find["CLASS"] = support.getByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { return context.getElementsByClassName( className ); } }; // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21), // no need to also add to buggyMatches since matches checks buggyQSA // A support test would require too much code (would include document ready) rbuggyQSA = [ ":focus" ]; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explictly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // IE8 - Some boolean attributes are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Opera 10-12/IE8 - ^= $= *= and empty values // Should not select anything div.innerHTML = "<input type='hidden' i=''/>"; if ( div.querySelectorAll("[i^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { var compare; if ( a === b ) { hasDuplicate = true; return 0; } if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { if ( a === doc || contains( preferredDoc, a ) ) { return -1; } if ( b === doc || contains( preferredDoc, b ) ) { return 1; } return 0; } return compare & 4 ? -1 : 1; } return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; // Always assume the presence of duplicates if sort doesn't // pass them to our comparison function (as in Google Chrome). hasDuplicate = false; [0, 0].sort( sortOrder ); support.detectDuplicates = hasDuplicate; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); // rbuggyQSA always contains :focus, so no need for an existence check if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { var val; // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } if ( !documentIsXML ) { name = name.toLowerCase(); } if ( (val = Expr.attrHandle[ name ]) ) { return val( elem ); } if ( documentIsXML || support.attributes ) { return elem.getAttribute( name ); } return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? name : val && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; // Document sorting and removing duplicates Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], i = 1, j = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; results.sort( sortOrder ); if ( hasDuplicate ) { for ( ; (elem = results[i]); i++ ) { if ( elem === results[ i - 1 ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; function siblingCheck( a, b ) { var cur = b && a, diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } // Returns a function to use in pseudos for input types function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } // Returns a function to use in pseudos for buttons function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } // Returns a function to use in pseudos for positionals function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[4] ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeName ) { if ( nodeName === "*" ) { return function() { return true; }; } nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); return function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifider if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsXML ? elem.getAttribute("xml:lang") || elem.getAttribute("lang") : elem.lang) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push( { value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push( { value: matched, type: type, matches: match } ); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && !documentIsXML && Expr.relative[ tokens[1].type ] ) { context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, slice.call( seed, 0 ) ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, documentIsXML, results, rsibling.test( selector ) ); return results; } // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Easy API for creating new setFilters function setFilters() {} Expr.filters = setFilters.prototype = Expr.pseudos; Expr.setFilters = new setFilters(); // Initialize with the default document setDocument(); // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); var runtil = /Until$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret, self, len = this.length; if ( typeof selector !== "string" ) { self = this; return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } ret = []; for ( i = 0; i < len; i++ ) { jQuery.find( selector, this[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true) ); }, is: function( selector ) { return !!selector && ( typeof selector === "string" ? // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". rneedsContext.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { cur = this[i]; while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } cur = cur.parentNode; } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); jQuery.fn.andSelf = jQuery.fn.addBack; function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( this.length > 1 && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem ) { return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function( value ) { var isFunc = jQuery.isFunction( value ); // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( !isFunc && typeof value !== "string" ) { value = jQuery( value ).not( this ).detach(); } return this.domManip( [ value ], true, function( elem ) { var next = this.nextSibling, parent = this.parentNode; if ( parent ) { jQuery( this ).remove(); parent.insertBefore( elem, next ); } }); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, table ? self.html() : undefined ); } self.domManip( args, table, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( table && jQuery.nodeName( this[i], "table" ) ? findOrAppend( this[i], "tbody" ) : this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery.ajax({ url: node.src, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); function findOrAppend( elem, tag ) { return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { var attr = elem.getAttributeNode("type"); elem.type = ( attr && attr.specified ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { var bool = typeof state === "boolean"; return this.each(function() { if ( bool ? state : isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Exclude the following css properties to add px cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.hover = function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }; var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 ) { isSuccess = true; statusText = "nocontent"; // if not modified } else if ( status === 304 ) { isSuccess = true; statusText = "notmodified"; // If we have data, let's convert it } else { isSuccess = ajaxConvert( s, response ); statusText = isSuccess.state; success = isSuccess.data; error = isSuccess.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); } }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { var conv2, current, conv, tmp, converters = {}, i = 0, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(), prev = dataTypes[ 0 ]; // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } // Convert to each sequential dataType, tolerating list modification for ( ; (current = dataTypes[++i]); ) { // There's only work to do if current dataType is non-auto if ( current !== "*" ) { // Convert response if prev dataType is non-auto and differs from current if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split(" "); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.splice( i--, 0, current ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s["throws"] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } // Update prev for next iteration prev = current; } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var end, unit, tween = this.createTween( prop, value ), parts = rfxnum.exec( value ), target = tween.cur(), start = +target || 0, scale = 1, maxIterations = 20; if ( parts ) { end = +parts[2]; unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" && start ) { // Iteratively approximate from a nonzero starting point // Prefer the current property, because this process will be trivial if it uses the same units // Fallback to end or a simple constant start = jQuery.css( tween.elem, prop, true ) || end || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } tween.unit = unit; tween.start = start; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTweens( animation, props ) { jQuery.each( props, function( prop, value ) { var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( collection[ index ].call( animation, prop, value ) ) { // we're done with this property return; } } }); } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } createTweens( animation, props ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var value, name, index, easing, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /*jshint validthis:true */ var prop, index, length, value, dataShow, toggle, tween, hooks, oldfire, anim = this, style = elem.style, orig = {}, handled = [], hidden = elem.nodeType && isHidden( elem ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( index in props ) { value = props[ index ]; if ( rfxtypes.exec( value ) ) { delete props[ index ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } handled.push( index ); } } length = handled.length; if ( length ) { dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( index = 0 ; index < length ; index++ ) { prop = handled[ index ]; tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Remove in 2.0 - this supports IE8's panic based approach // to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); doAnimation.finish = function() { anim.stop( true ); }; // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.cur && hooks.cur.finish ) { hooks.cur.finish.call( this ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.documentElement; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || document.documentElement; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // })(); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; // Expose jQuery as an AMD module, but only for AMD loaders that // understand the issues with loading multiple versions of jQuery // in a page that all might call define(). The loader will indicate // they have special allowances for multiple jQuery versions by // specifying define.amd.jQuery = true. Register as a named module, // since jQuery can be concatenated with other files that may use define, // but not use a proper concatenation script that understands anonymous // AMD modules. A named AMD is safest and most robust way to register. // Lowercase jquery is used because AMD module names are derived from // file names, and jQuery is normally delivered in a lowercase file name. // Do this after creating the global so that if an AMD module wants to call // noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } })( window );